respec 37.7.2 → 37.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- window.respecVersion="37.7.2",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=document.documentElement;t?.hasAttribute("lang")||(t.lang="en",t.hasAttribute("dir")||(t.dir="ltr"));const n={},r=t?.lang??"en";var i=Object.freeze({__proto__:null,l10n:n,lang:r,name:"core/l10n",run:function(e){e.l10n=n[r]||n.en}});const s=(e,t)=>t.some(t=>e instanceof t);let o,a;const c=new WeakMap,l=new WeakMap,u=new WeakMap;let d={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return m(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){d=e(d)}function h(e){return(a||(a=["advance","continue","continuePrimaryKey"].map(e=>IDBCursor.prototype[e]))).includes(e)?function(...t){return e.apply(g(this),t),m(this.request)}:function(...t){return m(e.apply(g(this),t))}}function f(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(c.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)});c.set(e,t)}(e),s(e,o||(o=[IDBIndex,IDBObjectStore,IDBCursor,IDBDatabase,IDBTransaction]))?new Proxy(e,d):e)}function m(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{t(m(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",s)});return u.set(t,e),t}(e);if(l.has(e))return l.get(e);const t=f(e);return Object.is(t,e)||(l.set(e,t),u.set(t,e)),t}const g=e=>u.get(e);const b=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],w={};function k(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(w[t])return w[t];const n=t.replace(/FromIndex$/,""),r=t!==n,i=y.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!b.includes(n))return;return w[t]=async function(e,...t){const s=this.transaction(e,i?"readwrite":"readonly");let o=s.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&s.done]))[0]}}p(e=>({...e,get:(t,n,r)=>k(t,n)||e.get(t,n,r),has:(t,n)=>!!k(t,n)||e.has(t,n)}));const v=["advance","continue","continuePrimaryKey"],$={},x=new WeakMap,C=new WeakMap,S={get(e,t){if(!v.includes(t))return e[t];let n=$[t];return n||(n=$[t]=function(...e){x.set(this,C.get(this)[t](...e))}),n}};async function*_(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,S);for(C.set(n,t),u.set(n,g(t));t;)yield n,t=await(x.get(n)||t.continue()),x.delete(n)}function T(e,t){return t===Symbol.asyncIterator&&s(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&s(e,[IDBIndex,IDBObjectStore])}p(e=>({...e,get:(t,n,r)=>T(t,n)?_:e.get(t,n,r),has:(t,n)=>T(t,n)||e.has(t,n)}));var R=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",e=>t(e.oldVersion,e)),m(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(e,t),a=m(o);return r&&o.addEventListener("upgradeneeded",e=>{r(m(o.result),e.oldVersion,e.newVersion,m(o.transaction),e)}),n&&o.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),a.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a},unwrap:g,wrap:m});function E(e,t,n,r,i,{level:s="error",autofix:o,ruleName:a}={}){function c(n){return n>0?e.slice(t,t+n):e.slice(Math.max(t+n,0),t)}function l(n,{precedes:r}={}){const i=n.map(e=>e.trivia+e.value).join(""),s=e[t];return"eof"===s.type?i:r?i+s.trivia:i.slice(s.trivia.length)}const u="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,d=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),h=l(p),f=d+h.split("\n")[0]+"\n"+(" ".repeat(d.length)+"^"),m="Syntax"===i?"since":"inside",g=`${i} error at line ${u}${e.name?` in ${e.name}`:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map(e=>function(e,t){let n=e;return t&&(n+=` ${t}`),n}(e.type,e.name)).join(" -> ")}(n)}\``:""}:\n${f}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:u,sourceName:e.name,level:s,ruleName:a,autofix:o,input:h,tokens:p}}function A(e,t,n,r){return E(e,t,n,r,"Syntax")}function L(e,t,n,r,i={}){return i.ruleName=n,E(t.source,e.index,t,r,"Validation",i)}class P{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){const e={type:void 0,name:void 0,inheritance:void 0};let t=this;for(;t!==Object.prototype;){const n=Object.getOwnPropertyDescriptors(t);for(const[t,r]of Object.entries(n))(r.enumerable||r.get)&&(e[t]=this[t]);t=Object.getPrototypeOf(t)}return e}}function N(e,t,{useNullableInner:n}={}){if(!e.union){const r=t.unique.get(e.idlType);if(!r)return;if("typedef"===r.type){const{typedefIncludesDictionary:n}=t.cache;if(n.has(r))return n.get(r);t.cache.typedefIncludesDictionary.set(r,void 0);const i=N(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,i),i)return{reference:e,dictionary:i.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=N(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function I(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some(e=>e.required);if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?I(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class O extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class D extends P{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new D({source:e.source,tokens:{value:n}})}}get value(){return ee(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class j extends D{static parse(e){const t=e.consumeKind("eof");if(t)return new j({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function z(e,t){return te(e,{parser:D.parser(e,t),listName:t+" list"})}const M=["identifier","decimal","integer","string"],q=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map(e=>[e,`Legacy${e}`]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function U(e){for(const t of M){const n=z(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class W extends P{static parse(e){const t={assign:e.consume("=")},n=pe(new W({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...M)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?U(e):se(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):t.assign&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map(n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e)),e.token(this.tokens.close)])}}class F extends P{static parse(e){const t=e.consumeKind("identifier");if(t)return new F({source:e.source,tokens:{name:t},params:W.parse(e)})}constructor({source:e,tokens:t,params:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"params",{value:n})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){const{rhsType:e,tokens:t,list:n}=this.params;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:this.params.tokens.secondaryName?ee(t.secondaryName.value):null}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.";yield L(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(q.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${q.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield L(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=q.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class B extends O{static parse(e){const t={};t.open=e.consume("[");const n=new B({source:e.source,tokens:t});return t.open?(n.push(...te(e,{parser:F.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Expected a closing token for the extended attribute list"),n.length||(e.unconsume(t.close.index),e.error("An extended attribute list must not be empty")),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n):n}*validate(e){for(const t of this)yield*t.validate(e)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map(t=>t.write(e)),e.token(this.tokens.close)]):""}}function H(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function G(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!n)return;const r=pe(new V({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error(`No opening bracket after ${n.value}`),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=ae(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{const i=oe(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(i);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...me)||e.error(`Record key must be one of: ${me.join(", ")}`),i=new V({source:e.source,tokens:{base:n}});i.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),i.type=t;const s=oe(e,t)||e.error("Error parsing generic type record");r.subtype.push(i,s);break}}return r.idlType||e.error(`Error parsing generic type ${n.value}`),r.tokens.close=e.consume(">")||e.error(`Missing closing bracket after ${n.value}`),r.this}(e,t)||ie(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...me,...fe);if(!t)return;n=new V({source:e.source,tokens:{base:t}}),e.probe("<")&&e.error(`Unsupported generic type ${t.value}`)}return"Promise"===n.generic&&e.probe("?")&&e.error("Promise type cannot be nullable"),n.type=t||null,H(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}let V=class extends P{static parse(e,t){return G(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=pe(new V({source:e.source,tokens:n}));for(r.type=t||null;;){const n=oe(e,t)||e.error("No type after open parenthesis or 'or' in union type");"any"===n.idlType&&e.error("Type `any` cannot be included in a union type"),"Promise"===n.generic&&e.error("Type `Promise` cannot be included in a union type"),r.subtype.push(n);const i=e.consume("or");if(!i)break;n.tokens.separator=i}return r.idlType.length<2&&e.error("At least two types are expected in a union type but found less"),n.close=e.consume(")")||e.error("Unterminated union type"),H(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new B({source:e,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return ee([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter(e=>e).map(e=>e.value).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"BufferSource"===this.idlType)for(const e of[this.extAttrs,this.parent?.extAttrs])for(const t of e){if("AllowShared"!==t.name)continue;const n="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield L(this.tokens.base,this,"migrate-allowshared",n,{autofix:J(this,t,e)})}if("void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.";yield L(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=N(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield L(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map(t=>t.write(e)),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}};function J(e,t,n){return()=>{const r=n.indexOf(t);n.splice(r,1),!n.length&&e.tokens.base.trivia.match(/^\s$/)&&(e.tokens.base.trivia=""),e.tokens.base.value="AllowSharedBufferSource"}}class Z extends P{static parse(e){const t=e.consume("=");if(!t)return null;const n=ne(e)||e.consumeKind("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new Z({source:e.source,tokens:{assign:t},expression:r})}constructor({source:e,tokens:t,expression:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"expression",{value:n})}get type(){return re(this.expression[0]).type}get value(){return re(this.expression[0]).value}get negative(){return re(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map(t=>e.token(t))])}}class K extends P{static parse(e){const t=e.position,n={},r=pe(new K({source:e.source,tokens:n}));return r.extAttrs=B.parse(e),n.optional=e.consume("optional"),r.idlType=oe(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...ge),n.name?(r.default=n.optional?Z.parse(e):null,r.this):e.unconsume(t)):e.unconsume(t)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return ee(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=N(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield L(this.tokens.name,this,"no-nullable-dict-arg",e)}else if(this.optional){if(!this.default){const e="Optional dictionary arguments must have a default value of `{}`.";yield L(this.tokens.name,this,"dict-arg-default",e,{autofix:Y(this)})}}else if(this.parent&&!I(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e),r=t.slice(n+1).some(e=>!e.optional);return!r}(this)){const e="Dictionary argument must be optional if it has no required fields";yield L(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=de(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",Y(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function Y(e){return()=>{e.default=Z.parse(new ke(" = {}"))}}class X extends P{static parse(e,{special:t,regular:n}={}){const r={special:t},i=pe(new X({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(i.arguments=[],i):(t||n||(r.special=e.consume("getter","setter","deleter")),i.idlType=ae(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),i.arguments=se(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),i.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?ee(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield L(this.tokens.open,this,"incomplete-op",e)}if(this.idlType){if("async_sequence"===this.idlType.generic){const e="async_sequence types cannot be returned by an operation.";yield L(this.idlType.tokens.base,this,"async-sequence-idl-to-js",e)}yield*this.idlType.validate(e)}for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class Q extends P{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const i=e.position,s={special:t},o=pe(new Q({source:e.source,tokens:s}));if(t||n||(s.special=e.consume("inherit")),"inherit"===o.special&&e.probe("readonly")&&e.error("Inherited attributes cannot be read-only"),s.readonly=e.consume("readonly"),r&&!s.readonly&&e.probe("attribute")&&e.error("Attributes must be readonly in this context"),s.base=e.consume("attribute"),s.base)return o.idlType=oe(e,"attribute-type")||e.error("Attribute lacks a type"),s.name=e.consumeKind("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),s.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),o.this;e.unconsume(i)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return ee(this.tokens.name.value)}*validate(e){if(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),["async_sequence","sequence","record"].includes(this.idlType.generic)){const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield L(this.tokens.name,this,"attr-invalid-type",e)}{const{reference:t}=N(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield L(e,this,"attr-invalid-type",n)}}if(this.readonly&&function(e,t){if(e.union)return!1;if(e.extAttrs.some(e=>"EnforceRange"===e.name))return!0;const n=t.unique.get(e.idlType);return"typedef"===n?.type&&n.idlType.extAttrs.some(e=>"EnforceRange"===e.name)}(this.idlType,e)){const e=this.idlType.tokens.base,t="Readonly attributes cannot accept [EnforceRange] extended attribute.";yield L(e,this,"attr-invalid-type",t)}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function ee(e){return e.startsWith("_")?e.slice(1):e}function te(e,{parser:t,allowDangler:n,listName:r="list"}){const i=t(e);if(!i)return[];i.tokens.separator=e.consume(",");const s=[i];for(;i.tokens.separator;){const i=t(e);if(!i){n||e.error(`Trailing comma in ${r}`);break}if(i.tokens.separator=e.consume(","),s.push(i),!i.tokens.separator)break}return s}function ne(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function re({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function ie(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const i=e.consume("long");return new V({source:t,tokens:{prefix:n,base:r,postfix:i}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new V({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new V({source:t,tokens:{base:r}}):void 0}function se(e){return te(e,{parser:K.parse,listName:"arguments list"})}function oe(e,t){const n=B.parse(e),r=V.parse(e,t);return r&&(pe(r).extAttrs=n),r}function ae(e,t){const n=V.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new V({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function ce(e){const t=e.consume("stringifier");if(!t)return;return Q.parse(e,{special:t})||X.parse(e,{special:t})||e.error("Unterminated stringifier")}function le(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function ue(e){return()=>{if(e.extAttrs.length){const t=new ke("Exposed=Window,"),n=F.parse(t);n.tokens.separator=t.consume(",");const r=e.extAttrs[0];/^\s/.test(r.tokens.name.trivia)||(r.tokens.name.trivia=` ${r.tokens.name.trivia}`),e.extAttrs.unshift(n)}else{pe(e).extAttrs=B.parse(new ke("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia=`\n${le(t)}`}}}function de(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return de(e.idlType);const t=Object.values(e.tokens).sort((e,t)=>e.index-t.index);return t[0]}function pe(e,t){if(t||(t=e),!e)return e;return new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)&&"source"!==t?pe(n,e):n},set(e,n,r){if(e[n]=r,!r)return!0;if(Array.isArray(r))for(const e of r)void 0!==e.parent&&(e.parent=t);else void 0!==r.parent&&(r.parent=t);return!0}})}const he={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},fe=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float16Array","Float32Array","Float64Array","any","object","symbol"],me=["ByteString","DOMString","USVString"],ge=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],be=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","async_iterable","async_sequence","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(ge,me,fe),ye=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],we=["_constructor","toString","_toString"];class ke{constructor(e){this.source=function(e){const t=[];let n=0,r="",i=1,s=0;for(;n<e.length;){const a=e.charAt(n);let c=-1;if(/[\t\n\r ]/.test(a)?c=o("whitespace",{noFlushTrivia:!0}):"/"===a&&(c=o("comment",{noFlushTrivia:!0})),-1!==c){const e=t.pop().value;i+=(e.match(/\n/g)||[]).length,r+=e,s-=1}else if(/[-0-9.A-Z_a-z]/.test(a)){if(c=o("decimal"),-1===c&&(c=o("integer")),-1===c){c=o("identifier");const e=t.length-1,n=t[e];if(-1!==c){if(we.includes(n.value)){const r=`${ee(n.value)} is a reserved identifier and must not be used.`;throw new ve(A(t,e,null,r))}be.includes(n.value)&&(n.type="inline")}}}else'"'===a&&(c=o("string"));for(const o of ye)if(e.startsWith(o,n)){t.push({type:"inline",value:o,trivia:r,line:i,index:s}),r="",n+=o.length,c=n;break}if(-1===c&&(c=o("other")),-1===c)throw new Error("Token stream not progressing");n=c,s+=1}return t.push({type:"eof",value:"",trivia:r,line:i,index:s}),t;function o(o,{noFlushTrivia:a}={}){const c=he[o];c.lastIndex=n;const l=c.exec(e);return l?(t.push({type:o,value:l[0],trivia:r,line:i,index:s}),a||(r=""),c.lastIndex):-1}}(e),this.position=0}error(e){throw new ve(A(this.source,this.position,this.current,e))}probeKind(e){return this.source.length>this.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class ve extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:i,input:s,tokens:o}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=i,this.input=s,this.tokens=o}}class $e extends D{static parse(e){const t=e.consumeKind("string");if(t)return new $e({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class xe extends P{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=pe(new xe({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=te(e,{parser:$e.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("string")&&e.error("No comma between enum values"),t.close=e.consume("}")||e.error("Unexpected value in enum"),n.values.length||e.error("No value in enum"),t.termination=e.consume(";")||e.error("No semicolon after enum"),n.this}get type(){return"enum"}get name(){return ee(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Ce extends P{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new Ce({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return ee(this.tokens.target.value)}get includes(){return ee(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class Se extends P{static parse(e){const t={},n=pe(new Se({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=oe(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("identifier")||e.error("Typedef lacks a name"),e.current=n.this,t.termination=e.consume(";")||e.error("Unterminated typedef, expected `;`"),n.this}get type(){return"typedef"}get name(){return ee(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class _e extends P{static parse(e,t){const n={base:t},r=pe(new _e({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=ae(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=se(e),n.close=e.consume(")")||e.error("Unterminated callback"),n.termination=e.consume(";")||e.error("Unterminated callback, expected `;`"),r.this}get type(){return"callback"}get name(){return ee(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e);for(const t of this.arguments)if(yield*t.validate(e),"async_sequence"===t.idlType.generic){const e="async_sequence types cannot be returned as a callback argument.";yield L(t.tokens.name,t,"async-sequence-idl-to-js",e)}yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map(t=>t.write(e)),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Te extends P{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:i,type:s}=t;for(i.name=e.consumeKind("identifier")||e.error(`Missing name in ${s}`),e.current=t,t=pe(t),n&&Object.assign(i,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),i.open=e.consume("{")||e.error(`Bodyless ${s}`),t.members=[];;){if(i.close=e.consume("}"),i.close)return i.termination=e.consume(";")||e.error(`Missing semicolon after ${s}`),t.this;const n=B.parse(e);let o;for(const[t,...n]of r)if(o=pe(t(e,...n)),o)break;o||e.error("Unknown member"),o.extAttrs=n,t.members.push(o.this)}}get partial(){return!!this.tokens.partial}get name(){return ee(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?ee(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Re extends P{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=ie(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new V({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=ne(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new Re({source:e.source,tokens:t});return pe(r).idlType=n,r}get type(){return"const"}get name(){return ee(this.tokens.name.value)}get value(){return re(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class Ee extends P{static parse(e){const t=e.position,n=pe(new Ee({source:e.source,tokens:{}})),{tokens:r}=n;if(r.readonly=e.consume("readonly"),r.readonly||(r.async=e.consume("async")),r.base=r.readonly?e.consume("maplike","setlike"):r.async?e.consume("iterable"):e.consume("iterable","async_iterable","maplike","setlike"),!r.base)return void e.unconsume(t);const{type:i}=n,s="maplike"===i,o=s||"iterable"===i||"async_iterable"===i,a="async_iterable"===i||n.async&&"iterable"===i;r.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${i} declaration`);const c=oe(e)||e.error(`Missing a type argument in ${i} declaration`);return n.idlType=[c],n.arguments=[],o&&(c.tokens.separator=e.consume(","),c.tokens.separator?n.idlType.push(oe(e)):s&&e.error(`Missing second type argument in ${i} declaration`)),r.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${i} declaration`),e.probe("(")&&(a?(r.argsOpen=e.consume("("),n.arguments.push(...se(e)),r.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),r.termination=e.consume(";")||e.error(`Missing semicolon after ${i} declaration`),n.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){if(this.async&&"iterable"===this.type){const e="`async iterable` is now changed to `async_iterable`.";yield L(this.tokens.async,this,"obsolete-async-iterable-syntax",e,{autofix:(t=this,()=>{const e=t.tokens.async;t.tokens.base={...e,type:"async_iterable",value:"async_iterable"},delete t.tokens.async})})}var t;for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class Ae extends P{static parse(e){const t=e.consume("constructor");if(!t)return;const n={base:t};n.open=e.consume("(")||e.error("No argument list in constructor");const r=se(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const i=new Ae({source:e.source,tokens:n});return pe(i).arguments=r,i}get type(){return"constructor"}*validate(e){for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function Le(e){const t=e.consume("static");if(!t)return;return Q.parse(e,{special:t})||X.parse(e,{special:t})||e.error("No body in static member")}class Pe extends Te{static parse(e,t,{extMembers:n=[],partial:r=null}={}){const i={partial:r,base:t};return Te.parse(e,new Pe({source:e.source,tokens:i}),{inheritable:!r,allowedMembers:[...n,[Re.parse],[Ae.parse],[Le],[ce],[Ee.parse],[Q.parse],[X.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every(e=>"Exposed"!==e.name)){const e="Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield L(this.tokens.name,this,"require-exposed",e,{autofix:ue(this)})}const t=this.extAttrs.filter(e=>"Constructor"===e.name);for(const e of t){const t="Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.";yield L(e.tokens.name,this,"constructor-member",t,{autofix:Ne(this,e)})}if(this.extAttrs.some(e=>"Global"===e.name)){const e=this.extAttrs.filter(e=>"LegacyFactoryFunction"===e.name);for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield L(t.tokens.name,this,"no-constructible-global",e)}const t=this.members.filter(e=>"constructor"===e.type);for(const e of t){const t="Interfaces marked as `[Global]` cannot have constructors.";yield L(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=function(e){const t=o(e);return{statics:new Set(t.filter(e=>"static"===e.special).map(e=>e.name)),nonstatics:new Set(t.filter(e=>"static"!==e.special).map(e=>e.name))}}(t),r=e.partials.get(t.name)||[],i=e.mixinMap.get(t.name)||[];for(const e of[...r,...i]){const r=o(e),i=r.filter(e=>"static"===e.special),a=r.filter(e=>"static"!==e.special);yield*s(i,n.statics,e,t),yield*s(a,n.nonstatics,e,t),i.forEach(e=>n.statics.add(e.name)),a.forEach(e=>n.nonstatics.add(e.name))}function*s(e,t,n,r){for(const i of e){const{name:e}=i;if(e&&t.has(e)){const t=`The ${"static"===i.special?"static ":""}operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield L(i.tokens.name,n,"no-cross-overload",t)}}}function o(e){return e.members.filter(({type:e})=>"operation"===e)}}(e,this))}}function Ne(e,t){return e=pe(e),()=>{const n=le(e.extAttrs.tokens.open.trivia),r=e.members.length?le(de(e.members[0]).trivia):function(e){const t=le(e),n=t.includes("\t")?"\t":" ";return t+n}(n),i=Ae.parse(new ke(`\n${r}constructor();`));i.extAttrs=new B({source:e.source,tokens:{}}),pe(i).arguments=t.arguments;const s=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,e=>"constructor"===e.type);e.members.splice(s+1,0,i);const{close:o}=e.tokens;o.trivia.includes("\n")||(o.trivia+=`\n${n}`);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class Ie extends Te{static parse(e,t,{extMembers:n=[],partial:r}={}){const i={partial:r,base:t};if(i.mixin=e.consume("mixin"),i.mixin)return Te.parse(e,new Ie({source:e.source,tokens:i}),{allowedMembers:[...n,[Re.parse],[ce],[Q.parse,{noInherit:!0}],[X.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Oe extends P{static parse(e){const t={},n=pe(new Oe({source:e.source,tokens:t}));return n.extAttrs=B.parse(e),t.required=e.consume("required"),n.idlType=oe(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=Z.parse(e),t.required&&n.default&&e.error("Required member must not have a default"),t.termination=e.consume(";")||e.error("Unterminated dictionary member, expected `;`"),n.this}get type(){return"field"}get name(){return ee(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class De extends Te{static parse(e,{extMembers:t=[],partial:n}={}){const r={partial:n};if(r.base=e.consume("dictionary"),r.base)return Te.parse(e,new De({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[...t,[Oe.parse]]})}get type(){return"dictionary"}}class je extends Te{static parse(e,{extMembers:t=[],partial:n}={}){const r={partial:n};if(r.base=e.consume("namespace"),r.base)return Te.parse(e,new je({source:e.source,tokens:r}),{allowedMembers:[...t,[Q.parse,{noInherit:!0,readonly:!0}],[Re.parse],[X.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(e){if(!this.partial&&this.extAttrs.every(e=>"Exposed"!==e.name)){const e="Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield L(this.tokens.name,this,"require-exposed",e,{autofix:ue(this)})}yield*super.validate(e)}}class ze extends Te{static parse(e,t,{extMembers:n=[]}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return Te.parse(e,new ze({source:e.source,tokens:r}),{allowedMembers:[...n,[Re.parse],[X.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Me(e,t){const n=e.source;function r(t){e.error(t)}function i(...t){return e.consume(...t)}function s(n){const s=i("interface");if(s)return Ie.parse(e,s,{...n,...t?.extensions?.mixin})||Pe.parse(e,s,{...n,...t?.extensions?.interface})||r("Interface has no proper body")}function o(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const n=i("callback");if(n)return e.probe("interface")?ze.parse(e,n,{...t?.extensions?.callbackInterface}):_e.parse(e,n)}()||s()||function(){const n=i("partial");if(n)return De.parse(e,{partial:n,...t?.extensions?.dictionary})||s({partial:n})||je.parse(e,{partial:n,...t?.extensions?.namespace})||r("Partial doesn't apply to anything")}()||De.parse(e,t?.extensions?.dictionary)||xe.parse(e)||Se.parse(e)||Ce.parse(e)||je.parse(e,t?.extensions?.namespace)}const a=function(){if(!n.length)return[];const i=[];for(;;){const t=B.parse(e),n=o();if(!n){t.length&&r("Stray extended attributes");break}pe(n).extAttrs=t,i.push(n)}const s=j.parse(e);return t.concrete&&i.push(s),i}();return e.position<n.length&&r("Unrecognised tokens"),a}function qe(e){return e}const Ue={wrap:e=>e.join(""),trivia:qe,name:qe,reference:qe,type:qe,generic:qe,nameless:qe,inheritance:qe,definition:qe,extendedAttribute:qe,extendedAttributeReference:qe};class We{constructor(e){this.ts=Object.assign({},Ue,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=qe,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function Fe(e,t){const n=new Map,r=e.filter(e=>"includes"===e.type);for(const e of r){const r=t.get(e.includes);if(!r)continue;const i=n.get(e.target);i?i.push(r):n.set(e.target,[r])}return n}function*Be(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const i of e){if(i.partial){const e=r.get(i.name);e?e.push(i):r.set(i.name,[i]);continue}i.name&&(t.has(i.name)?n.add(i):t.set(i.name,i))}return{all:e,unique:t,partials:r,duplicates:n,mixinMap:Fe(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({unique:e,duplicates:t}){for(const n of t){const{name:t}=n,r=`The name "${t}" of type "${e.get(t).type}" was already seen`;yield L(n.tokens.name,n,"no-duplicate",r)}}(t)}var He,Ge=Object.freeze({__proto__:null,WebIDLParseError:ve,parse:function(e,t={}){const n=new ke(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Me(n,t)},validate:function(e){return[...Be((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=Ue}={}){t=Object.assign({},Ue,t);const n=new We(t);return t.wrap(e.map(e=>e.write(n)))}});!function(e){e.ILLEGAL="ILLEGAL",e.EOF="EOF",e.NL="\n",e.SPACE=" ",e.UNDERSCORE="_",e.DOLLAR="$",e.ATSIGN="@",e.CARET="^",e.HASH="#",e.TILDE="~",e.AMPERSAND="&",e.IDENT="IDENT",e.COMMENT="COMMENT",e.STRING="STRING",e.NUMBER="NUMBER",e.FLOAT="FLOAT",e.CTLOP="CTLOP",e.BYTES="BYTES",e.HEX="HEX",e.BASE64="BASE64",e.ASSIGN="=",e.ARROWMAP="=>",e.TCHOICE="/",e.GCHOICE="//",e.TCHOICEALT="/=",e.GCHOICEALT="//=",e.PLUS="+",e.MINUS="-",e.QUEST="?",e.ASTERISK="*",e.INCLRANGE="..",e.EXCLRANGE="...",e.COMMA=",",e.DOT=".",e.COLON=":",e.SEMICOLON=";",e.LPAREN="(",e.RPAREN=")",e.LBRACE="{",e.RBRACE="}",e.LBRACK="[",e.RBRACK="]",e.LT="<",e.GT=">",e.QUOT='"'}(He||(He={}));const Ve=Object.entries(He).reduce((e,[t,n])=>(e[n]=t,e),{});class Je{type;literal;comments;whitespace;constructor(e,t,n=[],r=""){this.type=e,this.literal=t,this.comments=n,this.whitespace=r}serialize(){let e="";for(const t of this.comments)e+=t.serialize();switch(e+=this.whitespace,this.type){case He.IDENT:case He.COMMENT:case He.NUMBER:case He.FLOAT:e+=this.literal;break;case He.STRING:e+='"'+this.literal+'"';break;case He.CTLOP:e+="."+this.literal;break;case He.BYTES:e+="'"+this.literal+"'";break;case He.HEX:e+="h'"+this.literal+"'";break;case He.BASE64:e+="b64'"+this.literal+"'";break;case He.EOF:break;default:e+=this.type.valueOf()}return e}startWithSpaces(){return""!==this.whitespace||this.comments.length>0}toString(e=0){const t=[`${" ".repeat(e)}${this.constructor.name}: ${Ve[this.type]} (${this.type})`];""!==this.whitespace&&t.push(" ".repeat(e+1)+`whitespaces: ${this.whitespace.length}`),""!==this.literal&&t.push(" ".repeat(e+1)+`literal: ${this.literal}`);for(const n of this.comments)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return{type:this.type,literal:this.literal,comments:this.comments?.map(e=>e.toJSON()),whitespace:this.whitespace}}}class Ze{parentNode=null;serialize(e){if(this.setChildrenParent(),e){const t=e.markupFor(this);let n=null!==t[0]?t[0]:"";return n+=this._serialize(e),n+=null!==t[1]?t[1]:"",n}return this._serialize()}setChildrenParent(){for(const e of this.getChildren())e.parentNode=this,e.setChildrenParent()}getChildren(){return[]}_serializeToken(e,t){return e?t?t.serializeToken(e,this):e.serialize():""}toString(e=0){return" ".repeat(e)+this.constructor.name}toJSON(){return{}}}class Ke extends Ze{openToken=null;closeToken=null;serialize(e){let t="";if(e){const n=e.markupFor(this);t+=null!==n[0]?n[0]:""}if(t+=this._serializeToken(this.openToken,e),t+=this._serialize(e),t+=this._serializeToken(this.closeToken,e),e){const n=e.markupFor(this);t+=null!==n[1]?n[1]:""}return t}toString(e=0){const t=[super.toString(e)];return this.openToken&&t.push(this.openToken.toString(e+1)),this.closeToken&&t.push(this.closeToken.toString(e+1)),t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{openToken:this.openToken?.toJSON(),closeToken:this.closeToken?.toJSON()})}}class Ye extends Ke{comments=[];whitespace="";separator=null;_prestr(e){return""}serialize(e){let t=this._prestr(e);for(const n of this.comments)t+=this._serializeToken(n,e);return t+=this.whitespace,t+=super.serialize(e),t+=this._serializeToken(this.separator,e),t}setComments(e){this.comments=e.comments,this.whitespace=e.whitespace}toString(e=0){const t=[super.toString(e)];for(const n of this.comments)t.push(n.toString(e+1));return""!==this.whitespace&&t.push(" ".repeat(e+1)+`whitespaces: ${this.whitespace.length}`),this.separator&&t.push(this.separator.toString(e+1)),t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{comments:this.comments.map(e=>e.toJSON()),whitespace:this.whitespace,separator:this.separator?.toJSON()})}}class Xe extends Ye{rules;constructor(e){super(),this.rules=e}getChildren(){return this.rules}_serialize(e){return this.rules.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.rules)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{rules:this.rules.map(e=>e.toJSON())})}}class Qe extends Ze{name;assign;type;constructor(e,t,n){super(),this.name=e,this.assign=t,this.type=n}getChildren(){return[this.name,this.type]}_serialize(e){let t=this.name.serialize(e);return t+=this._serializeToken(this.assign,e),t+=this.type.serialize(e),t}toString(e=0){return[super.toString(e),this.name.toString(e+1),this.assign.toString(e+1),this.type.toString(e+1)].join("\n")}toJSON(){return Object.assign(super.toJSON(),{name:this.name.toJSON(),assign:this.assign.toJSON(),type:this.type.toJSON()})}}class et extends Ye{occurrence;key;type;constructor(e,t,n){super(),this.occurrence=e,this.key=t,this.type=n}getChildren(){const e=[];return this.occurrence&&e.push(this.occurrence),this.key&&e.push(this.key),e.push(this.type),e}_serialize(e){let t="";return this.occurrence&&(t+=this.occurrence.serialize(e)),this.key&&(t+=this.key.serialize(e)),t+=this.type.serialize(e),t}isConvertibleToType(){return null===this.occurrence&&null===this.key&&(!(this.type instanceof tt)||this.type instanceof rt||this.type instanceof nt)}toString(e=0){const t=[super.toString(e)];return this.occurrence&&t.push(this.occurrence.toString(e+1)),this.key&&t.push(this.key.toString(e+1)),t.push(this.type.toString(e+1)),t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{occurrence:this.occurrence?.toJSON(),key:this.key?.toJSON(),type:this.type.toJSON()})}}class tt extends Ye{groupChoices;constructor(e){super(),this.groupChoices=e}getChildren(){return this.groupChoices}_serialize(e){return this.groupChoices.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.groupChoices)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{groupChoices:this.groupChoices.map(e=>e.toJSON())})}}let nt=class extends tt{},rt=class extends tt{};class it extends Ye{groupEntries;constructor(e){super(),this.groupEntries=e}getChildren(){return this.groupEntries}_serialize(e){return this.groupEntries.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.groupEntries)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{groupEntries:this.groupEntries.map(e=>e.toJSON())})}}class st extends Ye{numericPart;typePart;constructor(e=null,t=null){super(),this.numericPart=e,this.typePart=t}getChildren(){return this.typePart?[this.typePart]:[]}_serialize(e){let t=this._serializeToken(new Je(He.HASH,""),e);return t+=this._serializeToken(this.numericPart,e),t+=this.typePart?this.typePart.serialize(e):"",t}toString(e=0){const t=[super.toString(e)+" (#)"];return this.numericPart&&t.push(this.numericPart.toString(e+1)),this.typePart&&t.push(this.typePart.toString(e+1)),t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{numericPart:this.numericPart?.toJSON(),typePart:this.typePart?.toJSON()})}}class ot extends Ye{n;m;tokens;constructor(e,t,n=[]){super(),this.n=e,this.m=t,this.tokens=n}_serialize(e){return this.tokens.map(t=>this._serializeToken(t,e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.tokens)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{n:this.n,m:this.m,tokens:this.tokens.map(e=>e.toJSON())})}}class at extends Ye{value;type;constructor(e,t){super(),this.value=e,this.type=t}_serialize(e){let t="",n="";return"text"===this.type?(t='"',n='"'):"bytes"===this.type?(t="'",n="'"):"hex"===this.type?(t="h'",n="'"):"base64"===this.type&&(t="b64'",n="'"),e?e.serializeValue(t,this.value,n,this):t+this.value+n}toString(e=0){return" ".repeat(e)+`${this.constructor.name} (${this.type}): ${this.value}`}toJSON(){return Object.assign(super.toJSON(),{value:this.value,type:this.type})}}class ct extends Ye{name;unwrapped;parameters;constructor(e,t,n=null){super(),this.name=e,this.unwrapped=t,this.parameters=n}getChildren(){return this.parameters?[this.parameters]:[]}_prestr(e){return this._serializeToken(this.unwrapped,e)}_serialize(e){let t="";return e?t+=e.serializeName(this.name,this):t=this.name,this.parameters&&(t+=this.parameters.serialize(e)),t}toString(e=0){const t=[super.toString(e)," ".repeat(e+1)+this.name];return this.unwrapped&&t.push(this.unwrapped.toString(e+1)),this.parameters&&t.push(this.parameters.toString(e+1)),t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{name:this.name,unwrapped:this.unwrapped?.toJSON(),parameters:this.parameters?.toJSON()})}}class lt extends Ye{target;constructor(e){super(),this.target=e}getChildren(){return[this.target]}_serialize(e){let t=this._serializeToken(new Je(He.AMPERSAND,""),e);return t+=this.target.serialize(e),t}toString(e=0){return[super.toString(e)+" (&)",this.target.toString(e+1)].join("\n")}toJSON(){return Object.assign(super.toJSON(),{target:this.target.toJSON()})}}class ut extends Ye{min;max;rangeop;constructor(e,t,n){super(),this.min=e,this.max=t,this.rangeop=n}getChildren(){return[this.min,this.max]}_serialize(e){let t=this.min.serialize(e);return t+=this._serializeToken(this.rangeop,e),t+=this.max.serialize(e),t}toString(e=0){return[super.toString(e),this.min.toString(e+1),this.rangeop.toString(e+1),this.max.toString(e+1)].join("\n")}toJSON(){return Object.assign(super.toJSON(),{min:this.min.toJSON(),max:this.max.toJSON(),rangeop:this.rangeop.toJSON()})}}class dt extends Ye{type;name;controller;constructor(e,t,n){super(),this.type=e,this.name=t,this.controller=n}getChildren(){return[this.type,this.controller]}_serialize(e){let t=this.type.serialize(e);return t+=this._serializeToken(this.name,e),t+=this.controller.serialize(e),t}toString(e=0){return[super.toString(e),this.type.toString(e+1),this.name.toString(e+1),this.controller.toString(e+1)].join("\n")}toJSON(){return Object.assign(super.toJSON(),{type:this.type.toJSON(),name:this.name.toJSON(),controller:this.controller.toJSON()})}}class pt extends Ze{type;hasCut;hasColon;tokens;constructor(e,t,n,r=[]){super(),this.type=e,this.hasCut=t,this.hasColon=n,this.tokens=r}getChildren(){return[this.type]}_serialize(e){let t=this.type.serialize(e);return t+=this.tokens.map(t=>this._serializeToken(t,e)).join(""),t}toString(e=0){const t=[super.toString(e),this.type.toString(e+1)];for(const n of this.tokens)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{type:this.type.toJSON(),hasCut:this.hasCut,hasColon:this.hasColon,tokens:this.tokens.map(e=>e.toJSON())})}}class ht extends Ye{types;constructor(e){super(),this.types=e}getChildren(){return this.types}_serialize(e){return this.types.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.types)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{types:this.types.map(e=>e.toJSON())})}}class ft extends Ke{parameters;constructor(e){super(),this.parameters=e}getChildren(){return this.parameters}_serialize(e){return this.parameters.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.parameters)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{parameters:this.parameters.map(e=>e.toJSON())})}}class mt extends Ke{parameters;constructor(e){super(),this.parameters=e}getChildren(){return this.parameters}_serialize(e){return this.parameters.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.parameters)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{parameters:this.parameters.map(e=>e.toJSON())})}}class gt extends Error{constructor(e="A parsing error occurred"){super(e),this.name="ParserError"}}function bt(e){return function(e){return"a"<=e&&e<="z"||"A"<=e&&e<="Z"}(e)||"@_$".includes(e)}function yt(e){return e.length>0&&"123456789".includes(e[0])&&[...e].every(e=>"0123456789".includes(e))}class wt{line;position;constructor(e=-1,t=-1){this.line=e,this.position=t}}class kt{input;position=0;readPosition=0;ch=0;constructor(e){this.input=e,this.readChar()}readChar(){this.readPosition>=this.input.length?this.ch=0:this.ch=this.input.charCodeAt(this.readPosition),this.position=this.readPosition,this.readPosition+=1}_peekAtNextChar(){return this.readPosition>=this.input.length?"":this.input[this.readPosition]}getLocation(){const e=this.position-2,t=this.input.split("\n");let n=0;for(let r=0;r<t.length;r++){const i=t[r].length;if(n+=i+1,n>e){return new wt(r,e-(n-i)+1)}}return new wt(0,0)}getLine(e){return this.input.split("\n")[e]}getLocationInfo(){const e=this.getLocation();let t=(e.line>=0?this.getLine(e.line):"")+"\n";return t+=" ".repeat(e.position>=0?e.position:0)+"^\n",t+=" ".repeat(e.position>=0?e.position:0)+"|\n",t}nextToken(){const e=this._readComments();let t="";e.length>0&&""===e[e.length-1].literal&&(t=e[e.length-1].whitespace,e.pop());let n=new Je(He.ILLEGAL,"");const r=String.fromCharCode(this.ch);let i=!1;if("="===r)">"===this._peekAtNextChar()?(this.readChar(),n=new Je(He.ARROWMAP,"",e,t)):n=new Je(He.ASSIGN,"",e,t);else if("("===r)n=new Je(He.LPAREN,"",e,t);else if(")"===r)n=new Je(He.RPAREN,"",e,t);else if("{"===r)n=new Je(He.LBRACE,"",e,t);else if("}"===r)n=new Je(He.RBRACE,"",e,t);else if("["===r)n=new Je(He.LBRACK,"",e,t);else if("]"===r)n=new Je(He.RBRACK,"",e,t);else if("<"===r)n=new Je(He.LT,"",e,t);else if(">"===r)n=new Je(He.GT,"",e,t);else if("+"===r)n=new Je(He.PLUS,"",e,t);else if(","===r)n=new Je(He.COMMA,"",e,t);else if("."===r)"."===this._peekAtNextChar()?(this.readChar(),n=new Je(He.INCLRANGE,"",e,t),"."===this._peekAtNextChar()&&(this.readChar(),n=new Je(He.EXCLRANGE,"",e,t))):bt(this._peekAtNextChar())&&(this.readChar(),n=new Je(He.CTLOP,this._readIdentifier(),e,t),i=!0);else if(":"===r)n=new Je(He.COLON,"",e,t);else if("?"===r)n=new Je(He.QUEST,"",e,t);else if("/"===r)"/"===this._peekAtNextChar()?(this.readChar(),n=new Je(He.GCHOICE,"",e,t),"="===this._peekAtNextChar()&&(this.readChar(),n=new Je(He.GCHOICEALT,"",e,t))):"="===this._peekAtNextChar()?(this.readChar(),n=new Je(He.TCHOICEALT,"",e,t)):n=new Je(He.TCHOICE,"",e,t);else if("*"===r)n=new Je(He.ASTERISK,"",e,t);else if("^"===r)n=new Je(He.CARET,"",e,t);else if("#"===r)n=new Je(He.HASH,"",e,t);else if("~"===r)n=new Je(He.TILDE,"",e,t);else if('"'===r)n=new Je(He.STRING,this._readString(),e,t);else if("'"===r)n=new Je(He.BYTES,this._readBytesString(),e,t);else if(";"===r)n=new Je(He.COMMENT,this._readComment(),e,t),i=!0;else if("&"===r)n=new Je(He.AMPERSAND,"",e,t);else if(0===this.ch)n=new Je(He.EOF,"",e,t);else if(bt(r))"b"===r&&"6"===this._peekAtNextChar()?(this.readChar(),this.readChar(),"4"===String.fromCharCode(this.ch)&&"'"===this._peekAtNextChar()?(this.readChar(),n=new Je(He.BASE64,this._readBytesString(),e,t)):(n=new Je(He.IDENT,this._readIdentifier("b6"),e,t),i=!0)):"h"===r&&"'"===this._peekAtNextChar()?(this.readChar(),n=new Je(He.HEX,this._readBytesString(),e,t)):(n=new Je(He.IDENT,this._readIdentifier(),e,t),i=!0);else if(this._isDigit(r)||"-"===r){const r=this._readNumberOrFloat();n=new Je(r.includes(".")?He.FLOAT:He.NUMBER,r,e,t),i=!0}return i||this.readChar(),n}_isDigit(e){return e>="0"&&e<="9"}_readIdentifier(e=""){const t=this.position;if(""===e&&!bt(String.fromCharCode(this.ch)))throw this._tokenError("expected identifier, got nothing");for(;bt(String.fromCharCode(this.ch))||this._isDigit(String.fromCharCode(this.ch))||"-. ".includes(String.fromCharCode(this.ch));){if(" "===String.fromCharCode(this.ch))break;this.readChar()}const n=e+this.input.substring(t,this.position);if(n.endsWith("-")||n.endsWith("."))throw this._tokenError(`identifier cannot end with \`-\` or \`.\`, got \`${n}\``);return n}_readComment(){const e=this.position;for(;this.ch&&"\n"!==String.fromCharCode(this.ch);)this.readChar();return this.input.substring(e,this.position)}_readString(){const e=this.position;for(this.readChar();'"'!==String.fromCharCode(this.ch);)if(this.ch>=32&&this.ch<=33||this.ch>=35&&this.ch<=91||this.ch>=93&&this.ch<=126||this.ch>=128&&this.ch<=1114109)this.readChar();else if("\\"===String.fromCharCode(this.ch)){if(this.readChar(),!(this.ch>=32&&this.ch<=126||this.ch>=128&&this.ch<=1114109))throw this._tokenError(`invalid escape character in text string \`${this.input.substring(e+1,this.position)}\``);this.readChar()}else if(10===this.ch)this.readChar();else{if(13!==this.ch||10!==this._peekAtNextChar().charCodeAt(0))throw this._tokenError(`invalid text string \`${this.input.substring(e+1,this.position)}\``);this.readChar(),this.readChar()}return this.input.substring(e+1,this.position)}_readBytesString(){const e=this.position;for(this.readChar();"'"!==String.fromCharCode(this.ch);)if(this.ch>=32&&this.ch<=38||this.ch>=40&&this.ch<=91||this.ch>=93&&this.ch<=1114109)this.readChar();else if("\\"===String.fromCharCode(this.ch)){if(this.readChar(),!(this.ch>=32&&this.ch<=126||this.ch>=128&&this.ch<=1114109))throw this._tokenError(`invalid escape character in byte string \`${this.input.substring(e+1,this.position)}\``);this.readChar()}else if(10===this.ch)this.readChar();else{if(13!==this.ch||10!==this._peekAtNextChar().charCodeAt(0))throw this._tokenError(`invalid byte string \`${this.input.substring(e+1,this.position)}\``);this.readChar(),this.readChar()}return this.input.substring(e+1,this.position)}_readNumberOrFloat(){const e=this.position;let t=!1;if("-"===String.fromCharCode(this.ch)&&this.readChar(),"0"===String.fromCharCode(this.ch)){if(this.readChar(),"x"===String.fromCharCode(this.ch)){if(this.readChar(),!"0123456789ABCDEF".includes(String.fromCharCode(this.ch).toUpperCase()))throw this._tokenError(`expected hex number to contain hex digits, got \`${this.input.substring(e,this.position)}\``);for(;"0123456789ABCDEF".includes(String.fromCharCode(this.ch).toUpperCase());)this.readChar();if("."===String.fromCharCode(this.ch)){if(t=!0,"."===this._peekAtNextChar())return this.input.substring(e,this.position);for(this.readChar();"0123456789ABCDEF".includes(String.fromCharCode(this.ch).toUpperCase());)this.readChar()}if(t&&"p"!==String.fromCharCode(this.ch))throw this._tokenError(`expected hex number with fraction to have an exponent, got \`${this.input.substring(e,this.position)}\``);if("p"===String.fromCharCode(this.ch)){if(this.readChar(),"+-".includes(String.fromCharCode(this.ch))&&this.readChar(),!this._isDigit(String.fromCharCode(this.ch)))throw this._tokenError(`expected hex number with exponent to have a digit in exponent, got \`${this.input.substring(e,this.position)}\``);for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar()}}else if("b"===String.fromCharCode(this.ch)){if(this.readChar(),!"01".includes(String.fromCharCode(this.ch)))throw this._tokenError(`expected binary number to have binary digits, got \`${this.input.substring(e,this.position)}\``);for(;"01".includes(String.fromCharCode(this.ch));)this.readChar()}else if("."===String.fromCharCode(this.ch)){if("."===this._peekAtNextChar())return this.input.substring(e,this.position);if(this.readChar(),!this._isDigit(String.fromCharCode(this.ch)))throw this._tokenError(`expected number with fraction to have digits in fraction part, got \`${this.input.substring(e,this.position)}\``);for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar();if("e"===String.fromCharCode(this.ch)){if(this.readChar(),"+-".includes(String.fromCharCode(this.ch))&&this.readChar(),!this._isDigit(String.fromCharCode(this.ch)))throw this._tokenError(`expected number with exponent to have digits in exponent, got \`${this.input.substring(e,this.position)}\``);for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar()}}}else{for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar();if("."===String.fromCharCode(this.ch)){if("."===this._peekAtNextChar())return this.input.substring(e,this.position);if(this.readChar(),!this._isDigit(String.fromCharCode(this.ch)))throw this._tokenError(`expected number with fraction to have digits in fraction part, got \`${this.input.substring(e,this.position)}\``);for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar()}if("e"===String.fromCharCode(this.ch)){if(this.readChar(),"+-".includes(String.fromCharCode(this.ch))&&this.readChar(),!this._isDigit(String.fromCharCode(this.ch)))throw this._tokenError(`expected number with exponent to have digits in exponent, got \`${this.input.substring(e,this.position)}\``);for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar()}}return this.input.substring(e,this.position)}_readWhitespace(){const e=this.position;for(;" \t\n\r".includes(String.fromCharCode(this.ch));)this.readChar();return this.input.substring(e,this.position)}_readComments(){const e=[];for(;;){const t=this._readWhitespace();if(";"!==String.fromCharCode(this.ch)){if(""!==t){const n=new Je(He.COMMENT,"",[],t);e.push(n)}break}const n=new Je(He.COMMENT,this._readComment(),[],t);e.push(n)}return e}_tokenError(e){const t=this.getLocation();return new gt(`CDDL token error - line ${t.line+1}: ${e}`)}}const vt=new Je(He.ILLEGAL,"");const $t=/^[!#$%&'*+-.^`|~\w]+$/,xt=/[\u000A\u000D\u0009\u0020]/u,Ct=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function St(e,t,n){(t&&""!==t&&!e.has(t)&&Ct.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function _t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Tt={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Rt(e){Tt=e}var Et={exec:()=>null};function At(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Lt(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(It.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Pt=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Nt="^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)",It={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,textIndentedContinuation:/^(?:\n(?: {4}| {0,3}\t)[ \t]*[^ \t\n][^\n]*)+/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)(\t[ \t]*)/gm,blockquoteFenceOpen:/^ {0,3}(`{3,}(?=[^`]*$)|~{3,})/,blockquoteFenceClose:/^ {0,3}(`{3,}|~{3,})[ \t]*$/,blockquoteListItemStart:/^ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|$)/,nestedBlockMarker:/^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableHeader:new RegExp(Nt+"(?:\\n|$)"),tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:At(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`)),hrRegex:At(e=>new RegExp(`^ {0,${e}}((?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\\*[ \t]*){3,})(?:\\n+|$)`)),fencesBeginRegex:At(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:At(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:At(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:At(e=>new RegExp(`^ {0,${e}}(?:</?(?:${jt})(?:[ \\t]+|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:At(e=>new RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},Ot=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,jt="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",zt=Lt(" {0,3}(?:</?(?:tag)(?:[ \\t]+|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",jt).getRegex(),Mt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,qt=Lt(Mt).replace(/bull/g,Dt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g,"").replace(/html/g,zt).getRegex(),Ut=Lt(Mt).replace(/bull/g,Dt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g,zt).getRegex(),Wt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ft=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Bt=Lt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ft).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),Ht=Lt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Dt).getRegex(),Gt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vt=Lt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Gt).replace("tag",jt).replace("attribute",/[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex(),Jt=e=>Lt(Wt).replace("hr",Ot).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html",zt).getRegex(),Zt=Jt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Kt=Jt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Yt=/ {0,3}> ?(?:(?!blank)(paragraph)|[^\n]*)(?:\n|$)/,Xt={blockquote:Lt(/^(first)(?:next)*/).replace("first",Lt(Yt).replace("blank",/[ \t]*(?:\n|$)| {4}/).getRegex()).replace("next",Lt(Yt).replace("blank",/[ \t]*(?:\n|$)/).getRegex()).replace(/paragraph/g,Kt).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Bt,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*)[ \t]*(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Ot,html:Vt,lheading:qt,list:Ht,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Zt,table:Et,text:/^[^\n]+/},Qt=Lt(Nt+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ot).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",zt).getRegex(),en={...Xt,lheading:Ut,table:Qt,paragraph:Lt(Wt).replace("hr",Ot).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",It.tableHeader).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",zt).getRegex()},tn={...Xt,html:Lt("^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))").replace("comment",Gt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Et,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Lt(Wt).replace("hr",Ot).replace("heading"," *#{1,6} *[^\n]").replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").replace("lheading",qt).getRegex()},nn=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,rn=/[\p{P}\p{S}]/u,sn=/[\s\p{P}\p{S}]/u,on=/[^\s\p{P}\p{S}]/u,an=Lt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sn).getRegex(),cn=/(?!~)[\p{P}\p{S}]/u,ln=Lt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Pt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),un=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dn=Lt(un,"u").replace(/punct/g,rn).getRegex(),pn=Lt(un,"u").replace(/punct/g,cn).getRegex(),hn=Lt(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,"u").replace(/openQuote/g,/[\p{Pi}\p{Ps}"']/u).replace(/punct/g,rn).getRegex(),fn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mn=Lt(fn,"gu").replace(/notPunctSpace/g,on).replace(/punctSpace/g,sn).replace(/punct/g,rn).getRegex(),gn=Lt(fn,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,cn).getRegex(),bn=Lt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,on).replace(/punctSpace/g,sn).replace(/punct/g,rn).getRegex(),yn=Lt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,on).replace(/punctSpace/g,sn).replace(/punct/g,rn).getRegex(),wn=Lt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,on).replace(/punctSpace/g,sn).replace(/punct/g,rn).getRegex(),kn=Lt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,rn).getRegex(),vn=Lt("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,on).replace(/punctSpace/g,sn).replace(/punct/g,rn).getRegex(),$n=Lt(/\\(punct)/,"gu").replace(/punct/g,rn).getRegex(),xn=Lt(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,rn).getRegex(),Cn=Lt(/^<(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(),Sn=Lt(Gt).replace("(?:--\x3e|$)","--\x3e").getRegex(),_n=Lt("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Sn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Tn=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Rn=Lt(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Tn).getRegex(),En=/\\[^ \t\n\x00-\x1f]|\\(?=[ \t\n])|[^ \t\n\x00-\x1f\\()]/,An=Lt(/\((?:char)*\)/).replace("char",En).getRegex(),Ln=Lt(/\((?:char|p1)*\)/).replace("char",En).replace("p1",An).getRegex(),Pn=Lt(/\((?:char|p2)*\)/).replace("char",En).replace("p2",Ln).getRegex(),Nn=Lt(/(?!<)(?:char|p3)+/).replace("char",En).replace("p3",Pn).getRegex(),In=Lt(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Rn).replace("href",Lt(/<(?:\\.|[^\n<>\\])*>|bareHref|(?=\))/).replace("bareHref",Nn).getRegex()).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),On=Lt(/^!?\[(label)\]\[(ref)\]/).replace("label",Rn).replace("ref",Ft).getRegex(),Dn=Lt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ft).getRegex(),jn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,zn=Lt(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Tn).getRegex(),Mn=Lt("reflink|nolink(?!\\()","g").replace("reflink",Lt(/^!?\[(label)\]\[(ref)\]/).replace("label",zn).replace("ref",jn).getRegex()).replace("nolink",Lt(/^!?\[(ref)\](?:\[\])?/).replace("ref",jn).getRegex()).getRegex(),qn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Un=Lt(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Wn={_backpedal:Et,anyPunctuation:$n,anyPunctuationOutsideCode:xn,autolink:Cn,blockSkip:ln,br:nn,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Et,delLDelim:Et,delRDelim:Et,emStrongLDelim:dn,emStrongRDelimAst:mn,emStrongRDelimUnd:yn,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:In,nolink:Dn,punctuation:an,reflink:On,reflinkSearch:Mn,tag:_n,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Et},Fn={...Wn,emStrongLDelim:hn,emStrongRDelimAst:bn,emStrongRDelimUnd:wn,link:Lt(/^!?\[(label)\]\((.*?)\)/).replace("label",Rn).getRegex(),reflink:Lt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Rn).getRegex()},Bn={...Wn,emStrongRDelimAst:gn,emStrongLDelim:pn,delLDelim:kn,delRDelim:vn,url:Lt(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Un).replace("protocol",qn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Lt(/^(?:[A-Za-z0-9.+-]+(?=@)|[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",qn).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",Pt?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},Hn={...Bn,br:Lt(nn).replace("{2,}","*").getRegex(),text:Lt(Bn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Gn={normal:Xt,gfm:en,pedantic:tn},Vn={normal:Wn,gfm:Bn,breaks:Hn,pedantic:Fn},Jn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zn=e=>Jn[e];function Kn(e,t){if(t){if(It.escapeTest.test(e))return e.replace(It.escapeReplace,Zn)}else if(It.escapeTestNoEncode.test(e))return e.replace(It.escapeReplaceNoEncode,Zn);return e}function Yn(e){try{e=encodeURI(e).replace(It.percentDecode,"%")}catch{return null}return e}function Xn(e,t){let n=e.replace(It.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(It.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(It.slashPipe,"|");return n}function Qn(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){if(e.charAt(r-i-1)!==t)break;i++}return e.slice(0,r-i)}function er(e){let t=e.split("\n"),n=t.length-1;for(;n>=0&&It.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join("\n")}function tr(e){return e.trim().replace(It.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function nr(e,t){if(-1===e.indexOf(t[0])&&-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var rr=new WeakMap;function ir(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let i=0;i<r;i++){let s=e[i];if("*"!==s&&"_"!==s&&"~"!==s)continue;let o=0===i?"\n":e[i-1],a=i+1;for(;a<r&&e[a]===s;)a++;" "!==o&&"\t"!==o&&"\n"!==o&&"\r"!==o&&"\f"!==o&&("~"===s?n=i:t[s]=i),i=a-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function sr(e,t,n){let r=rr.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:ir(t).lastPossibleEmStrongCloserIndex[n]}function or(e,t){let n=rr.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:ir(t).lastPossibleDelCloserIndex}function ar(e,t=0){let n=t,r="";for(let t of e)if("\t"===t){let e=4-n%4;r+=" ".repeat(e),n+=e}else r+=t,n++;return r}function cr(e){let t,n=!1;return e.map(e=>{if(n)return e;let{depth:r,expanded:i,keptIndent:s,content:o}=function(e,t){let n=0,r=0,i=0,s=0,o="";for(;i<t;){let t=n,a=r;for(;" "===e[t]||"\t"===e[t];)a+=lr(e[t],a),t++;if(">"!==e[t]||a-s>3)break;o+=" ".repeat(a-r)+">",i++,n=t+1,r=a+1,s=" "===e[n]||"\t"===e[n]?r+1:r}if(0===i)return{depth:i,expanded:e,keptIndent:e,content:e};let a="",c="";for(;(" "===e[n]||"\t"===e[n])&&r<s+4;){let t=lr(e[n],r);a+=" ".repeat(t),c+=r<s&&t>1?" ".repeat(t):e[n],r+=t,n++}let l=e.slice(n);return{depth:i,expanded:o+a+l,keptIndent:o+c+l,content:" ".repeat(Math.max(0,r-s))+l}}(e,t?.depth??1/0);if(t?.depth!==r&&(t=void 0),t){let e=It.blockquoteFenceClose.exec(o)?.[1];return!e||e[0]!==t.marker[0]||e.length<t.marker.length?s:(t=void 0,i)}if(n=It.blockquoteListItemStart.test(o),n)return e;let a=It.blockquoteFenceOpen.exec(o)?.[1];return a&&(t={marker:a,depth:r}),i}).join("\n")}function lr(e,t){return"\t"===e?4-t%4:1}function ur(e,t,n,r,i){let s=t.href,o=t.title||null,a=function(e,t){let n="";for(let r=0;r<e.length;r++){if("`"===e[r]){let i=t.inline.code.exec(e.slice(r));if(i){n+=i[0],r+=i[0].length-1;continue}}"\\"!==e[r]||"["!==e[r+1]&&"]"!==e[r+1]?n+=e[r]:(n+=e[r+1],r++)}return n}(e[1],i),c="!"===e[0].charAt(0),l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let p=r.inlineTokens(a),h=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(h)return void(r.state.inRawBlock=d);r.state.linkEmitted=!0}return{type:c?"image":"link",raw:n,href:s,title:o,text:a,tokens:p}}function dr(e,t,n,r){if(!t.includes("<"))return!1;for(let i=0;i<t.length;i++){if("\\"===t[i]){i++;continue}if("`"===t[i]){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if("<"!==t[i])continue;let s=e.slice(n+i),o=r.inline.tag.exec(s)||r.inline.autolink.exec(s);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var pr=class{options;rules;lexer;constructor(e){this.options=e||Tt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:er(t[0]),n=e.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split("\n").map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join("\n")}(e,t[3]||"",this.rules);return void 0!==t[3]&&(""===n||n.endsWith("\n"))&&(n+="\n"),{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Qn(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:"heading",raw:Qn(t[0],"\n"),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Qn(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Qn(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,s=!1,o=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))o.push(e[t]),s=!0;else{if(s)break;o.push(e[t])}e=e.slice(t);let a=o.join("\n"),c=(this.lexer.state.top&&!this.lexer.state.inBlockquote&&a.includes("\t")?cr(o):a).replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>n.startsWith(" ")?t+" "+n.slice(1):t+ar(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${c}`:c;let l=this.lexer.state.top,u=this.lexer.state.inBlockquote;if(this.lexer.state.top=!0,this.lexer.state.inBlockquote=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,this.lexer.state.inBlockquote=u,0===e.length)break;let d=i.at(-1);if("code"===d?.type||"heading"===d?.type||"hr"===d?.type||"html"===d?.type||"table"===d?.type)break;if("blockquote"===d?.type){let t=d,s=e.join("\n"),o=t.raw+"\n"+s.replace(this.rules.other.blockquoteSetextReplace2,"");this.lexer.state.inBlockquote=!0;let a=this.blockquote(o);this.lexer.state.inBlockquote=u,i[i.length-1]=a;let c=o.substring(a.raw.length).replace(/^\n/,""),l=c?c.split("\n").length:0,p=l?e.slice(0,-l):e;if(p.length>0&&(n=`${n}\n${p.join("\n")}`),r=r.substring(0,r.length-t.text.length)+a.text,e=e.slice(p.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if("list"===d?.type){let t=d,s=t.raw+"\n"+e.join("\n"),o=this.list(s);i[i.length-1]=o;let a=o.raw.length>t.raw.length?s.slice(t.raw.length+1,o.raw.length).split("\n").length:0;if(a>0){let t=e.slice(0,a).join("\n");n=`${n}\n${t}`,r=`${r}\n${t}`}if(e=e.slice(a),e.length>0&&!this.rules.other.blockquoteStart.test(e[0]))break;continue}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&"text"===this.lexer.state.lastToken?.type&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,i=t[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let a=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,s="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split("\n",1)[0],d=t[1].length,p=this.options.pedantic?ar(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>ar(e,d)),h=e.split("\n",1)[0],f=!p.trim(),m=0;if(this.options.pedantic?(m=2,s=p.trimStart()):f?m=d+1:(m=p.search(this.rules.other.nonSpaceChar),m=m>4?1:m,s=p.slice(m),m+=d),f&&this.rules.other.blankLine.test(h)&&(e=e.substring(h.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(m),n=this.rules.other.hrRegex(m),r=this.rules.other.fencesBeginRegex(m),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(m):this.rules.other.headingBeginRegex(m),o=this.rules.other.htmlBeginRegex(m),a=this.rules.other.blockquoteBeginRegex(m),c=!1;for(;e;){let l,u=e.split("\n",1)[0];if(h=u,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),l=h):l=h.replace(this.rules.other.leadingSpaceTab,e=>ar(e)),r.test(h)||i.test(h)||o.test(h)||a.test(h)||t.test(h)||n.test(h))break;if(l.search(this.rules.other.nonSpaceChar)>=m||!h.trim())s+="\n"+l.slice(m),c=!1;else{if(f)break;let e=p;if(!this.options.pedantic&&!s.includes("\n")&&!p.includes("\t")){let t;for(;!n.test(e)&&(t=this.rules.other.nestedBlockMarker.exec(e));)e=e.slice(t[0].length);if(!e.trim())break}if(e.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||r.test(e)||i.test(e)||o.test(e)||n.test(e))break;if(!this.options.pedantic&&!c){let e=p.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(e)||this.rules.block.heading.test(e)||this.rules.block.hr.test(e))break}s+="\n"+(!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(h)&&this.rules.block.lheading.test(`${p}\n${h}`)?` ${l.replace(/^ {0,3}/,"")}`:h),c=!0}f=!h.trim(),e=e.substring(u.length+1),p=l.slice(m)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]})}let l=o.items.at(-1);if(!l)return;l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd(),o.raw=n.slice(0,r()).trimEnd();let u=[];for(let e of o.items)if(this.lexer.state.top=!1,u.push(this.lexer.inlineQueue.length),e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));o.loose=n}for(let e=0;e<o.items.length;e++){let t=o.items[e],n=t.tokens[0];if(!t.task||"text"!==n?.type&&"paragraph"!==n?.type)t.task&&(t.task=!1);else{t.text=t.text.replace(this.rules.other.listReplaceTask,""),n.raw=n.raw.replace(this.rules.other.listReplaceTask,""),n.text=n.text.replace(this.rules.other.listReplaceTask,"");let r=this.lexer.inlineQueue;for(let t=u[e];t<r.length;t++)if(r[t].tokens===n.tokens){r[t].src=r[t].src.replace(this.rules.other.listReplaceTask,"");break}let i=this.rules.other.listTaskCheckbox.exec(t.raw);if(i){let e={type:"checkbox",raw:i[0]+" ",checked:"[ ]"!==i[0]};t.checked=e.checked,o.loose?t.tokens[0]&&["paragraph","text"].includes(t.tokens[0].type)&&"tokens"in t.tokens[0]&&t.tokens[0].tokens?(t.tokens[0].raw=e.raw+t.tokens[0].raw,t.tokens[0].text=e.raw+t.tokens[0].text,t.tokens[0].tokens.unshift(e)):t.tokens.unshift({type:"paragraph",raw:e.raw,text:e.raw,tokens:[e]}):t.tokens.unshift(e)}}}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){if("paragraph"===this.lexer.state.lastToken?.type&&!this.rules.other.htmlBeginRegex(4).test(e))return;let n=er(t[0]);return{type:"html",block:!0,raw:n,pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&-1!==nr(t[2],"()"))return;let e=tr(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$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:Qn(t[0],"\n"),href:n,title:r}}}table(e){let t,n;if(this.options.gfm&&!this.options.pedantic){let r=this.rules.other.tableHeader.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2])||(t=Xn(r[1]),n=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),t.length!==n.length))return}let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;t??=Xn(r[1]),n??=r[2].replace(this.rules.other.tableAlignChars,"").split("|");let i=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:Qn(r[0],"\n"),header:[],align:[],rows:[]};if(t.length===n.length){for(let e of n)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<t.length;e++)s.header.push({text:t[e],tokens:this.lexer.inline(t[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(Xn(e,s.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:Qn(t[0],"\n"),depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let 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){let t=this.rules.block.text.exec(e);if(t){let n=t[0],r=t[0],i=this.rules.other.textIndentedContinuation.exec(e.slice(n.length));return i&&(n+=i[0],r+=i[0].replace(this.rules.other.codeRemoveIndent,"")),{type:"text",raw:n,text:r,tokens:this.lexer.inline(r)}}}escape(e){if(92!==e.charCodeAt(0))return;let t=this.rules.inline.escape.exec(e);return t?{type:"escape",raw:t[0],text:t[1]}:void 0}tag(e){if(60!==e.charCodeAt(0))return;let t=this.rules.inline.tag.exec(e);return t?(!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.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]}):void 0}link(e){if(!1===this.lexer.state.linkParenPossible)return;let t=e.charCodeAt(0);if(91!==t&&33!==t)return;let n=this.rules.inline.link.exec(e);if(n){let t="!"===n[0].charAt(0)?2:1;if(!this.options.pedantic&&dr(e,n[1],t,this.rules))return;let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Qn(r.slice(0,-1),"\\");if((r.length-e.length)%2==0)return}else{let e=nr(n[2],"()");if(-2===e)return;if(e>-1){let t=(0===n[0].indexOf("!")?5:4)+n[1].length+e;n[2]=n[2].substring(0,e),n[0]=n[0].substring(0,t).trim(),n[3]=""}}let i=Qn(n[0].slice(0,-1),"\\");if((n[0].length-i.length)%2==0)return;let s=n[2],o="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(s);e&&(s=e[1],o=e[3])}else o=n[3]?n[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(s=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s.slice(1):s.slice(1,-1)),ur(n,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,t){let n,r=e.charCodeAt(0);if((91===r||33===r)&&((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e)))){let r="!"===n[0].charAt(0)?2:1;if(!this.options.pedantic&&dr(e,n[1],r,this.rules))return;let i=t[tr(n[2]||n[1])];if(!i){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ur(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],s=n===i,o=t.length-e.length,a=o;for(;!this.options.pedantic&&a>0&&t[a-1]===i;)a--;let c=[...t.slice(Math.max(0,a-2),a)].at(-1)??"",l="*"===c||"_"===c||!!this.rules.inline.punctuation.exec(c);a<o&&(n=c);let u=a<o?l:"*"===n||"_"===n||!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||"";if(!d||!n||u){let n,u,p=[...r[0]].length-1,h=p,f=0,m=o-a+p,g=!(this.options.pedantic||!c.trim()||!d&&("*"!==i||l));if("*"!==i&&"_"!==i)return;let b="*"===i?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,y=sr(this,t,i),w=t.length-e.length+p;if(y<w)return;t=t.slice(-1*e.length+p);let k=y-w;for(b.lastIndex=0;null!==(r=b.exec(t))&&!(r.index>k);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(u=[...n].length,r[3]||r[4]){h+=u;continue}if((r[5]||r[6]||g)&&m%3&&!((m+u)%3)){if(s&&(r[5]||r[6]))break;f+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h+f);let t=[...r[0]][0].length,i=e.slice(0,p+r.index+t+u);if(Math.min(p,u)%2){let e=i.slice(1,-1);return{type:"em",raw:i,text:e,tokens:this.lexer.inlineTokens(e)}}let o=i.slice(2,-2);return{type:"strong",raw:i,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){if(96!==e.charCodeAt(0))return;let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=e.charCodeAt(0);if(32!==t&&92!==t&&10!==t)return;let n=this.rules.inline.br.exec(e);return n?{type:"br",raw:n[0]}:void 0}del(e,t,n=""){if(126!==e.charCodeAt(0))return;let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n,i,s=[...r[0]].length-1,o=s,a=this.rules.inline.delRDelim,c=or(this,t),l=t.length-e.length+s;if(c<l)return;t=t.slice(-1*e.length+s);let u=c-l;for(a.lastIndex=0;null!==(r=a.exec(t))&&!(r.index>u);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(i=[...n].length,i!==s))continue;if(r[3]||r[4]){o+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o);let t=[...r[0]][0].length,a=e.slice(0,s+r.index+t+i),c=a.slice(s,-s);return{type:"del",raw:a,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){if(60!==e.charCodeAt(0))return;let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,autolink:!0,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=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=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:e?t[0]:(n=t[0],It.numericCharacterReference.test(n)?n.replace(It.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(void 0===t&&void 0===n)return"&amp;";let r=void 0===t?Number.parseInt(n,16):Number.parseInt(t,10);return 0===r||r>1114111||r>=55296&&r<=57343?"�":38===r?"&amp;":String.fromCodePoint(r)}):n),escaped:e}}var n}},hr=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Tt,this.options.tokenizer=this.options.tokenizer||new pr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0,inBlockquote:!1};let t={other:It,block:Gn.normal,inline:Vn.normal};this.options.pedantic?(t.block=Gn.pedantic,t.inline=Vn.pedantic):this.options.gfm&&(t.block=Gn.gfm,this.options.breaks?t.inline=Vn.breaks:t.inline=Vn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Gn,inline:Vn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(It.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this;let r=this.state.lastToken;this.options.pedantic&&(e=e.replace(It.tabCharGlobal," ").replace(It.spaceLine,""));let i,s=1/0,o=this.options.gfm&&!this.options.pedantic&&this.tokenizer.paragraph===pr.prototype.paragraph;for(;e;){if(!(e.length<s)){this.infiniteLoopError(e.charCodeAt(0));break}let r;if(s=e.length,this.state.lastToken=t.at(-1),this.options.extensions?.block?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(a=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let s=t.at(-1);(n||s===i&&o)&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text,i=s):(t.push(r),i=r),n=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&"!"!==e.charAt(n.index-1))return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf("[");if("!"!==e.charAt(0)&&Object.hasOwn(this.tokens.links,tr(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=e.includes(")");try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes("*")||e.includes("_")||e.includes("~"),r=n||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==pr.prototype.emStrong||this.tokenizer.del!==pr.prototype.del?this.#t(e):e;if(!n)return this.#n(e,r,t);!function(e,t){let n=ir(t),r=rr.get(e);r?r.push(n):rr.set(e,[n])}(this.tokenizer,r);try{return this.#n(e,r,t)}finally{!function(e){let t=rr.get(e);t&&(t.pop(),0===t.length&&rr.delete(e))}(this.tokenizer)}}#n(e,t,n){let r=!1,i="",s=1/0;for(;e;){if(!(e.length<s)){this.infiniteLoopError(e.charCodeAt(0));break}let o;if(s=e.length,r||(i=""),r=!1,this.options.extensions?.inline?.some(t=>!!(o=t.call({lexer:this},e,n))&&(e=e.substring(o.raw.length),n.push(o),!0)))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);"text"===o.type&&"text"===t?.type?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}let a=e[0];if("*"===a||"_"===a){let s=t.length-e.length;if(sr(this.tokenizer,t,a)<=s){let t=1;for(;t<e.length&&e.charCodeAt(t)===a.charCodeAt(0);)t++;let s=e.substring(0,t),o=n.at(-1);"text"!==o?.type||o.escaped?n.push({type:"text",raw:s,text:s,escaped:!1}):(o.raw+=s,o.text+=s),e=e.substring(t),i=a,r=!0;continue}}else if("~"===a){let s=t.length-e.length;if(or(this.tokenizer,t)<=s){let t=1;for(;t<e.length&&126===e.charCodeAt(t);)t++;let s=e.substring(0,t),o=n.at(-1);"text"!==o?.type||o.escaped?n.push({type:"text",raw:s,text:s,escaped:!1}):(o.raw+=s,o.text+=s),e=e.substring(t),i=a,r=!0;continue}}if(o=this.tokenizer.emStrong(e,t,i)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e,t,i)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let c=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(c=e.substring(0,n+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);"text"===t?.type?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#r(e){let t,{blockSkip:n,tag:r,autolink:i}=this.tokenizer.rules.inline,s="",o=0;for(n.lastIndex=0;t=n.exec(e);){let a=t.index+(t[2]?t[2].length:0),c=t.index+t[0].length;if("<"===e.charAt(a)){let t=e.slice(a),s=r.exec(t)||i.exec(t);if(!s){n.lastIndex=a+1;continue}c=a+s[0].length,n.lastIndex=c}s+=e.slice(o,a)+"["+"a".repeat(c-a-2)+"]",o=c}return s+e.slice(o)}#t(e){let t=e;if(this.tokens.links&&e.includes("[")){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,tr(t.slice(r+1,-1))))return t;if(r>1&&"!"!==t.charAt(0)){let i=t.slice(1,r-1);if(this.linkInText(i))return"["+i.replace(e,n)+"]["+"a".repeat(t.length-r-2)+"]"}return"["+"a".repeat(t.length-2)+"]"};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?"+".repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,"+")+t:e),t=this.#r(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(!this.options.silent)throw new Error(t);console.error(t)}};function fr(e){return e.map(e=>"codespan"===e.type||"escape"===e.type?{...e,text:Kn(e.text,!0)}:"tokens"in e&&e.tokens?{...e,tokens:fr(e.tokens)}:e)}var mr=class{options;parser;constructor(e){this.options=e||Tt}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(It.notSpaceStart)?.[0],i=e?e.replace(It.endingNewline,"")+"\n":"";return r?'<pre><code class="language-'+Kn(r)+'">'+(n?i:Kn(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Kn(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Kn(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let s=i?Kn(n,!0):this.parser.parseInline(r),o=Yn(e);if(null===o)return s;let a='<a href="'+(e=Kn(o,i))+'"';return t&&(a+=' title="'+Kn(t)+'"'),a+=">"+s+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(fr(r),this.parser.textRenderer));let i=Yn(e);if(null===i)return Kn(n);let s=`<img src="${Kn(e=i)}" alt="${Kn(n)}"`;return t&&(s+=` title="${Kn(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Kn(e.text)}},gr=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return"\n"}checkbox({raw:e}){return e}},br=class e{options;renderer;textRenderer;constructor(e){this.options=e||Tt,this.options.renderer=this.options.renderer||new mr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new gr,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n],i=this.options.extensions?.renderers;if(i&&Object.hasOwn(i,r.type)&&i[r.type]){let e=r,n=i[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(e.type)){t+=!1===n?"":n??"";continue}}let s=r;switch(s.type){case"space":t+=this.renderer.space(s);break;case"hr":t+=this.renderer.hr(s);break;case"heading":t+=this.renderer.heading(s);break;case"code":t+=this.renderer.code(s);break;case"table":t+=this.renderer.table(s);break;case"blockquote":t+=this.renderer.blockquote(s);break;case"list":t+=this.renderer.list(s);break;case"checkbox":t+=this.renderer.checkbox(s);break;case"html":t+=this.renderer.html(s);break;case"def":t+=this.renderer.def(s);break;case"paragraph":t+=this.renderer.paragraph(s);break;case"text":t+=this.renderer.text(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r],s=this.options.extensions?.renderers;if(s&&Object.hasOwn(s,i.type)&&s[i.type]){let e=s[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){n+=!1===e?"":e??"";continue}}let o=i;switch(o.type){case"escape":case"text":n+=t.text(o);break;case"html":n+=t.html(o);break;case"link":n+=t.link(o);break;case"image":n+=t.image(o);break;case"checkbox":n+=t.checkbox(o);break;case"strong":n+=t.strong(o);break;case"em":n+=t.em(o);break;case"codespan":n+=t.codespan(o);break;case"br":n+=t.br(o);break;case"del":n+=t.del(o);break;default:{let e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},yr=class{options;block;constructor(e){this.options=e||Tt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?hr.lex:hr.lexInline}provideParser(e=this.block){return e?br.parse:br.parseInline}};function wr(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var kr=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=br;Renderer=mr;TextRenderer=gr;Lexer=hr;Tokenizer=pr;Hooks=yr;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(wr(n,t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)wr(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)wr(n,this.walkTokens(e.tokens,t));break}case"list":{let e=r;wr(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{if(e[r]){let i=e[r].flat(1/0);wr(n,this.walkTokens(i,t))}}):e.tokens&&wr(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let 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){let 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'");let 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){let t=this.defaults.renderer||new mr(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),!1===n?"":n??""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new pr(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new yr;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,i=e.hooks[r],s=t[r];yr.passThroughHooks.has(n)?t[r]=e=>{if(t.options.async&&yr.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return s.call(t,n)})();let r=i.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{if(t.options.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await s.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return wr(n,r.call(this,e)),t&&wr(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return hr.lex(e,t??this.defaults)}parser(e,t){return br.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?hr.lex:hr.lexInline)(n,i),s=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(s,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?br.parse:br.parseInline)(s,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?hr.lex:hr.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?br.parse:br.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Kn(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function vr(e,t){return kr.parse(e,t)}function $r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}vr.options=vr.setOptions=function(e){return kr.setOptions(e),vr.defaults=kr.defaults,Rt(vr.defaults),vr},vr.getDefaults=_t,vr.defaults=Tt,vr.use=function(...e){return kr.use(...e),vr.defaults=kr.defaults,Rt(vr.defaults),vr},vr.walkTokens=function(e,t){return kr.walkTokens(e,t)},vr.parseInline=kr.parseInline,vr.Parser=br,vr.parser=br.parse,vr.Renderer=mr,vr.TextRenderer=gr,vr.Lexer=hr,vr.lexer=hr.lex,vr.Tokenizer=pr,vr.Hooks=yr,vr.parse=vr,vr.options,vr.setOptions,vr.walkTokens,vr.parseInline,br.parse,hr.lex;var xr,Cr={exports:{}};var Sr,_r=(xr||(xr=1,Sr=Cr,function(e,t){Sr.exports=t()}(0,function(){var e=[],t=[],n={},r={},i={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function o(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],function(n,r){var i,s,a=(i=t[1],s=arguments,i.replace(/\$(\d{1,2})/g,function(e,t){return s[t]||""}));return o(""===n?e[r-1]:n,a)})}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var i=r.length;i--;){var s=r[i];if(s[0].test(t))return a(t,s)}return t}function l(e,t,n){return function(r){var i=r.toLowerCase();return t.hasOwnProperty(i)?o(r,i):e.hasOwnProperty(i)?o(r,e[i]):c(i,r,n)}}function u(e,t,n,r){return function(r){var i=r.toLowerCase();return!!t.hasOwnProperty(i)||!e.hasOwnProperty(i)&&c(i,i,n)===i}}function d(e,t,n){return(n?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=l(i,r,e),d.isPlural=u(i,r,e),d.singular=l(r,i,t),d.isSingular=u(r,i,t),d.addPluralRule=function(t,n){e.push([s(t),n])},d.addSingularRule=function(e,n){t.push([s(e),n])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),i[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(e){return d.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return d.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return d.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d})),Cr.exports),Tr=$r(_r),Rr=function(e){var t={};try{t.WeakMap=WeakMap}catch(u){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,i=s.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},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var n=t.WeakMap,r={};try{r.WeakSet=WeakSet}catch(u){!function(e,t){var n=i.prototype;function i(){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=i}(Math.random(),Object.defineProperty)}function i(e,t,n,r,i,s){for(var o=("selectedIndex"in t),a=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,s),o&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:d.call(t.querySelectorAll("option"),l)),r++}}function s(e,t){return e==t}function o(e){return e}function a(e,t,n,r,i,s,o){var a=s-i;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=i;c<n&&l<s&&o(e[c],r[l]);)c++,l++;if(l===s)return t;t=c+1}return-1}function c(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function l(e,t,n,r){for(;n<r;)h(e(t[n++],-1))}var u=r.WeakSet,d=[].indexOf,p=function(e,t,n){for(var r=1,i=t;r<i;){var s=(r+i)/2>>>0;n<e[s]?i=s:r=1+s}return r},h=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function f(e,t,n,r){for(var u=(r=r||{}).compare||s,d=r.node||o,h=null==r.before?null:d(r.before,0),f=t.length,m=f,g=0,b=n.length,y=0;g<m&&y<b&&u(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&u(t[m-1],n[b-1]);)m--,b--;var w=g===m,k=y===b;if(w&&k)return n;if(w&&y<b)return i(d,e,n,y,b,c(d,t,g,f,h)),n;if(k&&g<m)return l(d,t,g,m),n;var v=m-g,$=b-y,x=-1;if(v<$){if(-1<(x=a(n,y,b,t,g,m,u)))return i(d,e,n,y,x,d(t[g],0)),i(d,e,n,x+v,b,c(d,t,m,f,h)),n}else if($<v&&-1<(x=a(t,g,m,n,y,b,u)))return l(d,t,g,x),l(d,t,x+$,m),n;return v<2||$<2?(i(d,e,n,y,b,d(t[g],0)),l(d,t,g,m)):v==$&&function(e,t,n,r,i,s){for(;r<i&&s(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,u)?i(d,e,n,y,b,c(d,t,m,f,h)):function(e,t,n,r,s,o,a,c,u,d,h,f,m){!function(e,t,n,r,s,o,a,c,u){for(var d=[],p=e.length,h=a,f=0;f<p;)switch(e[f++]){case 0:s++,h++;break;case 1:d.push(r[s]),i(t,n,r,s++,s,h<c?t(o[h],0):u);break;case-1:h++}for(f=0;f<p;)switch(e[f++]){case 0:a++;break;case-1:-1<d.indexOf(o[a])?a++:l(t,o,a++,a)}}(function(e,t,n,r,i,s,o){var a,c,l,u,d,p,h=n+s,f=[];e:for(b=0;b<=h;b++){if(50<b)return null;for(p=b-1,u=b?f[b-1]:[0,0],d=f[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&u[p+a-1]<u[p+a+1]?u[p+a+1]:u[p+a-1]+1)-a;l<s&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===s&&c===n)break e;d[b+a]=l}}for(var m=Array(b/2+h/2),g=m.length-1,b=f.length-1;0<=b;b--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,u=b?f[b-1]:[0,0],(a=l-c)===-b||a!==b&&u[p+a-1]<u[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,o,a,c,d,f)||function(e,t,n,r,i,s,o,a){var c=0,l=r<a?r:a,u=Array(l++),d=Array(l);d[0]=-1;for(var h=1;h<l;h++)d[h]=o;for(var f=i.slice(s,o),m=t;m<n;m++){var g,b=f.indexOf(e[m]);-1<b&&-1<(c=p(d,l,g=b+s))&&(d[c]=g,u[c]={newi:m,oldi:g,prev:u[c-1]})}for(c=--l,--o;d[c]>o;)--c;l=a+r-c;var y=Array(l),w=u[c];for(--n;w;){for(var k=w.newi,v=w.oldi;k<n;)y[--l]=1,--n;for(;v<o;)y[--l]=-1,--o;y[--l]=0,--n,--o,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;s<=o;)y[--l]=-1,--o;return y}(n,r,s,o,a,c,u,d),e,t,n,r,a,c,h,m)}(d,e,n,y,b,$,t,g,m,v,f,u,h),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(u){y.Map=function(){var e=0,t=[],n=[];return{delete:function(i){var s=r(i);return s&&(t.splice(e,1),n.splice(e,1)),s},forEach:function(e,r){t.forEach(function(t,i){e.call(r,n[i],t,this)},this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(i,s){return n[r(i)?e:t.push(i)-1]=s,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function k(){return this}function v(e,t){var n="_"+e+"$";return{get:function(){return this[n]||$(this,n,t.call(this,e))},set:function(e){$(this,n,e)}}}var $=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(k.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var x,C,S,_,T,R,E={},A={},L=[],P=A.hasOwnProperty,N=0,I={attributes:E,define:function(e,t){e.indexOf("-")<0?(e in A||(N=L.push(e)),A[e]=t):E[e]=t},invoke:function(e,t){for(var n=0;n<N;n++){var r=L[n];if(P.call(e,r))return A[r](e[r],t)}}},O=Array.isArray||(C=(x={}.toString).call([]),function(e){return x.call(e)===C}),D=(S=e,_="fragment",R="content"in z(T="template")?function(e){var t=z(T);return t.innerHTML=e,t.content}:function(e){var t,n=z(_),r=z(T);return j(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(_),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",j(t,n.firstChild.childNodes),t}:R)(e)});function j(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===_?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,U,W,F,B,H,G,V,J=(q="appendChild",U="cloneNode",W="createTextNode",B=(F="importNode")in(M=e),(H=M.createDocumentFragment())[q](M[W]("g")),H[q](M[W]("")),(B?M[F](H,!0):H[U](!0)).childNodes.length<2?function e(t,n){for(var r=t[U](),i=t.childNodes||[],s=i.length,o=0;n&&o<s;o++)r[q](e(i[o],n));return r}:B?M[F]:function(e,t){return e[U](!!t)}),Z="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},K="-"+Math.random().toFixed(6)+"%",Y=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+K+'"></p>',G.content.childNodes[0].getAttribute(V)==K)||(K="_dt: "+K.slice(1,-1)+";",Y=!0)}catch(u){}var X="\x3c!--"+K+"--\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,ie="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",se="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",oe=new RegExp(ie+re+se+"+)(["+te+"]*/?>)","g"),ae=new RegExp(ie+re+se+"*)(["+te+"]*/>)","g"),ce=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function le(e,t,n,r){return"<"+t+n.replace(ce,ue)+r}function ue(e,t,n){return t+(n||'"')+K+(n||'"')}function de(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=Y?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 he(t,n,r,i){for(var s=t.childNodes,o=s.length,a=0;a<o;){var c=s[a];switch(c.nodeType){case 1:var l=i.concat(a);!function(t,n,r,i){for(var s,o=t.attributes,a=[],c=[],l=pe(o,r),u=l.length,d=0;d<u;){var p=l[d++],h=p.value===K;if(h||1<(s=p.value.split(X)).length){var f=p.name;if(a.indexOf(f)<0){a.push(f);var m=r.shift().replace(h?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+f+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=o[m]||o[m.toLowerCase()];if(h)n.push(fe(g,i,m,null));else{for(var b=s.length-2;b--;)r.shift();n.push(fe(g,i,m,s))}}c.push(p)}}for(var y=((d=0)<(u=c.length)&&Y&&!("ownerSVGElement"in t));d<u;){var w=c[d++];y&&(w.value=""),t.removeAttribute(w.name)}var k=t.nodeName;if(/^script$/i.test(k)){var v=e.createElement(k);for(u=o.length,d=0;d<u;)v.setAttributeNode(o[d++].cloneNode(!0));v.textContent=t.textContent,t.parentNode.replaceChild(v,t)}}(c,n,r,l),he(c,n,r,l);break;case 8:var u=c.textContent;if(u===K)r.shift(),n.push(Q.test(t.nodeName)?me(t,i):{type:"any",node:c,path:i.concat(a)});else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":t.removeChild(c),a--,o--}break;case 3:Q.test(t.nodeName)&&Z.call(c.textContent)===X&&(r.shift(),n.push(me(t,i)))}a++}}function fe(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(X).replace(ae,de).replace(oe,le)})(t),r=e.transform;r&&(n=r(n));var i=D(n,e.type);ke(i);var s=[];return he(i,s,t.slice(0),[]),{content:i,updates:function(n){for(var r=[],i=s.length,o=0,a=0;o<i;){var c=s[o++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,d=e.attribute(l,c.name,c.node);null===u?r.push({fn:d,sparse:!1}):(a+=u.length-2,r.push({fn:d,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return i+=a,function(){var e=arguments.length;if(i!==e-1)throw new Error(e-1+" values instead of "+i+"\n"+t.join("${value}"));for(var s=1,o=1;s<e;){var a=r[s-o];if(a.sparse){var c=a.values,l=c[0],u=1,d=c.length;for(o+=d-2;u<d;)l+=arguments[s++]+c[u++];a.fn(l)}else a.fn(arguments[s++])}return n}}}}var we=[];function ke(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===Z.call(r.textContent).length&&e.removeChild(r)}}var ve,$e,xe=(ve=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,$e=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Se(n,!0)}(e,t):Se(e.style,!1)});function Ce(e,t,n){return t+"-"+n.toLowerCase()}function Se(e,t){var n,r;return function(i){var s,o,a,c;switch(typeof i){case"object":if(i){if("object"===n){if(!t&&r!==i)for(o in r)o in i||(e[o]="")}else t?e.value="":e.cssText="";for(o in s=t?{}:e,i)a="number"!=typeof(c=i[o])||ve.test(o)?c:c+"px",!t&&/^--/.test(o)?s.setProperty(o,a):s[o]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace($e,Ce),":",e[t],";");return n.join("")}(r=s):r=i;break}default:r!=i&&(n="string",r=i,t?e.value=i||"":e.cssText=i||"")}}}var _e,Te,Re=(_e=[].slice,(Te=Ee.prototype).ELEMENT_NODE=1,Te.nodeType=111,Te.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Te.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,s=r.length;i<s;i++)t.appendChild(r[i]);return t},Ee);function Ee(e){var t=this.childNodes=_e.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Ae(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Ue:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case qe:return Le(e.render(),t);default:return e}}function Pe(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Ae).then(t):Promise.resolve(I.invoke(e,t)).then(t)}function Ne(e){return null!=e&&"then"in e}var Ie,Oe,De,je,ze,Me="ownerSVGElement",qe=k.prototype.nodeType,Ue=Re.prototype.nodeType,We=(Oe=(Ie={Event:b,WeakSet:u}).Event,De=Ie.WeakSet,je=!0,ze=null,function(e){return je&&(je=!je,ze=new De,function(e){var t=new De,n=new De;try{new MutationObserver(o).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,i=[],s=function(e){i.push(e),clearTimeout(r),r=setTimeout(function(){o(i.splice(r=0,i.length))},0)};e.addEventListener("DOMNodeRemoved",function(e){s({addedNodes:[],removedNodes:[e.target]})},!0),e.addEventListener("DOMNodeInserted",function(e){s({addedNodes:[e.target],removedNodes:[]})},!0)}function o(e){for(var r,i=e.length,s=0;s<i;s++)a((r=e[s]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var i,s=new Oe(t),o=e.length,a=0;a<o;1===(i=e[a++]).nodeType&&function e(t,n,r,i,s){ze.has(t)&&!i.has(t)&&(s.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],a=o.length,c=0;c<a;e(o[c++],n,r,i,s));}(i,s,t,n,r));}}(e.ownerDocument)),ze.add(e),e}),Fe=/^(?:form|list)$/i,Be=[].slice;function He(t){return this.type=t,function(t){var n=we,r=ke;return function(i){var s,o,a;return n!==i&&(s=t,o=n=i,a=be.get(o)||be.set(o,ye(s,o)),r=a.updates(J.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(He.prototype={attribute:function(e,t,n){var r,i=Me in e;if("style"===t)return xe(e,n,i);if("."===t.slice(0,1))return l=e,u=t.slice(1),i?function(e){try{l[u]=e}catch(t){l.setAttribute(u,e)}}:function(e){l[u]=e};if("?"===t.slice(0,1))return o=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(a,""):o.removeAttribute(a))};if(/^on/.test(t)){var s=t.slice(2);return"connected"===s||"disconnected"===s?We(e):t.toLowerCase()in e&&(s=s.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(s,r,!1),(r=t)&&e.addEventListener(s,t,!1))}}if("data"===t||!i&&t in e&&!Fe.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in I.attributes)return function(n){var i=I.attributes[t](e,n);r!==i&&(null==(r=i)?e.removeAttribute(t):e.setAttribute(t,i))};var o,a,c,l,u,d=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(d&&(d=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,d||(d=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Le,before:e},i=Me in e?"svg":"html",s=!1;return function o(a){switch(typeof a){case"string":case"number":case"boolean":s?n!==a&&(n=a,t[0].textContent=a):(s=!0,n=a,t=f(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":o(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=f(e.parentNode,t,[],r);break}default:if(s=!1,O(n=a))if(0===a.length)t.length&&(t=f(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":o({html:a});break;case"object":if(O(a[0])&&(a=a.concat.apply([],a)),Ne(a[0])){Promise.all(a).then(o);break}default:t=f(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=f(e.parentNode,t,11===a.nodeType?Be.call(a.childNodes):[a],r):Ne(a)?a.then(o):"placeholder"in a?Pe(a,o):"text"in a?o(String(a.text)):"any"in a?o(a.any):"html"in a?t=f(e.parentNode,t,Be.call(D([].concat(a.html).join(""),i).childNodes),r):o("length"in a?Be.call(a):I.invoke(a,o))}var c}},text:function(e){var t;return function n(r){var i;t!==r&&("object"==(i=typeof(t=r))&&r?Ne(r)?r.then(n):"placeholder"in r?Pe(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?Be.call(r).join(""):I.invoke(r,n)):"function"==i?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,i,s,o,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(i={},s=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return i[t]||(i[t]=e)},Ve=c?s:(o=new n,function(e){return o.get(e)||(n=s(t=e),o.set(t,n),n);var t,n})):Ge=!0,Je(t)};function Je(e){return Ge?e:Ve(e)}function Ze(e){for(var t=arguments.length,n=[Je(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ke=new n,Ye=function(e){var t,n,r;return function(){var i=Ze.apply(null,arguments);return r!==i[0]?(r=i[0],n=new He(e),t=Qe(n.apply(n,i))):n.apply(n,i),t}},Xe=function(e,t){var n=t.indexOf(":"),r=Ke.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ke.set(e,r={}),r[i]||(r[i]=Ye(t))},Qe=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Re(t):e},et=new n;function tt(){var e=et.get(this),t=Ze.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new He(Me in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,it,st,ot=I.define,at=He.prototype;function ct(e){return arguments.length<2?null==e?Ye("html"):"string"==typeof e?ct.wire(null,e):"raw"in e?Ye("html")(e):"nodeType"in e?ct.bind(e):Xe(e,"html"):("raw"in e?Ye("html"):ct.wire).apply(null,arguments)}return ct.Component=k,ct.bind=function(e){return tt.bind(e)},ct.define=ot,ct.diff=f,(ct.hyper=ct).observe=We,ct.tagger=at,ct.wire=function(e,t){return null==e?Ye(t||"html"):Xe(e,t||"html")},ct._={WeakMap:n,WeakSet:u},nt=Ye,rt=new n,it=Object.create,st=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(k,{for:{configurable:!0,value:function(e,t){return function(e,t,r,i){var s,o,a,c=t.get(e)||st(e,t);switch(typeof i){case"object":case"function":var l=c.w||(c.w=new n);return l.get(i)||(s=l,o=i,a=new e(r),s.set(o,a),a);default:var u=c.p||(c.p=it(null));return u[i]||(u[i]=new e(r))}}(this,rt.get(e)||(r=e,i=new w,rt.set(r,i),i),e,null==t?"default":t);var r,i}}}),Object.defineProperties(k.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:v("html",nt),svg:v("svg",nt),state:v("state",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),ct}(document);const{Component:Er,bind:Ar,define:Lr,diff:Pr,hyper:Nr,wire:Ir}=Rr,Or=Rr,Dr=R,jr=vr,zr=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)throw new TypeError("Invalid input.");let t="",n="",r="",i=null,s=new Map,o="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(o){case"type":if("/"===c){o="subtype";continue}t+=c;break;case"subtype":if(";"===c){o="param-start";continue}n+=c;break;case"param-start":if(xt.test(c)||";"===c)continue;r+=c,o="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){o="param-value",i=null;continue}s.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){o="collect-quoted-string";continue}if(";"===c){i=i.trimEnd(),o="param-start",St(s,r,i),r="";continue}i="string"==typeof i?i+c:c;break;case"collect-quoted-string":if('"'===c){St(s,r,i),o="ignore-input-until-next-param",r="",i=null;continue}if("\\"===c)continue;i="string"==typeof i?i+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;o="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${o} `)}}r&&St(s,r,i);if(""===t.trim()||!$t.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!$t.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(s.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?$t.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Mr=Tr,qr=Ge,Ur=class{lexer;curToken=vt;peekToken=vt;getCurToken(){return this.curToken}getPeekToken(){return this.peekToken}constructor(e){this.lexer=new kt(e),this._nextToken(),this._nextToken()}parse(){const e=[];for(;this.getCurToken().type!==He.EOF;){const t=this._parseRule();e.push(t)}const t=new Xe(e);return t.separator=this._nextToken(),t.setChildrenParent(),this._convertGroupDefinitions(t),t}_parseRule(){const e=this._parseTypename(!0,null),t=this._nextToken();let n;if(t.type===He.ASSIGN||t.type===He.GCHOICEALT){const r=this._parseGroupEntry();n=new Qe(e,t,r)}else{if(t.type!==He.TCHOICEALT)throw this._parserError(`expected assignment (\`=\`, \`/=\`, \`//=\`) after \`${e.serialize().trim()}\`, got \`${t.serialize().trim()}\``);{const r=this._parseType();if(!(r instanceof ht))throw new Error("Expected Type instance");n=new Qe(e,t,r)}}return n}_parseGroupEntry(){const e=this._parseOccurrence(),t=this._parseType(!0);let n;if(t instanceof pt){const r=this._parseType(!1);if(!(r instanceof ht))throw new Error("Expected Type instance");n=new et(e,t,r)}else n=new et(e,null,t);return n}_parseType(e=!1){const t=[];let n=this._parseType1(e);if(t.push(n),e&&this.getCurToken().type===He.CARET){const e=[];if(e.push(this._nextToken()),this.getCurToken().type!==He.ARROWMAP)throw this._parserError("expected arrow map (`=>`), got `#{(this.getCurToken().serialize() + this.getPeekToken().serialize()).trim()}`");e.push(this._nextToken());return new pt(n,!0,!1,e)}if(e&&this.getCurToken().type===He.ARROWMAP){return new pt(n,!1,!1,[this._nextToken()])}if(e&&this.getCurToken().type===He.COLON){return new pt(n,!0,!0,[this._nextToken()])}for(;this.getCurToken().type===He.TCHOICE;)n.separator=this._nextToken(),n=this._parseType1(),t.push(n);return new ht(t)}_parseType1(e=!1){const t=this._parseType2(e);let n;if(this.getCurToken().type===He.INCLRANGE||this.getCurToken().type===He.EXCLRANGE){const e=this._nextToken(),r=this._parseType2();if(!(t instanceof at||t instanceof ct))throw this._parserError(`expected range min to be a value or a typename, got \`${t.serialize().trim()}\``);if(!(r instanceof at||r instanceof ct))throw this._parserError(`expected range max to be a value or a typename, got \`${r.serialize().trim()}\``);n=new ut(t,r,e)}else if(this.getCurToken().type===He.CTLOP){const e=this._nextToken(),r=this._parseType2();n=new dt(t,e,r)}else n=t;return n}_parseType2(e=!1){let t;if(this.getCurToken().type===He.LPAREN){const n=this._nextToken();if(e)t=this._parseGroup(!1);else{const e=this._parseType();if(!(e instanceof ht))throw new Error("Expected Type instance");t=e}if(t.openToken=n,this.getCurToken().type!==He.RPAREN)throw this._parserError(`expected right parenthesis, got \`${this.getCurToken().serialize().trim()}\``);t.closeToken=this._nextToken()}else if(this.getCurToken().type===He.LBRACE){const e=this._nextToken();if(t=this._parseGroup(!0),t.openToken=e,this.getCurToken().type!==He.RBRACE)throw this._parserError(`expected right brace, got \`${this.getCurToken().serialize()}\``);t.closeToken=this._nextToken()}else if(this.getCurToken().type===He.LBRACK){const e=this._nextToken(),n=this._parseGroup(!1);if(t=new rt(n.groupChoices),t.openToken=e,this.getCurToken().type!==He.RBRACK)throw this._parserError(`expected right bracket, got \`${this.getCurToken().serialize().trim()}\``);t.closeToken=this._nextToken()}else if(this.getCurToken().type===He.TILDE){const e=this._nextToken();t=this._parseTypename(!1,e)}else if(this.getCurToken().type===He.AMPERSAND){const e=this._nextToken();if(this.getCurToken().type===He.LPAREN){const e=this._nextToken(),n=this._parseGroup(!1);if(n.openToken=e,this.getCurToken().type!==He.RPAREN)throw this._parserError(`expected right parenthesis, got \`${this.getCurToken().serialize().trim()}\``);n.closeToken=this._nextToken(),t=new lt(n)}else{const e=this._parseTypename(!1,null);t=new lt(e)}t.setComments(e)}else if(this.getCurToken().type===He.HASH){const e=this._nextToken();if(this.getCurToken().type!==He.NUMBER&&this.getCurToken().type!==He.FLOAT||this.getCurToken().startWithSpaces())t=new st;else{const e=this._nextToken();if(e.literal.length>1&&("."!==e.literal[1]||e.literal.includes("e")))throw this._parserError(`expected data item after "#" to match \`DIGIT ["." uint]\`, got \`${this.getCurToken().serialize().trim()}\``);if("6"!==e.literal[0]||this.getCurToken().type!==He.LPAREN||this.getCurToken().startWithSpaces())t=new st(e);else{const n=this._parseType2();if(!(n instanceof ht))throw new Error("Expected Type instance");t=new st(e,n)}}t.setComments(e)}else if(this.getCurToken().type===He.IDENT)t=this._parseTypename(!1,null);else if(this.getCurToken().type===He.STRING){const e=this._nextToken();t=new at(e.literal,"text"),t.setComments(e)}else if(this.getCurToken().type===He.BYTES){const e=this._nextToken();t=new at(e.literal,"bytes"),t.setComments(e)}else if(this.getCurToken().type===He.HEX){const e=this._nextToken();t=new at(e.literal,"hex"),t.setComments(e)}else if(this.getCurToken().type===He.BASE64){const e=this._nextToken();t=new at(e.literal,"base64"),t.setComments(e)}else if(this.getCurToken().type===He.NUMBER){const e=this._nextToken();t=new at(e.literal,"number"),t.setComments(e)}else{if(this.getCurToken().type!==He.FLOAT)throw this._parserError(`invalid type2 production, got \`${this.getCurToken().serialize().trim()}\``);{const e=this._nextToken();t=new at(e.literal,"number"),t.setComments(e)}}return t}_parseGroup(e=!1){const t=[];for(;this.getCurToken().type!==He.RPAREN&&this.getCurToken().type!==He.RBRACE&&this.getCurToken().type!==He.RBRACK;){const e=[];for(;this.getCurToken().type!==He.GCHOICE;){const t=this._parseGroupEntry();if(e.push(t),this.getCurToken().type===He.COMMA&&(t.separator=this._nextToken()),this.getCurToken().type===He.RPAREN||this.getCurToken().type===He.RBRACE||this.getCurToken().type===He.RBRACK)break}const n=new it(e);if(t.push(n),this.getCurToken().type===He.RPAREN||this.getCurToken().type===He.RBRACE||this.getCurToken().type===He.RBRACK)break;n.separator=this._nextToken()}let n;return n=e?new nt(t):new tt(t),n}_parseOccurrence(){const e=[];let t=null;if(this.getCurToken().type===He.QUEST||this.getCurToken().type===He.ASTERISK||this.getCurToken().type===He.PLUS){const n=this.getCurToken().type===He.PLUS?1:0;let r=1/0;this.getCurToken().type===He.ASTERISK&&this.getPeekToken().type===He.NUMBER&&yt(this.getPeekToken().literal)&&!this.getPeekToken().startWithSpaces()&&(e.push(this._nextToken()),r=parseInt(this.getCurToken().literal)),e.push(this._nextToken()),t=new ot(n,r,e)}else if(this.getCurToken().type===He.NUMBER&&yt(this.getCurToken().literal)&&this.getPeekToken().type===He.ASTERISK&&!this.getPeekToken().startWithSpaces()){const n=parseInt(this.getCurToken().literal);let r=1/0;e.push(this._nextToken()),e.push(this._nextToken()),this.getCurToken().type===He.NUMBER&&yt(this.getCurToken().literal)&&!this.getCurToken().startWithSpaces()&&(r=parseInt(this.getCurToken().literal),e.push(this._nextToken())),t=new ot(n,r,e)}return t}_parseTypename(e=!1,t=null){if(this.getCurToken().type!==He.IDENT)throw this._parserError(`expected group identifier, got \`${this.getCurToken().serialize().trim()}\``);const n=this._nextToken();let r;r=e?this._parseGenericParameters():this._parseGenericArguments();const i=new ct(n.literal,t,r);return i.setComments(n),i}_parseGenericParameters(){if(this.getCurToken().type!==He.LT||this.getCurToken().startWithSpaces())return null;const e=this._nextToken(),t=[];let n=this._parseTypename();for(t.push(n);this.getCurToken().type===He.COMMA;)n.separator=this._nextToken(),n=this._parseTypename(),t.push(n);const r=new ft(t);if(r.openToken=e,this.getCurToken().type!==He.GT)throw this._parserError(`expected \`>\` character to end generic production, got \`${this.getCurToken().serialize().trim()}\``);return r.closeToken=this._nextToken(),r}_parseGenericArguments(){if(this.getCurToken().type!==He.LT||this.getCurToken().startWithSpaces())return null;const e=this._nextToken(),t=[];let n=this._parseType1();for(t.push(n);this.getCurToken().type===He.COMMA;)n.separator=this._nextToken(),n=this._parseType1(),t.push(n);const r=new mt(t);if(r.openToken=e,this.getCurToken().type!==He.GT)throw this._parserError(`expected \`>\` character to end generic production, got \`${this.getCurToken().serialize().trim()}\``);return r.closeToken=this._nextToken(),r}_convertGroupDefinitions(e){const t=new Set,n=new Set,r=new Set,i=e=>{if(e instanceof at||e instanceof nt||e instanceof rt||e instanceof lt||e instanceof st)return"type";if(e instanceof ut)return i(e.min);if(e instanceof dt)return i(e.type);if(e instanceof ct){const t=e.name;if(n.has(t)||this._isPreludeType(t))return"type";if(r.has(t))return"group"}return"unknown"};for(const i of e.rules)t.add(i.name.name),0===n.size&&n.add(i.name.name),i.type instanceof ht?n.add(i.name.name):(i.assign.type===He.TCHOICEALT&&n.add(i.name.name),i.assign.type===He.GCHOICEALT&&r.add(i.name.name),i.type.type.types.length>1&&null===i.type.type.openToken&&n.add(i.name.name),null!==i.type.occurrence&&r.add(i.name.name),null!==i.type.key&&r.add(i.name.name));const s=e=>{e instanceof et&&null!==e.key&&e.key.type instanceof ct&&!e.key.hasColon&&t.has(e.key.type.name)&&n.add(e.key.type.name);for(const t of e.getChildren())s(t)};s(e);let o=!0;for(;o;){o=!1;for(const s of e.rules)if(s.type instanceof ht)for(const e of s.type.types)e instanceof ct&&t.has(e.name)&&(n.has(e.name)||(o=!0,n.add(e.name)));else{if(n.has(s.name.name))for(const e of s.type.type.types)e instanceof ct&&t.has(e.name)&&(n.has(e.name)||(o=!0,n.add(e.name)));if(r.has(s.name.name))for(const e of s.type.type.types)e instanceof ct&&t.has(e.name)&&(r.has(e.name)||(o=!0,r.add(e.name)));if(s.assign.type===He.ASSIGN){const e=new Set(s.type.type.types.map(e=>i(e)));if(e.has("type")&&e.has("group"))throw new gt(`CDDL semantic error - rule \`${s.name.name}\` targets a mix of type and group rules`);e.has("type")?n.has(s.name.name)||(o=!0,n.add(s.name.name)):e.has("group")&&(r.has(s.name.name)||(o=!0,r.add(s.name.name)))}}}const a=[...n].filter(e=>r.has(e));if(a.length>0){const e=a.join(", ");throw new gt(`CDDL semantic error - mix of type and group definitions for ${e}`)}for(const t of e.rules)if(!(t.type instanceof ht)&&n.has(t.name.name)){if(!t.type.isConvertibleToType())throw new gt(`CDDL semantic error - rule \`${t.name.name}\` is a type definition but uses a group entry`);t.type=t.type.type}}_isPreludeType(e){return["any","uint","nint","int","bstr","bytes","tstr","text","tdate","time","number","biguint","bignint","bigint","integer","unsigned","decfrac","bigfloat","eb64url","eb64legacy","eb16","encoded-cbor","uri","b64url","b64legacy","regexp","mime-message","cbor-any","float16","float32","float64","float16-32","float32-64","float","false","true","bool","nil","null","undefined"].includes(e)}_nextToken(){const e=this.curToken;return this.curToken=this.peekToken,this.peekToken=this.lexer.nextToken(),e}_parserError(e){const t=this.lexer.getLocation();return new gt(`CDDL syntax error - line ${t.line+1}: ${e}`)}},Wr=class{serializeToken(e,t){return e.serialize()}serializeValue(e,t,n,r){return e+t+n}serializeName(e,t){return e}markupFor(e){return[null,null]}},Fr=Qe,Br=pt,Hr=ft,Gr=mt,Vr=ht,Jr=ot,Zr=/['\u2019]s$/,Kr=/-/g,Yr=RegExp.escape??(e=>e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"));const Xr=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Qr="en"===r||r.startsWith("en-")?"en-AU":r,ei=new Intl.DateTimeFormat(Qr,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Qr?"2-digit":"numeric"}),ti=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function ni(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as||""),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function ri(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach(e=>{e.remove()})}function ii(e,t="long"){const n=new Intl.ListFormat(r,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map(({type:n,value:i})=>"element"===n&&t?t(i,r++,e):i)}}const si=ii("conjunction"),oi=ii("disjunction");function ai(e,t){return si(e,t).join("")}function ci(e,t){return oi(e,t).join("")}function li(e){return e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function ui(e){return e.trim().replace(/\s+/g," ")}function di(e,t=r){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=pi(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function pi(e,t,n=r){n=n.toLowerCase();const i=n.match(/^(\w{2,3})-.+$/)?.[1]??"";return e[n]?.[t]||e[i]?.[t]}function hi(e,t=""){return Xr.format(e).replace(Kr,t)}function fi(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){Ii(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace.",cause:e})}}}return e}async function mi(e,t=864e5){const n=new Request(e),r=new URL(n.url);let i,s;if("caches"in window)try{if(i=await caches.open(r.origin),s=await i.match(n),s&&new Date(s.headers.get("Expires")??"")>new Date)return s}catch(e){console.error("Failed to use Cache API.",e)}const o=await fetch(n);if(!o.ok&&s)return console.warn(`Returning a stale cached response for ${r}`),s;if(i&&o.ok){const e=o.clone(),r=new Headers(o.headers),s=new Date(Date.now()+t);r.set("Expires",s.toISOString());const a=new Response(await e.blob(),{headers:r});await i.put(n,a).catch(console.error)}return o}function gi(e,t=e=>e){const n=e.map(t),r=n.slice(0,-1).map(e=>Or`${e}, `);return Or`${r}${n[n.length-1]}`}function bi(e,t){return[].concat(si(e,t)).map(e=>"string"==typeof e?Or`${e}`:e)}function yi(e,t=""){const n=function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(ui(e.textContent));return ki(e,t,n)}function wi(e,t=!1){return(t?e:e.toLowerCase()).trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,"")}function ki(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let i=wi(n,r);if(i?!/\.$/.test(i)&&/^[a-z]/i.test(t||i)||(i=`x${i}`):i="generatedID",t&&(i=`${t}-${i}`),e.ownerDocument.getElementById(i)){let t=0,n=`${i}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${i}-${t}`;i=n}return e.id=i,i}function vi(e){const t=new Set,n="ltNodefault"in e.dataset?"":ui(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>ui(e)).forEach(e=>t.add(e)):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r&&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(ui(e)))}return[...t]}function $i(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 xi(e,t){const n=t.closest(ti);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 Ci(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Si(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}function _i(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 Ti 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)??e)}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find(t=>t.toLowerCase()===e.toLowerCase())}}function Ri(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{$i(e,"span",{copyAttributes:!1})}),t.hasAttribute("id")&&t.removeAttribute("id"),Ei(t),t}function Ei(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Ai(t)])e.remove()}function*Ai(e){for(;e.nextNode();)yield e.currentNode}class Li 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 Pi extends Error{constructor(e,t,n){super(e,{...n.cause&&{cause:n.cause}});const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach(t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||ki(e,"respec-offender")}(t,e,n.title))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:i,elements:s,title:o,details:a}=this;return{message:e,name:t,plugin:r,hint:i,elements:s,title:o,details:a,stack:n,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function Ni(e,t,n={}){const r={...n,isWarning:!1};Fi("error",new Pi(e,t,r))}function Ii(e,t,n={}){const r={...n,isWarning:!0};Fi("warn",new Pi(e,t,r))}function Oi(e){return{amendConfiguration:e=>Fi("amend-user-config",e),showError:(t,n)=>Ni(t,e,n),showWarning:(t,n)=>Ii(t,e,n)}}function Di(e){return e?`\`${e}\``:""}function ji(e,{quotes:t}={quotes:!1}){return ci(e,t?e=>Di(Mi(e)):Di)}function zi(e,{quotes:t}={quotes:!1}){return ai(e,t?e=>Di(Mi(e)):Di)}function Mi(e){return String(e)?`"${e}"`:""}function qi(e,...t){return Ui(e.map((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[i,s]=r.slice(1,-1).split("|");if(s){return`${e}[${i}](${new URL(s,"https://respec.org/docs/")})`}return`${e}[\`${i}\`](https://respec.org/docs/#${i})`}).join(""))}function Ui(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 Wi=new EventTarget;function Fi(e,t){if(Wi.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 Bi(e,t,n={once:!1}){Wi.addEventListener(e,async n=>{try{await t(n.detail)}catch(t){const n=t;Ni(`Error in handler for topic "${e}": ${n.message}`,`sub:${e}`,{cause:n})}},n)}const Hi=["githubToken","githubUser"];const Gi=new Map([["text/html","html"],["application/xml","xml"]]);function Vi(e,t=document){const n=Gi.get(e);if(!n){const t=[...Gi.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Ji(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Ji(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;Ei(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar","toc-inline"),ri(r);const i=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&i.appendChild(s);const o=e.querySelector("meta[charset], meta[content*='charset=']")||Or`<meta charset="utf-8" />`;i.appendChild(o);const a=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=Or`
1
+ window.respecVersion="37.8.0",function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=document.documentElement;t?.hasAttribute("lang")||(t.lang="en",t.hasAttribute("dir")||(t.dir="ltr"));const n={},r=t?.lang??"en";var i=Object.freeze({__proto__:null,l10n:n,lang:r,name:"core/l10n",run:function(e){e.l10n=n[r]||n.en}});const s=(e,t)=>t.some(t=>e instanceof t);let o,a;const c=new WeakMap,l=new WeakMap,d=new WeakMap;let u={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return m(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){u=e(u)}function h(e){return(a||(a=["advance","continue","continuePrimaryKey"].map(e=>IDBCursor.prototype[e]))).includes(e)?function(...t){return e.apply(g(this),t),m(this.request)}:function(...t){return m(e.apply(g(this),t))}}function f(e){return"function"==typeof e?h(e):(e instanceof IDBTransaction&&function(e){if(c.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)});c.set(e,t)}(e),s(e,o||(o=[IDBIndex,IDBObjectStore,IDBCursor,IDBDatabase,IDBTransaction]))?new Proxy(e,u):e)}function m(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{t(m(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",s)});return d.set(t,e),t}(e);if(l.has(e))return l.get(e);const t=f(e);return Object.is(t,e)||(l.set(e,t),d.set(t,e)),t}const g=e=>d.get(e);const b=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],w={};function v(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(w[t])return w[t];const n=t.replace(/FromIndex$/,""),r=t!==n,i=y.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!b.includes(n))return;return w[t]=async function(e,...t){const s=this.transaction(e,i?"readwrite":"readonly");let o=s.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&s.done]))[0]}}p(e=>({...e,get:(t,n,r)=>v(t,n)||e.get(t,n,r),has:(t,n)=>!!v(t,n)||e.has(t,n)}));const k=["advance","continue","continuePrimaryKey"],$={},x=new WeakMap,C=new WeakMap,S={get(e,t){if(!k.includes(t))return e[t];let n=$[t];return n||(n=$[t]=function(...e){x.set(this,C.get(this)[t](...e))}),n}};async function*_(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,S);for(C.set(n,t),d.set(n,g(t));t;)yield n,t=await(x.get(n)||t.continue()),x.delete(n)}function T(e,t){return t===Symbol.asyncIterator&&s(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&s(e,[IDBIndex,IDBObjectStore])}p(e=>({...e,get:(t,n,r)=>T(t,n)?_:e.get(t,n,r),has:(t,n)=>T(t,n)||e.has(t,n)}));var R=Object.freeze({__proto__:null,deleteDB:function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",e=>t(e.oldVersion,e)),m(n).then(()=>{})},openDB:function(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(e,t),a=m(o);return r&&o.addEventListener("upgradeneeded",e=>{r(m(o.result),e.oldVersion,e.newVersion,m(o.transaction),e)}),n&&o.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),a.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a},unwrap:g,wrap:m});function E(e,t,n,r,i,{level:s="error",autofix:o,ruleName:a}={}){function c(n){return n>0?e.slice(t,t+n):e.slice(Math.max(t+n,0),t)}function l(n,{precedes:r}={}){const i=n.map(e=>e.trivia+e.value).join(""),s=e[t];return"eof"===s.type?i:r?i+s.trivia:i.slice(s.trivia.length)}const d="eof"!==e[t].type?e[t].line:e.length>1?e[t-1].line:1,u=function(e){const t=e.split("\n");return t[t.length-1]}(l(c(-5),{precedes:!0})),p=c(5),h=l(p),f=u+h.split("\n")[0]+"\n"+(" ".repeat(u.length)+"^"),m="Syntax"===i?"since":"inside",g=`${i} error at line ${d}${e.name?` in ${e.name}`:""}${n&&n.name?`, ${m} \`${n.partial?"partial ":""}${function(e){const t=[e];for(;e&&e.parent;){const{parent:n}=e;t.unshift(n),e=n}return t.map(e=>function(e,t){let n=e;return t&&(n+=` ${t}`),n}(e.type,e.name)).join(" -> ")}(n)}\``:""}:\n${f}`;return{message:`${g} ${r}`,bareMessage:r,context:g,line:d,sourceName:e.name,level:s,ruleName:a,autofix:o,input:h,tokens:p}}function A(e,t,n,r){return E(e,t,n,r,"Syntax")}function L(e,t,n,r,i={}){return i.ruleName=n,E(t.source,e.index,t,r,"Validation",i)}class P{constructor({source:e,tokens:t}){Object.defineProperties(this,{source:{value:e},tokens:{value:t,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){const e={type:void 0,name:void 0,inheritance:void 0};let t=this;for(;t!==Object.prototype;){const n=Object.getOwnPropertyDescriptors(t);for(const[t,r]of Object.entries(n))(r.enumerable||r.get)&&(e[t]=this[t]);t=Object.getPrototypeOf(t)}return e}}function N(e,t,{useNullableInner:n}={}){if(!e.union){const r=t.unique.get(e.idlType);if(!r)return;if("typedef"===r.type){const{typedefIncludesDictionary:n}=t.cache;if(n.has(r))return n.get(r);t.cache.typedefIncludesDictionary.set(r,void 0);const i=N(r.idlType,t);if(t.cache.typedefIncludesDictionary.set(r,i),i)return{reference:e,dictionary:i.dictionary}}if("dictionary"===r.type&&(n||!e.nullable))return{reference:e,dictionary:r}}for(const n of e.subtype){const e=N(n,t);if(e)return n.union?e:{reference:n,dictionary:e.dictionary}}}function I(e,t){if(t.cache.dictionaryIncludesRequiredField.has(e))return t.cache.dictionaryIncludesRequiredField.get(e);t.cache.dictionaryIncludesRequiredField.set(e,void 0);let n=e.members.some(e=>e.required);if(!n&&e.inheritance){const r=t.unique.get(e.inheritance);r?I(r,t)&&(n=!0):n=!0}return t.cache.dictionaryIncludesRequiredField.set(e,n),n}class O extends Array{constructor({source:e,tokens:t}){super(),Object.defineProperties(this,{source:{value:e},tokens:{value:t},parent:{value:null,writable:!0}})}}class D extends P{static parser(e,t){return()=>{const n=e.consumeKind(t);if(n)return new D({source:e.source,tokens:{value:n}})}}get value(){return ee(this.tokens.value.value)}write(e){return e.ts.wrap([e.token(this.tokens.value),e.token(this.tokens.separator)])}}class j extends D{static parse(e){const t=e.consumeKind("eof");if(t)return new j({source:e.source,tokens:{value:t}})}get type(){return"eof"}}function z(e,t){return te(e,{parser:D.parser(e,t),listName:t+" list"})}const M=["identifier","decimal","integer","string"],q=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map(e=>[e,`Legacy${e}`]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function U(e){for(const t of M){const n=z(e,t);if(n.length)return n}e.error("Expected identifiers, strings, decimals, or integers but none found")}class W extends P{static parse(e){const t={assign:e.consume("=")},n=pe(new W({source:e.source,tokens:t}));if(n.list=[],t.assign){if(t.asterisk=e.consume("*"),t.asterisk)return n.this;t.secondaryName=e.consumeKind(...M)}return t.open=e.consume("("),t.open?(n.list=n.rhsIsList?U(e):se(e),t.close=e.consume(")")||e.error("Unexpected token in extended attribute argument list")):t.assign&&!t.secondaryName&&e.error("No right hand side to extended attribute assignment"),n.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(e){const{rhsType:t}=this;return e.ts.wrap([e.token(this.tokens.assign),e.token(this.tokens.asterisk),e.reference_token(this.tokens.secondaryName,this.parent),e.token(this.tokens.open),...this.list.map(n=>"identifier-list"===t?e.identifier(n,this.parent):n.write(e)),e.token(this.tokens.close)])}}class F extends P{static parse(e){const t=e.consumeKind("identifier");if(t)return new F({source:e.source,tokens:{name:t},params:W.parse(e)})}constructor({source:e,tokens:t,params:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"params",{value:n})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){const{rhsType:e,tokens:t,list:n}=this.params;if(!e)return null;return{type:e,value:this.params.rhsIsList?n:this.params.tokens.secondaryName?ee(t.secondaryName.value):null}}get arguments(){const{rhsIsList:e,list:t}=this.params;return!t||e?[]:t}*validate(e){const{name:t}=this;if("LegacyNoInterfaceObject"===t){const e="`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.";yield L(this.tokens.name,this,"no-nointerfaceobject",e,{level:"warning"})}else if(q.has(t)){const e=`\`[${t}]\` extended attribute is a legacy feature that is now renamed to \`[${q.get(t)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield L(this.tokens.name,this,"renamed-legacy",e,{level:"warning",autofix:(n=this,()=>{const{name:e}=n;n.tokens.name.value=q.get(e),"TreatNullAs"===e&&(n.params.tokens={})})})}var n;for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.wrap([e.ts.trivia(this.tokens.name.trivia),e.ts.extendedAttribute(e.ts.wrap([e.ts.extendedAttributeReference(this.name),this.params.write(e)])),e.token(this.tokens.separator)])}}class H extends O{static parse(e){const t={};t.open=e.consume("[");const n=new H({source:e.source,tokens:t});return t.open?(n.push(...te(e,{parser:F.parse,listName:"extended attribute"})),t.close=e.consume("]")||e.error("Expected a closing token for the extended attribute list"),n.length||(e.unconsume(t.close.index),e.error("An extended attribute list must not be empty")),e.probe("[")&&e.error("Illegal double extended attribute lists, consider merging them"),n):n}*validate(e){for(const t of this)yield*t.validate(e)}write(e){return this.length?e.ts.wrap([e.token(this.tokens.open),...this.map(t=>t.write(e)),e.token(this.tokens.close)]):""}}function B(e,t){const n=e.consume("?");n&&(t.tokens.nullable=n),e.probe("?")&&e.error("Can't nullable more than once")}function G(e,t){let n=function(e,t){const n=e.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!n)return;const r=pe(new V({source:e.source,tokens:{base:n}}));switch(r.tokens.open=e.consume("<")||e.error(`No opening bracket after ${n.value}`),n.value){case"Promise":{e.probe("[")&&e.error("Promise type cannot have extended attribute");const n=ae(e,t)||e.error("Missing Promise subtype");r.subtype.push(n);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{const i=oe(e,t)||e.error(`Missing ${n.value} subtype`);r.subtype.push(i);break}case"record":{e.probe("[")&&e.error("Record key cannot have extended attribute");const n=e.consume(...me)||e.error(`Record key must be one of: ${me.join(", ")}`),i=new V({source:e.source,tokens:{base:n}});i.tokens.separator=e.consume(",")||e.error("Missing comma after record key type"),i.type=t;const s=oe(e,t)||e.error("Error parsing generic type record");r.subtype.push(i,s);break}}return r.idlType||e.error(`Error parsing generic type ${n.value}`),r.tokens.close=e.consume(">")||e.error(`Missing closing bracket after ${n.value}`),r.this}(e,t)||ie(e);if(!n){const t=e.consumeKind("identifier")||e.consume(...me,...fe);if(!t)return;n=new V({source:e.source,tokens:{base:t}}),e.probe("<")&&e.error(`Unsupported generic type ${t.value}`)}return"Promise"===n.generic&&e.probe("?")&&e.error("Promise type cannot be nullable"),n.type=t||null,B(e,n),n.nullable&&"any"===n.idlType&&e.error("Type `any` cannot be made nullable"),n}let V=class extends P{static parse(e,t){return G(e,t)||function(e,t){const n={};if(n.open=e.consume("("),!n.open)return;const r=pe(new V({source:e.source,tokens:n}));for(r.type=t||null;;){const n=oe(e,t)||e.error("No type after open parenthesis or 'or' in union type");"any"===n.idlType&&e.error("Type `any` cannot be included in a union type"),"Promise"===n.generic&&e.error("Type `Promise` cannot be included in a union type"),r.subtype.push(n);const i=e.consume("or");if(!i)break;n.tokens.separator=i}return r.idlType.length<2&&e.error("At least two types are expected in a union type but found less"),n.close=e.consume(")")||e.error("Unterminated union type"),B(e,r),r.this}(e,t)}constructor({source:e,tokens:t}){super({source:e,tokens:t}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new H({source:e,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return ee([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter(e=>e).map(e=>e.value).join(" "))}*validate(e){if(yield*this.extAttrs.validate(e),"BufferSource"===this.idlType)for(const e of[this.extAttrs,this.parent?.extAttrs])for(const t of e){if("AllowShared"!==t.name)continue;const n="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield L(this.tokens.base,this,"migrate-allowshared",n,{autofix:J(this,t,e)})}if("void"===this.idlType){const e="`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.";yield L(this.tokens.base,this,"replace-void",e,{autofix:(t=this,()=>{t.tokens.base.value="undefined"})})}var t;const n=!this.union&&e.unique.get(this.idlType),r=this.union?this:n&&"typedef"===n.type?n.idlType:void 0;if(r&&this.nullable){const{reference:t}=N(r,e)||{};if(t){const e=(this.union?t:this).tokens.base,n="Nullable union cannot include a dictionary type.";yield L(e,this,"no-nullable-union-dict",n)}}else for(const t of this.subtype)yield*t.validate(e)}write(e){return e.ts.wrap([this.extAttrs.write(e),(()=>{if(this.union||this.generic)return e.ts.wrap([e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),...this.subtype.map(t=>t.write(e)),e.token(this.tokens.close)]);const t=this.tokens.prefix||this.tokens.base,n=this.tokens.prefix?[this.tokens.prefix.value,e.ts.trivia(this.tokens.base.trivia)]:[],r=e.reference(e.ts.wrap([...n,this.tokens.base.value,e.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return e.ts.wrap([e.ts.trivia(t.trivia),r])})(),e.token(this.tokens.nullable),e.token(this.tokens.separator)])}};function J(e,t,n){return()=>{const r=n.indexOf(t);n.splice(r,1),!n.length&&e.tokens.base.trivia.match(/^\s$/)&&(e.tokens.base.trivia=""),e.tokens.base.value="AllowSharedBufferSource"}}class Z extends P{static parse(e){const t=e.consume("=");if(!t)return null;const n=ne(e)||e.consumeKind("string")||e.consume("null","[","{")||e.error("No value for default"),r=[n];if("["===n.value){const t=e.consume("]")||e.error("Default sequence value must be empty");r.push(t)}else if("{"===n.value){const t=e.consume("}")||e.error("Default dictionary value must be empty");r.push(t)}return new Z({source:e.source,tokens:{assign:t},expression:r})}constructor({source:e,tokens:t,expression:n}){super({source:e,tokens:t}),n.parent=this,Object.defineProperty(this,"expression",{value:n})}get type(){return re(this.expression[0]).type}get value(){return re(this.expression[0]).value}get negative(){return re(this.expression[0]).negative}write(e){return e.ts.wrap([e.token(this.tokens.assign),...this.expression.map(t=>e.token(t))])}}class K extends P{static parse(e){const t=e.position,n={},r=pe(new K({source:e.source,tokens:n}));return r.extAttrs=H.parse(e),n.optional=e.consume("optional"),r.idlType=oe(e,"argument-type"),r.idlType?(n.optional||(n.variadic=e.consume("...")),n.name=e.consumeKind("identifier")||e.consume(...ge),n.name?(r.default=n.optional?Z.parse(e):null,r.this):e.unconsume(t)):e.unconsume(t)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return ee(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e),yield*this.idlType.validate(e);const t=N(this.idlType,e,{useNullableInner:!0});if(t)if(this.idlType.nullable){const e="Dictionary arguments cannot be nullable.";yield L(this.tokens.name,this,"no-nullable-dict-arg",e)}else if(this.optional){if(!this.default){const e="Optional dictionary arguments must have a default value of `{}`.";yield L(this.tokens.name,this,"dict-arg-default",e,{autofix:Y(this)})}}else if(this.parent&&!I(t.dictionary,e)&&function(e){const t=e.parent.arguments||e.parent.list,n=t.indexOf(e),r=t.slice(n+1).some(e=>!e.optional);return!r}(this)){const e="Dictionary argument must be optional if it has no required fields";yield L(this.tokens.name,this,"dict-arg-optional",e,{autofix:(n=this,()=>{const e=ue(n.idlType);n.tokens.optional={...e,type:"optional",value:"optional"},e.trivia=" ",Y(n)()})})}var n}write(e){return e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.optional),e.ts.type(this.idlType.write(e)),e.token(this.tokens.variadic),e.name_token(this.tokens.name,{data:this}),this.default?this.default.write(e):"",e.token(this.tokens.separator)])}}function Y(e){return()=>{e.default=Z.parse(new ve(" = {}"))}}class X extends P{static parse(e,{special:t,regular:n}={}){const r={special:t},i=pe(new X({source:e.source,tokens:r}));return t&&"stringifier"===t.value&&(r.termination=e.consume(";"),r.termination)?(i.arguments=[],i):(t||n||(r.special=e.consume("getter","setter","deleter")),i.idlType=ae(e)||e.error("Missing return type"),r.name=e.consumeKind("identifier")||e.consume("includes"),r.open=e.consume("(")||e.error("Invalid operation"),i.arguments=se(e),r.close=e.consume(")")||e.error("Unterminated operation"),r.termination=e.consume(";")||e.error("Unterminated operation, expected `;`"),i.this)}get type(){return"operation"}get name(){const{name:e}=this.tokens;return e?ee(e.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(e){if(yield*this.extAttrs.validate(e),!this.name&&["","static"].includes(this.special)){const e="Regular or static operations must have both a return type and an identifier.";yield L(this.tokens.open,this,"incomplete-op",e)}if(this.idlType){if("async_sequence"===this.idlType.generic){const e="async_sequence types cannot be returned by an operation.";yield L(this.idlType.tokens.base,this,"async-sequence-idl-to-js",e)}yield*this.idlType.validate(e)}for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this,n=this.idlType?[e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close)]:[];return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),this.tokens.name?e.token(this.tokens.special):e.token(this.tokens.special,e.ts.nameless,{data:this,parent:t}),...n,e.token(this.tokens.termination)]),{data:this,parent:t})}}class Q extends P{static parse(e,{special:t,noInherit:n=!1,readonly:r=!1}={}){const i=e.position,s={special:t},o=pe(new Q({source:e.source,tokens:s}));if(t||n||(s.special=e.consume("inherit")),"inherit"===o.special&&e.probe("readonly")&&e.error("Inherited attributes cannot be read-only"),s.readonly=e.consume("readonly"),r&&!s.readonly&&e.probe("attribute")&&e.error("Attributes must be readonly in this context"),s.base=e.consume("attribute"),s.base)return o.idlType=oe(e,"attribute-type")||e.error("Attribute lacks a type"),s.name=e.consumeKind("identifier")||e.consume("async","required")||e.error("Attribute lacks a name"),s.termination=e.consume(";")||e.error("Unterminated attribute, expected `;`"),o.this;e.unconsume(i)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return ee(this.tokens.name.value)}*validate(e){if(yield*this.extAttrs.validate(e),yield*this.idlType.validate(e),["async_sequence","sequence","record"].includes(this.idlType.generic)){const e=`Attributes cannot accept ${this.idlType.generic} types.`;yield L(this.tokens.name,this,"attr-invalid-type",e)}{const{reference:t}=N(this.idlType,e)||{};if(t){const e=(this.idlType.union?t:this.idlType).tokens.base,n="Attributes cannot accept dictionary types.";yield L(e,this,"attr-invalid-type",n)}}if(this.readonly&&function(e,t){if(e.union)return!1;if(e.extAttrs.some(e=>"EnforceRange"===e.name))return!0;const n=t.unique.get(e.idlType);return"typedef"===n?.type&&n.idlType.extAttrs.some(e=>"EnforceRange"===e.name)}(this.idlType,e)){const e=this.idlType.tokens.base,t="Readonly attributes cannot accept [EnforceRange] extended attribute.";yield L(e,this,"attr-invalid-type",t)}}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.special),e.token(this.tokens.readonly),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.termination)]),{data:this,parent:t})}}function ee(e){return e.startsWith("_")?e.slice(1):e}function te(e,{parser:t,allowDangler:n,listName:r="list"}){const i=t(e);if(!i)return[];i.tokens.separator=e.consume(",");const s=[i];for(;i.tokens.separator;){const i=t(e);if(!i){n||e.error(`Trailing comma in ${r}`);break}if(i.tokens.separator=e.consume(","),s.push(i),!i.tokens.separator)break}return s}function ne(e){return e.consumeKind("decimal","integer")||e.consume("true","false","Infinity","-Infinity","NaN")}function re({type:e,value:t}){switch(e){case"decimal":case"integer":return{type:"number",value:t};case"string":return{type:"string",value:t.slice(1,-1)}}switch(t){case"true":case"false":return{type:"boolean",value:"true"===t};case"Infinity":case"-Infinity":return{type:"Infinity",negative:t.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:t}}}function ie(e){const{source:t}=e,n=function(){const n=e.consume("unsigned"),r=e.consume("short","long");if(r){const i=e.consume("long");return new V({source:t,tokens:{prefix:n,base:r,postfix:i}})}n&&e.error("Failed to parse integer type")}()||function(){const n=e.consume("unrestricted"),r=e.consume("float","double");if(r)return new V({source:t,tokens:{prefix:n,base:r}});n&&e.error("Failed to parse float type")}();if(n)return n;const r=e.consume("bigint","boolean","byte","octet","undefined");return r?new V({source:t,tokens:{base:r}}):void 0}function se(e){return te(e,{parser:K.parse,listName:"arguments list"})}function oe(e,t){const n=H.parse(e),r=V.parse(e,t);return r&&(pe(r).extAttrs=n),r}function ae(e,t){const n=V.parse(e,t||"return-type");if(n)return n;const r=e.consume("void");if(r){const t=new V({source:e.source,tokens:{base:r}});return t.type="return-type",t}}function ce(e){const t=e.consume("stringifier");if(!t)return;return Q.parse(e,{special:t})||X.parse(e,{special:t})||e.error("Unterminated stringifier")}function le(e){const t=e.split("\n");if(t.length){const e=t[t.length-1].match(/^\s+/);if(e)return e[0]}return""}function de(e){return()=>{if(e.extAttrs.length){const t=new ve("Exposed=Window,"),n=F.parse(t);n.tokens.separator=t.consume(",");const r=e.extAttrs[0];/^\s/.test(r.tokens.name.trivia)||(r.tokens.name.trivia=` ${r.tokens.name.trivia}`),e.extAttrs.unshift(n)}else{pe(e).extAttrs=H.parse(new ve("[Exposed=Window]"));const t=e.tokens.base.trivia;e.extAttrs.tokens.open.trivia=t,e.tokens.base.trivia=`\n${le(t)}`}}}function ue(e){if(e.extAttrs.length)return e.extAttrs.tokens.open;if("operation"===e.type&&!e.special)return ue(e.idlType);const t=Object.values(e.tokens).sort((e,t)=>e.index-t.index);return t[0]}function pe(e,t){if(t||(t=e),!e)return e;return new Proxy(e,{get(e,t){const n=e[t];return Array.isArray(n)&&"source"!==t?pe(n,e):n},set(e,n,r){if(e[n]=r,!r)return!0;if(Array.isArray(r))for(const e of r)void 0!==e.parent&&(e.parent=t);else void 0!==r.parent&&(r.parent=t);return!0}})}const he={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},fe=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float16Array","Float32Array","Float64Array","any","object","symbol"],me=["ByteString","DOMString","USVString"],ge=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],be=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","async_iterable","async_sequence","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(ge,me,fe),ye=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],we=["_constructor","toString","_toString"];class ve{constructor(e){this.source=function(e){const t=[];let n=0,r="",i=1,s=0;for(;n<e.length;){const a=e.charAt(n);let c=-1;if(/[\t\n\r ]/.test(a)?c=o("whitespace",{noFlushTrivia:!0}):"/"===a&&(c=o("comment",{noFlushTrivia:!0})),-1!==c){const e=t.pop().value;i+=(e.match(/\n/g)||[]).length,r+=e,s-=1}else if(/[-0-9.A-Z_a-z]/.test(a)){if(c=o("decimal"),-1===c&&(c=o("integer")),-1===c){c=o("identifier");const e=t.length-1,n=t[e];if(-1!==c){if(we.includes(n.value)){const r=`${ee(n.value)} is a reserved identifier and must not be used.`;throw new ke(A(t,e,null,r))}be.includes(n.value)&&(n.type="inline")}}}else'"'===a&&(c=o("string"));for(const o of ye)if(e.startsWith(o,n)){t.push({type:"inline",value:o,trivia:r,line:i,index:s}),r="",n+=o.length,c=n;break}if(-1===c&&(c=o("other")),-1===c)throw new Error("Token stream not progressing");n=c,s+=1}return t.push({type:"eof",value:"",trivia:r,line:i,index:s}),t;function o(o,{noFlushTrivia:a}={}){const c=he[o];c.lastIndex=n;const l=c.exec(e);return l?(t.push({type:o,value:l[0],trivia:r,line:i,index:s}),a||(r=""),c.lastIndex):-1}}(e),this.position=0}error(e){throw new ke(A(this.source,this.position,this.current,e))}probeKind(e){return this.source.length>this.position&&this.source[this.position].type===e}probe(e){return this.probeKind("inline")&&this.source[this.position].value===e}consumeKind(...e){for(const t of e){if(!this.probeKind(t))continue;const e=this.source[this.position];return this.position++,e}}consume(...e){if(!this.probeKind("inline"))return;const t=this.source[this.position];for(const n of e)if(t.value===n)return this.position++,t}consumeIdentifier(e){if(this.probeKind("identifier")&&this.source[this.position].value===e)return this.consumeKind("identifier")}unconsume(e){this.position=e}}class ke extends Error{constructor({message:e,bareMessage:t,context:n,line:r,sourceName:i,input:s,tokens:o}){super(e),this.name="WebIDLParseError",this.bareMessage=t,this.context=n,this.line=r,this.sourceName=i,this.input=s,this.tokens=o}}class $e extends D{static parse(e){const t=e.consumeKind("string");if(t)return new $e({source:e.source,tokens:{value:t}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(e){const{parent:t}=this;return e.ts.wrap([e.ts.trivia(this.tokens.value.trivia),e.ts.definition(e.ts.wrap(['"',e.ts.name(this.value,{data:this,parent:t}),'"']),{data:this,parent:t}),e.token(this.tokens.separator)])}}class xe extends P{static parse(e){const t={};if(t.base=e.consume("enum"),!t.base)return;t.name=e.consumeKind("identifier")||e.error("No name for enum");const n=pe(new xe({source:e.source,tokens:t}));return e.current=n.this,t.open=e.consume("{")||e.error("Bodyless enum"),n.values=te(e,{parser:$e.parse,allowDangler:!0,listName:"enumeration"}),e.probeKind("string")&&e.error("No comma between enum values"),t.close=e.consume("}")||e.error("Unexpected value in enum"),n.values.length||e.error("No value in enum"),t.termination=e.consume(";")||e.error("No semicolon after enum"),n.this}get type(){return"enum"}get name(){return ee(this.tokens.name.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.open),e.ts.wrap(this.values.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Ce extends P{static parse(e){const t=e.consumeKind("identifier");if(!t)return;const n={target:t};if(n.includes=e.consume("includes"),n.includes)return n.mixin=e.consumeKind("identifier")||e.error("Incomplete includes statement"),n.termination=e.consume(";")||e.error("No terminating ; for includes statement"),new Ce({source:e.source,tokens:n});e.unconsume(t.index)}get type(){return"includes"}get target(){return ee(this.tokens.target.value)}get includes(){return ee(this.tokens.mixin.value)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.reference_token(this.tokens.target,this),e.token(this.tokens.includes),e.reference_token(this.tokens.mixin,this),e.token(this.tokens.termination)]),{data:this})}}class Se extends P{static parse(e){const t={},n=pe(new Se({source:e.source,tokens:t}));if(t.base=e.consume("typedef"),t.base)return n.idlType=oe(e,"typedef-type")||e.error("Typedef lacks a type"),t.name=e.consumeKind("identifier")||e.error("Typedef lacks a name"),e.current=n.this,t.termination=e.consume(";")||e.error("Unterminated typedef, expected `;`"),n.this}get type(){return"typedef"}get name(){return ee(this.tokens.name.value)}*validate(e){yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.termination)]),{data:this})}}class _e extends P{static parse(e,t){const n={base:t},r=pe(new _e({source:e.source,tokens:n}));return n.name=e.consumeKind("identifier")||e.error("Callback lacks a name"),e.current=r.this,n.assign=e.consume("=")||e.error("Callback lacks an assignment"),r.idlType=ae(e)||e.error("Callback lacks a return type"),n.open=e.consume("(")||e.error("Callback lacks parentheses for arguments"),r.arguments=se(e),n.close=e.consume(")")||e.error("Unterminated callback"),n.termination=e.consume(";")||e.error("Unterminated callback, expected `;`"),r.this}get type(){return"callback"}get name(){return ee(this.tokens.name.value)}*validate(e){yield*this.extAttrs.validate(e);for(const t of this.arguments)if(yield*t.validate(e),"async_sequence"===t.idlType.generic){const e="async_sequence types cannot be returned as a callback argument.";yield L(t.tokens.name,t,"async-sequence-idl-to-js",e)}yield*this.idlType.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.name_token(this.tokens.name,{data:this}),e.token(this.tokens.assign),e.ts.type(this.idlType.write(e)),e.token(this.tokens.open),...this.arguments.map(t=>t.write(e)),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Te extends P{static parse(e,t,{inheritable:n,allowedMembers:r}){const{tokens:i,type:s}=t;for(i.name=e.consumeKind("identifier")||e.error(`Missing name in ${s}`),e.current=t,t=pe(t),n&&Object.assign(i,function(e){const t=e.consume(":");return t?{colon:t,inheritance:e.consumeKind("identifier")||e.error("Inheritance lacks a type")}:{}}(e)),i.open=e.consume("{")||e.error(`Bodyless ${s}`),t.members=[];;){if(i.close=e.consume("}"),i.close)return i.termination=e.consume(";")||e.error(`Missing semicolon after ${s}`),t.this;const n=H.parse(e);let o;for(const[t,...n]of r)if(o=pe(t(e,...n)),o)break;o||e.error("Unknown member"),o.extAttrs=n,t.members.push(o.this)}}get partial(){return!!this.tokens.partial}get name(){return ee(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?ee(this.tokens.inheritance.value):null}*validate(e){for(const t of this.members)t.validate&&(yield*t.validate(e))}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.callback),e.token(this.tokens.partial),e.token(this.tokens.base),e.token(this.tokens.mixin),e.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?e.ts.wrap([e.token(this.tokens.colon),e.ts.trivia(this.tokens.inheritance.trivia),e.ts.inheritance(e.reference(this.tokens.inheritance.value,{context:this}))]):"")(),e.token(this.tokens.open),e.ts.wrap(this.members.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this})}}class Re extends P{static parse(e){const t={};if(t.base=e.consume("const"),!t.base)return;let n=ie(e);if(!n){const t=e.consumeKind("identifier")||e.error("Const lacks a type");n=new V({source:e.source,tokens:{base:t}})}e.probe("?")&&e.error("Unexpected nullable constant type"),n.type="const-type",t.name=e.consumeKind("identifier")||e.error("Const lacks a name"),t.assign=e.consume("=")||e.error("Const lacks value assignment"),t.value=ne(e)||e.error("Const lacks a value"),t.termination=e.consume(";")||e.error("Unterminated const, expected `;`");const r=new Re({source:e.source,tokens:t});return pe(r).idlType=n,r}get type(){return"const"}get name(){return ee(this.tokens.name.value)}get value(){return re(this.tokens.value)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),e.token(this.tokens.assign),e.token(this.tokens.value),e.token(this.tokens.termination)]),{data:this,parent:t})}}class Ee extends P{static parse(e){const t=e.position,n=pe(new Ee({source:e.source,tokens:{}})),{tokens:r}=n;if(r.readonly=e.consume("readonly"),r.readonly||(r.async=e.consume("async")),r.base=r.readonly?e.consume("maplike","setlike"):r.async?e.consume("iterable"):e.consume("iterable","async_iterable","maplike","setlike"),!r.base)return void e.unconsume(t);const{type:i}=n,s="maplike"===i,o=s||"iterable"===i||"async_iterable"===i,a="async_iterable"===i||n.async&&"iterable"===i;r.open=e.consume("<")||e.error(`Missing less-than sign \`<\` in ${i} declaration`);const c=oe(e)||e.error(`Missing a type argument in ${i} declaration`);return n.idlType=[c],n.arguments=[],o&&(c.tokens.separator=e.consume(","),c.tokens.separator?n.idlType.push(oe(e)):s&&e.error(`Missing second type argument in ${i} declaration`)),r.close=e.consume(">")||e.error(`Missing greater-than sign \`>\` in ${i} declaration`),e.probe("(")&&(a?(r.argsOpen=e.consume("("),n.arguments.push(...se(e)),r.argsClose=e.consume(")")||e.error("Unterminated async iterable argument list")):e.error("Arguments are only allowed for `async iterable`")),r.termination=e.consume(";")||e.error(`Missing semicolon after ${i} declaration`),n.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(e){if(this.async&&"iterable"===this.type){const e="`async iterable` is now changed to `async_iterable`.";yield L(this.tokens.async,this,"obsolete-async-iterable-syntax",e,{autofix:(t=this,()=>{const e=t.tokens.async;t.tokens.base={...e,type:"async_iterable",value:"async_iterable"},delete t.tokens.async})})}var t;for(const t of this.idlType)yield*t.validate(e);for(const t of this.arguments)yield*t.validate(e)}write(e){return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.readonly),e.token(this.tokens.async),e.token(this.tokens.base,e.ts.generic),e.token(this.tokens.open),e.ts.wrap(this.idlType.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.argsOpen),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.argsClose),e.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class Ae extends P{static parse(e){const t=e.consume("constructor");if(!t)return;const n={base:t};n.open=e.consume("(")||e.error("No argument list in constructor");const r=se(e);n.close=e.consume(")")||e.error("Unterminated constructor"),n.termination=e.consume(";")||e.error("No semicolon after constructor");const i=new Ae({source:e.source,tokens:n});return pe(i).arguments=r,i}get type(){return"constructor"}*validate(e){for(const t of this.arguments)yield*t.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.base,e.ts.nameless,{data:this,parent:t}),e.token(this.tokens.open),e.ts.wrap(this.arguments.map(t=>t.write(e))),e.token(this.tokens.close),e.token(this.tokens.termination)]),{data:this,parent:t})}}function Le(e){const t=e.consume("static");if(!t)return;return Q.parse(e,{special:t})||X.parse(e,{special:t})||e.error("No body in static member")}class Pe extends Te{static parse(e,t,{extMembers:n=[],partial:r=null}={}){const i={partial:r,base:t};return Te.parse(e,new Pe({source:e.source,tokens:i}),{inheritable:!r,allowedMembers:[...n,[Re.parse],[Ae.parse],[Le],[ce],[Ee.parse],[Q.parse],[X.parse]]})}get type(){return"interface"}*validate(e){if(yield*this.extAttrs.validate(e),!this.partial&&this.extAttrs.every(e=>"Exposed"!==e.name)){const e="Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield L(this.tokens.name,this,"require-exposed",e,{autofix:de(this)})}const t=this.extAttrs.filter(e=>"Constructor"===e.name);for(const e of t){const t="Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.";yield L(e.tokens.name,this,"constructor-member",t,{autofix:Ne(this,e)})}if(this.extAttrs.some(e=>"Global"===e.name)){const e=this.extAttrs.filter(e=>"LegacyFactoryFunction"===e.name);for(const t of e){const e="Interfaces marked as `[Global]` cannot have factory functions.";yield L(t.tokens.name,this,"no-constructible-global",e)}const t=this.members.filter(e=>"constructor"===e.type);for(const e of t){const t="Interfaces marked as `[Global]` cannot have constructors.";yield L(e.tokens.base,this,"no-constructible-global",t)}}yield*super.validate(e),this.partial||(yield*function*(e,t){const n=function(e){const t=o(e);return{statics:new Set(t.filter(e=>"static"===e.special).map(e=>e.name)),nonstatics:new Set(t.filter(e=>"static"!==e.special).map(e=>e.name))}}(t),r=e.partials.get(t.name)||[],i=e.mixinMap.get(t.name)||[];for(const e of[...r,...i]){const r=o(e),i=r.filter(e=>"static"===e.special),a=r.filter(e=>"static"!==e.special);yield*s(i,n.statics,e,t),yield*s(a,n.nonstatics,e,t),i.forEach(e=>n.statics.add(e.name)),a.forEach(e=>n.nonstatics.add(e.name))}function*s(e,t,n,r){for(const i of e){const{name:e}=i;if(e&&t.has(e)){const t=`The ${"static"===i.special?"static ":""}operation "${e}" has already been defined for the base interface "${r.name}" either in itself or in a mixin`;yield L(i.tokens.name,n,"no-cross-overload",t)}}}function o(e){return e.members.filter(({type:e})=>"operation"===e)}}(e,this))}}function Ne(e,t){return e=pe(e),()=>{const n=le(e.extAttrs.tokens.open.trivia),r=e.members.length?le(ue(e.members[0]).trivia):function(e){const t=le(e),n=t.includes("\t")?"\t":" ";return t+n}(n),i=Ae.parse(new ve(`\n${r}constructor();`));i.extAttrs=new H({source:e.source,tokens:{}}),pe(i).arguments=t.arguments;const s=function(e,t){const n=e.slice().reverse().findIndex(t);return-1===n?n:e.length-n-1}(e.members,e=>"constructor"===e.type);e.members.splice(s+1,0,i);const{close:o}=e.tokens;o.trivia.includes("\n")||(o.trivia+=`\n${n}`);const{extAttrs:a}=e,c=a.indexOf(t),l=a.splice(c,1);a.length?a.length===c?a[c-1].tokens.separator=void 0:a[c].tokens.name.trivia.trim()||(a[c].tokens.name.trivia=l[0].tokens.name.trivia):a.tokens.open=a.tokens.close=void 0}}class Ie extends Te{static parse(e,t,{extMembers:n=[],partial:r}={}){const i={partial:r,base:t};if(i.mixin=e.consume("mixin"),i.mixin)return Te.parse(e,new Ie({source:e.source,tokens:i}),{allowedMembers:[...n,[Re.parse],[ce],[Q.parse,{noInherit:!0}],[X.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Oe extends P{static parse(e){const t={},n=pe(new Oe({source:e.source,tokens:t}));return n.extAttrs=H.parse(e),t.required=e.consume("required"),n.idlType=oe(e,"dictionary-type")||e.error("Dictionary member lacks a type"),t.name=e.consumeKind("identifier")||e.error("Dictionary member lacks a name"),n.default=Z.parse(e),t.required&&n.default&&e.error("Required member must not have a default"),t.termination=e.consume(";")||e.error("Unterminated dictionary member, expected `;`"),n.this}get type(){return"field"}get name(){return ee(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(e){yield*this.idlType.validate(e)}write(e){const{parent:t}=this;return e.ts.definition(e.ts.wrap([this.extAttrs.write(e),e.token(this.tokens.required),e.ts.type(this.idlType.write(e)),e.name_token(this.tokens.name,{data:this,parent:t}),this.default?this.default.write(e):"",e.token(this.tokens.termination)]),{data:this,parent:t})}}class De extends Te{static parse(e,{extMembers:t=[],partial:n}={}){const r={partial:n};if(r.base=e.consume("dictionary"),r.base)return Te.parse(e,new De({source:e.source,tokens:r}),{inheritable:!n,allowedMembers:[...t,[Oe.parse]]})}get type(){return"dictionary"}}class je extends Te{static parse(e,{extMembers:t=[],partial:n}={}){const r={partial:n};if(r.base=e.consume("namespace"),r.base)return Te.parse(e,new je({source:e.source,tokens:r}),{allowedMembers:[...t,[Q.parse,{noInherit:!0,readonly:!0}],[Re.parse],[X.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(e){if(!this.partial&&this.extAttrs.every(e=>"Exposed"!==e.name)){const e="Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.";yield L(this.tokens.name,this,"require-exposed",e,{autofix:de(this)})}yield*super.validate(e)}}class ze extends Te{static parse(e,t,{extMembers:n=[]}={}){const r={callback:t};if(r.base=e.consume("interface"),r.base)return Te.parse(e,new ze({source:e.source,tokens:r}),{allowedMembers:[...n,[Re.parse],[X.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Me(e,t){const n=e.source;function r(t){e.error(t)}function i(...t){return e.consume(...t)}function s(n){const s=i("interface");if(s)return Ie.parse(e,s,{...n,...t?.extensions?.mixin})||Pe.parse(e,s,{...n,...t?.extensions?.interface})||r("Interface has no proper body")}function o(){if(t.productions)for(const n of t.productions){const t=n(e);if(t)return t}return function(){const n=i("callback");if(n)return e.probe("interface")?ze.parse(e,n,{...t?.extensions?.callbackInterface}):_e.parse(e,n)}()||s()||function(){const n=i("partial");if(n)return De.parse(e,{partial:n,...t?.extensions?.dictionary})||s({partial:n})||je.parse(e,{partial:n,...t?.extensions?.namespace})||r("Partial doesn't apply to anything")}()||De.parse(e,t?.extensions?.dictionary)||xe.parse(e)||Se.parse(e)||Ce.parse(e)||je.parse(e,t?.extensions?.namespace)}const a=function(){if(!n.length)return[];const i=[];for(;;){const t=H.parse(e),n=o();if(!n){t.length&&r("Stray extended attributes");break}pe(n).extAttrs=t,i.push(n)}const s=j.parse(e);return t.concrete&&i.push(s),i}();return e.position<n.length&&r("Unrecognised tokens"),a}function qe(e){return e}const Ue={wrap:e=>e.join(""),trivia:qe,name:qe,reference:qe,type:qe,generic:qe,nameless:qe,inheritance:qe,definition:qe,extendedAttribute:qe,extendedAttributeReference:qe};class We{constructor(e){this.ts=Object.assign({},Ue,e)}reference(e,{unescaped:t,context:n}){return t||(t=e.startsWith("_")?e.slice(1):e),this.ts.reference(e,t,n)}token(e,t=qe,...n){if(!e)return"";const r=t(e.value,...n);return this.ts.wrap([this.ts.trivia(e.trivia),r])}reference_token(e,t){return this.token(e,this.reference.bind(this),{context:t})}name_token(e,t){return this.token(e,this.ts.name,t)}identifier(e,t){return this.ts.wrap([this.reference_token(e.tokens.value,t),this.token(e.tokens.separator)])}}function Fe(e,t){const n=new Map,r=e.filter(e=>"includes"===e.type);for(const e of r){const r=t.get(e.includes);if(!r)continue;const i=n.get(e.target);i?i.push(r):n.set(e.target,[r])}return n}function*He(e){const t=function(e){const t=new Map,n=new Set,r=new Map;for(const i of e){if(i.partial){const e=r.get(i.name);e?e.push(i):r.set(i.name,[i]);continue}i.name&&(t.has(i.name)?n.add(i):t.set(i.name,i))}return{all:e,unique:t,partials:r,duplicates:n,mixinMap:Fe(e,t),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(e);for(const e of t.all)e.validate&&(yield*e.validate(t));yield*function*({unique:e,duplicates:t}){for(const n of t){const{name:t}=n,r=`The name "${t}" of type "${e.get(t).type}" was already seen`;yield L(n.tokens.name,n,"no-duplicate",r)}}(t)}var Be,Ge=Object.freeze({__proto__:null,WebIDLParseError:ke,parse:function(e,t={}){const n=new ve(e);return void 0!==t.sourceName&&(n.source.name=t.sourceName),Me(n,t)},validate:function(e){return[...He((t=e,t.flat?t.flat():[].concat(...t)))];var t},write:function(e,{templates:t=Ue}={}){t=Object.assign({},Ue,t);const n=new We(t);return t.wrap(e.map(e=>e.write(n)))}});!function(e){e.ILLEGAL="ILLEGAL",e.EOF="EOF",e.NL="\n",e.SPACE=" ",e.UNDERSCORE="_",e.DOLLAR="$",e.ATSIGN="@",e.CARET="^",e.HASH="#",e.TILDE="~",e.AMPERSAND="&",e.IDENT="IDENT",e.COMMENT="COMMENT",e.STRING="STRING",e.NUMBER="NUMBER",e.FLOAT="FLOAT",e.CTLOP="CTLOP",e.BYTES="BYTES",e.HEX="HEX",e.BASE64="BASE64",e.ASSIGN="=",e.ARROWMAP="=>",e.TCHOICE="/",e.GCHOICE="//",e.TCHOICEALT="/=",e.GCHOICEALT="//=",e.PLUS="+",e.MINUS="-",e.QUEST="?",e.ASTERISK="*",e.INCLRANGE="..",e.EXCLRANGE="...",e.COMMA=",",e.DOT=".",e.COLON=":",e.SEMICOLON=";",e.LPAREN="(",e.RPAREN=")",e.LBRACE="{",e.RBRACE="}",e.LBRACK="[",e.RBRACK="]",e.LT="<",e.GT=">",e.QUOT='"'}(Be||(Be={}));const Ve=Object.entries(Be).reduce((e,[t,n])=>(e[n]=t,e),{});class Je{type;literal;comments;whitespace;constructor(e,t,n=[],r=""){this.type=e,this.literal=t,this.comments=n,this.whitespace=r}serialize(){let e="";for(const t of this.comments)e+=t.serialize();switch(e+=this.whitespace,this.type){case Be.IDENT:case Be.COMMENT:case Be.NUMBER:case Be.FLOAT:e+=this.literal;break;case Be.STRING:e+='"'+this.literal+'"';break;case Be.CTLOP:e+="."+this.literal;break;case Be.BYTES:e+="'"+this.literal+"'";break;case Be.HEX:e+="h'"+this.literal+"'";break;case Be.BASE64:e+="b64'"+this.literal+"'";break;case Be.EOF:break;default:e+=this.type.valueOf()}return e}startWithSpaces(){return""!==this.whitespace||this.comments.length>0}toString(e=0){const t=[`${" ".repeat(e)}${this.constructor.name}: ${Ve[this.type]} (${this.type})`];""!==this.whitespace&&t.push(" ".repeat(e+1)+`whitespaces: ${this.whitespace.length}`),""!==this.literal&&t.push(" ".repeat(e+1)+`literal: ${this.literal}`);for(const n of this.comments)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return{type:this.type,literal:this.literal,comments:this.comments?.map(e=>e.toJSON()),whitespace:this.whitespace}}}class Ze{parentNode=null;serialize(e){if(this.setChildrenParent(),e){const t=e.markupFor(this);let n=null!==t[0]?t[0]:"";return n+=this._serialize(e),n+=null!==t[1]?t[1]:"",n}return this._serialize()}setChildrenParent(){for(const e of this.getChildren())e.parentNode=this,e.setChildrenParent()}getChildren(){return[]}_serializeToken(e,t){return e?t?t.serializeToken(e,this):e.serialize():""}toString(e=0){return" ".repeat(e)+this.constructor.name}toJSON(){return{}}}class Ke extends Ze{openToken=null;closeToken=null;serialize(e){let t="";if(e){const n=e.markupFor(this);t+=null!==n[0]?n[0]:""}if(t+=this._serializeToken(this.openToken,e),t+=this._serialize(e),t+=this._serializeToken(this.closeToken,e),e){const n=e.markupFor(this);t+=null!==n[1]?n[1]:""}return t}toString(e=0){const t=[super.toString(e)];return this.openToken&&t.push(this.openToken.toString(e+1)),this.closeToken&&t.push(this.closeToken.toString(e+1)),t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{openToken:this.openToken?.toJSON(),closeToken:this.closeToken?.toJSON()})}}class Ye extends Ke{comments=[];whitespace="";separator=null;_prestr(e){return""}serialize(e){let t=this._prestr(e);for(const n of this.comments)t+=this._serializeToken(n,e);return t+=this.whitespace,t+=super.serialize(e),t+=this._serializeToken(this.separator,e),t}setComments(e){this.comments=e.comments,this.whitespace=e.whitespace}toString(e=0){const t=[super.toString(e)];for(const n of this.comments)t.push(n.toString(e+1));return""!==this.whitespace&&t.push(" ".repeat(e+1)+`whitespaces: ${this.whitespace.length}`),this.separator&&t.push(this.separator.toString(e+1)),t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{comments:this.comments.map(e=>e.toJSON()),whitespace:this.whitespace,separator:this.separator?.toJSON()})}}class Xe extends Ye{rules;constructor(e){super(),this.rules=e}getChildren(){return this.rules}_serialize(e){return this.rules.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.rules)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{rules:this.rules.map(e=>e.toJSON())})}}class Qe extends Ze{name;assign;type;constructor(e,t,n){super(),this.name=e,this.assign=t,this.type=n}getChildren(){return[this.name,this.type]}_serialize(e){let t=this.name.serialize(e);return t+=this._serializeToken(this.assign,e),t+=this.type.serialize(e),t}toString(e=0){return[super.toString(e),this.name.toString(e+1),this.assign.toString(e+1),this.type.toString(e+1)].join("\n")}toJSON(){return Object.assign(super.toJSON(),{name:this.name.toJSON(),assign:this.assign.toJSON(),type:this.type.toJSON()})}}class et extends Ye{occurrence;key;type;constructor(e,t,n){super(),this.occurrence=e,this.key=t,this.type=n}getChildren(){const e=[];return this.occurrence&&e.push(this.occurrence),this.key&&e.push(this.key),e.push(this.type),e}_serialize(e){let t="";return this.occurrence&&(t+=this.occurrence.serialize(e)),this.key&&(t+=this.key.serialize(e)),t+=this.type.serialize(e),t}isConvertibleToType(){return null===this.occurrence&&null===this.key&&(!(this.type instanceof tt)||this.type instanceof rt||this.type instanceof nt)}toString(e=0){const t=[super.toString(e)];return this.occurrence&&t.push(this.occurrence.toString(e+1)),this.key&&t.push(this.key.toString(e+1)),t.push(this.type.toString(e+1)),t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{occurrence:this.occurrence?.toJSON(),key:this.key?.toJSON(),type:this.type.toJSON()})}}class tt extends Ye{groupChoices;constructor(e){super(),this.groupChoices=e}getChildren(){return this.groupChoices}_serialize(e){return this.groupChoices.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.groupChoices)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{groupChoices:this.groupChoices.map(e=>e.toJSON())})}}let nt=class extends tt{},rt=class extends tt{};class it extends Ye{groupEntries;constructor(e){super(),this.groupEntries=e}getChildren(){return this.groupEntries}_serialize(e){return this.groupEntries.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.groupEntries)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{groupEntries:this.groupEntries.map(e=>e.toJSON())})}}class st extends Ye{numericPart;typePart;constructor(e=null,t=null){super(),this.numericPart=e,this.typePart=t}getChildren(){return this.typePart?[this.typePart]:[]}_serialize(e){let t=this._serializeToken(new Je(Be.HASH,""),e);return t+=this._serializeToken(this.numericPart,e),t+=this.typePart?this.typePart.serialize(e):"",t}toString(e=0){const t=[super.toString(e)+" (#)"];return this.numericPart&&t.push(this.numericPart.toString(e+1)),this.typePart&&t.push(this.typePart.toString(e+1)),t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{numericPart:this.numericPart?.toJSON(),typePart:this.typePart?.toJSON()})}}class ot extends Ye{n;m;tokens;constructor(e,t,n=[]){super(),this.n=e,this.m=t,this.tokens=n}_serialize(e){return this.tokens.map(t=>this._serializeToken(t,e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.tokens)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{n:this.n,m:this.m,tokens:this.tokens.map(e=>e.toJSON())})}}class at extends Ye{value;type;constructor(e,t){super(),this.value=e,this.type=t}_serialize(e){let t="",n="";return"text"===this.type?(t='"',n='"'):"bytes"===this.type?(t="'",n="'"):"hex"===this.type?(t="h'",n="'"):"base64"===this.type&&(t="b64'",n="'"),e?e.serializeValue(t,this.value,n,this):t+this.value+n}toString(e=0){return" ".repeat(e)+`${this.constructor.name} (${this.type}): ${this.value}`}toJSON(){return Object.assign(super.toJSON(),{value:this.value,type:this.type})}}class ct extends Ye{name;unwrapped;parameters;constructor(e,t,n=null){super(),this.name=e,this.unwrapped=t,this.parameters=n}getChildren(){return this.parameters?[this.parameters]:[]}_prestr(e){return this._serializeToken(this.unwrapped,e)}_serialize(e){let t="";return e?t+=e.serializeName(this.name,this):t=this.name,this.parameters&&(t+=this.parameters.serialize(e)),t}toString(e=0){const t=[super.toString(e)," ".repeat(e+1)+this.name];return this.unwrapped&&t.push(this.unwrapped.toString(e+1)),this.parameters&&t.push(this.parameters.toString(e+1)),t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{name:this.name,unwrapped:this.unwrapped?.toJSON(),parameters:this.parameters?.toJSON()})}}class lt extends Ye{target;constructor(e){super(),this.target=e}getChildren(){return[this.target]}_serialize(e){let t=this._serializeToken(new Je(Be.AMPERSAND,""),e);return t+=this.target.serialize(e),t}toString(e=0){return[super.toString(e)+" (&)",this.target.toString(e+1)].join("\n")}toJSON(){return Object.assign(super.toJSON(),{target:this.target.toJSON()})}}class dt extends Ye{min;max;rangeop;constructor(e,t,n){super(),this.min=e,this.max=t,this.rangeop=n}getChildren(){return[this.min,this.max]}_serialize(e){let t=this.min.serialize(e);return t+=this._serializeToken(this.rangeop,e),t+=this.max.serialize(e),t}toString(e=0){return[super.toString(e),this.min.toString(e+1),this.rangeop.toString(e+1),this.max.toString(e+1)].join("\n")}toJSON(){return Object.assign(super.toJSON(),{min:this.min.toJSON(),max:this.max.toJSON(),rangeop:this.rangeop.toJSON()})}}class ut extends Ye{type;name;controller;constructor(e,t,n){super(),this.type=e,this.name=t,this.controller=n}getChildren(){return[this.type,this.controller]}_serialize(e){let t=this.type.serialize(e);return t+=this._serializeToken(this.name,e),t+=this.controller.serialize(e),t}toString(e=0){return[super.toString(e),this.type.toString(e+1),this.name.toString(e+1),this.controller.toString(e+1)].join("\n")}toJSON(){return Object.assign(super.toJSON(),{type:this.type.toJSON(),name:this.name.toJSON(),controller:this.controller.toJSON()})}}class pt extends Ze{type;hasCut;hasColon;tokens;constructor(e,t,n,r=[]){super(),this.type=e,this.hasCut=t,this.hasColon=n,this.tokens=r}getChildren(){return[this.type]}_serialize(e){let t=this.type.serialize(e);return t+=this.tokens.map(t=>this._serializeToken(t,e)).join(""),t}toString(e=0){const t=[super.toString(e),this.type.toString(e+1)];for(const n of this.tokens)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{type:this.type.toJSON(),hasCut:this.hasCut,hasColon:this.hasColon,tokens:this.tokens.map(e=>e.toJSON())})}}class ht extends Ye{types;constructor(e){super(),this.types=e}getChildren(){return this.types}_serialize(e){return this.types.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.types)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{types:this.types.map(e=>e.toJSON())})}}class ft extends Ke{parameters;constructor(e){super(),this.parameters=e}getChildren(){return this.parameters}_serialize(e){return this.parameters.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.parameters)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{parameters:this.parameters.map(e=>e.toJSON())})}}class mt extends Ke{parameters;constructor(e){super(),this.parameters=e}getChildren(){return this.parameters}_serialize(e){return this.parameters.map(t=>t.serialize(e)).join("")}toString(e=0){const t=[super.toString(e)];for(const n of this.parameters)t.push(n.toString(e+1));return t.join("\n")}toJSON(){return Object.assign(super.toJSON(),{parameters:this.parameters.map(e=>e.toJSON())})}}class gt extends Error{constructor(e="A parsing error occurred"){super(e),this.name="ParserError"}}function bt(e){return function(e){return"a"<=e&&e<="z"||"A"<=e&&e<="Z"}(e)||"@_$".includes(e)}function yt(e){return e.length>0&&"123456789".includes(e[0])&&[...e].every(e=>"0123456789".includes(e))}class wt{line;position;constructor(e=-1,t=-1){this.line=e,this.position=t}}class vt{input;position=0;readPosition=0;ch=0;constructor(e){this.input=e,this.readChar()}readChar(){this.readPosition>=this.input.length?this.ch=0:this.ch=this.input.charCodeAt(this.readPosition),this.position=this.readPosition,this.readPosition+=1}_peekAtNextChar(){return this.readPosition>=this.input.length?"":this.input[this.readPosition]}getLocation(){const e=this.position-2,t=this.input.split("\n");let n=0;for(let r=0;r<t.length;r++){const i=t[r].length;if(n+=i+1,n>e){return new wt(r,e-(n-i)+1)}}return new wt(0,0)}getLine(e){return this.input.split("\n")[e]}getLocationInfo(){const e=this.getLocation();let t=(e.line>=0?this.getLine(e.line):"")+"\n";return t+=" ".repeat(e.position>=0?e.position:0)+"^\n",t+=" ".repeat(e.position>=0?e.position:0)+"|\n",t}nextToken(){const e=this._readComments();let t="";e.length>0&&""===e[e.length-1].literal&&(t=e[e.length-1].whitespace,e.pop());let n=new Je(Be.ILLEGAL,"");const r=String.fromCharCode(this.ch);let i=!1;if("="===r)">"===this._peekAtNextChar()?(this.readChar(),n=new Je(Be.ARROWMAP,"",e,t)):n=new Je(Be.ASSIGN,"",e,t);else if("("===r)n=new Je(Be.LPAREN,"",e,t);else if(")"===r)n=new Je(Be.RPAREN,"",e,t);else if("{"===r)n=new Je(Be.LBRACE,"",e,t);else if("}"===r)n=new Je(Be.RBRACE,"",e,t);else if("["===r)n=new Je(Be.LBRACK,"",e,t);else if("]"===r)n=new Je(Be.RBRACK,"",e,t);else if("<"===r)n=new Je(Be.LT,"",e,t);else if(">"===r)n=new Je(Be.GT,"",e,t);else if("+"===r)n=new Je(Be.PLUS,"",e,t);else if(","===r)n=new Je(Be.COMMA,"",e,t);else if("."===r)"."===this._peekAtNextChar()?(this.readChar(),n=new Je(Be.INCLRANGE,"",e,t),"."===this._peekAtNextChar()&&(this.readChar(),n=new Je(Be.EXCLRANGE,"",e,t))):bt(this._peekAtNextChar())&&(this.readChar(),n=new Je(Be.CTLOP,this._readIdentifier(),e,t),i=!0);else if(":"===r)n=new Je(Be.COLON,"",e,t);else if("?"===r)n=new Je(Be.QUEST,"",e,t);else if("/"===r)"/"===this._peekAtNextChar()?(this.readChar(),n=new Je(Be.GCHOICE,"",e,t),"="===this._peekAtNextChar()&&(this.readChar(),n=new Je(Be.GCHOICEALT,"",e,t))):"="===this._peekAtNextChar()?(this.readChar(),n=new Je(Be.TCHOICEALT,"",e,t)):n=new Je(Be.TCHOICE,"",e,t);else if("*"===r)n=new Je(Be.ASTERISK,"",e,t);else if("^"===r)n=new Je(Be.CARET,"",e,t);else if("#"===r)n=new Je(Be.HASH,"",e,t);else if("~"===r)n=new Je(Be.TILDE,"",e,t);else if('"'===r)n=new Je(Be.STRING,this._readString(),e,t);else if("'"===r)n=new Je(Be.BYTES,this._readBytesString(),e,t);else if(";"===r)n=new Je(Be.COMMENT,this._readComment(),e,t),i=!0;else if("&"===r)n=new Je(Be.AMPERSAND,"",e,t);else if(0===this.ch)n=new Je(Be.EOF,"",e,t);else if(bt(r))"b"===r&&"6"===this._peekAtNextChar()?(this.readChar(),this.readChar(),"4"===String.fromCharCode(this.ch)&&"'"===this._peekAtNextChar()?(this.readChar(),n=new Je(Be.BASE64,this._readBytesString(),e,t)):(n=new Je(Be.IDENT,this._readIdentifier("b6"),e,t),i=!0)):"h"===r&&"'"===this._peekAtNextChar()?(this.readChar(),n=new Je(Be.HEX,this._readBytesString(),e,t)):(n=new Je(Be.IDENT,this._readIdentifier(),e,t),i=!0);else if(this._isDigit(r)||"-"===r){const r=this._readNumberOrFloat();n=new Je(r.includes(".")?Be.FLOAT:Be.NUMBER,r,e,t),i=!0}return i||this.readChar(),n}_isDigit(e){return e>="0"&&e<="9"}_readIdentifier(e=""){const t=this.position;if(""===e&&!bt(String.fromCharCode(this.ch)))throw this._tokenError("expected identifier, got nothing");for(;bt(String.fromCharCode(this.ch))||this._isDigit(String.fromCharCode(this.ch))||"-. ".includes(String.fromCharCode(this.ch));){if(" "===String.fromCharCode(this.ch))break;this.readChar()}const n=e+this.input.substring(t,this.position);if(n.endsWith("-")||n.endsWith("."))throw this._tokenError(`identifier cannot end with \`-\` or \`.\`, got \`${n}\``);return n}_readComment(){const e=this.position;for(;this.ch&&"\n"!==String.fromCharCode(this.ch);)this.readChar();return this.input.substring(e,this.position)}_readString(){const e=this.position;for(this.readChar();'"'!==String.fromCharCode(this.ch);)if(this.ch>=32&&this.ch<=33||this.ch>=35&&this.ch<=91||this.ch>=93&&this.ch<=126||this.ch>=128&&this.ch<=1114109)this.readChar();else if("\\"===String.fromCharCode(this.ch)){if(this.readChar(),!(this.ch>=32&&this.ch<=126||this.ch>=128&&this.ch<=1114109))throw this._tokenError(`invalid escape character in text string \`${this.input.substring(e+1,this.position)}\``);this.readChar()}else if(10===this.ch)this.readChar();else{if(13!==this.ch||10!==this._peekAtNextChar().charCodeAt(0))throw this._tokenError(`invalid text string \`${this.input.substring(e+1,this.position)}\``);this.readChar(),this.readChar()}return this.input.substring(e+1,this.position)}_readBytesString(){const e=this.position;for(this.readChar();"'"!==String.fromCharCode(this.ch);)if(this.ch>=32&&this.ch<=38||this.ch>=40&&this.ch<=91||this.ch>=93&&this.ch<=1114109)this.readChar();else if("\\"===String.fromCharCode(this.ch)){if(this.readChar(),!(this.ch>=32&&this.ch<=126||this.ch>=128&&this.ch<=1114109))throw this._tokenError(`invalid escape character in byte string \`${this.input.substring(e+1,this.position)}\``);this.readChar()}else if(10===this.ch)this.readChar();else{if(13!==this.ch||10!==this._peekAtNextChar().charCodeAt(0))throw this._tokenError(`invalid byte string \`${this.input.substring(e+1,this.position)}\``);this.readChar(),this.readChar()}return this.input.substring(e+1,this.position)}_readNumberOrFloat(){const e=this.position;let t=!1;if("-"===String.fromCharCode(this.ch)&&this.readChar(),"0"===String.fromCharCode(this.ch)){if(this.readChar(),"x"===String.fromCharCode(this.ch)){if(this.readChar(),!"0123456789ABCDEF".includes(String.fromCharCode(this.ch).toUpperCase()))throw this._tokenError(`expected hex number to contain hex digits, got \`${this.input.substring(e,this.position)}\``);for(;"0123456789ABCDEF".includes(String.fromCharCode(this.ch).toUpperCase());)this.readChar();if("."===String.fromCharCode(this.ch)){if(t=!0,"."===this._peekAtNextChar())return this.input.substring(e,this.position);for(this.readChar();"0123456789ABCDEF".includes(String.fromCharCode(this.ch).toUpperCase());)this.readChar()}if(t&&"p"!==String.fromCharCode(this.ch))throw this._tokenError(`expected hex number with fraction to have an exponent, got \`${this.input.substring(e,this.position)}\``);if("p"===String.fromCharCode(this.ch)){if(this.readChar(),"+-".includes(String.fromCharCode(this.ch))&&this.readChar(),!this._isDigit(String.fromCharCode(this.ch)))throw this._tokenError(`expected hex number with exponent to have a digit in exponent, got \`${this.input.substring(e,this.position)}\``);for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar()}}else if("b"===String.fromCharCode(this.ch)){if(this.readChar(),!"01".includes(String.fromCharCode(this.ch)))throw this._tokenError(`expected binary number to have binary digits, got \`${this.input.substring(e,this.position)}\``);for(;"01".includes(String.fromCharCode(this.ch));)this.readChar()}else if("."===String.fromCharCode(this.ch)){if("."===this._peekAtNextChar())return this.input.substring(e,this.position);if(this.readChar(),!this._isDigit(String.fromCharCode(this.ch)))throw this._tokenError(`expected number with fraction to have digits in fraction part, got \`${this.input.substring(e,this.position)}\``);for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar();if("e"===String.fromCharCode(this.ch)){if(this.readChar(),"+-".includes(String.fromCharCode(this.ch))&&this.readChar(),!this._isDigit(String.fromCharCode(this.ch)))throw this._tokenError(`expected number with exponent to have digits in exponent, got \`${this.input.substring(e,this.position)}\``);for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar()}}}else{for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar();if("."===String.fromCharCode(this.ch)){if("."===this._peekAtNextChar())return this.input.substring(e,this.position);if(this.readChar(),!this._isDigit(String.fromCharCode(this.ch)))throw this._tokenError(`expected number with fraction to have digits in fraction part, got \`${this.input.substring(e,this.position)}\``);for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar()}if("e"===String.fromCharCode(this.ch)){if(this.readChar(),"+-".includes(String.fromCharCode(this.ch))&&this.readChar(),!this._isDigit(String.fromCharCode(this.ch)))throw this._tokenError(`expected number with exponent to have digits in exponent, got \`${this.input.substring(e,this.position)}\``);for(;this._isDigit(String.fromCharCode(this.ch));)this.readChar()}}return this.input.substring(e,this.position)}_readWhitespace(){const e=this.position;for(;" \t\n\r".includes(String.fromCharCode(this.ch));)this.readChar();return this.input.substring(e,this.position)}_readComments(){const e=[];for(;;){const t=this._readWhitespace();if(";"!==String.fromCharCode(this.ch)){if(""!==t){const n=new Je(Be.COMMENT,"",[],t);e.push(n)}break}const n=new Je(Be.COMMENT,this._readComment(),[],t);e.push(n)}return e}_tokenError(e){const t=this.getLocation();return new gt(`CDDL token error - line ${t.line+1}: ${e}`)}}const kt=new Je(Be.ILLEGAL,"");const $t=/^[!#$%&'*+-.^`|~\w]+$/,xt=/[\u000A\u000D\u0009\u0020]/u,Ct=/^[\u0009\u{0020}-\{u0073}\u{0080}-\u{00FF}]+$/u;function St(e,t,n){(t&&""!==t&&!e.has(t)&&Ct.test(n)||null===n)&&e.set(t.toLowerCase(),n)}function _t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Tt={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Rt(e){Tt=e}var Et={exec:()=>null};function At(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Lt(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(It.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Pt=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Nt="^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)",It={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,textIndentedContinuation:/^(?:\n(?: {4}| {0,3}\t)[ \t]*[^ \t\n][^\n]*)+/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)(\t[ \t]*)/gm,blockquoteFenceOpen:/^ {0,3}(`{3,}(?=[^`]*$)|~{3,})/,blockquoteFenceClose:/^ {0,3}(`{3,}|~{3,})[ \t]*$/,blockquoteListItemStart:/^ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|$)/,nestedBlockMarker:/^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableHeader:new RegExp(Nt+"(?:\\n|$)"),tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:At(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`)),hrRegex:At(e=>new RegExp(`^ {0,${e}}((?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\\*[ \t]*){3,})(?:\\n+|$)`)),fencesBeginRegex:At(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:At(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:At(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:At(e=>new RegExp(`^ {0,${e}}(?:</?(?:${jt})(?:[ \\t]+|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:At(e=>new RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},Ot=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,jt="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",zt=Lt(" {0,3}(?:</?(?:tag)(?:[ \\t]+|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",jt).getRegex(),Mt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,qt=Lt(Mt).replace(/bull/g,Dt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g,"").replace(/html/g,zt).getRegex(),Ut=Lt(Mt).replace(/bull/g,Dt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g,zt).getRegex(),Wt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ft=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Ht=Lt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ft).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),Bt=Lt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Dt).getRegex(),Gt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vt=Lt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Gt).replace("tag",jt).replace("attribute",/[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex(),Jt=e=>Lt(Wt).replace("hr",Ot).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html",zt).getRegex(),Zt=Jt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Kt=Jt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Yt=/ {0,3}> ?(?:(?!blank)(paragraph)|[^\n]*)(?:\n|$)/,Xt={blockquote:Lt(/^(first)(?:next)*/).replace("first",Lt(Yt).replace("blank",/[ \t]*(?:\n|$)| {4}/).getRegex()).replace("next",Lt(Yt).replace("blank",/[ \t]*(?:\n|$)/).getRegex()).replace(/paragraph/g,Kt).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Ht,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*)[ \t]*(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Ot,html:Vt,lheading:qt,list:Bt,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Zt,table:Et,text:/^[^\n]+/},Qt=Lt(Nt+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ot).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",zt).getRegex(),en={...Xt,lheading:Ut,table:Qt,paragraph:Lt(Wt).replace("hr",Ot).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",It.tableHeader).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",zt).getRegex()},tn={...Xt,html:Lt("^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))").replace("comment",Gt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Et,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Lt(Wt).replace("hr",Ot).replace("heading"," *#{1,6} *[^\n]").replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").replace("lheading",qt).getRegex()},nn=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,rn=/[\p{P}\p{S}]/u,sn=/[\s\p{P}\p{S}]/u,on=/[^\s\p{P}\p{S}]/u,an=Lt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sn).getRegex(),cn=/(?!~)[\p{P}\p{S}]/u,ln=Lt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Pt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),dn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,un=Lt(dn,"u").replace(/punct/g,rn).getRegex(),pn=Lt(dn,"u").replace(/punct/g,cn).getRegex(),hn=Lt(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,"u").replace(/openQuote/g,/[\p{Pi}\p{Ps}"']/u).replace(/punct/g,rn).getRegex(),fn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mn=Lt(fn,"gu").replace(/notPunctSpace/g,on).replace(/punctSpace/g,sn).replace(/punct/g,rn).getRegex(),gn=Lt(fn,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,cn).getRegex(),bn=Lt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,on).replace(/punctSpace/g,sn).replace(/punct/g,rn).getRegex(),yn=Lt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,on).replace(/punctSpace/g,sn).replace(/punct/g,rn).getRegex(),wn=Lt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,on).replace(/punctSpace/g,sn).replace(/punct/g,rn).getRegex(),vn=Lt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,rn).getRegex(),kn=Lt("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,on).replace(/punctSpace/g,sn).replace(/punct/g,rn).getRegex(),$n=Lt(/\\(punct)/,"gu").replace(/punct/g,rn).getRegex(),xn=Lt(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,rn).getRegex(),Cn=Lt(/^<(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(),Sn=Lt(Gt).replace("(?:--\x3e|$)","--\x3e").getRegex(),_n=Lt("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Sn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Tn=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Rn=Lt(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Tn).getRegex(),En=/\\[^ \t\n\x00-\x1f]|\\(?=[ \t\n])|[^ \t\n\x00-\x1f\\()]/,An=Lt(/\((?:char)*\)/).replace("char",En).getRegex(),Ln=Lt(/\((?:char|p1)*\)/).replace("char",En).replace("p1",An).getRegex(),Pn=Lt(/\((?:char|p2)*\)/).replace("char",En).replace("p2",Ln).getRegex(),Nn=Lt(/(?!<)(?:char|p3)+/).replace("char",En).replace("p3",Pn).getRegex(),In=Lt(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Rn).replace("href",Lt(/<(?:\\.|[^\n<>\\])*>|bareHref|(?=\))/).replace("bareHref",Nn).getRegex()).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),On=Lt(/^!?\[(label)\]\[(ref)\]/).replace("label",Rn).replace("ref",Ft).getRegex(),Dn=Lt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ft).getRegex(),jn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,zn=Lt(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Tn).getRegex(),Mn=Lt("reflink|nolink(?!\\()","g").replace("reflink",Lt(/^!?\[(label)\]\[(ref)\]/).replace("label",zn).replace("ref",jn).getRegex()).replace("nolink",Lt(/^!?\[(ref)\](?:\[\])?/).replace("ref",jn).getRegex()).getRegex(),qn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Un=Lt(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Wn={_backpedal:Et,anyPunctuation:$n,anyPunctuationOutsideCode:xn,autolink:Cn,blockSkip:ln,br:nn,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Et,delLDelim:Et,delRDelim:Et,emStrongLDelim:un,emStrongRDelimAst:mn,emStrongRDelimUnd:yn,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:In,nolink:Dn,punctuation:an,reflink:On,reflinkSearch:Mn,tag:_n,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Et},Fn={...Wn,emStrongLDelim:hn,emStrongRDelimAst:bn,emStrongRDelimUnd:wn,link:Lt(/^!?\[(label)\]\((.*?)\)/).replace("label",Rn).getRegex(),reflink:Lt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Rn).getRegex()},Hn={...Wn,emStrongRDelimAst:gn,emStrongLDelim:pn,delLDelim:vn,delRDelim:kn,url:Lt(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Un).replace("protocol",qn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Lt(/^(?:[A-Za-z0-9.+-]+(?=@)|[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",qn).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",Pt?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},Bn={...Hn,br:Lt(nn).replace("{2,}","*").getRegex(),text:Lt(Hn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Gn={normal:Xt,gfm:en,pedantic:tn},Vn={normal:Wn,gfm:Hn,breaks:Bn,pedantic:Fn},Jn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zn=e=>Jn[e];function Kn(e,t){if(t){if(It.escapeTest.test(e))return e.replace(It.escapeReplace,Zn)}else if(It.escapeTestNoEncode.test(e))return e.replace(It.escapeReplaceNoEncode,Zn);return e}function Yn(e){try{e=encodeURI(e).replace(It.percentDecode,"%")}catch{return null}return e}function Xn(e,t){let n=e.replace(It.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(It.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(It.slashPipe,"|");return n}function Qn(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){if(e.charAt(r-i-1)!==t)break;i++}return e.slice(0,r-i)}function er(e){let t=e.split("\n"),n=t.length-1;for(;n>=0&&It.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join("\n")}function tr(e){return e.trim().replace(It.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function nr(e,t){if(-1===e.indexOf(t[0])&&-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var rr=new WeakMap;function ir(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let i=0;i<r;i++){let s=e[i];if("*"!==s&&"_"!==s&&"~"!==s)continue;let o=0===i?"\n":e[i-1],a=i+1;for(;a<r&&e[a]===s;)a++;" "!==o&&"\t"!==o&&"\n"!==o&&"\r"!==o&&"\f"!==o&&("~"===s?n=i:t[s]=i),i=a-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function sr(e,t,n){let r=rr.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:ir(t).lastPossibleEmStrongCloserIndex[n]}function or(e,t){let n=rr.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:ir(t).lastPossibleDelCloserIndex}function ar(e,t=0){let n=t,r="";for(let t of e)if("\t"===t){let e=4-n%4;r+=" ".repeat(e),n+=e}else r+=t,n++;return r}function cr(e){let t,n=!1;return e.map(e=>{if(n)return e;let{depth:r,expanded:i,keptIndent:s,content:o}=function(e,t){let n=0,r=0,i=0,s=0,o="";for(;i<t;){let t=n,a=r;for(;" "===e[t]||"\t"===e[t];)a+=lr(e[t],a),t++;if(">"!==e[t]||a-s>3)break;o+=" ".repeat(a-r)+">",i++,n=t+1,r=a+1,s=" "===e[n]||"\t"===e[n]?r+1:r}if(0===i)return{depth:i,expanded:e,keptIndent:e,content:e};let a="",c="";for(;(" "===e[n]||"\t"===e[n])&&r<s+4;){let t=lr(e[n],r);a+=" ".repeat(t),c+=r<s&&t>1?" ".repeat(t):e[n],r+=t,n++}let l=e.slice(n);return{depth:i,expanded:o+a+l,keptIndent:o+c+l,content:" ".repeat(Math.max(0,r-s))+l}}(e,t?.depth??1/0);if(t?.depth!==r&&(t=void 0),t){let e=It.blockquoteFenceClose.exec(o)?.[1];return!e||e[0]!==t.marker[0]||e.length<t.marker.length?s:(t=void 0,i)}if(n=It.blockquoteListItemStart.test(o),n)return e;let a=It.blockquoteFenceOpen.exec(o)?.[1];return a&&(t={marker:a,depth:r}),i}).join("\n")}function lr(e,t){return"\t"===e?4-t%4:1}function dr(e,t,n,r,i){let s=t.href,o=t.title||null,a=function(e,t){let n="";for(let r=0;r<e.length;r++){if("`"===e[r]){let i=t.inline.code.exec(e.slice(r));if(i){n+=i[0],r+=i[0].length-1;continue}}"\\"!==e[r]||"["!==e[r+1]&&"]"!==e[r+1]?n+=e[r]:(n+=e[r+1],r++)}return n}(e[1],i),c="!"===e[0].charAt(0),l=r.state.inLink,d=r.state.linkEmitted,u=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let p=r.inlineTokens(a),h=r.state.linkEmitted;if(r.state.linkEmitted=d,r.state.inLink=l,!c){if(h)return void(r.state.inRawBlock=u);r.state.linkEmitted=!0}return{type:c?"image":"link",raw:n,href:s,title:o,text:a,tokens:p}}function ur(e,t,n,r){if(!t.includes("<"))return!1;for(let i=0;i<t.length;i++){if("\\"===t[i]){i++;continue}if("`"===t[i]){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if("<"!==t[i])continue;let s=e.slice(n+i),o=r.inline.tag.exec(s)||r.inline.autolink.exec(s);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var pr=class{options;rules;lexer;constructor(e){this.options=e||Tt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:er(t[0]),n=e.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split("\n").map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join("\n")}(e,t[3]||"",this.rules);return void 0!==t[3]&&(""===n||n.endsWith("\n"))&&(n+="\n"),{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Qn(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:"heading",raw:Qn(t[0],"\n"),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Qn(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Qn(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,s=!1,o=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))o.push(e[t]),s=!0;else{if(s)break;o.push(e[t])}e=e.slice(t);let a=o.join("\n"),c=(this.lexer.state.top&&!this.lexer.state.inBlockquote&&a.includes("\t")?cr(o):a).replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>n.startsWith(" ")?t+" "+n.slice(1):t+ar(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${c}`:c;let l=this.lexer.state.top,d=this.lexer.state.inBlockquote;if(this.lexer.state.top=!0,this.lexer.state.inBlockquote=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,this.lexer.state.inBlockquote=d,0===e.length)break;let u=i.at(-1);if("code"===u?.type||"heading"===u?.type||"hr"===u?.type||"html"===u?.type||"table"===u?.type)break;if("blockquote"===u?.type){let t=u,s=e.join("\n"),o=t.raw+"\n"+s.replace(this.rules.other.blockquoteSetextReplace2,"");this.lexer.state.inBlockquote=!0;let a=this.blockquote(o);this.lexer.state.inBlockquote=d,i[i.length-1]=a;let c=o.substring(a.raw.length).replace(/^\n/,""),l=c?c.split("\n").length:0,p=l?e.slice(0,-l):e;if(p.length>0&&(n=`${n}\n${p.join("\n")}`),r=r.substring(0,r.length-t.text.length)+a.text,e=e.slice(p.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if("list"===u?.type){let t=u,s=t.raw+"\n"+e.join("\n"),o=this.list(s);i[i.length-1]=o;let a=o.raw.length>t.raw.length?s.slice(t.raw.length+1,o.raw.length).split("\n").length:0;if(a>0){let t=e.slice(0,a).join("\n");n=`${n}\n${t}`,r=`${r}\n${t}`}if(e=e.slice(a),e.length>0&&!this.rules.other.blockquoteStart.test(e[0]))break;continue}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&"text"===this.lexer.state.lastToken?.type&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,i=t[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let a=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,s="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let d=t[2].split("\n",1)[0],u=t[1].length,p=this.options.pedantic?ar(d,u):d.replace(this.rules.other.leadingSpaceTab,e=>ar(e,u)),h=e.split("\n",1)[0],f=!p.trim(),m=0;if(this.options.pedantic?(m=2,s=p.trimStart()):f?m=u+1:(m=p.search(this.rules.other.nonSpaceChar),m=m>4?1:m,s=p.slice(m),m+=u),f&&this.rules.other.blankLine.test(h)&&(e=e.substring(h.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(m),n=this.rules.other.hrRegex(m),r=this.rules.other.fencesBeginRegex(m),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(m):this.rules.other.headingBeginRegex(m),o=this.rules.other.htmlBeginRegex(m),a=this.rules.other.blockquoteBeginRegex(m),c=!1;for(;e;){let l,d=e.split("\n",1)[0];if(h=d,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),l=h):l=h.replace(this.rules.other.leadingSpaceTab,e=>ar(e)),r.test(h)||i.test(h)||o.test(h)||a.test(h)||t.test(h)||n.test(h))break;if(l.search(this.rules.other.nonSpaceChar)>=m||!h.trim())s+="\n"+l.slice(m),c=!1;else{if(f)break;let e=p;if(!this.options.pedantic&&!s.includes("\n")&&!p.includes("\t")){let t;for(;!n.test(e)&&(t=this.rules.other.nestedBlockMarker.exec(e));)e=e.slice(t[0].length);if(!e.trim())break}if(e.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||r.test(e)||i.test(e)||o.test(e)||n.test(e))break;if(!this.options.pedantic&&!c){let e=p.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(e)||this.rules.block.heading.test(e)||this.rules.block.hr.test(e))break}s+="\n"+(!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(h)&&this.rules.block.lheading.test(`${p}\n${h}`)?` ${l.replace(/^ {0,3}/,"")}`:h),c=!0}f=!h.trim(),e=e.substring(d.length+1),p=l.slice(m)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]})}let l=o.items.at(-1);if(!l)return;l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd(),o.raw=n.slice(0,r()).trimEnd();let d=[];for(let e of o.items)if(this.lexer.state.top=!1,d.push(this.lexer.inlineQueue.length),e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));o.loose=n}for(let e=0;e<o.items.length;e++){let t=o.items[e],n=t.tokens[0];if(!t.task||"text"!==n?.type&&"paragraph"!==n?.type)t.task&&(t.task=!1);else{t.text=t.text.replace(this.rules.other.listReplaceTask,""),n.raw=n.raw.replace(this.rules.other.listReplaceTask,""),n.text=n.text.replace(this.rules.other.listReplaceTask,"");let r=this.lexer.inlineQueue;for(let t=d[e];t<r.length;t++)if(r[t].tokens===n.tokens){r[t].src=r[t].src.replace(this.rules.other.listReplaceTask,"");break}let i=this.rules.other.listTaskCheckbox.exec(t.raw);if(i){let e={type:"checkbox",raw:i[0]+" ",checked:"[ ]"!==i[0]};t.checked=e.checked,o.loose?t.tokens[0]&&["paragraph","text"].includes(t.tokens[0].type)&&"tokens"in t.tokens[0]&&t.tokens[0].tokens?(t.tokens[0].raw=e.raw+t.tokens[0].raw,t.tokens[0].text=e.raw+t.tokens[0].text,t.tokens[0].tokens.unshift(e)):t.tokens.unshift({type:"paragraph",raw:e.raw,text:e.raw,tokens:[e]}):t.tokens.unshift(e)}}}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){if("paragraph"===this.lexer.state.lastToken?.type&&!this.rules.other.htmlBeginRegex(4).test(e))return;let n=er(t[0]);return{type:"html",block:!0,raw:n,pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&-1!==nr(t[2],"()"))return;let e=tr(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$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:Qn(t[0],"\n"),href:n,title:r}}}table(e){let t,n;if(this.options.gfm&&!this.options.pedantic){let r=this.rules.other.tableHeader.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2])||(t=Xn(r[1]),n=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),t.length!==n.length))return}let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;t??=Xn(r[1]),n??=r[2].replace(this.rules.other.tableAlignChars,"").split("|");let i=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:Qn(r[0],"\n"),header:[],align:[],rows:[]};if(t.length===n.length){for(let e of n)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<t.length;e++)s.header.push({text:t[e],tokens:this.lexer.inline(t[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(Xn(e,s.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:Qn(t[0],"\n"),depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let 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){let t=this.rules.block.text.exec(e);if(t){let n=t[0],r=t[0],i=this.rules.other.textIndentedContinuation.exec(e.slice(n.length));return i&&(n+=i[0],r+=i[0].replace(this.rules.other.codeRemoveIndent,"")),{type:"text",raw:n,text:r,tokens:this.lexer.inline(r)}}}escape(e){if(92!==e.charCodeAt(0))return;let t=this.rules.inline.escape.exec(e);return t?{type:"escape",raw:t[0],text:t[1]}:void 0}tag(e){if(60!==e.charCodeAt(0))return;let t=this.rules.inline.tag.exec(e);return t?(!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.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]}):void 0}link(e){if(!1===this.lexer.state.linkParenPossible)return;let t=e.charCodeAt(0);if(91!==t&&33!==t)return;let n=this.rules.inline.link.exec(e);if(n){let t="!"===n[0].charAt(0)?2:1;if(!this.options.pedantic&&ur(e,n[1],t,this.rules))return;let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Qn(r.slice(0,-1),"\\");if((r.length-e.length)%2==0)return}else{let e=nr(n[2],"()");if(-2===e)return;if(e>-1){let t=(0===n[0].indexOf("!")?5:4)+n[1].length+e;n[2]=n[2].substring(0,e),n[0]=n[0].substring(0,t).trim(),n[3]=""}}let i=Qn(n[0].slice(0,-1),"\\");if((n[0].length-i.length)%2==0)return;let s=n[2],o="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(s);e&&(s=e[1],o=e[3])}else o=n[3]?n[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(s=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s.slice(1):s.slice(1,-1)),dr(n,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,t){let n,r=e.charCodeAt(0);if((91===r||33===r)&&((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e)))){let r="!"===n[0].charAt(0)?2:1;if(!this.options.pedantic&&ur(e,n[1],r,this.rules))return;let i=t[tr(n[2]||n[1])];if(!i){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return dr(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],s=n===i,o=t.length-e.length,a=o;for(;!this.options.pedantic&&a>0&&t[a-1]===i;)a--;let c=[...t.slice(Math.max(0,a-2),a)].at(-1)??"",l="*"===c||"_"===c||!!this.rules.inline.punctuation.exec(c);a<o&&(n=c);let d=a<o?l:"*"===n||"_"===n||!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let u=r[1]||r[3]||"";if(!u||!n||d){let n,d,p=[...r[0]].length-1,h=p,f=0,m=o-a+p,g=!(this.options.pedantic||!c.trim()||!u&&("*"!==i||l));if("*"!==i&&"_"!==i)return;let b="*"===i?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,y=sr(this,t,i),w=t.length-e.length+p;if(y<w)return;t=t.slice(-1*e.length+p);let v=y-w;for(b.lastIndex=0;null!==(r=b.exec(t))&&!(r.index>v);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(d=[...n].length,r[3]||r[4]){h+=d;continue}if((r[5]||r[6]||g)&&m%3&&!((m+d)%3)){if(s&&(r[5]||r[6]))break;f+=d;continue}if(h-=d,h>0)continue;d=Math.min(d,d+h+f);let t=[...r[0]][0].length,i=e.slice(0,p+r.index+t+d);if(Math.min(p,d)%2){let e=i.slice(1,-1);return{type:"em",raw:i,text:e,tokens:this.lexer.inlineTokens(e)}}let o=i.slice(2,-2);return{type:"strong",raw:i,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){if(96!==e.charCodeAt(0))return;let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=e.charCodeAt(0);if(32!==t&&92!==t&&10!==t)return;let n=this.rules.inline.br.exec(e);return n?{type:"br",raw:n[0]}:void 0}del(e,t,n=""){if(126!==e.charCodeAt(0))return;let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n,i,s=[...r[0]].length-1,o=s,a=this.rules.inline.delRDelim,c=or(this,t),l=t.length-e.length+s;if(c<l)return;t=t.slice(-1*e.length+s);let d=c-l;for(a.lastIndex=0;null!==(r=a.exec(t))&&!(r.index>d);){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(i=[...n].length,i!==s))continue;if(r[3]||r[4]){o+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o);let t=[...r[0]][0].length,a=e.slice(0,s+r.index+t+i),c=a.slice(s,-s);return{type:"del",raw:a,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){if(60!==e.charCodeAt(0))return;let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,autolink:!0,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=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=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:e?t[0]:(n=t[0],It.numericCharacterReference.test(n)?n.replace(It.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(void 0===t&&void 0===n)return"&amp;";let r=void 0===t?Number.parseInt(n,16):Number.parseInt(t,10);return 0===r||r>1114111||r>=55296&&r<=57343?"�":38===r?"&amp;":String.fromCodePoint(r)}):n),escaped:e}}var n}},hr=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Tt,this.options.tokenizer=this.options.tokenizer||new pr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0,inBlockquote:!1};let t={other:It,block:Gn.normal,inline:Vn.normal};this.options.pedantic?(t.block=Gn.pedantic,t.inline=Vn.pedantic):this.options.gfm&&(t.block=Gn.gfm,this.options.breaks?t.inline=Vn.breaks:t.inline=Vn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Gn,inline:Vn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(It.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this;let r=this.state.lastToken;this.options.pedantic&&(e=e.replace(It.tabCharGlobal," ").replace(It.spaceLine,""));let i,s=1/0,o=this.options.gfm&&!this.options.pedantic&&this.tokenizer.paragraph===pr.prototype.paragraph;for(;e;){if(!(e.length<s)){this.infiniteLoopError(e.charCodeAt(0));break}let r;if(s=e.length,this.state.lastToken=t.at(-1),this.options.extensions?.block?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(a=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let s=t.at(-1);(n||s===i&&o)&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text,i=s):(t.push(r),i=r),n=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&"!"!==e.charAt(n.index-1))return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf("[");if("!"!==e.charAt(0)&&Object.hasOwn(this.tokens.links,tr(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=e.includes(")");try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes("*")||e.includes("_")||e.includes("~"),r=n||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==pr.prototype.emStrong||this.tokenizer.del!==pr.prototype.del?this.#t(e):e;if(!n)return this.#n(e,r,t);!function(e,t){let n=ir(t),r=rr.get(e);r?r.push(n):rr.set(e,[n])}(this.tokenizer,r);try{return this.#n(e,r,t)}finally{!function(e){let t=rr.get(e);t&&(t.pop(),0===t.length&&rr.delete(e))}(this.tokenizer)}}#n(e,t,n){let r=!1,i="",s=1/0;for(;e;){if(!(e.length<s)){this.infiniteLoopError(e.charCodeAt(0));break}let o;if(s=e.length,r||(i=""),r=!1,this.options.extensions?.inline?.some(t=>!!(o=t.call({lexer:this},e,n))&&(e=e.substring(o.raw.length),n.push(o),!0)))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);"text"===o.type&&"text"===t?.type?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}let a=e[0];if("*"===a||"_"===a){let s=t.length-e.length;if(sr(this.tokenizer,t,a)<=s){let t=1;for(;t<e.length&&e.charCodeAt(t)===a.charCodeAt(0);)t++;let s=e.substring(0,t),o=n.at(-1);"text"!==o?.type||o.escaped?n.push({type:"text",raw:s,text:s,escaped:!1}):(o.raw+=s,o.text+=s),e=e.substring(t),i=a,r=!0;continue}}else if("~"===a){let s=t.length-e.length;if(or(this.tokenizer,t)<=s){let t=1;for(;t<e.length&&126===e.charCodeAt(t);)t++;let s=e.substring(0,t),o=n.at(-1);"text"!==o?.type||o.escaped?n.push({type:"text",raw:s,text:s,escaped:!1}):(o.raw+=s,o.text+=s),e=e.substring(t),i=a,r=!0;continue}}if(o=this.tokenizer.emStrong(e,t,i)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e,t,i)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let c=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(c=e.substring(0,n+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);"text"===t?.type?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#r(e){let t,{blockSkip:n,tag:r,autolink:i}=this.tokenizer.rules.inline,s="",o=0;for(n.lastIndex=0;t=n.exec(e);){let a=t.index+(t[2]?t[2].length:0),c=t.index+t[0].length;if("<"===e.charAt(a)){let t=e.slice(a),s=r.exec(t)||i.exec(t);if(!s){n.lastIndex=a+1;continue}c=a+s[0].length,n.lastIndex=c}s+=e.slice(o,a)+"["+"a".repeat(c-a-2)+"]",o=c}return s+e.slice(o)}#t(e){let t=e;if(this.tokens.links&&e.includes("[")){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,tr(t.slice(r+1,-1))))return t;if(r>1&&"!"!==t.charAt(0)){let i=t.slice(1,r-1);if(this.linkInText(i))return"["+i.replace(e,n)+"]["+"a".repeat(t.length-r-2)+"]"}return"["+"a".repeat(t.length-2)+"]"};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?"+".repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,"+")+t:e),t=this.#r(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(!this.options.silent)throw new Error(t);console.error(t)}};function fr(e){return e.map(e=>"codespan"===e.type||"escape"===e.type?{...e,text:Kn(e.text,!0)}:"tokens"in e&&e.tokens?{...e,tokens:fr(e.tokens)}:e)}var mr=class{options;parser;constructor(e){this.options=e||Tt}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(It.notSpaceStart)?.[0],i=e?e.replace(It.endingNewline,"")+"\n":"";return r?'<pre><code class="language-'+Kn(r)+'">'+(n?i:Kn(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Kn(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Kn(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let s=i?Kn(n,!0):this.parser.parseInline(r),o=Yn(e);if(null===o)return s;let a='<a href="'+(e=Kn(o,i))+'"';return t&&(a+=' title="'+Kn(t)+'"'),a+=">"+s+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(fr(r),this.parser.textRenderer));let i=Yn(e);if(null===i)return Kn(n);let s=`<img src="${Kn(e=i)}" alt="${Kn(n)}"`;return t&&(s+=` title="${Kn(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Kn(e.text)}},gr=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return"\n"}checkbox({raw:e}){return e}},br=class e{options;renderer;textRenderer;constructor(e){this.options=e||Tt,this.options.renderer=this.options.renderer||new mr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new gr,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n],i=this.options.extensions?.renderers;if(i&&Object.hasOwn(i,r.type)&&i[r.type]){let e=r,n=i[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(e.type)){t+=!1===n?"":n??"";continue}}let s=r;switch(s.type){case"space":t+=this.renderer.space(s);break;case"hr":t+=this.renderer.hr(s);break;case"heading":t+=this.renderer.heading(s);break;case"code":t+=this.renderer.code(s);break;case"table":t+=this.renderer.table(s);break;case"blockquote":t+=this.renderer.blockquote(s);break;case"list":t+=this.renderer.list(s);break;case"checkbox":t+=this.renderer.checkbox(s);break;case"html":t+=this.renderer.html(s);break;case"def":t+=this.renderer.def(s);break;case"paragraph":t+=this.renderer.paragraph(s);break;case"text":t+=this.renderer.text(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r],s=this.options.extensions?.renderers;if(s&&Object.hasOwn(s,i.type)&&s[i.type]){let e=s[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){n+=!1===e?"":e??"";continue}}let o=i;switch(o.type){case"escape":case"text":n+=t.text(o);break;case"html":n+=t.html(o);break;case"link":n+=t.link(o);break;case"image":n+=t.image(o);break;case"checkbox":n+=t.checkbox(o);break;case"strong":n+=t.strong(o);break;case"em":n+=t.em(o);break;case"codespan":n+=t.codespan(o);break;case"br":n+=t.br(o);break;case"del":n+=t.del(o);break;default:{let e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},yr=class{options;block;constructor(e){this.options=e||Tt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?hr.lex:hr.lexInline}provideParser(e=this.block){return e?br.parse:br.parseInline}};function wr(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var vr=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=br;Renderer=mr;TextRenderer=gr;Lexer=hr;Tokenizer=pr;Hooks=yr;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(wr(n,t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)wr(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)wr(n,this.walkTokens(e.tokens,t));break}case"list":{let e=r;wr(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{if(e[r]){let i=e[r].flat(1/0);wr(n,this.walkTokens(i,t))}}):e.tokens&&wr(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let 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){let 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'");let 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){let t=this.defaults.renderer||new mr(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),!1===n?"":n??""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new pr(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new yr;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,i=e.hooks[r],s=t[r];yr.passThroughHooks.has(n)?t[r]=e=>{if(t.options.async&&yr.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return s.call(t,n)})();let r=i.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{if(t.options.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await s.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return wr(n,r.call(this,e)),t&&wr(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return hr.lex(e,t??this.defaults)}parser(e,t){return br.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?hr.lex:hr.lexInline)(n,i),s=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(s,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?br.parse:br.parseInline)(s,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?hr.lex:hr.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?br.parse:br.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Kn(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function kr(e,t){return vr.parse(e,t)}function $r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}kr.options=kr.setOptions=function(e){return vr.setOptions(e),kr.defaults=vr.defaults,Rt(kr.defaults),kr},kr.getDefaults=_t,kr.defaults=Tt,kr.use=function(...e){return vr.use(...e),kr.defaults=vr.defaults,Rt(kr.defaults),kr},kr.walkTokens=function(e,t){return vr.walkTokens(e,t)},kr.parseInline=vr.parseInline,kr.Parser=br,kr.parser=br.parse,kr.Renderer=mr,kr.TextRenderer=gr,kr.Lexer=hr,kr.lexer=hr.lex,kr.Tokenizer=pr,kr.Hooks=yr,kr.parse=kr,kr.options,kr.setOptions,kr.walkTokens,kr.parseInline,br.parse,hr.lex;var xr,Cr={exports:{}};var Sr,_r=(xr||(xr=1,Sr=Cr,function(e,t){Sr.exports=t()}(0,function(){var e=[],t=[],n={},r={},i={};function s(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function o(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],function(n,r){var i,s,a=(i=t[1],s=arguments,i.replace(/\$(\d{1,2})/g,function(e,t){return s[t]||""}));return o(""===n?e[r-1]:n,a)})}function c(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var i=r.length;i--;){var s=r[i];if(s[0].test(t))return a(t,s)}return t}function l(e,t,n){return function(r){var i=r.toLowerCase();return t.hasOwnProperty(i)?o(r,i):e.hasOwnProperty(i)?o(r,e[i]):c(i,r,n)}}function d(e,t,n,r){return function(r){var i=r.toLowerCase();return!!t.hasOwnProperty(i)||!e.hasOwnProperty(i)&&c(i,i,n)===i}}function u(e,t,n){return(n?t+" ":"")+(1===t?u.singular(e):u.plural(e))}return u.plural=l(i,r,e),u.isPlural=d(i,r,e),u.singular=l(r,i,t),u.isSingular=d(r,i,t),u.addPluralRule=function(t,n){e.push([s(t),n])},u.addSingularRule=function(e,n){t.push([s(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(),i[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})),Cr.exports),Tr=$r(_r),Rr=function(e){var t={};try{t.WeakMap=WeakMap}catch(d){t.WeakMap=function(e,t){var n=t.defineProperty,r=t.hasOwnProperty,i=s.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},s;function s(t){n(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(o,this)}function o(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=i.prototype;function i(){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=i}(Math.random(),Object.defineProperty)}function i(e,t,n,r,i,s){for(var o=("selectedIndex"in t),a=o;r<i;){var c,l=e(n[r],1);t.insertBefore(l,s),o&&a&&l.selected&&(a=!a,c=t.selectedIndex,t.selectedIndex=c<0?r:u.call(t.querySelectorAll("option"),l)),r++}}function s(e,t){return e==t}function o(e){return e}function a(e,t,n,r,i,s,o){var a=s-i;if(a<1)return-1;for(;a<=n-t;){for(var c=t,l=i;c<n&&l<s&&o(e[c],r[l]);)c++,l++;if(l===s)return t;t=c+1}return-1}function c(e,t,n,r,i){return n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:i}function l(e,t,n,r){for(;n<r;)h(e(t[n++],-1))}var d=r.WeakSet,u=[].indexOf,p=function(e,t,n){for(var r=1,i=t;r<i;){var s=(r+i)/2>>>0;n<e[s]?i=s:r=1+s}return r},h=function(e){return(e.remove||function(){var e=this.parentNode;e&&e.removeChild(this)}).call(e)};function f(e,t,n,r){for(var d=(r=r||{}).compare||s,u=r.node||o,h=null==r.before?null:u(r.before,0),f=t.length,m=f,g=0,b=n.length,y=0;g<m&&y<b&&d(t[g],n[y]);)g++,y++;for(;g<m&&y<b&&d(t[m-1],n[b-1]);)m--,b--;var w=g===m,v=y===b;if(w&&v)return n;if(w&&y<b)return i(u,e,n,y,b,c(u,t,g,f,h)),n;if(v&&g<m)return l(u,t,g,m),n;var k=m-g,$=b-y,x=-1;if(k<$){if(-1<(x=a(n,y,b,t,g,m,d)))return i(u,e,n,y,x,u(t[g],0)),i(u,e,n,x+k,b,c(u,t,m,f,h)),n}else if($<k&&-1<(x=a(t,g,m,n,y,b,d)))return l(u,t,g,x),l(u,t,x+$,m),n;return k<2||$<2?(i(u,e,n,y,b,u(t[g],0)),l(u,t,g,m)):k==$&&function(e,t,n,r,i,s){for(;r<i&&s(n[r],e[t-1]);)r++,t--;return 0===t}(n,b,t,g,m,d)?i(u,e,n,y,b,c(u,t,m,f,h)):function(e,t,n,r,s,o,a,c,d,u,h,f,m){!function(e,t,n,r,s,o,a,c,d){for(var u=[],p=e.length,h=a,f=0;f<p;)switch(e[f++]){case 0:s++,h++;break;case 1:u.push(r[s]),i(t,n,r,s++,s,h<c?t(o[h],0):d);break;case-1:h++}for(f=0;f<p;)switch(e[f++]){case 0:a++;break;case-1:-1<u.indexOf(o[a])?a++:l(t,o,a++,a)}}(function(e,t,n,r,i,s,o){var a,c,l,d,u,p,h=n+s,f=[];e:for(b=0;b<=h;b++){if(50<b)return null;for(p=b-1,d=b?f[b-1]:[0,0],u=f[b]=[],a=-b;a<=b;a+=2){for(c=(l=a===-b||a!==b&&d[p+a-1]<d[p+a+1]?d[p+a+1]:d[p+a-1]+1)-a;l<s&&c<n&&o(r[i+l],e[t+c]);)l++,c++;if(l===s&&c===n)break e;u[b+a]=l}}for(var m=Array(b/2+h/2),g=m.length-1,b=f.length-1;0<=b;b--){for(;0<l&&0<c&&o(r[i+l-1],e[t+c-1]);)m[g--]=0,l--,c--;if(!b)break;p=b-1,d=b?f[b-1]:[0,0],(a=l-c)===-b||a!==b&&d[p+a-1]<d[p+a+1]?(c--,m[g--]=1):(l--,m[g--]=-1)}return m}(n,r,o,a,c,u,f)||function(e,t,n,r,i,s,o,a){var c=0,l=r<a?r:a,d=Array(l++),u=Array(l);u[0]=-1;for(var h=1;h<l;h++)u[h]=o;for(var f=i.slice(s,o),m=t;m<n;m++){var g,b=f.indexOf(e[m]);-1<b&&-1<(c=p(u,l,g=b+s))&&(u[c]=g,d[c]={newi:m,oldi:g,prev:d[c-1]})}for(c=--l,--o;u[c]>o;)--c;l=a+r-c;var y=Array(l),w=d[c];for(--n;w;){for(var v=w.newi,k=w.oldi;v<n;)y[--l]=1,--n;for(;k<o;)y[--l]=-1,--o;y[--l]=0,--n,--o,w=w.prev}for(;t<=n;)y[--l]=1,--n;for(;s<=o;)y[--l]=-1,--o;return y}(n,r,s,o,a,c,d,u),e,t,n,r,a,c,h,m)}(u,e,n,y,b,$,t,g,m,k,f,d,h),n}var m={};function g(t,n){n=n||{};var r=e.createEvent("CustomEvent");return r.initCustomEvent(t,!!n.bubbles,!!n.cancelable,n.detail),r}m.CustomEvent="function"==typeof CustomEvent?CustomEvent:(g["prototype"]=new g("").constructor.prototype,g);var b=m.CustomEvent,y={};try{y.Map=Map}catch(d){y.Map=function(){var e=0,t=[],n=[];return{delete:function(i){var s=r(i);return s&&(t.splice(e,1),n.splice(e,1)),s},forEach:function(e,r){t.forEach(function(t,i){e.call(r,n[i],t,this)},this)},get:function(t){return r(t)?n[e]:void 0},has:r,set:function(i,s){return n[r(i)?e:t.push(i)-1]=s,this}};function r(n){return-1<(e=t.indexOf(n))}}}var w=y.Map;function v(){return this}function k(e,t){var n="_"+e+"$";return{get:function(){return this[n]||$(this,n,t.call(this,e))},set:function(e){$(this,n,e)}}}var $=function(e,t,n){return Object.defineProperty(e,t,{configurable:!0,value:"function"==typeof n?function(){return e._wire$=n.apply(this,arguments)}:n})[t]};Object.defineProperties(v.prototype,{ELEMENT_NODE:{value:1},nodeType:{value:-1}});var x,C,S,_,T,R,E={},A={},L=[],P=A.hasOwnProperty,N=0,I={attributes:E,define:function(e,t){e.indexOf("-")<0?(e in A||(N=L.push(e)),A[e]=t):E[e]=t},invoke:function(e,t){for(var n=0;n<N;n++){var r=L[n];if(P.call(e,r))return A[r](e[r],t)}}},O=Array.isArray||(C=(x={}.toString).call([]),function(e){return x.call(e)===C}),D=(S=e,_="fragment",R="content"in z(T="template")?function(e){var t=z(T);return t.innerHTML=e,t.content}:function(e){var t,n=z(_),r=z(T);return j(n,/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)?(t=RegExp.$1,r.innerHTML="<table>"+e+"</table>",r.querySelectorAll(t)):(r.innerHTML=e,r.childNodes)),n},function(e,t){return("svg"===t?function(e){var t=z(_),n=z("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",j(t,n.firstChild.childNodes),t}:R)(e)});function j(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function z(e){return e===_?S.createDocumentFragment():S.createElementNS("http://www.w3.org/1999/xhtml",e)}var M,q,U,W,F,H,B,G,V,J=(q="appendChild",U="cloneNode",W="createTextNode",H=(F="importNode")in(M=e),(B=M.createDocumentFragment())[q](M[W]("g")),B[q](M[W]("")),(H?M[F](B,!0):B[U](!0)).childNodes.length<2?function e(t,n){for(var r=t[U](),i=t.childNodes||[],s=i.length,o=0;n&&o<s;o++)r[q](e(i[o],n));return r}:H?M[F]:function(e,t){return e[U](!!t)}),Z="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},K="-"+Math.random().toFixed(6)+"%",Y=!1;try{G=e.createElement("template"),V="tabindex","content"in G&&(G.innerHTML="<p "+V+'="'+K+'"></p>',G.content.childNodes[0].getAttribute(V)==K)||(K="_dt: "+K.slice(1,-1)+";",Y=!0)}catch(d){}var X="\x3c!--"+K+"--\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,ie="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",se="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ne.replace("\\/","")+"))?)",oe=new RegExp(ie+re+se+"+)(["+te+"]*/?>)","g"),ae=new RegExp(ie+re+se+"*)(["+te+"]*/>)","g"),ce=new RegExp("("+re+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function le(e,t,n,r){return"<"+t+n.replace(ce,de)+r}function de(e,t,n){return t+(n||'"')+K+(n||'"')}function ue(e,t,n){return ee.test(t)?e:"<"+t+n+"></"+t+">"}var pe=Y?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 he(t,n,r,i){for(var s=t.childNodes,o=s.length,a=0;a<o;){var c=s[a];switch(c.nodeType){case 1:var l=i.concat(a);!function(t,n,r,i){for(var s,o=t.attributes,a=[],c=[],l=pe(o,r),d=l.length,u=0;u<d;){var p=l[u++],h=p.value===K;if(h||1<(s=p.value.split(X)).length){var f=p.name;if(a.indexOf(f)<0){a.push(f);var m=r.shift().replace(h?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+f+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),g=o[m]||o[m.toLowerCase()];if(h)n.push(fe(g,i,m,null));else{for(var b=s.length-2;b--;)r.shift();n.push(fe(g,i,m,s))}}c.push(p)}}for(var y=((u=0)<(d=c.length)&&Y&&!("ownerSVGElement"in t));u<d;){var w=c[u++];y&&(w.value=""),t.removeAttribute(w.name)}var v=t.nodeName;if(/^script$/i.test(v)){var k=e.createElement(v);for(d=o.length,u=0;u<d;)k.setAttributeNode(o[u++].cloneNode(!0));k.textContent=t.textContent,t.parentNode.replaceChild(k,t)}}(c,n,r,l),he(c,n,r,l);break;case 8:var d=c.textContent;if(d===K)r.shift(),n.push(Q.test(t.nodeName)?me(t,i):{type:"any",node:c,path:i.concat(a)});else switch(d.slice(0,2)){case"/*":if("*/"!==d.slice(-2))break;case"👻":t.removeChild(c),a--,o--}break;case 3:Q.test(t.nodeName)&&Z.call(c.textContent)===X&&(r.shift(),n.push(me(t,i)))}a++}}function fe(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function me(e,t){return{type:"text",node:e,path:t}}var ge,be=(ge=new n,{get:function(e){return ge.get(e)},set:function(e,t){return ge.set(e,t),t}});function ye(e,t){var n=(e.convert||function(e){return e.join(X).replace(ae,ue).replace(oe,le)})(t),r=e.transform;r&&(n=r(n));var i=D(n,e.type);ve(i);var s=[];return he(i,s,t.slice(0),[]),{content:i,updates:function(n){for(var r=[],i=s.length,o=0,a=0;o<i;){var c=s[o++],l=function(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var d=c.sparse,u=e.attribute(l,c.name,c.node);null===d?r.push({fn:u,sparse:!1}):(a+=d.length-2,r.push({fn:u,sparse:!0,values:d}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return i+=a,function(){var e=arguments.length;if(i!==e-1)throw new Error(e-1+" values instead of "+i+"\n"+t.join("${value}"));for(var s=1,o=1;s<e;){var a=r[s-o];if(a.sparse){var c=a.values,l=c[0],d=1,u=c.length;for(o+=u-2;d<u;)l+=arguments[s++]+c[d++];a.fn(l)}else a.fn(arguments[s++])}return n}}}}var we=[];function ve(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===Z.call(r.textContent).length&&e.removeChild(r)}}var ke,$e,xe=(ke=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,$e=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Se(n,!0)}(e,t):Se(e.style,!1)});function Ce(e,t,n){return t+"-"+n.toLowerCase()}function Se(e,t){var n,r;return function(i){var s,o,a,c;switch(typeof i){case"object":if(i){if("object"===n){if(!t&&r!==i)for(o in r)o in i||(e[o]="")}else t?e.value="":e.cssText="";for(o in s=t?{}:e,i)a="number"!=typeof(c=i[o])||ke.test(o)?c:c+"px",!t&&/^--/.test(o)?s.setProperty(o,a):s[o]=a;n="object",t?e.value=function(e){var t,n=[];for(t in e)n.push(t.replace($e,Ce),":",e[t],";");return n.join("")}(r=s):r=i;break}default:r!=i&&(n="string",r=i,t?e.value=i||"":e.cssText=i||"")}}}var _e,Te,Re=(_e=[].slice,(Te=Ee.prototype).ELEMENT_NODE=1,Te.nodeType=111,Te.remove=function(e){var t,n=this.childNodes,r=this.firstChild,i=this.lastChild;return this._=null,e&&2===n.length?i.parentNode.removeChild(i):((t=this.ownerDocument.createRange()).setStartBefore(e?n[1]:r),t.setEndAfter(i),t.deleteContents()),r},Te.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,s=r.length;i<s;i++)t.appendChild(r[i]);return t},Ee);function Ee(e){var t=this.childNodes=_e.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function Ae(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Ue:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case qe:return Le(e.render(),t);default:return e}}function Pe(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(Ae).then(t):Promise.resolve(I.invoke(e,t)).then(t)}function Ne(e){return null!=e&&"then"in e}var Ie,Oe,De,je,ze,Me="ownerSVGElement",qe=v.prototype.nodeType,Ue=Re.prototype.nodeType,We=(Oe=(Ie={Event:b,WeakSet:d}).Event,De=Ie.WeakSet,je=!0,ze=null,function(e){return je&&(je=!je,ze=new De,function(e){var t=new De,n=new De;try{new MutationObserver(o).observe(e,{subtree:!0,childList:!0})}catch(t){var r=0,i=[],s=function(e){i.push(e),clearTimeout(r),r=setTimeout(function(){o(i.splice(r=0,i.length))},0)};e.addEventListener("DOMNodeRemoved",function(e){s({addedNodes:[],removedNodes:[e.target]})},!0),e.addEventListener("DOMNodeInserted",function(e){s({addedNodes:[e.target],removedNodes:[]})},!0)}function o(e){for(var r,i=e.length,s=0;s<i;s++)a((r=e[s]).removedNodes,"disconnected",n,t),a(r.addedNodes,"connected",t,n)}function a(e,t,n,r){for(var i,s=new Oe(t),o=e.length,a=0;a<o;1===(i=e[a++]).nodeType&&function e(t,n,r,i,s){ze.has(t)&&!i.has(t)&&(s.delete(t),i.add(t),t.dispatchEvent(n));for(var o=t.children||[],a=o.length,c=0;c<a;e(o[c++],n,r,i,s));}(i,s,t,n,r));}}(e.ownerDocument)),ze.add(e),e}),Fe=/^(?:form|list)$/i,He=[].slice;function Be(t){return this.type=t,function(t){var n=we,r=ve;return function(i){var s,o,a;return n!==i&&(s=t,o=n=i,a=be.get(o)||be.set(o,ye(s,o)),r=a.updates(J.call(e,a.content,!0))),r.apply(null,arguments)}}(this)}var Ge=!(Be.prototype={attribute:function(e,t,n){var r,i=Me in e;if("style"===t)return xe(e,n,i);if("."===t.slice(0,1))return l=e,d=t.slice(1),i?function(e){try{l[d]=e}catch(t){l.setAttribute(d,e)}}:function(e){l[d]=e};if("?"===t.slice(0,1))return o=e,a=t.slice(1),function(e){c!==!!e&&((c=!!e)?o.setAttribute(a,""):o.removeAttribute(a))};if(/^on/.test(t)){var s=t.slice(2);return"connected"===s||"disconnected"===s?We(e):t.toLowerCase()in e&&(s=s.toLowerCase()),function(t){r!==t&&(r&&e.removeEventListener(s,r,!1),(r=t)&&e.addEventListener(s,t,!1))}}if("data"===t||!i&&t in e&&!Fe.test(t))return function(n){r!==n&&(r=n,e[t]!==n&&null==n?(e[t]="",e.removeAttribute(t)):e[t]=n)};if(t in I.attributes)return function(n){var i=I.attributes[t](e,n);r!==i&&(null==(r=i)?e.removeAttribute(t):e.setAttribute(t,i))};var o,a,c,l,d,u=!1,p=n.cloneNode(!0);return function(t){r!==t&&(r=t,p.value!==t&&(null==t?(u&&(u=!1,e.removeAttributeNode(p)),p.value=t):(p.value=t,u||(u=!0,e.setAttributeNode(p)))))}},any:function(e,t){var n,r={node:Le,before:e},i=Me in e?"svg":"html",s=!1;return function o(a){switch(typeof a){case"string":case"number":case"boolean":s?n!==a&&(n=a,t[0].textContent=a):(s=!0,n=a,t=f(e.parentNode,t,[(c=a,e.ownerDocument.createTextNode(c))],r));break;case"function":o(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=f(e.parentNode,t,[],r);break}default:if(s=!1,O(n=a))if(0===a.length)t.length&&(t=f(e.parentNode,t,[],r));else switch(typeof a[0]){case"string":case"number":case"boolean":o({html:a});break;case"object":if(O(a[0])&&(a=a.concat.apply([],a)),Ne(a[0])){Promise.all(a).then(o);break}default:t=f(e.parentNode,t,a,r)}else"ELEMENT_NODE"in a?t=f(e.parentNode,t,11===a.nodeType?He.call(a.childNodes):[a],r):Ne(a)?a.then(o):"placeholder"in a?Pe(a,o):"text"in a?o(String(a.text)):"any"in a?o(a.any):"html"in a?t=f(e.parentNode,t,He.call(D([].concat(a.html).join(""),i).childNodes),r):o("length"in a?He.call(a):I.invoke(a,o))}var c}},text:function(e){var t;return function n(r){var i;t!==r&&("object"==(i=typeof(t=r))&&r?Ne(r)?r.then(n):"placeholder"in r?Pe(r,n):n("text"in r?String(r.text):"any"in r?r.any:"html"in r?[].concat(r.html).join(""):"length"in r?He.call(r).join(""):I.invoke(r,n)):"function"==i?n(r(e)):e.textContent=null==r?"":r)}}}),Ve=function(t){var r,i,s,o,a=(r=(e.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(r)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(r)),c=!("raw"in t)||t.propertyIsEnumerable("raw")||!Object.isFrozen(t.raw);return a||c?(i={},s=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return i[t]||(i[t]=e)},Ve=c?s:(o=new n,function(e){return o.get(e)||(n=s(t=e),o.set(t,n),n);var t,n})):Ge=!0,Je(t)};function Je(e){return Ge?e:Ve(e)}function Ze(e){for(var t=arguments.length,n=[Je(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ke=new n,Ye=function(e){var t,n,r;return function(){var i=Ze.apply(null,arguments);return r!==i[0]?(r=i[0],n=new Be(e),t=Qe(n.apply(n,i))):n.apply(n,i),t}},Xe=function(e,t){var n=t.indexOf(":"),r=Ke.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ke.set(e,r={}),r[i]||(r[i]=Ye(t))},Qe=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new Re(t):e},et=new n;function tt(){var e=et.get(this),t=Ze.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Be(Me in this?"svg":"html");et.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))}.apply(this,t),this}var nt,rt,it,st,ot=I.define,at=Be.prototype;function ct(e){return arguments.length<2?null==e?Ye("html"):"string"==typeof e?ct.wire(null,e):"raw"in e?Ye("html")(e):"nodeType"in e?ct.bind(e):Xe(e,"html"):("raw"in e?Ye("html"):ct.wire).apply(null,arguments)}return ct.Component=v,ct.bind=function(e){return tt.bind(e)},ct.define=ot,ct.diff=f,(ct.hyper=ct).observe=We,ct.tagger=at,ct.wire=function(e,t){return null==e?Ye(t||"html"):Xe(e,t||"html")},ct._={WeakMap:n,WeakSet:d},nt=Ye,rt=new n,it=Object.create,st=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(v,{for:{configurable:!0,value:function(e,t){return function(e,t,r,i){var s,o,a,c=t.get(e)||st(e,t);switch(typeof i){case"object":case"function":var l=c.w||(c.w=new n);return l.get(i)||(s=l,o=i,a=new e(r),s.set(o,a),a);default:var d=c.p||(c.p=it(null));return d[i]||(d[i]=new e(r))}}(this,rt.get(e)||(r=e,i=new w,rt.set(r,i),i),e,null==t?"default":t);var r,i}}}),Object.defineProperties(v.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:k("html",nt),svg:k("svg",nt),state:k("state",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new b(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),ct}(document);const{Component:Er,bind:Ar,define:Lr,diff:Pr,hyper:Nr,wire:Ir}=Rr,Or=Rr,Dr=R,jr=kr,zr=class{constructor(e){const{type:t,subtype:n,params:r}=function(e){if(e=e.trim(),!e)throw new TypeError("Invalid input.");let t="",n="",r="",i=null,s=new Map,o="type",a=Array.from(e);for(let e=0;e<a.length;e++){const c=a[e];switch(o){case"type":if("/"===c){o="subtype";continue}t+=c;break;case"subtype":if(";"===c){o="param-start";continue}n+=c;break;case"param-start":if(xt.test(c)||";"===c)continue;r+=c,o="param-name";break;case"param-name":if("="===c||";"===c){if("="===c){o="param-value",i=null;continue}s.set(r.toLowerCase(),null),r="";continue}r+=c;break;case"param-value":if('"'==c){o="collect-quoted-string";continue}if(";"===c){i=i.trimEnd(),o="param-start",St(s,r,i),r="";continue}i="string"==typeof i?i+c:c;break;case"collect-quoted-string":if('"'===c){St(s,r,i),o="ignore-input-until-next-param",r="",i=null;continue}if("\\"===c)continue;i="string"==typeof i?i+c:c;break;case"ignore-input-until-next-param":if(";"!==c)continue;o="param-start";break;default:throw new Error(`State machine error - unknown parser mode: ${o} `)}}r&&St(s,r,i);if(""===t.trim()||!$t.test(t))throw new TypeError("Invalid type");if(""===n.trim()||!$t.test(n))throw new TypeError("Invalid subtype");return{type:t,subtype:n,params:Object.fromEntries(s.entries())}}(e);this.type=t.trim().toLowerCase(),this.subtype=n.trimEnd().toLowerCase(),this.parameters=new Map(Object.entries(r))}get essence(){return`${this.type}/${this.subtype}`}toString(){return function(e){const{parameters:t,essence:n}=e;if(!t.size)return n;let r=";";for(const[e,n]of t.entries())r+=e,null!==n?$t.test(n)?r+=`=${n}`:r+=`="${n}"`:r+='=""',r+=";";return e.essence+r.slice(0,-1)}(this)}},Mr=Tr,qr=Ge,Ur=class{lexer;curToken=kt;peekToken=kt;getCurToken(){return this.curToken}getPeekToken(){return this.peekToken}constructor(e){this.lexer=new vt(e),this._nextToken(),this._nextToken()}parse(){const e=[];for(;this.getCurToken().type!==Be.EOF;){const t=this._parseRule();e.push(t)}const t=new Xe(e);return t.separator=this._nextToken(),t.setChildrenParent(),this._convertGroupDefinitions(t),t}_parseRule(){const e=this._parseTypename(!0,null),t=this._nextToken();let n;if(t.type===Be.ASSIGN||t.type===Be.GCHOICEALT){const r=this._parseGroupEntry();n=new Qe(e,t,r)}else{if(t.type!==Be.TCHOICEALT)throw this._parserError(`expected assignment (\`=\`, \`/=\`, \`//=\`) after \`${e.serialize().trim()}\`, got \`${t.serialize().trim()}\``);{const r=this._parseType();if(!(r instanceof ht))throw new Error("Expected Type instance");n=new Qe(e,t,r)}}return n}_parseGroupEntry(){const e=this._parseOccurrence(),t=this._parseType(!0);let n;if(t instanceof pt){const r=this._parseType(!1);if(!(r instanceof ht))throw new Error("Expected Type instance");n=new et(e,t,r)}else n=new et(e,null,t);return n}_parseType(e=!1){const t=[];let n=this._parseType1(e);if(t.push(n),e&&this.getCurToken().type===Be.CARET){const e=[];if(e.push(this._nextToken()),this.getCurToken().type!==Be.ARROWMAP)throw this._parserError("expected arrow map (`=>`), got `#{(this.getCurToken().serialize() + this.getPeekToken().serialize()).trim()}`");e.push(this._nextToken());return new pt(n,!0,!1,e)}if(e&&this.getCurToken().type===Be.ARROWMAP){return new pt(n,!1,!1,[this._nextToken()])}if(e&&this.getCurToken().type===Be.COLON){return new pt(n,!0,!0,[this._nextToken()])}for(;this.getCurToken().type===Be.TCHOICE;)n.separator=this._nextToken(),n=this._parseType1(),t.push(n);return new ht(t)}_parseType1(e=!1){const t=this._parseType2(e);let n;if(this.getCurToken().type===Be.INCLRANGE||this.getCurToken().type===Be.EXCLRANGE){const e=this._nextToken(),r=this._parseType2();if(!(t instanceof at||t instanceof ct))throw this._parserError(`expected range min to be a value or a typename, got \`${t.serialize().trim()}\``);if(!(r instanceof at||r instanceof ct))throw this._parserError(`expected range max to be a value or a typename, got \`${r.serialize().trim()}\``);n=new dt(t,r,e)}else if(this.getCurToken().type===Be.CTLOP){const e=this._nextToken(),r=this._parseType2();n=new ut(t,e,r)}else n=t;return n}_parseType2(e=!1){let t;if(this.getCurToken().type===Be.LPAREN){const n=this._nextToken();if(e)t=this._parseGroup(!1);else{const e=this._parseType();if(!(e instanceof ht))throw new Error("Expected Type instance");t=e}if(t.openToken=n,this.getCurToken().type!==Be.RPAREN)throw this._parserError(`expected right parenthesis, got \`${this.getCurToken().serialize().trim()}\``);t.closeToken=this._nextToken()}else if(this.getCurToken().type===Be.LBRACE){const e=this._nextToken();if(t=this._parseGroup(!0),t.openToken=e,this.getCurToken().type!==Be.RBRACE)throw this._parserError(`expected right brace, got \`${this.getCurToken().serialize()}\``);t.closeToken=this._nextToken()}else if(this.getCurToken().type===Be.LBRACK){const e=this._nextToken(),n=this._parseGroup(!1);if(t=new rt(n.groupChoices),t.openToken=e,this.getCurToken().type!==Be.RBRACK)throw this._parserError(`expected right bracket, got \`${this.getCurToken().serialize().trim()}\``);t.closeToken=this._nextToken()}else if(this.getCurToken().type===Be.TILDE){const e=this._nextToken();t=this._parseTypename(!1,e)}else if(this.getCurToken().type===Be.AMPERSAND){const e=this._nextToken();if(this.getCurToken().type===Be.LPAREN){const e=this._nextToken(),n=this._parseGroup(!1);if(n.openToken=e,this.getCurToken().type!==Be.RPAREN)throw this._parserError(`expected right parenthesis, got \`${this.getCurToken().serialize().trim()}\``);n.closeToken=this._nextToken(),t=new lt(n)}else{const e=this._parseTypename(!1,null);t=new lt(e)}t.setComments(e)}else if(this.getCurToken().type===Be.HASH){const e=this._nextToken();if(this.getCurToken().type!==Be.NUMBER&&this.getCurToken().type!==Be.FLOAT||this.getCurToken().startWithSpaces())t=new st;else{const e=this._nextToken();if(e.literal.length>1&&("."!==e.literal[1]||e.literal.includes("e")))throw this._parserError(`expected data item after "#" to match \`DIGIT ["." uint]\`, got \`${this.getCurToken().serialize().trim()}\``);if("6"!==e.literal[0]||this.getCurToken().type!==Be.LPAREN||this.getCurToken().startWithSpaces())t=new st(e);else{const n=this._parseType2();if(!(n instanceof ht))throw new Error("Expected Type instance");t=new st(e,n)}}t.setComments(e)}else if(this.getCurToken().type===Be.IDENT)t=this._parseTypename(!1,null);else if(this.getCurToken().type===Be.STRING){const e=this._nextToken();t=new at(e.literal,"text"),t.setComments(e)}else if(this.getCurToken().type===Be.BYTES){const e=this._nextToken();t=new at(e.literal,"bytes"),t.setComments(e)}else if(this.getCurToken().type===Be.HEX){const e=this._nextToken();t=new at(e.literal,"hex"),t.setComments(e)}else if(this.getCurToken().type===Be.BASE64){const e=this._nextToken();t=new at(e.literal,"base64"),t.setComments(e)}else if(this.getCurToken().type===Be.NUMBER){const e=this._nextToken();t=new at(e.literal,"number"),t.setComments(e)}else{if(this.getCurToken().type!==Be.FLOAT)throw this._parserError(`invalid type2 production, got \`${this.getCurToken().serialize().trim()}\``);{const e=this._nextToken();t=new at(e.literal,"number"),t.setComments(e)}}return t}_parseGroup(e=!1){const t=[];for(;this.getCurToken().type!==Be.RPAREN&&this.getCurToken().type!==Be.RBRACE&&this.getCurToken().type!==Be.RBRACK;){const e=[];for(;this.getCurToken().type!==Be.GCHOICE;){const t=this._parseGroupEntry();if(e.push(t),this.getCurToken().type===Be.COMMA&&(t.separator=this._nextToken()),this.getCurToken().type===Be.RPAREN||this.getCurToken().type===Be.RBRACE||this.getCurToken().type===Be.RBRACK)break}const n=new it(e);if(t.push(n),this.getCurToken().type===Be.RPAREN||this.getCurToken().type===Be.RBRACE||this.getCurToken().type===Be.RBRACK)break;n.separator=this._nextToken()}let n;return n=e?new nt(t):new tt(t),n}_parseOccurrence(){const e=[];let t=null;if(this.getCurToken().type===Be.QUEST||this.getCurToken().type===Be.ASTERISK||this.getCurToken().type===Be.PLUS){const n=this.getCurToken().type===Be.PLUS?1:0;let r=1/0;this.getCurToken().type===Be.ASTERISK&&this.getPeekToken().type===Be.NUMBER&&yt(this.getPeekToken().literal)&&!this.getPeekToken().startWithSpaces()&&(e.push(this._nextToken()),r=parseInt(this.getCurToken().literal)),e.push(this._nextToken()),t=new ot(n,r,e)}else if(this.getCurToken().type===Be.NUMBER&&yt(this.getCurToken().literal)&&this.getPeekToken().type===Be.ASTERISK&&!this.getPeekToken().startWithSpaces()){const n=parseInt(this.getCurToken().literal);let r=1/0;e.push(this._nextToken()),e.push(this._nextToken()),this.getCurToken().type===Be.NUMBER&&yt(this.getCurToken().literal)&&!this.getCurToken().startWithSpaces()&&(r=parseInt(this.getCurToken().literal),e.push(this._nextToken())),t=new ot(n,r,e)}return t}_parseTypename(e=!1,t=null){if(this.getCurToken().type!==Be.IDENT)throw this._parserError(`expected group identifier, got \`${this.getCurToken().serialize().trim()}\``);const n=this._nextToken();let r;r=e?this._parseGenericParameters():this._parseGenericArguments();const i=new ct(n.literal,t,r);return i.setComments(n),i}_parseGenericParameters(){if(this.getCurToken().type!==Be.LT||this.getCurToken().startWithSpaces())return null;const e=this._nextToken(),t=[];let n=this._parseTypename();for(t.push(n);this.getCurToken().type===Be.COMMA;)n.separator=this._nextToken(),n=this._parseTypename(),t.push(n);const r=new ft(t);if(r.openToken=e,this.getCurToken().type!==Be.GT)throw this._parserError(`expected \`>\` character to end generic production, got \`${this.getCurToken().serialize().trim()}\``);return r.closeToken=this._nextToken(),r}_parseGenericArguments(){if(this.getCurToken().type!==Be.LT||this.getCurToken().startWithSpaces())return null;const e=this._nextToken(),t=[];let n=this._parseType1();for(t.push(n);this.getCurToken().type===Be.COMMA;)n.separator=this._nextToken(),n=this._parseType1(),t.push(n);const r=new mt(t);if(r.openToken=e,this.getCurToken().type!==Be.GT)throw this._parserError(`expected \`>\` character to end generic production, got \`${this.getCurToken().serialize().trim()}\``);return r.closeToken=this._nextToken(),r}_convertGroupDefinitions(e){const t=new Set,n=new Set,r=new Set,i=e=>{if(e instanceof at||e instanceof nt||e instanceof rt||e instanceof lt||e instanceof st)return"type";if(e instanceof dt)return i(e.min);if(e instanceof ut)return i(e.type);if(e instanceof ct){const t=e.name;if(n.has(t)||this._isPreludeType(t))return"type";if(r.has(t))return"group"}return"unknown"};for(const i of e.rules)t.add(i.name.name),0===n.size&&n.add(i.name.name),i.type instanceof ht?n.add(i.name.name):(i.assign.type===Be.TCHOICEALT&&n.add(i.name.name),i.assign.type===Be.GCHOICEALT&&r.add(i.name.name),i.type.type.types.length>1&&null===i.type.type.openToken&&n.add(i.name.name),null!==i.type.occurrence&&r.add(i.name.name),null!==i.type.key&&r.add(i.name.name));const s=e=>{e instanceof et&&null!==e.key&&e.key.type instanceof ct&&!e.key.hasColon&&t.has(e.key.type.name)&&n.add(e.key.type.name);for(const t of e.getChildren())s(t)};s(e);let o=!0;for(;o;){o=!1;for(const s of e.rules)if(s.type instanceof ht)for(const e of s.type.types)e instanceof ct&&t.has(e.name)&&(n.has(e.name)||(o=!0,n.add(e.name)));else{if(n.has(s.name.name))for(const e of s.type.type.types)e instanceof ct&&t.has(e.name)&&(n.has(e.name)||(o=!0,n.add(e.name)));if(r.has(s.name.name))for(const e of s.type.type.types)e instanceof ct&&t.has(e.name)&&(r.has(e.name)||(o=!0,r.add(e.name)));if(s.assign.type===Be.ASSIGN){const e=new Set(s.type.type.types.map(e=>i(e)));if(e.has("type")&&e.has("group"))throw new gt(`CDDL semantic error - rule \`${s.name.name}\` targets a mix of type and group rules`);e.has("type")?n.has(s.name.name)||(o=!0,n.add(s.name.name)):e.has("group")&&(r.has(s.name.name)||(o=!0,r.add(s.name.name)))}}}const a=[...n].filter(e=>r.has(e));if(a.length>0){const e=a.join(", ");throw new gt(`CDDL semantic error - mix of type and group definitions for ${e}`)}for(const t of e.rules)if(!(t.type instanceof ht)&&n.has(t.name.name)){if(!t.type.isConvertibleToType())throw new gt(`CDDL semantic error - rule \`${t.name.name}\` is a type definition but uses a group entry`);t.type=t.type.type}}_isPreludeType(e){return["any","uint","nint","int","bstr","bytes","tstr","text","tdate","time","number","biguint","bignint","bigint","integer","unsigned","decfrac","bigfloat","eb64url","eb64legacy","eb16","encoded-cbor","uri","b64url","b64legacy","regexp","mime-message","cbor-any","float16","float32","float64","float16-32","float32-64","float","false","true","bool","nil","null","undefined"].includes(e)}_nextToken(){const e=this.curToken;return this.curToken=this.peekToken,this.peekToken=this.lexer.nextToken(),e}_parserError(e){const t=this.lexer.getLocation();return new gt(`CDDL syntax error - line ${t.line+1}: ${e}`)}},Wr=class{serializeToken(e,t){return e.serialize()}serializeValue(e,t,n,r){return e+t+n}serializeName(e,t){return e}markupFor(e){return[null,null]}},Fr=Qe,Hr=pt,Br=ft,Gr=mt,Vr=ht,Jr=ot,Zr=/['\u2019]s$/,Kr=/-/g,Yr=RegExp.escape??(e=>e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"));const Xr=new Intl.DateTimeFormat(["sv-SE"],{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit"}),Qr="en"===r||r.startsWith("en-")?"en-AU":r,ei=new Intl.DateTimeFormat(Qr,{timeZone:"UTC",year:"numeric",month:"long",day:"en-AU"===Qr?"2-digit":"numeric"}),ti=".informative, .note, .issue, .example, .ednote, .practice, .introductory";function ni(e){const t=new URL(e.href,document.baseURI),n=document.createElement("link");let{href:r}=t;switch(n.rel=e.hint,n.rel){case"dns-prefetch":case"preconnect":r=t.origin,(e.corsMode||t.origin!==document.location.origin)&&(n.crossOrigin=e.corsMode||"anonymous");break;case"preload":"as"in e&&n.setAttribute("as",e.as||""),e.corsMode&&(n.crossOrigin=e.corsMode)}return n.href=r,e.dontRemove||n.classList.add("removeOnSave"),n}function ri(e){e.querySelectorAll(".remove, script[data-requiremodule]").forEach(e=>{e.remove()})}function ii(e,t="long"){const n=new Intl.ListFormat(r,{style:t,type:e});return(e,t)=>{let r=0;return n.formatToParts(e).map(({type:n,value:i})=>"element"===n&&t?t(i,r++,e):i)}}const si=ii("conjunction"),oi=ii("disjunction");function ai(e,t){return si(e,t).join("")}function ci(e,t){return oi(e,t).join("")}function li(e){return e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function di(e){return e.trim().replace(/\s+/g," ")}function ui(e,t=r){return t=t.toLowerCase(),new Proxy(e,{get(e,n){const r=pi(e,n,t)||e.en[n];if(!r)throw new Error(`No l10n data for key: "${n}"`);return r}})}function pi(e,t,n=r){n=n.toLowerCase();const i=n.match(/^(\w{2,3})-.+$/)?.[1]??"";return e[n]?.[t]||e[i]?.[t]}function hi(e,t=""){return Xr.format(e).replace(Kr,t)}function fi(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){Ii(`call to \`${t}()\` failed with: ${e}.`,"utils/runTransforms",{hint:"See developer console for stack trace.",cause:e})}}}return e}async function mi(e,t=864e5){const n=new Request(e),r=new URL(n.url);let i,s;if("caches"in window)try{if(i=await caches.open(r.origin),s=await i.match(n),s&&new Date(s.headers.get("Expires")??"")>new Date)return s}catch(e){console.error("Failed to use Cache API.",e)}const o=await fetch(n);if(!o.ok&&s)return console.warn(`Returning a stale cached response for ${r}`),s;if(i&&o.ok){const e=o.clone(),r=new Headers(o.headers),s=new Date(Date.now()+t);r.set("Expires",s.toISOString());const a=new Response(await e.blob(),{headers:r});await i.put(n,a).catch(console.error)}return o}function gi(e,t=e=>e){const n=e.map(t),r=n.slice(0,-1).map(e=>Or`${e}, `);return Or`${r}${n[n.length-1]}`}function bi(e,t){return[].concat(si(e,t)).map(e=>"string"==typeof e?Or`${e}`:e)}function yi(e,t=""){const n=function(e){let t=0;for(const n of e)t=Math.imul(31,t)+n.charCodeAt(0)|0;return String(t)}(di(e.textContent));return vi(e,t,n)}function wi(e,t=!1){return(t?e:e.toLowerCase()).trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\W+/gim,"-").replace(/^-+/,"").replace(/-+$/,"")}function vi(e,t="",n="",r=!1){if(e.id)return e.id;n||(n=(e.title?e.title:e.textContent).trim());let i=wi(n,r);if(i?!/\.$/.test(i)&&/^[a-z]/i.test(t||i)||(i=`x${i}`):i="generatedID",t&&(i=`${t}-${i}`),e.ownerDocument.getElementById(i)){let t=0,n=`${i}-${t}`;for(;e.ownerDocument.getElementById(n);)t+=1,n=`${i}-${t}`;i=n}return e.id=i,i}function ki(e){const t=new Set,n="ltNodefault"in e.dataset?"":di(e.textContent),r=e.children[0];if(e.dataset.lt?e.dataset.lt.split("|").map(e=>di(e)).forEach(e=>t.add(e)):1===e.childNodes.length&&1===e.getElementsByTagName("abbr").length&&r&&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(di(e)))}return[...t]}function $i(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 xi(e,t){const n=t.closest(ti);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 Ci(e,t){return t.append(...e.childNodes),e.appendChild(t),e}function Si(e){const t=[];for(const n of function*(e){let t=e;for(;t.previousElementSibling;)t=t.previousElementSibling,yield t}(e))"section"===n.localName&&t.push(n);return t}function _i(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 Ti 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)??e)}getCanonicalKey(e){return super.has(e)?e:[...this.keys()].find(t=>t.toLowerCase()===e.toLowerCase())}}function Ri(e){const t=e.cloneNode(!0);return t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.querySelectorAll("dfn").forEach(e=>{$i(e,"span",{copyAttributes:!1})}),t.hasAttribute("id")&&t.removeAttribute("id"),Ei(t),t}function Ei(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(const e of[...Ai(t)])e.remove()}function*Ai(e){for(;e.nextNode();)yield e.currentNode}class Li 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 Pi extends Error{constructor(e,t,n){super(e,{...n.cause&&{cause:n.cause}});const r=n.isWarning?"ReSpecWarning":"ReSpecError";Object.assign(this,{message:e,plugin:t,name:r,...n}),n.elements&&n.elements.forEach(t=>function(e,t,n){e.classList.add("respec-offending-element"),e.hasAttribute("title")||e.setAttribute("title",n||t),e.id||vi(e,"respec-offender")}(t,e,n.title))}toJSON(){const{message:e,name:t,stack:n}=this,{plugin:r,hint:i,elements:s,title:o,details:a}=this;return{message:e,name:t,plugin:r,hint:i,elements:s,title:o,details:a,stack:n,...this.cause instanceof Error&&{cause:{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}}}}}function Ni(e,t,n={}){const r={...n,isWarning:!1};Fi("error",new Pi(e,t,r))}function Ii(e,t,n={}){const r={...n,isWarning:!0};Fi("warn",new Pi(e,t,r))}function Oi(e){return{amendConfiguration:e=>Fi("amend-user-config",e),showError:(t,n)=>Ni(t,e,n),showWarning:(t,n)=>Ii(t,e,n)}}function Di(e){return e?`\`${e}\``:""}function ji(e,{quotes:t}={quotes:!1}){return ci(e,t?e=>Di(Mi(e)):Di)}function zi(e,{quotes:t}={quotes:!1}){return ai(e,t?e=>Di(Mi(e)):Di)}function Mi(e){return String(e)?`"${e}"`:""}function qi(e,...t){return Ui(e.map((e,n)=>{const r=t[n];if(!r)return e;if(!r.startsWith("[")&&!r.endsWith("]"))return e+r;const[i,s]=r.slice(1,-1).split("|");if(s){return`${e}[${i}](${new URL(s,"https://respec.org/docs/")})`}return`${e}[\`${i}\`](https://respec.org/docs/#${i})`}).join(""))}function Ui(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 Wi=new EventTarget;function Fi(e,t){if(Wi.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 Hi(e,t,n={once:!1}){Wi.addEventListener(e,async n=>{try{await t(n.detail)}catch(t){const n=t;Ni(`Error in handler for topic "${e}": ${n.message}`,`sub:${e}`,{cause:n})}},n)}const Bi=["githubToken","githubUser"];const Gi=new Map([["text/html","html"],["application/xml","xml"]]);function Vi(e,t=document){const n=Gi.get(e);if(!n){const t=[...Gi.values()].join(", ");throw new TypeError(`Invalid format: ${e}. Expected one of: ${t}.`)}const r=Ji(n,t);return`data:${e};charset=utf-8,${encodeURIComponent(r)}`}function Ji(e,t){const n=t.cloneNode(!0);!function(e){const{head:t,body:n,documentElement:r}=e;Ei(e),e.querySelectorAll(".removeOnSave, #toc-nav").forEach(e=>e.remove()),n.classList.remove("toc-sidebar","toc-inline"),ri(r);const i=e.createDocumentFragment(),s=e.querySelector("meta[name='viewport']");s&&t.firstChild!==s&&i.appendChild(s);const o=e.querySelector("meta[charset], meta[content*='charset=']")||Or`<meta charset="utf-8" />`;i.appendChild(o);const a=`ReSpec ${window.respecVersion||"Developer Channel"}`,c=Or`
2
2
  <meta name="generator" content="${a}" />
3
- `;i.appendChild(c),t.prepend(i),Fi("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}async function Zi(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href));return await n.text()}const Ki=(e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href).endsWith("/src/core/worker.js")?new URL("../../builds/respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href).href:new URL("respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href).href,Yi=ni({hint:"preload",href:Ki,as:"script"});async function Xi(){try{return(await Promise.resolve().then(function(){return qs})).default}catch{return Zi("worker/respec-worker.js")}}async function Qi(){try{const e=await fetch(Ki);if(e.ok)return await e.text()}catch{}return null}document.head.appendChild(Yi);const es=async function(){const[e,t]=await Promise.all([Xi(),Qi()]),n=new Blob([null!==t?`${t}\n`:'self.RESPEC_HIGHLIGHT_URL = "https://www.w3.org/Tools/respec/respec-highlight";\n',e],{type:"application/javascript"});return new Worker(URL.createObjectURL(n))}();class ts{constructor(){this._respecDonePromise=new Promise(e=>{Bi("end-all",()=>e(),{once:!0})}),this.errors=[],this.warnings=[],Bi("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),Bi("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}get worker(){return es}async toHTML(){return Ji("html",document)}}const ns="core/post-process";function rs(e,t){return new Promise((n,r)=>{const i=setTimeout(()=>{r(new Error(`${t} timed out.`))},15e3);Promise.resolve(e).then(n,r).finally(()=>{clearTimeout(i)})})}const is="core/pre-process";const ss="core/base-runner";async function os(e){!function(){const e=new ts;Object.defineProperty(document,"respec",{value:e})}(),Fi("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),Bi("amend-user-config",n),Bi("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of Hi)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 i;try{i=JSON.parse(r)}catch{i=r}return[n,i]}),r=Object.fromEntries(n);Object.assign(e,r),Fi("amend-user-config",r)}(respecConfig),performance.mark(`${ss}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter(e=>{const t="function"==typeof e;return t||Ni("Every item in `preProcess` must be a JS function.",is),t});for(const[n,r]of t.entries()){const t=`${is}/${r.name||`[${n}]`}`,i=Oi(t);try{await new Promise((n,s)=>{const o=setTimeout(()=>{s(new Error(`preProcess function "${t}" timed out.`))},15e3);Promise.resolve().then(()=>r(e,document,i)).then(n,s).finally(()=>{clearTimeout(o)})})}catch(e){Ni(`Function ${t} threw an error during \`preProcess\`.`,is,{hint:"See developer console.",cause:e})}}}}(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,i)=>{const s=setTimeout(()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),i(new Error(t))},15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r(void 0)):n.run&&(await n.run(t),r(void 0))}catch(e){i(e)}finally{clearTimeout(s),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}})}catch(e){console.error(e)}}}(t,respecConfig),Fi("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||Ni("Every item in `postProcess` must be a JS function.",ns),t});for(const[n,r]of t.entries()){const t=`${ns}/${r.name||`[${n}]`}`,i=Oi(t);try{await rs(r(e,document,i),`postProcess function "${t}"`)}catch(e){Ni(`Function ${t} threw an error during \`postProcess\`.`,ns,{hint:"See developer console.",cause:e})}}}if("function"==typeof e.afterEnd)try{await rs(e.afterEnd(e,document),"config.afterEnd")}catch(e){Ni("Function afterEnd threw an error.",ns,{hint:"See developer console.",cause:e})}}(respecConfig),Fi("end-all",void 0),ri(document),performance.mark(`${ss}-end`),performance.measure(ss,`${ss}-start`,`${ss}-end`)}var as=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}
3
+ `;i.appendChild(c),t.prepend(i),Fi("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}async function Zi(t){const n=await fetch(new URL(`../../${t}`,e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href));return await n.text()}const Ki=(e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href).endsWith("/src/core/worker.js")?new URL("../../builds/respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href).href:new URL("respec-highlight.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href).href,Yi=ni({hint:"preload",href:Ki,as:"script"});async function Xi(){try{return(await Promise.resolve().then(function(){return Ws})).default}catch{return Zi("worker/respec-worker.js")}}async function Qi(){try{const e=await fetch(Ki);if(e.ok)return await e.text()}catch{}return null}document.head.appendChild(Yi);const es=async function(){const[e,t]=await Promise.all([Xi(),Qi()]),n=new Blob([null!==t?`${t}\n`:'self.RESPEC_HIGHLIGHT_URL = "https://www.w3.org/Tools/respec/respec-highlight";\n',e],{type:"application/javascript"});return new Worker(URL.createObjectURL(n))}();class ts{constructor(){this._respecDonePromise=new Promise(e=>{Hi("end-all",()=>e(),{once:!0})}),this.errors=[],this.warnings=[],Hi("error",e=>{console.error(e,e.toJSON()),this.errors.push(e)}),Hi("warn",e=>{console.warn(e,e.toJSON()),this.warnings.push(e)})}get version(){return window.respecVersion}get ready(){return this._respecDonePromise}get worker(){return es}async toHTML(){return Ji("html",document)}}const ns="core/post-process";function rs(e,t){return new Promise((n,r)=>{const i=setTimeout(()=>{r(new Error(`${t} timed out.`))},15e3);Promise.resolve(e).then(n,r).finally(()=>{clearTimeout(i)})})}const is="core/pre-process";const ss="core/base-runner";async function os(e){!function(){const e=new ts;Object.defineProperty(document,"respec",{value:e})}(),Fi("start-all",respecConfig),function(e){const t={},n=e=>Object.assign(t,e);n(e),Hi("amend-user-config",n),Hi("end-all",()=>{const e=document.createElement("script");e.id="initialUserConfig",e.type="application/json";for(const e of Bi)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 i;try{i=JSON.parse(r)}catch{i=r}return[n,i]}),r=Object.fromEntries(n);Object.assign(e,r),Fi("amend-user-config",r)}(respecConfig),performance.mark(`${ss}-start`),await async function(e){if(Array.isArray(e.preProcess)){const t=e.preProcess.filter(e=>{const t="function"==typeof e;return t||Ni("Every item in `preProcess` must be a JS function.",is),t});for(const[n,r]of t.entries()){const t=`${is}/${r.name||`[${n}]`}`,i=Oi(t);try{await new Promise((n,s)=>{const o=setTimeout(()=>{s(new Error(`preProcess function "${t}" timed out.`))},15e3);Promise.resolve().then(()=>r(e,document,i)).then(n,s).finally(()=>{clearTimeout(o)})})}catch(e){Ni(`Function ${t} threw an error during \`preProcess\`.`,is,{hint:"See developer console.",cause:e})}}}}(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,i)=>{const s=setTimeout(()=>{const t=`Plugin ${e} took too long.`;console.error(t,n),i(new Error(t))},15e3);performance.mark(`${e}-start`);try{n.Plugin?(await new n.Plugin(t).run(),r(void 0)):n.run&&(await n.run(t),r(void 0))}catch(e){i(e)}finally{clearTimeout(s),performance.mark(`${e}-end`),performance.measure(e,`${e}-start`,`${e}-end`)}})}catch(e){console.error(e)}}}(t,respecConfig),Fi("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||Ni("Every item in `postProcess` must be a JS function.",ns),t});for(const[n,r]of t.entries()){const t=`${ns}/${r.name||`[${n}]`}`,i=Oi(t);try{await rs(r(e,document,i),`postProcess function "${t}"`)}catch(e){Ni(`Function ${t} threw an error during \`postProcess\`.`,ns,{hint:"See developer console.",cause:e})}}}if("function"==typeof e.afterEnd)try{await rs(e.afterEnd(e,document),"config.afterEnd")}catch(e){Ni("Function afterEnd threw an error.",ns,{hint:"See developer console.",cause:e})}}(respecConfig),Fi("end-all",void 0),ri(document),performance.mark(`${ss}-end`),performance.measure(ss,`${ss}-start`,`${ss}-end`)}var as=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}
4
4
  #respec-ui{position:fixed;display:flex;flex-direction:row-reverse;top:20px;right:20px;width:202px;text-align:right;z-index:9000}
5
5
  #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}
6
6
  .respec-info-button{border:none;opacity:.75;border-radius:2em;margin-right:1em;min-width:3.5em;will-change:opacity}
@@ -63,42 +63,42 @@ to{margin-top:0;border:1px solid #ccc;border-radius:0;box-shadow:1px 1px 8px 0 r
63
63
  .respec-iframe:not(.ready){background:url(https://respec.org/xref/loader.gif) no-repeat center}
64
64
  .respec-iframe+a[href]{font-size:.9rem;float:right;margin:0 .5em .5em;border-bottom-width:1px}
65
65
  p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
66
- .respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const cs=new Set;let ls=!1;function us(e){const t=new CSSStyleSheet;t.replaceSync(e);const n=[];let r=!1;for(const e of t.cssRules){e instanceof CSSMediaRule&&/prefers-color-scheme\s*:\s*dark/i.test(e.conditionText)&&!/\bnot\b/i.test(e.conditionText)?r=!0:n.push(e.cssText)}return r?n.join("\n"):e}function ds(e,{id:t,className:n,before:r}={}){const i=document.createElement("style");return t&&(i.id=t),void 0!==n&&(i.className=n),i.textContent=ls?us(e):e,document.head.insertBefore(i,r??null),cs.add(i),i}const ps=/&gt;/gm,hs=/&amp;/gm;class fs extends jr.Renderer{code(e){const{text:t,lang:n=""}=e,{language:r,...i}=fs.parseInfoString(n);if(/(^webidl$)/i.test(r))return`<pre class="idl">${t}</pre>`;const s=super.code({...e,lang:r}).replace('class="language-','class="'),{example:o,illegalExample:a}=i;if(!o&&!a)return s;const c=o||a,l=`${r} ${o?"example":"illegal-example"}`;return s.replace("<pre>",`<pre title="${c}" class="${l}">`)}image(e){const{href:t,title:n,text:r}=e;if(!n)return super.image(e);return String.raw`
66
+ .respec-plugin{text-align:right;color:rgb(120,120,120,.5);font-size:.6em}`;const cs=new Set;let ls=!1;function ds(e){const t=new CSSStyleSheet;t.replaceSync(e);const n=[];let r=!1;for(const e of t.cssRules){e instanceof CSSMediaRule&&/prefers-color-scheme\s*:\s*dark/i.test(e.conditionText)&&!/\bnot\b/i.test(e.conditionText)?r=!0:n.push(e.cssText)}return r?n.join("\n"):e}function us(e,{id:t,className:n,before:r}={}){const i=document.createElement("style");return t&&(i.id=t),void 0!==n&&(i.className=n),i.textContent=ls?ds(e):e,document.head.insertBefore(i,r??null),cs.add(i),i}let ps,hs=!1;Hi("start-all",e=>ps=e,{once:!0});const fs=/&gt;/gm,ms=/&amp;/gm;class gs extends jr.Renderer{code(e){const{text:t,lang:n=""}=e,{language:r,...i}=gs.parseInfoString(n);if(/(^webidl$)/i.test(r))return`<pre class="idl">${t}</pre>`;if(ps?.diagrams&&/^mermaid$/i.test(r)){const e=e=>li(hs?e:e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")),n=i.title?`<figcaption>${e(i.title)}</figcaption>`:"";return`<figure><pre class="mermaid">${e(t)}</pre>${n}</figure>`}const s=super.code({...e,lang:r}).replace('class="language-','class="'),{example:o,illegalExample:a}=i;if(!o&&!a)return s;const c=o||a,l=`${r} ${o?"example":"illegal-example"}`;return s.replace("<pre>",`<pre title="${c}" class="${l}">`)}image(e){const{href:t,title:n,text:r}=e;if(!n)return super.image(e);return String.raw`
67
67
  <figure>
68
68
  <img src="${t}" alt="${r}" />
69
69
  <figcaption>${n}</figcaption>
70
70
  </figure>
71
- `}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 i;if(r)try{i=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...i}}heading(e){const t=this.parser.parseInline(e.tokens),n=e.depth,r=t.match(/(.+)\s+{#([\w-]+)}$/);if(r){const[,e,t]=r;return`<h${n} id="${t}">${e}</h${n}>`}return super.heading(e)}}const ms={gfm:!0,renderer:new fs};function gs(e,t={inline:!1}){const n=function(e){if(!e)return e;const t=e.trimEnd().split("\n"),n=t.findIndex(e=>e.trim());if(-1===n)return"";const r=t.slice(n),i=r[0].search(/[^\s]/);if(i<1)return r.join("\n");const s=" ".repeat(i);return r.map(e=>e.startsWith(s)?e.slice(i):e).join("\n")}(e),r=n.replace(ps,">").replace(hs,"&");return t.inline?jr.parseInline(r,ms):jr.parse(r,ms)}function bs(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");e.innerHTML=gs(e.innerHTML)}const ys=(ws="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(ws);return t.forEach(bs),Array.from(t)});var ws;var ks=Object.freeze({__proto__:null,markdownToHtml:gs,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 ys(document.body);const r=document.getElementById("respec-ui");r?.remove();const i=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),i=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),i.trim()){const t=_i(e);e.append(`\n\n${t}`)}}}(i,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),bs(i),function(e){Array.from(e).forEach(e=>{e.replaceWith(e.textContent)})}(i.querySelectorAll(".nolinks a[href]")),r&&i.append(r),document.body.replaceWith(i)}});function vs(e,t){e&&Array.from(t).forEach(([t,n])=>{e.setAttribute(`aria-${t}`,n)})}ds(as,{id:"respec-ui-styles",className:"removeOnSave"});const $s=Or`<div id="respec-ui" class="removeOnSave" hidden></div>`,xs=Or`<ul
71
+ `}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 i;if(r)try{i=JSON.parse(`{ ${r} }`)}catch(e){console.error(e)}return{language:n,...i}}heading(e){const t=this.parser.parseInline(e.tokens),n=e.depth,r=t.match(/(.+)\s+{#([\w-]+)}$/);if(r){const[,e,t]=r;return`<h${n} id="${t}">${e}</h${n}>`}return super.heading(e)}}const bs={gfm:!0,renderer:new gs};function ys(e,t={inline:!1}){const n=function(e){if(!e)return e;const t=e.trimEnd().split("\n"),n=t.findIndex(e=>e.trim());if(-1===n)return"";const r=t.slice(n),i=r[0].search(/[^\s]/);if(i<1)return r.join("\n");const s=" ".repeat(i);return r.map(e=>e.startsWith(s)?e.slice(i):e).join("\n")}(e),r=t.raw?n:n.replace(fs,">").replace(ms,"&");hs=!!t.raw;try{return t.inline?jr.parseInline(r,bs):jr.parse(r,bs)}finally{hs=!1}}function ws(e){for(const t of e.getElementsByTagName("pre"))t.prepend("\n");const t=[];for(const n of e.querySelectorAll("pre.mermaid"))n.setAttribute("data-diagram-text",String(t.length)),t.push(n.textContent??""),n.textContent="";e.innerHTML=ys(e.innerHTML);for(const n of e.querySelectorAll("pre[data-diagram-text]")){const e=Number(n.getAttribute("data-diagram-text"));n.removeAttribute("data-diagram-text"),n.textContent=t[e]}}const vs=(ks="[data-format='markdown']:not(body)",e=>{const t=e.querySelectorAll(ks);return t.forEach(ws),Array.from(t)});var ks;var $s=Object.freeze({__proto__:null,markdownToHtml:ys,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 vs(document.body);const r=document.getElementById("respec-ui");r?.remove();const i=document.body.cloneNode(!0);!function(e,t){const n=e.querySelectorAll(t);for(const e of n){const{innerHTML:t}=e;if(/^<\w/.test(t.trimStart()))continue;const n=t.split("\n"),r=n.slice(0,2).join("\n"),i=n.slice(-2).join("\n");if(r.trim()&&e.prepend("\n\n"),i.trim()){const t=_i(e);e.append(`\n\n${t}`)}}}(i,"[data-format=markdown], section, div, address, article, aside, figure, header, main"),ws(i),function(e){Array.from(e).forEach(e=>{e.replaceWith(e.textContent)})}(i.querySelectorAll(".nolinks a[href]")),r&&i.append(r),document.body.replaceWith(i)}});function xs(e,t){e&&Array.from(t).forEach(([t,n])=>{e.setAttribute(`aria-${t}`,n)})}us(as,{id:"respec-ui-styles",className:"removeOnSave"});const Cs=Or`<div id="respec-ui" class="removeOnSave" hidden></div>`,Ss=Or`<ul
72
72
  id="respec-menu"
73
73
  role="menu"
74
74
  aria-labelledby="respec-pill"
75
75
  hidden
76
- ></ul>`,Cs=Or`<button
76
+ ></ul>`,_s=Or`<button
77
77
  class="close-button"
78
- onclick=${()=>Os.closeModal()}
78
+ onclick=${()=>js.closeModal()}
79
79
  aria-label="Close"
80
80
  >
81
81
  ❌
82
- </button>`;let Ss,_s;window.addEventListener("load",()=>Ps(xs));const Ts=[],Rs=[],Es={};Bi("start-all",()=>document.body.prepend($s),{once:!0}),Bi("end-all",()=>document.body.prepend($s),{once:!0});const As=Or`<button id="respec-pill" disabled>ReSpec</button>`;function Ls(){xs.classList.toggle("respec-hidden"),xs.classList.toggle("respec-visible"),xs.hidden=!xs.hidden}function Ps(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=>{const t=e;"Tab"===t.key&&(t.shiftKey?document.activeElement===n&&(r.focus(),t.preventDefault()):document.activeElement===r&&(n.focus(),t.preventDefault()))})}$s.appendChild(As),As.addEventListener("click",e=>{e.stopPropagation(),As.setAttribute("aria-expanded",String(xs.hidden)),Ls(),xs.querySelector("li:first-child button").focus()}),document.documentElement.addEventListener("click",()=>{xs.hidden||Ls()}),$s.appendChild(xs),xs.addEventListener("keydown",e=>{"Escape"!==e.key||xs.hidden||(As.setAttribute("aria-expanded",String(xs.hidden)),Ls(),As.focus())});const Ns=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Is(e,t,n,r){t.push(e),Es.hasOwnProperty(n)||(Es[n]=function(e,t,n){const r=`respec-pill-${e}`,i=Or`<button
82
+ </button>`;let Ts,Rs;window.addEventListener("load",()=>Is(Ss));const Es=[],As=[],Ls={};Hi("start-all",()=>document.body.prepend(Cs),{once:!0}),Hi("end-all",()=>document.body.prepend(Cs),{once:!0});const Ps=Or`<button id="respec-pill" disabled>ReSpec</button>`;function Ns(){Ss.classList.toggle("respec-hidden"),Ss.classList.toggle("respec-visible"),Ss.hidden=!Ss.hidden}function Is(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=>{const t=e;"Tab"===t.key&&(t.shiftKey?document.activeElement===n&&(r.focus(),t.preventDefault()):document.activeElement===r&&(n.focus(),t.preventDefault()))})}Cs.appendChild(Ps),Ps.addEventListener("click",e=>{e.stopPropagation(),Ps.setAttribute("aria-expanded",String(Ss.hidden)),Ns(),Ss.querySelector("li:first-child button").focus()}),document.documentElement.addEventListener("click",()=>{Ss.hidden||Ns()}),Cs.appendChild(Ss),Ss.addEventListener("keydown",e=>{"Escape"!==e.key||Ss.hidden||(Ps.setAttribute("aria-expanded",String(Ss.hidden)),Ns(),Ps.focus())});const Os=new Map([["controls","respec-menu"],["expanded","false"],["haspopup","true"],["label","ReSpec Menu"]]);function Ds(e,t,n,r){t.push(e),Ls.hasOwnProperty(n)||(Ls[n]=function(e,t,n){const r=`respec-pill-${e}`,i=Or`<button
83
83
  id="${r}"
84
84
  class="respec-info-button"
85
- ></button>`;i.addEventListener("click",()=>{i.setAttribute("aria-expanded","true");const r=Or`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(Ds(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}Os.freshModal(n,r,i)});const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return vs(i,s),i}(n,t,r),$s.appendChild(Es[n]));const i=Es[n];i.textContent=String(t.length);const s=1===t.length?Mr.singular(r):r;vs(i,new Map([["label",`${t.length} ${s}`]]))}vs(As,Ns);const Os={show(){try{$s.hidden=!1}catch(e){console.error(e)}},hide(){$s.hidden=!0},enable(){As.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const i=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,s=Or`<button id="${i}" class="respec-option">
85
+ ></button>`;i.addEventListener("click",()=>{i.setAttribute("aria-expanded","true");const r=Or`<ol class="${`respec-${e}-list`}"></ol>`;for(const e of t){const t=document.createRange().createContextualFragment(zs(e)),n=document.createElement("li");t.firstElementChild===t.lastElementChild?n.append(...t.firstElementChild.childNodes):n.appendChild(t),r.appendChild(n)}js.freshModal(n,r,i)});const s=new Map([["expanded","false"],["haspopup","true"],["controls",`respec-pill-${e}-modal`]]);return xs(i,s),i}(n,t,r),Cs.appendChild(Ls[n]));const i=Ls[n];i.textContent=String(t.length);const s=1===t.length?Mr.singular(r):r;xs(i,new Map([["label",`${t.length} ${s}`]]))}xs(Ps,Os);const js={show(){try{Cs.hidden=!1}catch(e){console.error(e)}},hide(){Cs.hidden=!0},enable(){Ps.removeAttribute("disabled")},addCommand(e,t,n,r){r=r||"";const i=`respec-button-${e.toLowerCase().replace(/\s+/,"-")}`,s=Or`<button id="${i}" class="respec-option">
86
86
  <span class="respec-cmd-icon" aria-hidden="true">${r}</span> ${e}…
87
- </button>`,o=Or`<li role="menuitem">${s}</li>`;return o.addEventListener("click",t),xs.appendChild(o),s},error(e){Is(e,Ts,"error","ReSpec Errors")},warning(e){Is(e,Rs,"warning","ReSpec Warnings")},closeModal(e){if(_s){const e=_s;e.classList.remove("respec-show-overlay"),e.classList.add("respec-hide-overlay"),e.addEventListener("transitionend",()=>{e.remove(),_s=null})}e&&e.setAttribute("aria-expanded","false"),Ss&&(Ss.remove(),Ss=null,As.focus())},freshModal(e,t,n){Ss&&Ss.remove(),_s&&_s.remove(),_s=Or`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,i=`${r}-heading`;Ss=Or`<div
87
+ </button>`,o=Or`<li role="menuitem">${s}</li>`;return o.addEventListener("click",t),Ss.appendChild(o),s},error(e){Ds(e,Es,"error","ReSpec Errors")},warning(e){Ds(e,As,"warning","ReSpec Warnings")},closeModal(e){if(Rs){const e=Rs;e.classList.remove("respec-show-overlay"),e.classList.add("respec-hide-overlay"),e.addEventListener("transitionend",()=>{e.remove(),Rs=null})}e&&e.setAttribute("aria-expanded","false"),Ts&&(Ts.remove(),Ts=null,Ps.focus())},freshModal(e,t,n){Ts&&Ts.remove(),Rs&&Rs.remove(),Rs=Or`<div id="respec-overlay" class="removeOnSave"></div>`;const r=`${n.id}-modal`,i=`${r}-heading`;Ts=Or`<div
88
88
  id="${r}"
89
89
  class="respec-modal removeOnSave"
90
90
  role="dialog"
91
91
  aria-labelledby="${i}"
92
92
  >
93
- ${Cs}
93
+ ${_s}
94
94
  <h3 id="${i}">${e}</h3>
95
95
  <div class="inside">${t}</div>
96
- </div>`;const s=new Map([["labelledby",i]]);vs(Ss,s),document.body.append(_s,Ss),_s.addEventListener("click",()=>this.closeModal(n)),_s.classList.toggle("respec-show-overlay"),Ss.hidden=!1,Ps(Ss)}};function Ds(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${gs(`<p class="respec-hint"><strong>How to fix:</strong> ${Ui(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${gs(e.elements.map(js).join("\n"))}`:"",i=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${gs(`**${li(e.message)}**`,{inline:!0})}${n}${r}${i}${t}`}function js(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function zs(e){try{Os.show(),await async function(){"loading"===document.readyState&&await new Promise(e=>document.addEventListener("DOMContentLoaded",e))}(),await os(e)}finally{Os.enable()}}document.addEventListener("keydown",e=>{"Escape"===e.key&&Os.closeModal()}),window.respecUI=Os,Bi("error",e=>Os.error(e)),Bi("warn",e=>Os.warning(e)),window.addEventListener("error",e=>{console.error(e.error,e.message,e)});const Ms=[Promise.resolve().then(function(){return Us}),Promise.resolve().then(function(){return i}),Promise.resolve().then(function(){return Bs}),Promise.resolve().then(function(){return zo}),Promise.resolve().then(function(){return Wo}),Promise.resolve().then(function(){return Vo}),Promise.resolve().then(function(){return Qo}),Promise.resolve().then(function(){return aa}),Promise.resolve().then(function(){return ks}),Promise.resolve().then(function(){return ca}),Promise.resolve().then(function(){return da}),Promise.resolve().then(function(){return fa}),Promise.resolve().then(function(){return Po}),Promise.resolve().then(function(){return ba}),Promise.resolve().then(function(){return ya}),Promise.resolve().then(function(){return va}),Promise.resolve().then(function(){return xa}),Promise.resolve().then(function(){return Oc}),Promise.resolve().then(function(){return zc}),Promise.resolve().then(function(){return Jc}),Promise.resolve().then(function(){return Zc}),Promise.resolve().then(function(){return Qc}),Promise.resolve().then(function(){return il}),Promise.resolve().then(function(){return ll}),Promise.resolve().then(function(){return pl}),Promise.resolve().then(function(){return fl}),Promise.resolve().then(function(){return Ul}),Promise.resolve().then(function(){return Zl}),Promise.resolve().then(function(){return Qa}),Promise.resolve().then(function(){return mu}),Promise.resolve().then(function(){return Pu}),Promise.resolve().then(function(){return su}),Promise.resolve().then(function(){return Uu}),Promise.resolve().then(function(){return lc}),Promise.resolve().then(function(){return ed}),Promise.resolve().then(function(){return nd}),Promise.resolve().then(function(){return ra}),Promise.resolve().then(function(){return rd}),Promise.resolve().then(function(){return id}),Promise.resolve().then(function(){return od}),Promise.resolve().then(function(){return fd}),Promise.resolve().then(function(){return gd}),Promise.resolve().then(function(){return yd}),Promise.resolve().then(function(){return Cd}),Promise.resolve().then(function(){return Fd}),Promise.resolve().then(function(){return Yd}),Promise.resolve().then(function(){return tp}),Promise.resolve().then(function(){return sp}),Promise.resolve().then(function(){return lp}),Promise.resolve().then(function(){return mp}),Promise.resolve().then(function(){return gp}),Promise.resolve().then(function(){return $p}),Promise.resolve().then(function(){return Tp}),Promise.resolve().then(function(){return Rl}),Promise.resolve().then(function(){return Ip}),Promise.resolve().then(function(){return Mp}),Promise.resolve().then(function(){return Up}),Promise.resolve().then(function(){return Fp}),Promise.resolve().then(function(){return Yp}),Promise.resolve().then(function(){return ih}),Promise.resolve().then(function(){return lh}),Promise.resolve().then(function(){return uh}),Promise.resolve().then(function(){return dh}),Promise.resolve().then(function(){return hh}),Promise.resolve().then(function(){return gh}),Promise.resolve().then(function(){return vh}),Promise.resolve().then(function(){return Ch}),Promise.resolve().then(function(){return Rh}),Promise.resolve().then(function(){return Lh}),Promise.resolve().then(function(){return Dh}),Promise.resolve().then(function(){return Mh}),Promise.resolve().then(function(){return Wh}),Promise.resolve().then(function(){return Vh}),Promise.resolve().then(function(){return Qh}),Promise.resolve().then(function(){return nf}),Promise.resolve().then(function(){return of}),Promise.resolve().then(function(){return uf}),Promise.resolve().then(function(){return ff})];Promise.all(Ms).then(e=>zs(e)).catch(e=>console.error(e));var qs=Object.freeze({__proto__:null,default:'// ReSpec Worker\n"use strict";\n// hljs is either inlined by core/worker.js (preferred) or loaded below via\n// importScripts as a fallback when the inline fetch was not possible.\nif (typeof self.hljs === "undefined" && self.RESPEC_HIGHLIGHT_URL) {\n try {\n importScripts(self.RESPEC_HIGHLIGHT_URL);\n } catch (err) {\n console.error("Network error loading highlighter", err);\n }\n}\n\nself.addEventListener("message", ({ data }) => {\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, langScript, propName, lang } = data;\n console.warn(\n `[ReSpec] The "highlight-load-lang" worker action is deprecated ` +\n `and will be removed in a future version. ` +\n `To migrate, fetch your language script in the main thread and ` +\n `send the text as "langScript" instead of "langURL". ` +\n `The "langURL" path may fail in Firefox. ` +\n `See https://github.com/speced/respec/issues/5228`\n );\n try {\n if (langScript) {\n const blob = new Blob([langScript], {\n type: "application/javascript",\n });\n const objectURL = URL.createObjectURL(blob);\n try {\n importScripts(objectURL);\n } finally {\n URL.revokeObjectURL(objectURL);\n }\n } else if (langURL) {\n const { protocol, hostname } = new URL(langURL);\n const isSecure =\n protocol === "https:" ||\n (protocol === "http:" &&\n (hostname === "localhost" ||\n hostname === "127.0.0.1" ||\n hostname === "[::1]"));\n if (!isSecure) {\n throw new Error(\n `langURL must be https: or http: on localhost, got "${langURL}"`\n );\n }\n importScripts(langURL);\n } else {\n throw new Error(\n `No langScript or langURL provided for language "${lang}"`\n );\n }\n if (typeof self[propName] === "function") {\n self.hljs.registerLanguage(lang, self[propName]);\n } else {\n throw new Error(\n `Language definer "${propName}" is not a function on self`\n );\n }\n } catch (err) {\n console.error("Failed to load or register language", lang, err);\n }\n delete data.langScript;\n delete data.langURL;\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 Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'});var Us=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 Ws="w3c/group";async function Fs(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,"https://respec.org/w3c/groups/"),i=await mi(r.href);if(i.ok){const e=await i.json(),{id:t,name:n,patentURI:r,patentPolicy:s,type:o,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:s,groupType:o}}const s=await i.text();let o,a=`Failed to fetch group details (HTTP: ${i.status}).`;409===i.status?[a,o]=s.split("\n",2):404===i.status&&(o=qi`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`),Ni(a,Ws,{hint:o})}var Bs=Object.freeze({__proto__:null,name:Ws,run:async function(e){if(!e.group)return;const{group:t}=e,n=Array.isArray(t)?await async function(e){const t=await Promise.all(e.map(Fs)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter(Boolean))for(const t of Object.keys(n))n[t].push(e[t]);return n}(t):await Fs(t);Object.assign(e,n)}});function Hs(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Ii(t,"core/templates/show-link"),void console.warn(t,e)}return Or`
96
+ </div>`;const s=new Map([["labelledby",i]]);xs(Ts,s),document.body.append(Rs,Ts),Rs.addEventListener("click",()=>this.closeModal(n)),Rs.classList.toggle("respec-show-overlay"),Ts.hidden=!1,Is(Ts)}};function zs(e){if("string"==typeof e)return e;const t=e.plugin?`<p class="respec-plugin">(plugin: "${e.plugin}")</p>`:"",n=e.hint?`\n${ys(`<p class="respec-hint"><strong>How to fix:</strong> ${Ui(e.hint)}`,{inline:!e.hint.includes("\n")})}\n`:"",r=Array.isArray(e.elements)?`<p class="respec-occurrences">Occurred <strong>${e.elements.length}</strong> times at:</p>\n ${ys(e.elements.map(Ms).join("\n"))}`:"",i=e.details?`\n\n<details>\n${e.details}\n</details>\n`:"";return`${ys(`**${li(e.message)}**`,{inline:!0})}${n}${r}${i}${t}`}function Ms(e){return`* [\`<${e.localName}>\`](#${e.id}) element`}async function qs(e){try{js.show(),await async function(){"loading"===document.readyState&&await new Promise(e=>document.addEventListener("DOMContentLoaded",e))}(),await os(e)}finally{js.enable()}}document.addEventListener("keydown",e=>{"Escape"===e.key&&js.closeModal()}),window.respecUI=js,Hi("error",e=>js.error(e)),Hi("warn",e=>js.warning(e)),window.addEventListener("error",e=>{console.error(e.error,e.message,e)});const Us=[Promise.resolve().then(function(){return Fs}),Promise.resolve().then(function(){return i}),Promise.resolve().then(function(){return Gs}),Promise.resolve().then(function(){return qo}),Promise.resolve().then(function(){return Ho}),Promise.resolve().then(function(){return Zo}),Promise.resolve().then(function(){return ta}),Promise.resolve().then(function(){return la}),Promise.resolve().then(function(){return $s}),Promise.resolve().then(function(){return da}),Promise.resolve().then(function(){return ha}),Promise.resolve().then(function(){return ga}),Promise.resolve().then(function(){return Io}),Promise.resolve().then(function(){return wa}),Promise.resolve().then(function(){return va}),Promise.resolve().then(function(){return xa}),Promise.resolve().then(function(){return Sa}),Promise.resolve().then(function(){return jc}),Promise.resolve().then(function(){return qc}),Promise.resolve().then(function(){return Kc}),Promise.resolve().then(function(){return Yc}),Promise.resolve().then(function(){return tl}),Promise.resolve().then(function(){return ol}),Promise.resolve().then(function(){return ul}),Promise.resolve().then(function(){return fl}),Promise.resolve().then(function(){return Il}),Promise.resolve().then(function(){return Dl}),Promise.resolve().then(function(){return td}),Promise.resolve().then(function(){return ld}),Promise.resolve().then(function(){return tc}),Promise.resolve().then(function(){return Ed}),Promise.resolve().then(function(){return Gd}),Promise.resolve().then(function(){return wd}),Promise.resolve().then(function(){return tu}),Promise.resolve().then(function(){return uc}),Promise.resolve().then(function(){return fu}),Promise.resolve().then(function(){return gu}),Promise.resolve().then(function(){return sa}),Promise.resolve().then(function(){return bu}),Promise.resolve().then(function(){return yu}),Promise.resolve().then(function(){return vu}),Promise.resolve().then(function(){return Ru}),Promise.resolve().then(function(){return Au}),Promise.resolve().then(function(){return Pu}),Promise.resolve().then(function(){return zu}),Promise.resolve().then(function(){return rp}),Promise.resolve().then(function(){return up}),Promise.resolve().then(function(){return mp}),Promise.resolve().then(function(){return wp}),Promise.resolve().then(function(){return xp}),Promise.resolve().then(function(){return Ep}),Promise.resolve().then(function(){return Ap}),Promise.resolve().then(function(){return Dp}),Promise.resolve().then(function(){return Up}),Promise.resolve().then(function(){return $l}),Promise.resolve().then(function(){return Jp}),Promise.resolve().then(function(){return Qp}),Promise.resolve().then(function(){return th}),Promise.resolve().then(function(){return rh}),Promise.resolve().then(function(){return uh}),Promise.resolve().then(function(){return yh}),Promise.resolve().then(function(){return xh}),Promise.resolve().then(function(){return Ch}),Promise.resolve().then(function(){return Sh}),Promise.resolve().then(function(){return Th}),Promise.resolve().then(function(){return Ah}),Promise.resolve().then(function(){return Oh}),Promise.resolve().then(function(){return zh}),Promise.resolve().then(function(){return Wh}),Promise.resolve().then(function(){return Bh}),Promise.resolve().then(function(){return Kh}),Promise.resolve().then(function(){return Qh}),Promise.resolve().then(function(){return nf}),Promise.resolve().then(function(){return cf}),Promise.resolve().then(function(){return ff}),Promise.resolve().then(function(){return bf}),Promise.resolve().then(function(){return vf}),Promise.resolve().then(function(){return Cf}),Promise.resolve().then(function(){return Rf})];Promise.all(Us).then(e=>qs(e)).catch(e=>console.error(e));var Ws=Object.freeze({__proto__:null,default:'// ReSpec Worker\n"use strict";\n// hljs is either inlined by core/worker.js (preferred) or loaded below via\n// importScripts as a fallback when the inline fetch was not possible.\nif (typeof self.hljs === "undefined" && self.RESPEC_HIGHLIGHT_URL) {\n try {\n importScripts(self.RESPEC_HIGHLIGHT_URL);\n } catch (err) {\n console.error("Network error loading highlighter", err);\n }\n}\n\nself.addEventListener("message", ({ data }) => {\n switch (data.action) {\n case "highlight-load-lang": {\n const { langURL, langScript, propName, lang } = data;\n console.warn(\n `[ReSpec] The "highlight-load-lang" worker action is deprecated ` +\n `and will be removed in a future version. ` +\n `To migrate, fetch your language script in the main thread and ` +\n `send the text as "langScript" instead of "langURL". ` +\n `The "langURL" path may fail in Firefox. ` +\n `See https://github.com/speced/respec/issues/5228`\n );\n try {\n if (langScript) {\n const blob = new Blob([langScript], {\n type: "application/javascript",\n });\n const objectURL = URL.createObjectURL(blob);\n try {\n importScripts(objectURL);\n } finally {\n URL.revokeObjectURL(objectURL);\n }\n } else if (langURL) {\n const { protocol, hostname } = new URL(langURL);\n const isSecure =\n protocol === "https:" ||\n (protocol === "http:" &&\n (hostname === "localhost" ||\n hostname === "127.0.0.1" ||\n hostname === "[::1]"));\n if (!isSecure) {\n throw new Error(\n `langURL must be https: or http: on localhost, got "${langURL}"`\n );\n }\n importScripts(langURL);\n } else {\n throw new Error(\n `No langScript or langURL provided for language "${lang}"`\n );\n }\n if (typeof self[propName] === "function") {\n self.hljs.registerLanguage(lang, self[propName]);\n } else {\n throw new Error(\n `Language definer "${propName}" is not a function on self`\n );\n }\n } catch (err) {\n console.error("Failed to load or register language", lang, err);\n }\n delete data.langScript;\n delete data.langURL;\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 Object.assign(data, { value: code, language: "" });\n }\n break;\n }\n }\n self.postMessage(data);\n});\n'});var Fs=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 Hs="w3c/group";async function Bs(e){let t="",n=e;e.includes("/")&&([t,n]=e.split("/",2));const r=new URL(`${n}/${t}`,"https://respec.org/w3c/groups/"),i=await mi(r.href);if(i.ok){const e=await i.json(),{id:t,name:n,patentURI:r,patentPolicy:s,type:o,wgURI:a}=e;return{wg:n,wgId:t,wgURI:a,wgPatentURI:r,wgPatentPolicy:s,groupType:o}}const s=await i.text();let o,a=`Failed to fetch group details (HTTP: ${i.status}).`;409===i.status?[a,o]=s.split("\n",2):404===i.status&&(o=qi`See the list of [supported group names](https://respec.org/w3c/groups/) to use with the ${"[group]"} configuration option.`),Ni(a,Hs,{hint:o})}var Gs=Object.freeze({__proto__:null,name:Hs,run:async function(e){if(!e.group)return;const{group:t}=e,n=Array.isArray(t)?await async function(e){const t=await Promise.all(e.map(Bs)),n={wg:[],wgId:[],wgURI:[],wgPatentURI:[],wgPatentPolicy:[],groupType:[]};for(const e of t.filter(Boolean))for(const t of Object.keys(n))n[t].push(e[t]);return n}(t):await Bs(t);Object.assign(e,n)}});function Vs(e){if(!e.key){const t="Found a link without `key` attribute in the configuration. See dev console.";return Ii(t,"core/templates/show-link"),void console.warn(t,e)}return Or`
97
97
  <dt class="${e.class?e.class:null}">${e.key}</dt>
98
- ${e.data?e.data.map(Gs):Gs(e)}
99
- `}function Gs(e){return Or`<dd class="${e.class?e.class:null}">
98
+ ${e.data?e.data.map(Js):Js(e)}
99
+ `}function Js(e){return Or`<dd class="${e.class?e.class:null}">
100
100
  ${e.href?Or`<a href="${e.href}">${e.value||e.href}</a>`:e.value}
101
- </dd>`}const Vs="core/templates/show-logo";function Js(e,t){const n=Or`<a href="${e.url||null}" class="logo"
101
+ </dd>`}const Zs="core/templates/show-logo";function Ks(e,t){const n=Or`<a href="${e.url||null}" class="logo"
102
102
  ><img
103
103
  alt="${e.alt||null}"
104
104
  crossorigin
@@ -107,7 +107,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
107
107
  src="${e.src||null}"
108
108
  width="${e.width||null}"
109
109
  />
110
- </a>`;if(!e.alt){const r=qi`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Ni(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,Vs,{hint:r,elements:[n]})}if(!e.src){const e=qi`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Ni(`Logo at index ${t} is missing "\`src\`" property.`,Vs,{hint:e,elements:[n]})}return n}const Zs="core/templates/show-people",Ks=di({en:{until:e=>Or` Until ${e} `},es:{until:e=>Or` Hasta ${e} `},ko:{until:e=>Or` ${e} 이전 `},ja:{until:e=>Or` ${e} 以前 `},de:{until:e=>Or` bis ${e} `},zh:{until:e=>Or` 直到 ${e} `}});function Ys(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(i=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,s=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${i}\`](${n}#${i})" configuration option.`;if(!e.name)return Ni(`${s} Missing required property \`"name"\`.`,Zs,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${s} ORCID "${e.orcid}" at index ${t} is invalid.`,i=`The origin should be "https://orcid.org", not "${r.origin}".`;return Ni(n,Zs,{hint:i}),!1}const i=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(i))return Ni(`${s} ORCID "${i}" has wrong format.`,Zs,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter(e=>/\d/.test(e)).map(Number).reduce((e,t)=>2*(e+t),0),r=(12-n%11)%11,i=10===r?"X":String(r);return t===i}(n))return Ni(`${s} ORCID "${n}" failed checksum check.`,Zs,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(o=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(o)?new Date(o):"Invalid Date").toString())?(Ni(`${s} The property "\`retiredDate\`" is not a valid date.`,Zs,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every((e,r)=>{switch(!0){case"object"!=typeof e:return Ni(`${n}. Member "extra" at index ${r} is not an object.`,Zs,{hint:t}),!1;case!e.hasOwnProperty("name"):return Ni(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,Zs,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Ni(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,Zs,{hint:t}),!1}return!0}):(Ni(`${n}. A person's "extras" member must be an array.`,Zs,{hint:t}),!1)}(e.extras??[],r,s))&&(e.url&&e.mailto&&Ii(`${s} Has both "url" and "mailto" property.`,Zs,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&Ii(`${s} Has a "\`companyURL\`" property but no "\`company\`" property.`,Zs,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var o});var i;return n.filter(r).map(Xs)}function Xs(e){const t=[e.name],n=[e.company],r=e.w3cid||null,i=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";i.push(Or`<a class="${n}" href="${e.url}">${t}</a>`)}else i.push(Or`<span class="p-name fn">${t}</span>`);if(e.orcid&&i.push(Or`<a class="p-name orcid" href="${e.orcid}">${Or`<svg
110
+ </a>`;if(!e.alt){const r=qi`Add the missing "\`alt\`" property describing the logo. See ${"[logos]"} for more information.`;Ni(`Logo at index ${t}${e.src?`, with \`src\` ${e.src}, `:""} is missing required "\`alt\`" property.`,Zs,{hint:r,elements:[n]})}if(!e.src){const e=qi`The \`src\` property is required on every logo. See ${"[logos]"} for more information.`;Ni(`Logo at index ${t} is missing "\`src\`" property.`,Zs,{hint:e,elements:[n]})}return n}const Ys="core/templates/show-people",Xs=ui({en:{until:e=>Or` Until ${e} `},es:{until:e=>Or` Hasta ${e} `},ko:{until:e=>Or` ${e} 이전 `},ja:{until:e=>Or` ${e} 以前 `},de:{until:e=>Or` bis ${e} `},zh:{until:e=>Or` 直到 ${e} `}});function Qs(e,t){const n=e[t];if(!Array.isArray(n)||!n.length)return;const r=(i=t,function(e,t){const n="https://respec.org/docs/",r=`See [person](${n}#person) configuration for available options.`,s=`Error processing the [person object](${n}#person) at index ${t} of the "[\`${i}\`](${n}#${i})" configuration option.`;if(!e.name)return Ni(`${s} Missing required property \`"name"\`.`,Ys,{hint:r}),!1;if(e.orcid){const{orcid:n}=e,r=new URL(n,"https://orcid.org/");if("https://orcid.org"!==r.origin){const n=`${s} ORCID "${e.orcid}" at index ${t} is invalid.`,i=`The origin should be "https://orcid.org", not "${r.origin}".`;return Ni(n,Ys,{hint:i}),!1}const i=r.pathname.slice(1).replace(/\/$/,"");if(!/^\d{4}-\d{4}-\d{4}-\d{3}(\d|X)$/.test(i))return Ni(`${s} ORCID "${i}" has wrong format.`,Ys,{hint:'ORCIDs have the format "1234-1234-1234-1234."'}),!1;if(!function(e){const t=e[e.length-1],n=e.split("").slice(0,-1).filter(e=>/\d/.test(e)).map(Number).reduce((e,t)=>2*(e+t),0),r=(12-n%11)%11,i=10===r?"X":String(r);return t===i}(n))return Ni(`${s} ORCID "${n}" failed checksum check.`,Ys,{hint:"Please check that the ORCID is valid."}),!1;e.orcid=r.href}return e.retiredDate&&(o=e.retiredDate,"Invalid Date"===(/\d{4}-\d{2}-\d{2}/.test(o)?new Date(o):"Invalid Date").toString())?(Ni(`${s} The property "\`retiredDate\`" is not a valid date.`,Ys,{hint:`The expected format is YYYY-MM-DD. ${r}`}),!1):!(e.hasOwnProperty("extras")&&!function(e,t,n){return Array.isArray(e)?e.every((e,r)=>{switch(!0){case"object"!=typeof e:return Ni(`${n}. Member "extra" at index ${r} is not an object.`,Ys,{hint:t}),!1;case!e.hasOwnProperty("name"):return Ni(`${n} \`PersonExtra\` object at index ${r} is missing required "name" member.`,Ys,{hint:t}),!1;case"string"==typeof e.name&&""===e.name.trim():return Ni(`${n} \`PersonExtra\` object at index ${r} "name" can't be empty.`,Ys,{hint:t}),!1}return!0}):(Ni(`${n}. A person's "extras" member must be an array.`,Ys,{hint:t}),!1)}(e.extras??[],r,s))&&(e.url&&e.mailto&&Ii(`${s} Has both "url" and "mailto" property.`,Ys,{hint:`Please choose either "url" or "mailto" ("url" is preferred). ${r}`}),e.companyURL&&!e.company&&Ii(`${s} Has a "\`companyURL\`" property but no "\`company\`" property.`,Ys,{hint:`Please add a "\`company\`" property. ${r}.`}),!0);var o});var i;return n.filter(r).map(eo)}function eo(e){const t=[e.name],n=[e.company],r=e.w3cid||null,i=[];if(e.mailto&&(e.url=`mailto:${e.mailto}`),e.url){const n="mailto:"===new URL(e.url,document.location.href).protocol?"ed_mailto u-email email p-name":"u-url url p-name fn";i.push(Or`<a class="${n}" href="${e.url}">${t}</a>`)}else i.push(Or`<span class="p-name fn">${t}</span>`);if(e.orcid&&i.push(Or`<a class="p-name orcid" href="${e.orcid}">${Or`<svg
111
111
  width="16"
112
112
  height="16"
113
113
  xmlns="http://www.w3.org/2000/svg"
@@ -128,60 +128,60 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
128
128
  />
129
129
  </svg>`}</a>`),e.company){const t="p-org org h-org",r=e.companyURL?Or`<a class="${t}" href="${e.companyURL}">${n}</a>`:Or`<span class="${t}">${n}</span>`;i.push(Or` (${r})`)}e.note&&i.push(document.createTextNode(` (${e.note})`)),e.extras&&i.push(...e.extras.map(e=>Or`, ${function(e){const t=e.class||null,{name:n,href:r}=e;return r?Or`<a href="${r}" class="${t}">${n}</a>`:Or`<span class="${t}">${n}</span>`}(e)}`));const{retiredDate:s}=e;if(e.retiredDate){const e=Or`<time datetime="${s}"
130
130
  >${ei.format(new Date(s??""))}</time
131
- >`;i.push(Or` - ${Ks.until(e)} `)}return Or`<dd
131
+ >`;i.push(Or` - ${Xs.until(e)} `)}return Or`<dd
132
132
  class="editor p-author h-card vcard"
133
133
  data-editor-id="${r}"
134
134
  >
135
135
  ${i}
136
- </dd>`}const Qs=di({en:{archives:"archives",author:"Author:",authors:"Authors:",commit_history:"Commit history",edited_in_place:"edited in place",editor:"Editor:",editors:"Editors:",feedback:"Feedback:",former_editor:"Former editor:",former_editors:"Former editors:",history:"History:",implementation_report:"Implementation report:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",latest_recommendation:"Latest Recommendation:",message_topic:"… message topic …",more_details_about_this_doc:"More details about this document",multiple_alternates:e=>`This document is also available in ${e?"these non-normative formats":"this non-normative format"}:`,prev_editor_draft:"Previous editor's draft:",prev_recommendation:"Previous Recommendation:",prev_version:"Previous version:",publication_history:"Publication history",test_suite:"Test suite:",this_version:"This version:",with_subject_line:"with subject line",your_topic_here:"YOUR TOPIC HERE"},ko:{author:"저자:",authors:"저자:",editor:"편집자:",editors:"편집자:",former_editor:"이전 편집자:",former_editors:"이전 편집자:",latest_editors_draft:"최신 편집 초안:",latest_published_version:"최신 버전:",this_version:"현재 버전:"},zh:{author:"作者:",authors:"作者:",commit_history:"Git提交历史",editor:"编辑:",editors:"编辑:",feedback:"反馈:",former_editor:"原编辑:",former_editors:"原编辑:",history:"历史:",implementation_report:"实现报告:",latest_editors_draft:"最新编辑草稿:",latest_published_version:"最新发布版本:",latest_recommendation:"最新发布的正式推荐标准:",message_topic:"… 邮件主题 …",prev_editor_draft:"上一版编辑草稿:",prev_recommendation:"上一版正式推荐标准:",prev_version:"上一版:",test_suite:"测试套件:",this_version:"本版本:"},ja:{archives:"アーカイブ",author:"著者:",authors:"著者:",commit_history:"更新履歴",edited_in_place:"改版なく更新",editor:"編者:",editors:"編者:",feedback:"フィードバック:",former_editor:"以前の版の編者:",former_editors:"以前の版の編者:",history:"履歴:",implementation_report:"実装レポート:",latest_editors_draft:"最新の編集用草案:",latest_published_version:"最新バージョン:",latest_recommendation:"最新の勧告版:",message_topic:"… メール件名 …",more_details_about_this_doc:"この文書についてのより詳細",prev_editor_draft:"前回の編集用草案:",prev_recommendation:"前回の勧告版:",prev_version:"前回のバージョン:",publication_history:"公表履歴",test_suite:"テストスイート:",this_version:"このバージョン:",with_subject_line:"次の件名で"},nl:{archives:"archieven",author:"Auteur:",authors:"Auteurs:",commit_history:"Commit geschiedenis",editor:"Redacteur:",editors:"Redacteurs:",feedback:"Feedback:",former_editor:"Voormalige redacteur:",former_editors:"Voormalige redacteurs:",history:"Geschiedenis:",implementation_report:"Implementatie rapport:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",latest_recommendation:"Laatste aanbeveling:",more_details_about_this_doc:"Meer informatie over dit document",multiple_alternates:e=>`Dit document is ook beschikbaar in ${e?"dit niet-normatieve formaat":"deze niet-normatieve formaten"}:`,publication_history:"Publicatiegeschiedenis",this_version:"Deze versie:"},es:{archives:"archivos",author:"Autor:",authors:"Autores:",commit_history:"Historial de cambios",edited_in_place:"editado en lugar",editor:"Editor:",editors:"Editores:",feedback:"Comentarios:",former_editor:"Antiguo editor:",former_editors:"Antiguos editores:",history:"Historia:",implementation_report:"Informe de implementación:",latest_editors_draft:"Última versión del editor:",latest_published_version:"Última versión publicada:",latest_recommendation:"Recomendación más reciente:",message_topic:"… detalles de mensaje …",more_details_about_this_doc:"Más detalles sobre este documento:",publication_history:"Historial de publicación",prev_editor_draft:"Última versión del editor:",prev_recommendation:"Última Recomendación:",prev_version:"Última versión:",test_suite:"Suite de pruebas:",this_version:"Esta versión:",with_subject_line:"con línea de asunto",your_topic_here:"TU SUJETO AQUÍ"},de:{archives:"Archiv",author:"Autor/in:",authors:"Autor/innen:",commit_history:"Commit-Historie",edited_in_place:"zuletzt geändert am",editor:"Redaktion:",editors:"Redaktion:",feedback:"Feedback:",former_editor:"Frühere Mitwirkende:",former_editors:"Frühere Mitwirkende:",history:"Verlauf:",implementation_report:"Umsetzungsbericht:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",latest_recommendation:"Aktuellste Empfehlung:",more_details_about_this_doc:"Mehr Informationen über dieses Dokument",multiple_alternates:e=>`Dieses Dokument ist ebenfalls in ${e?"diesen nicht-normativen Formaten verfügbar":"diesem nicht-normativen Format verfügbar"}:`,prev_editor_draft:"Vorheriger Entwurf:",prev_recommendation:"Vorherige Empfehlung:",prev_version:"Vorherige Version:",publication_history:"Veröffentlichungsverlauf",test_suite:"Testumgebung:",this_version:"Diese Fassung:"},cs:{archives:"archivy",author:"Autor:",authors:"Autoři:",commit_history:"Historie změn",edited_in_place:"upraveno přímo",editor:"Editor:",editors:"Editoři:",feedback:"Zpětná vazba:",former_editor:"Bývalý editor:",former_editors:"Bývalí editoři:",history:"Historie:",implementation_report:"Implementační zpráva:",latest_editors_draft:"Nejnovější pracovní verze:",latest_published_version:"Nejnovější publikovaná verze:",latest_recommendation:"Nejnovější doporučení:",message_topic:"… předmět zprávy …",more_details_about_this_doc:"Více informací o tomto dokumentu",multiple_alternates:e=>`Tento dokument je také dostupný v ${e?"těchto ne-normativních formátech":"tomto ne-normativním formátu"}:`,prev_editor_draft:"Předchozí pracovní verze:",prev_recommendation:"Předchozí doporučení:",prev_version:"Předchozí verze:",publication_history:"Historie publikací",test_suite:"Testovací sada:",this_version:"Tato verze:",with_subject_line:"s předmětem",your_topic_here:"VÁŠ PŘEDMĚT ZDE"}});function eo(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&(t=document.createElement("h2"),t.textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}var to=(e,t)=>{Bi("beforesave",e=>{const t=e.querySelector(".head details");t&&(t.open=!0)});const n=ro(e.thisVersion),r=ro(e.latestVersion),i=ro(e.edDraftURI),s=ro(e.historyURI),o=ro(e.prevVersion);return Or`<div class="head">
137
- ${(e.logos??[]).length?Or`<p class="logos">${(e.logos??[]).map(Js)}</p>`:""}
138
- ${document.querySelector("h1#title")} ${eo(e)}
136
+ </dd>`}const to=ui({en:{archives:"archives",author:"Author:",authors:"Authors:",commit_history:"Commit history",edited_in_place:"edited in place",editor:"Editor:",editors:"Editors:",feedback:"Feedback:",former_editor:"Former editor:",former_editors:"Former editors:",history:"History:",implementation_report:"Implementation report:",latest_editors_draft:"Latest editor's draft:",latest_published_version:"Latest published version:",latest_recommendation:"Latest Recommendation:",message_topic:"… message topic …",more_details_about_this_doc:"More details about this document",multiple_alternates:e=>`This document is also available in ${e?"these non-normative formats":"this non-normative format"}:`,prev_editor_draft:"Previous editor's draft:",prev_recommendation:"Previous Recommendation:",prev_version:"Previous version:",publication_history:"Publication history",test_suite:"Test suite:",this_version:"This version:",with_subject_line:"with subject line",your_topic_here:"YOUR TOPIC HERE"},ko:{author:"저자:",authors:"저자:",editor:"편집자:",editors:"편집자:",former_editor:"이전 편집자:",former_editors:"이전 편집자:",latest_editors_draft:"최신 편집 초안:",latest_published_version:"최신 버전:",this_version:"현재 버전:"},zh:{author:"作者:",authors:"作者:",commit_history:"Git提交历史",editor:"编辑:",editors:"编辑:",feedback:"反馈:",former_editor:"原编辑:",former_editors:"原编辑:",history:"历史:",implementation_report:"实现报告:",latest_editors_draft:"最新编辑草稿:",latest_published_version:"最新发布版本:",latest_recommendation:"最新发布的正式推荐标准:",message_topic:"… 邮件主题 …",prev_editor_draft:"上一版编辑草稿:",prev_recommendation:"上一版正式推荐标准:",prev_version:"上一版:",test_suite:"测试套件:",this_version:"本版本:"},ja:{archives:"アーカイブ",author:"著者:",authors:"著者:",commit_history:"更新履歴",edited_in_place:"改版なく更新",editor:"編者:",editors:"編者:",feedback:"フィードバック:",former_editor:"以前の版の編者:",former_editors:"以前の版の編者:",history:"履歴:",implementation_report:"実装レポート:",latest_editors_draft:"最新の編集用草案:",latest_published_version:"最新バージョン:",latest_recommendation:"最新の勧告版:",message_topic:"… メール件名 …",more_details_about_this_doc:"この文書についてのより詳細",prev_editor_draft:"前回の編集用草案:",prev_recommendation:"前回の勧告版:",prev_version:"前回のバージョン:",publication_history:"公表履歴",test_suite:"テストスイート:",this_version:"このバージョン:",with_subject_line:"次の件名で"},nl:{archives:"archieven",author:"Auteur:",authors:"Auteurs:",commit_history:"Commit geschiedenis",editor:"Redacteur:",editors:"Redacteurs:",feedback:"Feedback:",former_editor:"Voormalige redacteur:",former_editors:"Voormalige redacteurs:",history:"Geschiedenis:",implementation_report:"Implementatie rapport:",latest_editors_draft:"Laatste werkversie:",latest_published_version:"Laatst gepubliceerde versie:",latest_recommendation:"Laatste aanbeveling:",more_details_about_this_doc:"Meer informatie over dit document",multiple_alternates:e=>`Dit document is ook beschikbaar in ${e?"dit niet-normatieve formaat":"deze niet-normatieve formaten"}:`,publication_history:"Publicatiegeschiedenis",this_version:"Deze versie:"},es:{archives:"archivos",author:"Autor:",authors:"Autores:",commit_history:"Historial de cambios",edited_in_place:"editado en lugar",editor:"Editor:",editors:"Editores:",feedback:"Comentarios:",former_editor:"Antiguo editor:",former_editors:"Antiguos editores:",history:"Historia:",implementation_report:"Informe de implementación:",latest_editors_draft:"Última versión del editor:",latest_published_version:"Última versión publicada:",latest_recommendation:"Recomendación más reciente:",message_topic:"… detalles de mensaje …",more_details_about_this_doc:"Más detalles sobre este documento:",publication_history:"Historial de publicación",prev_editor_draft:"Última versión del editor:",prev_recommendation:"Última Recomendación:",prev_version:"Última versión:",test_suite:"Suite de pruebas:",this_version:"Esta versión:",with_subject_line:"con línea de asunto",your_topic_here:"TU SUJETO AQUÍ"},de:{archives:"Archiv",author:"Autor/in:",authors:"Autor/innen:",commit_history:"Commit-Historie",edited_in_place:"zuletzt geändert am",editor:"Redaktion:",editors:"Redaktion:",feedback:"Feedback:",former_editor:"Frühere Mitwirkende:",former_editors:"Frühere Mitwirkende:",history:"Verlauf:",implementation_report:"Umsetzungsbericht:",latest_editors_draft:"Letzter Entwurf:",latest_published_version:"Letzte publizierte Fassung:",latest_recommendation:"Aktuellste Empfehlung:",more_details_about_this_doc:"Mehr Informationen über dieses Dokument",multiple_alternates:e=>`Dieses Dokument ist ebenfalls in ${e?"diesen nicht-normativen Formaten verfügbar":"diesem nicht-normativen Format verfügbar"}:`,prev_editor_draft:"Vorheriger Entwurf:",prev_recommendation:"Vorherige Empfehlung:",prev_version:"Vorherige Version:",publication_history:"Veröffentlichungsverlauf",test_suite:"Testumgebung:",this_version:"Diese Fassung:"},cs:{archives:"archivy",author:"Autor:",authors:"Autoři:",commit_history:"Historie změn",edited_in_place:"upraveno přímo",editor:"Editor:",editors:"Editoři:",feedback:"Zpětná vazba:",former_editor:"Bývalý editor:",former_editors:"Bývalí editoři:",history:"Historie:",implementation_report:"Implementační zpráva:",latest_editors_draft:"Nejnovější pracovní verze:",latest_published_version:"Nejnovější publikovaná verze:",latest_recommendation:"Nejnovější doporučení:",message_topic:"… předmět zprávy …",more_details_about_this_doc:"Více informací o tomto dokumentu",multiple_alternates:e=>`Tento dokument je také dostupný v ${e?"těchto ne-normativních formátech":"tomto ne-normativním formátu"}:`,prev_editor_draft:"Předchozí pracovní verze:",prev_recommendation:"Předchozí doporučení:",prev_version:"Předchozí verze:",publication_history:"Historie publikací",test_suite:"Testovací sada:",this_version:"Tato verze:",with_subject_line:"s předmětem",your_topic_here:"VÁŠ PŘEDMĚT ZDE"}});function no(e){let t=document.querySelector("h2#subtitle");return t&&t.parentElement?(t.remove(),e.subtitle=t.textContent.trim()):e.subtitle&&(t=document.createElement("h2"),t.textContent=e.subtitle,t.id="subtitle"),t&&t.classList.add("subtitle"),t}var ro=(e,t)=>{Hi("beforesave",e=>{const t=e.querySelector(".head details");t&&(t.open=!0)});const n=so(e.thisVersion),r=so(e.latestVersion),i=so(e.edDraftURI),s=so(e.historyURI),o=so(e.prevVersion);return Or`<div class="head">
137
+ ${(e.logos??[]).length?Or`<p class="logos">${(e.logos??[]).map(Ks)}</p>`:""}
138
+ ${document.querySelector("h1#title")} ${no(e)}
139
139
  <p id="w3c-state">${function(e){const t=e.isCR||e.isCRY?e.longStatus:e.textStatus,n=e.prependW3C?Or`<a href="https://www.w3.org/standards/types#${e.specStatus}"
140
140
  >W3C ${t}</a
141
141
  >`:Or`${t}`;return Or`${n}${" "}
142
142
  <time class="dt-published" datetime="${e.dashDate}"
143
143
  >${ei.format(e.publishDate)}</time
144
- >${e.modificationDate?Or`, ${Qs.edited_in_place}${" "}
144
+ >${e.modificationDate?Or`, ${to.edited_in_place}${" "}
145
145
  <time
146
146
  class="dt-modified"
147
147
  datetime="${Xr.format(e.modificationDate)}"
148
148
  >${ei.format(e.modificationDate)}</time
149
149
  >`:""}`}(e)}</p>
150
150
  <details open="${localStorage.getItem("tr-metadata")||"true"}">
151
- <summary>${Qs.more_details_about_this_doc}</summary>
151
+ <summary>${to.more_details_about_this_doc}</summary>
152
152
  <dl>
153
- ${e.thisVersion?Or`<dt>${Qs.this_version}</dt>
153
+ ${e.thisVersion?Or`<dt>${to.this_version}</dt>
154
154
  <dd>
155
155
  <a class="u-url" href="${e.thisVersion}"
156
156
  >${n}</a
157
157
  >
158
158
  </dd>`:""}
159
- ${"latestVersion"in e?Or`<dt>${Qs.latest_published_version}</dt>
159
+ ${"latestVersion"in e?Or`<dt>${to.latest_published_version}</dt>
160
160
  <dd>
161
161
  ${e.latestVersion?Or`<a href="${e.latestVersion}"
162
162
  >${r}</a
163
163
  >`:"none"}
164
164
  </dd>`:""}
165
165
  ${e.edDraftURI?Or`
166
- <dt>${Qs.latest_editors_draft}</dt>
166
+ <dt>${to.latest_editors_draft}</dt>
167
167
  <dd><a href="${e.edDraftURI}">${i}</a></dd>
168
168
  `:""}
169
- ${e.historyURI||e.github?Or`<dt>${Qs.history}</dt>
169
+ ${e.historyURI||e.github?Or`<dt>${to.history}</dt>
170
170
  ${e.historyURI?Or`<dd>
171
171
  <a href="${e.historyURI}">${s}</a>
172
172
  </dd>`:""}
173
173
  ${e.github?Or`<dd>
174
174
  <a
175
175
  href="${e.github.commitHistoryURL}"
176
- >${Qs.commit_history}</a
176
+ >${to.commit_history}</a
177
177
  >
178
178
  </dd>`:""}`:""}
179
179
  ${e.testSuiteURI?Or`
180
- <dt>${Qs.test_suite}</dt>
180
+ <dt>${to.test_suite}</dt>
181
181
  <dd><a href="${e.testSuiteURI}">${e.testSuiteURI}</a></dd>
182
182
  `:""}
183
183
  ${e.implementationReportURI?Or`
184
- <dt>${Qs.implementation_report}</dt>
184
+ <dt>${to.implementation_report}</dt>
185
185
  <dd>
186
186
  <a href="${e.implementationReportURI}"
187
187
  >${e.implementationReportURI}</a
@@ -189,43 +189,43 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
189
189
  </dd>
190
190
  `:""}
191
191
  ${e.prevED?Or`
192
- <dt>${Qs.prev_editor_draft}</dt>
192
+ <dt>${to.prev_editor_draft}</dt>
193
193
  <dd><a href="${e.prevED}">${e.prevED}</a></dd>
194
194
  `:""}
195
195
  ${e.showPreviousVersion?Or`
196
- <dt>${Qs.prev_version}</dt>
196
+ <dt>${to.prev_version}</dt>
197
197
  <dd><a href="${e.prevVersion}">${o}</a></dd>
198
198
  `:""}
199
199
  ${e.prevRecURI?e.isRec?Or`
200
- <dt>${Qs.prev_recommendation}</dt>
200
+ <dt>${to.prev_recommendation}</dt>
201
201
  <dd><a href="${e.prevRecURI}">${e.prevRecURI}</a></dd>
202
202
  `:Or`
203
- <dt>${Qs.latest_recommendation}</dt>
203
+ <dt>${to.latest_recommendation}</dt>
204
204
  <dd><a href="${e.prevRecURI}">${e.prevRecURI}</a></dd>
205
205
  `:""}
206
206
  ${(e.editors??[]).length?Or`
207
207
  <dt>
208
- ${(e.editors??[]).length>1?Qs.editors:Qs.editor}
208
+ ${(e.editors??[]).length>1?to.editors:to.editor}
209
209
  </dt>
210
- ${Ys(e,"editors")}
210
+ ${Qs(e,"editors")}
211
211
  `:""}
212
212
  ${(e.formerEditors??[]).length?Or`
213
213
  <dt>
214
- ${(e.formerEditors??[]).length>1?Qs.former_editors:Qs.former_editor}
214
+ ${(e.formerEditors??[]).length>1?to.former_editors:to.former_editor}
215
215
  </dt>
216
- ${Ys(e,"formerEditors")}
216
+ ${Qs(e,"formerEditors")}
217
217
  `:""}
218
218
  ${(e.authors??[]).length?Or`
219
219
  <dt>
220
- ${(e.authors??[]).length>1?Qs.authors:Qs.author}
220
+ ${(e.authors??[]).length>1?to.authors:to.author}
221
221
  </dt>
222
- ${Ys(e,"authors")}
222
+ ${Qs(e,"authors")}
223
223
  `:""}
224
- ${e.github||e.wgPublicList?Or`<dt>${Qs.feedback}</dt>
225
- ${no(e)}`:""}
224
+ ${e.github||e.wgPublicList?Or`<dt>${to.feedback}</dt>
225
+ ${io(e)}`:""}
226
226
  ${e.errata?Or`<dt>Errata:</dt>
227
227
  <dd><a href="${e.errata}">Errata exists</a>.</dd>`:""}
228
- ${e.otherLinks?e.otherLinks.map(Hs):""}
228
+ ${e.otherLinks?e.otherLinks.map(Vs):""}
229
229
  </dl>
230
230
  </details>
231
231
  ${e.isRec?Or`<p>
@@ -237,7 +237,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
237
237
  >.
238
238
  </p>`:""}
239
239
  ${e.alternateFormats?Or`<p>
240
- ${Qs.multiple_alternates(t.multipleAlternates)}
240
+ ${to.multiple_alternates(t.multipleAlternates)}
241
241
  ${t.alternatesHTML}
242
242
  </p>`:""}
243
243
  ${function(e){const t=document.querySelector(".copyright");if(t)return t.remove(),t;if(e.isUnofficial&&e.licenseInfo)return Or`<p class="copyright">
@@ -261,20 +261,20 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
261
261
  <a rel="license" href="${t}" title="${r}">${n}</a> rules apply.`}(e.licenseInfo)}
262
262
  </p>`}(e)}(e)}
263
263
  <hr title="Separator for header" />
264
- </div>`};function no(e){const t=[];if(e.github){const{repoURL:n,issuesURL:r,newIssuesURL:i,pullsURL:s,fullName:o}=e.github;t.push(Or`<dd>
264
+ </div>`};function io(e){const t=[];if(e.github){const{repoURL:n,issuesURL:r,newIssuesURL:i,pullsURL:s,fullName:o}=e.github;t.push(Or`<dd>
265
265
  <a href="${n}">GitHub ${o}</a>
266
266
  (<a href="${s}">pull requests</a>,
267
267
  <a href="${i}">new issue</a>,
268
268
  <a href="${r}">open issues</a>)
269
- </dd>`)}if(e.wgPublicList){const n=new URL(`mailto:${e.wgPublicList}@w3.org`),r=e.subjectPrefix??`[${e.shortName}] ${Qs.your_topic_here}`,i=Or`<a
269
+ </dd>`)}if(e.wgPublicList){const n=new URL(`mailto:${e.wgPublicList}@w3.org`),r=e.subjectPrefix??`[${e.shortName}] ${to.your_topic_here}`,i=Or`<a
270
270
  href="${n.href}?subject=${encodeURIComponent(r)}"
271
271
  >${n.pathname}</a
272
- >`,s=e.subjectPrefix||Or`[${e.shortName}] <em>${Qs.message_topic}</em>`,o=Or`${Qs.with_subject_line}${" "}
272
+ >`,s=e.subjectPrefix||Or`[${e.shortName}] <em>${to.message_topic}</em>`,o=Or`${to.with_subject_line}${" "}
273
273
  <kbd>${s}</kbd>`,a=new URL(e.wgPublicList,"https://lists.w3.org/Archives/Public/"),c=Or`(<a href="${a}" rel="discussion"
274
- >${Qs.archives}</a
275
- >)`;t.push(Or`<dd>${i} ${o} ${c}</dd>`)}return t}function ro(e){if(!e)return e;try{return decodeURI(e)}catch{return e}}var io=(e,t)=>{const n=document.querySelector(".copyright");n&&n.remove();const r=document.querySelector("h1#title"),i=r?.cloneNode(!0);return Or`<div class="head">
276
- ${(e.logos??[]).length?Or`<p class="logos">${(e.logos??[]).map(Js)}</p>`:""}
277
- ${r} ${eo(e)}
274
+ >${to.archives}</a
275
+ >)`;t.push(Or`<dd>${i} ${o} ${c}</dd>`)}return t}function so(e){if(!e)return e;try{return decodeURI(e)}catch{return e}}var oo=(e,t)=>{const n=document.querySelector(".copyright");n&&n.remove();const r=document.querySelector("h1#title"),i=r?.cloneNode(!0);return Or`<div class="head">
276
+ ${(e.logos??[]).length?Or`<p class="logos">${(e.logos??[]).map(Ks)}</p>`:""}
277
+ ${r} ${no(e)}
278
278
  <p id="w3c-state">
279
279
  <a href="https://www.w3.org/standards/types#reports"
280
280
  >${e.longStatus}</a
@@ -284,20 +284,20 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
284
284
  >
285
285
  </p>
286
286
  <dl>
287
- ${e.thisVersion?Or`<dt>${Qs.this_version}</dt>
287
+ ${e.thisVersion?Or`<dt>${to.this_version}</dt>
288
288
  <dd>
289
289
  <a class="u-url" href="${e.thisVersion}"
290
290
  >${e.thisVersion}</a
291
291
  >
292
292
  </dd>`:""}
293
- ${"latestVersion"in e?Or`<dt>${Qs.latest_published_version}</dt>
293
+ ${"latestVersion"in e?Or`<dt>${to.latest_published_version}</dt>
294
294
  <dd>
295
295
  ${e.latestVersion?Or`<a href="${e.latestVersion}"
296
296
  >${e.latestVersion}</a
297
297
  >`:"none"}
298
298
  </dd>`:""}
299
299
  ${e.edDraftURI?Or`
300
- <dt>${Qs.latest_editors_draft}</dt>
300
+ <dt>${to.latest_editors_draft}</dt>
301
301
  <dd><a href="${e.edDraftURI}">${e.edDraftURI}</a></dd>
302
302
  `:""}
303
303
  ${e.testSuiteURI?Or`
@@ -324,25 +324,25 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
324
324
  `}
325
325
  ${(e.editors??[]).length?Or`
326
326
  <dt>
327
- ${(e.editors??[]).length>1?Qs.editors:Qs.editor}
327
+ ${(e.editors??[]).length>1?to.editors:to.editor}
328
328
  </dt>
329
- ${Ys(e,"editors")}
329
+ ${Qs(e,"editors")}
330
330
  `:""}
331
331
  ${(e.formerEditors??[]).length?Or`
332
332
  <dt>
333
- ${(e.formerEditors??[]).length>1?Qs.former_editors:Qs.former_editor}
333
+ ${(e.formerEditors??[]).length>1?to.former_editors:to.former_editor}
334
334
  </dt>
335
- ${Ys(e,"formerEditors")}
335
+ ${Qs(e,"formerEditors")}
336
336
  `:""}
337
337
  ${(e.authors??[]).length?Or`
338
338
  <dt>
339
- ${(e.authors??[]).length>1?Qs.authors:Qs.author}
339
+ ${(e.authors??[]).length>1?to.authors:to.author}
340
340
  </dt>
341
- ${Ys(e,"authors")}
341
+ ${Qs(e,"authors")}
342
342
  `:""}
343
- ${e.github||e.wgPublicList?Or`<dt>${Qs.feedback}</dt>
344
- ${no(e)}`:""}
345
- ${e.otherLinks?e.otherLinks.map(Hs):""}
343
+ ${e.github||e.wgPublicList?Or`<dt>${to.feedback}</dt>
344
+ ${io(e)}`:""}
345
+ ${e.otherLinks?e.otherLinks.map(Vs):""}
346
346
  </dl>
347
347
  ${e.alternateFormats?Or`<p>
348
348
  ${t.multipleAlternates?"This document is also available in these non-normative formats:":"This document is also available in this non-normative format:"}
@@ -377,7 +377,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
377
377
  `}
378
378
  </p>`}
379
379
  <hr title="Separator for header" />
380
- </div>`};const so=di({en:{sotd:"Status of This Document",status_at_publication:Or`This section describes the status of this
380
+ </div>`};const ao=ui({en:{sotd:"Status of This Document",status_at_publication:Or`This section describes the status of this
381
381
  document at the time of its publication. A list of current W3C
382
382
  publications and the latest revision of this technical report can be found
383
383
  in the
@@ -400,9 +400,9 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
400
400
  jeho zveřejnění. Seznam aktuálních publikací W3C a nejnovější verzi této
401
401
  technické zprávy najdete v
402
402
  <a href="https://www.w3.org/TR/">indexu standardů a návrhů W3C</a>
403
- na https://www.w3.org/TR/.`}}),oo="https://www.w3.org/policies/process/20250818/";function ao(e){return/^[aeiou]/i.test(e)?`an ${e}`:`a ${e}`}var co=(e,t)=>Or`
404
- <h2>${so.sotd}</h2>
405
- ${e.isPreview?lo(e):""}
403
+ na https://www.w3.org/TR/.`}}),co="https://www.w3.org/policies/process/20250818/";function lo(e){return/^[aeiou]/i.test(e)?`an ${e}`:`a ${e}`}var uo=(e,t)=>Or`
404
+ <h2>${ao.sotd}</h2>
405
+ ${e.isPreview?po(e):""}
406
406
  ${e.isUnofficial?function(e){const{additionalContent:t}=e;return Or`
407
407
  <p>
408
408
  This document is a draft of a potential specification. It has no official
@@ -418,7 +418,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
418
418
  </p>
419
419
  ${r}
420
420
  `}(e,t):Or`
421
- <p><em>${so.status_at_publication}</em></p>
421
+ <p><em>${ao.status_at_publication}</em></p>
422
422
  ${e.isMemberSubmission?function(e,t){return Or`
423
423
  ${t.additionalContent}
424
424
  ${e.isMemberSubmission?function(e){const t=`https://www.w3.org/Submission/${e.publishDate.getUTCFullYear()}/${e.submissionCommentNumber}/Comment/`,n="PP2017"===e.wgPatentPolicy?"https://www.w3.org/Consortium/Patent-Policy-20170801/":"https://www.w3.org/policies/patent-policy/";return Or`<p>
@@ -446,30 +446,30 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
446
446
  `}(e,t):Or`
447
447
  ${e.sotdAfterWGinfo?"":t.additionalContent}
448
448
  ${e.overrideStatus?"":Or` ${function(e){if(!e.wg)return;let t=null;const n=document.querySelector(".addition.proposed"),r=document.querySelector(".correction.proposed"),i=document.querySelector(".addition:not(.proposed)"),s=document.querySelector(".correction:not(.proposed)"),o=n||r||i||s;e.isRec&&o&&(n&&r||i&&s?t=Or`It includes
449
- ${n?Or`<a href="${oo}#proposed-amendments">
449
+ ${n?Or`<a href="${co}#proposed-amendments">
450
450
  proposed amendments</a
451
- >`:Or`<a href="${oo}#candidate-amendments">
451
+ >`:Or`<a href="${co}#candidate-amendments">
452
452
  candidate amendments</a
453
453
  >`},
454
454
  introducing substantive changes and new features since the previous
455
455
  recommendation.`:n||i?t=Or`It includes
456
- ${n?Or`<a href="${oo}#proposed-addition">
456
+ ${n?Or`<a href="${co}#proposed-addition">
457
457
  proposed additions</a
458
- >`:Or`<a href="${oo}#candidate-addition">
458
+ >`:Or`<a href="${co}#candidate-addition">
459
459
  candidate additions</a
460
460
  >`},
461
461
  introducing new features since the previous recommendation.`:(r||s)&&(t=Or`It includes
462
- ${r?Or`<a href="${oo}#proposed-corrections">
462
+ ${r?Or`<a href="${co}#proposed-corrections">
463
463
  proposed corrections</a
464
- >`:Or`<a href="${oo}#candidate-correction">
464
+ >`:Or`<a href="${co}#candidate-correction">
465
465
  candidate corrections</a
466
- >`}.`));const a=yo[e.specStatus]?Or` using the
467
- <a href="${oo}#recs-and-notes"
468
- >${yo[e.specStatus]}
466
+ >`}.`));const a=vo[e.specStatus]?Or` using the
467
+ <a href="${co}#recs-and-notes"
468
+ >${vo[e.specStatus]}
469
469
  track</a
470
470
  >`:"";return Or`<p>
471
- This document was published by ${uo(e)} as
472
- ${ao(e.longStatus)}${a}. ${t}
471
+ This document was published by ${ho(e)} as
472
+ ${lo(e.longStatus)}${a}. ${t}
473
473
  </p>`}(e)} `}
474
474
  ${e.sotdAfterWGinfo?t.additionalContent:""}
475
475
  ${e.isRec?function(e){const{revisedRecEnd:t}=e,n=document.querySelector("#sotd.updateable-rec");let r="";document.querySelector(".addition.proposed")?r="additions":document.querySelector(".correction.proposed")&&(r="corrections");return Or`
@@ -488,7 +488,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
488
488
  >
489
489
  for implementations.
490
490
  ${n?Or`Future updates to this recommendation may incorporate
491
- <a href="${oo}#allow-new-features">new features</a>.`:""}
491
+ <a href="${co}#allow-new-features">new features</a>.`:""}
492
492
  </p>
493
493
  ${document.querySelector(".addition:not(.proposed)")?Or`<p class="addition">
494
494
  Candidate additions are marked in the document.
@@ -512,13 +512,13 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
512
512
  >.
513
513
  </p>`:""}
514
514
  `}(e):function(e){const t=document.querySelector("#sotd.updateable-rec");let n=null,r=null,i=Or`Publication as
515
- ${ao(e.textStatus)} does not imply endorsement
515
+ ${lo(e.textStatus)} does not imply endorsement
516
516
  by W3C and its Members.`,s=Or`<p>
517
517
  This is a draft document and may be updated, replaced, or obsoleted by other
518
518
  documents at any time. It is inappropriate to cite this document as other
519
519
  than a work in progress.
520
520
  ${t?Or`Future updates to this upcoming recommendation may incorporate
521
- <a href="${oo}#allow-new-features">new features</a>.`:""}
521
+ <a href="${co}#allow-new-features">new features</a>.`:""}
522
522
  </p>`;"DISC"===e.specStatus&&(s=Or`<p>
523
523
  Publication as a Discontinued Draft implies that this document is no
524
524
  longer intended to advance or to be maintained. It is inappropriate to
@@ -542,7 +542,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
542
542
  from the previous Candidate Registry Snapshot that the Working
543
543
  Group${e.multipleWGs?"s intend":" intends"} to include in a
544
544
  subsequent Candidate Registry Snapshot.`,"LS"===e.pubMode&&(s=o);break;case"CRY":n=Or`A Candidate Registry Snapshot has received
545
- <a href="${oo}#dfn-wide-review">wide review</a>.`,r=Or`<p>
545
+ <a href="${co}#dfn-wide-review">wide review</a>.`,r=Or`<p>
546
546
  The W3C Membership and other interested parties are invited to review
547
547
  the document and send comments through ${e.humanPREnd}. Advisory
548
548
  Committee Representatives should consult their
@@ -551,7 +551,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
551
551
  >. Note that substantive technical comments were expected during the
552
552
  Candidate Recommendation review period that ended ${e.humanCREnd}.
553
553
  </p>`;break;case"CR":n=Or`A Candidate Recommendation Snapshot has received
554
- <a href="${oo}#dfn-wide-review">wide review</a>, is intended to
554
+ <a href="${co}#dfn-wide-review">wide review</a>, is intended to
555
555
  gather
556
556
  <a href="${e.implementationReportURI}">implementation experience</a>,
557
557
  and has commitments from Working Group members to
@@ -559,7 +559,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
559
559
  >royalty-free licensing</a
560
560
  >
561
561
  for implementations.`,s=Or`${t?Or`Future updates to this upcoming recommendation may incorporate
562
- <a href="${oo}#allow-new-features">new features</a>.`:""}`,r="LS"===e.pubMode?Or`<p>
562
+ <a href="${co}#allow-new-features">new features</a>.`:""}`,r="LS"===e.pubMode?Or`<p>
563
563
  Comments are welcome at any time but most especially before
564
564
  ${ei.format(e.crEnd)}.
565
565
  </p>`:Or`<p>
@@ -578,7 +578,7 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
578
578
  ${ei.format(e.crEnd)}.
579
579
  </p>`;break;case"DNOTE":i=Or`${e.textStatus}s are not endorsed by
580
580
  <abbr title="World Wide Web Consortium">W3C</abbr> nor its Members.`;break;case"NOTE":i=Or`This ${e.textStatus} is endorsed by
581
- ${uo(e)}, but is not endorsed by
581
+ ${ho(e)}, but is not endorsed by
582
582
  <abbr title="World Wide Web Consortium">W3C</abbr> itself nor its
583
583
  Members.`,s=""}return Or`<p>${i} ${n}</p>
584
584
  ${s} ${r}`}(e)}
@@ -619,14 +619,14 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
619
619
  </p>`}(e)}
620
620
  <p>
621
621
  This document is governed by the
622
- <a id="w3c_process_revision" href="${oo}"
622
+ <a id="w3c_process_revision" href="${co}"
623
623
  >18 August 2025 W3C Process Document</a
624
624
  >.
625
625
  </p>
626
626
  `}
627
627
  `}
628
628
  ${t.additionalSections}
629
- `;function lo(e){const{prUrl:t,prNumber:n,edDraftURI:r}=e;return Or`<details class="annoying-warning" open="">
629
+ `;function po(e){const{prUrl:t,prNumber:n,edDraftURI:r}=e;return Or`<details class="annoying-warning" open="">
630
630
  <summary>
631
631
  This is a
632
632
  preview${t&&n?Or`
@@ -642,9 +642,9 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
642
642
  <a href="${r}">${r}</a> for the Editor's draft.
643
643
  `:""}
644
644
  </p>
645
- </details>`}function uo(e){return Array.isArray(e.wg)?bi(e.wg,(t,n)=>Or`the <a href="${e.wgURI[n]}">${t}</a>`):e.wg?Or`the <a href="${e.wgURI}">${e.wg}</a>`:void 0}var po=(e,t)=>Or`
646
- <h2>${so.sotd}</h2>
647
- ${e.isPreview?lo(e):""}
645
+ </details>`}function ho(e){return Array.isArray(e.wg)?bi(e.wg,(t,n)=>Or`the <a href="${e.wgURI[n]}">${t}</a>`):e.wg?Or`the <a href="${e.wgURI}">${e.wg}</a>`:void 0}var fo=(e,t)=>Or`
646
+ <h2>${ao.sotd}</h2>
647
+ ${e.isPreview?po(e):""}
648
648
  <p>
649
649
  This specification was published by the
650
650
  <a href="${e.wgURI}">${e.wg}</a>. It is not a W3C Standard nor is it
@@ -696,17 +696,17 @@ p:is(.respec-hint,.respec-occurrences){display:block;margin-top:.5em}
696
696
  </p>`}(e,t):""}
697
697
  ${e.sotdAfterWGinfo?t.additionalContent:""}
698
698
  ${t.additionalSections}
699
- `;const ho="w3c/headers";function fo(e){return new URL(e,"https://www.w3.org/").href}const mo={LS:"WD",LD:"WD",FPWD:"WD","Member-SUBM":"SUBM"},go={DNOTE:"Group Note Draft",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Registry Draft",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",UD:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-draft-finding":"Draft TAG Finding","CG-DRAFT":"Draft Community Group Report","CG-FINAL":"Final Community Group Report","BG-DRAFT":"Draft Business Group Report","BG-FINAL":"Final Business Group Report"},bo={...go,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},yo={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},wo=["DNOTE","NOTE","STMT"],ko=["CR","CRD","DISC","FPWD","PR","REC","RSCND","WD"],vo=["DRY","CRY","CRYD","RY"],$o=["draft-finding","finding","editor-draft-finding"],xo=["CG-DRAFT","CG-FINAL"],Co=["BG-DRAFT","BG-FINAL"],So=[...xo,...Co],_o=[...wo,...ko,...vo],To=["base",...xo,...Co,"editor-draft-finding","draft-finding","finding","MO","unofficial"],Ro=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["w3c-software",{name:"W3C Software Notice and License",short:"W3C Software",url:"https://www.w3.org/copyright/software-license-2002/"}],["w3c-software-doc",{name:"W3C Software and Document Notice and License",short:"permissive document license",url:"https://www.w3.org/copyright/software-license-2023/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/copyright/document-license/"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}]]),Eo=["PP2017","PP2020"];function Ao(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Xr.format(r);return new Date(e)}return Ni(qi`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,ho),new Date(Xr.format(new Date))}function Lo(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){Ii(qi`ReSpec does not support automated SotD generation for TAG findings.`,ho,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var Po=Object.freeze({__proto__:null,W3CNotes:wo,bgStatus:Co,cgStatus:xo,cgbgStatus:So,licenses:Ro,name:ho,noTrackStatus:To,recTrackStatus:ko,registryTrackStatus:vo,run:async function(e){const t=e.specStatus??"";if(e.isBasic="base"===t,e.isCGBG=So.includes(t),e.isCGFinal=e.isCGBG&&t.endsWith("G-FINAL"),e.isCR="CR"===t||"CRD"===t,e.isCRDraft="CRD"===t,e.isCRY="CRY"===t||"CRYD"===t,e.isEd="ED"===t,e.isMemberSubmission="Member-SUBM"===t,e.isMO="MO"===t,e.isNote=wo.includes(t),e.isNoTrack=To.includes(t),e.isPR="PR"===t,e.isRecTrack=ko.includes(t),e.isRec=e.isRecTrack&&"REC"===t,e.isRegistry=vo.includes(t),e.isRegular=!e.isCGBG&&!e.isBasic,e.isTagEditorFinding="editor-draft-finding"===t,e.isTagFinding=$o.includes(t),e.isUnofficial="unofficial"===t,e.licenseInfo=function(e){let t;if("string"==typeof e.license){const n=e.license.toLowerCase();if(Ro.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=qi`Please set
700
- ${"[license]"} to one of: ${ji([...Ro.keys()].filter(e=>e),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;Ni(t,ho,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=qi`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;Ni(qi`License "\`${e.license}\`" is not allowed for W3C Specifications.`,ho,{hint:t})}return void 0===t?{name:"unlicensed",url:null,short:"UNLICENSED"}:Ro.get(t)}(e),e.prependW3C=!e.isBasic&&!e.isUnofficial,e.longStatus=bo[t],e.textStatus=go[t],e.showPreviousVersion=!1,e.isRegular&&!e.shortName){const e=qi`Please set ${"[shortName]"} to a short name for the specification.`;Ni(qi`The ${"[shortName]"} configuration option is required for this kind of document.`,ho,{hint:e})}if(e.publishDate=Ao(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.modificationDate&&(e.modificationDate=Ao(e,"modificationDate",document.lastModified)),e.isRecTrack&&!e.github&&!e.wgPublicList){const e=qi`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;Ni("W3C Process requires a either a link to a public repository or mailing list.",ho,{hint:e})}if(e.isEd&&!e.edDraftURI){const e=qi`Please set ${"[edDraftURI]"} to the URL of the Editor's Draft. Alternatively, use the set ${"[github]"} option, which automatically sets it for you.`;Ii(qi`Editor's Drafts should set ${"[edDraftURI]"} configuration option.`,ho,{hint:e})}const n=function(e){const{specStatus:t,group:n}=e;if(e.isNoTrack&&!e.isCGBG&&!e.isTagFinding)return"";const r=e.groupType,i="wg"===r||Array.isArray(r)&&r.includes("wg");if(_o.includes(t??"")||i)return"/TR";switch(t){case"CG-FINAL":case"BG-FINAL":return`/community/reports/${n}`;case"finding":case"draft-finding":return"/2001/tag/doc";case"Member-SUBM":return"/Submission"}if(("tag"===e.group||"ab"===e.group)&&"TR"===e.canonicalURI)return"/TR";return""}(e);if(n&&!e.thisVersion){const r=mo[t]||t,{shortName:i,publishDate:s}=e,o=`${r}-${i}-${hi(s)}`,a=[..._o,"Member-SUBM"].includes(t)?`${s.getUTCFullYear()}/`:"";e.thisVersion=fo(`${n}/${a}${o}/`)}e.isEd&&(e.thisVersion=e.edDraftURI),e.isCGBG&&function(e){const t=go[e.specStatus],n=e.latestVersion?new URL(fo(e.latestVersion)):null;if(!e.wg){return void Ni(qi`The ${"[group]"} configuration option is required for this kind of document (${t}).`,ho)}if(e.isCGFinal){if(!1===("https://www.w3.org"===n?.origin||"https://w3.org/"===n?.origin)){Ni(qi`For ${t}, the ${"[latestVersion]"} URL must point to somewhere at https://www.w3.org/.`,ho,{hint:"Ask a W3C Team Member for a W3C URL where the report can be published."})}}}(e),null!==e.latestVersion&&(e.latestVersion=e.latestVersion?fo(e.latestVersion):n?fo(`${n}/${e.shortName}/`):""),e.latestVersion&&function(e){const t=new URL(e.latestVersion);if(("https://www.w3.org"===t.origin||"https://w3.org/"===t.origin)&&t.pathname.startsWith("/TR/")&&!1===["ED",..._o].includes(e.specStatus)){const t=qi`Ask a W3C Team Member for a W3C URL where the report can be published and change ${"[latestVersion]"} to something else.`;Ni(qi`Documents with a status of \`"${e.specStatus}"\` can't be published on the W3C's /TR/ (Technical Report) space.`,ho,{hint:t})}}(e);const r=`${n}/${e.shortName}`;if(e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){Ni(qi`${"[`previousPublishDate`]"} is set, but missing ${"[`previousMaturity`]"}.`,ho)}e.previousPublishDate=Ao(e,"previousPublishDate");const t=mo[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=Xr.format(e.publishDate);e.thisVersion=fo(`${r}-${t}`);const n=Xr.format(e.previousPublishDate);e.prevVersion=fo(`${r}-${n}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const r=e.previousPublishDate.getUTCFullYear(),{shortName:i}=e,s=hi(e.previousPublishDate);e.prevVersion=fo(`${n}/${r}/${t}-${i}-${s}/`)}}e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=fo(`${n}/${e.prevRecShortname}`));const i=e.editors??[],s=e.formerEditors??[];for(let e=0;e<i.length;e++){const t=i[e];"retiredDate"in t&&(s.push(t),i.splice(e--,1))}if(e.editors=i,e.formerEditors=s,0===i.length){const e=qi`Add one or more editors using the ${"[editors]"} configuration option.`;Ni("At least one editor is required.",ho,{hint:e})}else i.length&&e.isRecTrack&&i.forEach((e,t)=>{if(e.w3cid)return;const n=qi`See ${"[w3cid]"} for instructions for how to retrieve it and add it.`;Ni(qi`Editor ${e.name?`"${e.name}"`:`number ${t+1}`} is missing their ${"[w3cid]"}.`,ho,{hint:n})});if(e.alternateFormats?.some(({uri:e,label:t})=>!e||!t)){Ni(qi`Every ${"[`alternateFormats`]"} entry must have a \`uri\` and a \`label\`.`,ho)}e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.dashDate=Xr.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=Xr.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every(e=>Eo.includes(e))){const e=qi`Invalid ${"[wgPatentPolicy]"} value(s): ${zi([...t].filter(e=>!Eo.includes(e)))}.`,n=`Please use one of: ${ji(Eo)}.`;Ni(e,ho,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=qi`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;Ni(e,ho,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI||!e.latestVersion)return;const t=e.isEd||_o.includes(e.specStatus);if(e.historyURI&&!t){const t=qi`Please remove ${"[historyURI]"}.`;return Ni(qi`The ${"[historyURI]"} can't be used with non /TR/ documents.`,ho,{hint:t}),void(e.historyURI=null)}const n=new URL(e.historyURI??`${e.shortName}/`,"https://www.w3.org/standards/history/");t&&(e.historyURI=n.href)}(e),e.isTagEditorFinding&&(delete e.thisVersion,delete e.latestVersion),e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate);const o={get multipleAlternates(){return!!(e.alternateFormats&&e.alternateFormats.length>1)},get alternatesHTML(){return e.alternateFormats&&bi(e.alternateFormats.map(({label:e})=>e),(t,n)=>{const r=e.alternateFormats[n];return Or`<a
699
+ `;const mo="w3c/headers";function go(e){return new URL(e,"https://www.w3.org/").href}const bo={LS:"WD",LD:"WD",FPWD:"WD","Member-SUBM":"SUBM"},yo={DNOTE:"Group Note Draft",NOTE:"Group Note",STMT:"Statement","Member-SUBM":"Member Submission",MO:"Member-Only Document",ED:"Editor's Draft",LS:"Living Standard",LD:"Living Document",FPWD:"First Public Working Draft",WD:"Working Draft",CR:"Candidate Recommendation",CRD:"Candidate Recommendation",PR:"Proposed Recommendation",REC:"Recommendation",DISC:"Discontinued Draft",RSCND:"Rescinded Recommendation",DRY:"Registry Draft",CRYD:"Candidate Registry",CRY:"Candidate Registry",RY:"Registry",unofficial:"Unofficial Draft",UD:"Unofficial Draft",base:"",finding:"TAG Finding","draft-finding":"Draft TAG Finding","editor-draft-finding":"Draft TAG Finding","CG-DRAFT":"Draft Community Group Report","CG-FINAL":"Final Community Group Report","BG-DRAFT":"Draft Business Group Report","BG-FINAL":"Final Business Group Report"},wo={...yo,CR:"Candidate Recommendation Snapshot",CRD:"Candidate Recommendation Draft",CRY:"Candidate Registry Snapshot",CRYD:"Candidate Registry Draft"},vo={DNOTE:"Note",NOTE:"Note",STMT:"Note","WG-NOTE":"Note","IG-NOTE":"Note",FPWD:"Recommendation",WD:"Recommendation",CR:"Recommendation",CRD:"Recommendation",PR:"Recommendation",REC:"Recommendation",DISC:"Recommendation",RSCND:"Recommendation",DRY:"Registry",CRYD:"Registry",CRY:"Registry",RY:"Registry"},ko=["DNOTE","NOTE","STMT"],$o=["CR","CRD","DISC","FPWD","PR","REC","RSCND","WD"],xo=["DRY","CRY","CRYD","RY"],Co=["draft-finding","finding","editor-draft-finding"],So=["CG-DRAFT","CG-FINAL"],_o=["BG-DRAFT","BG-FINAL"],To=[...So,..._o],Ro=[...ko,...$o,...xo],Eo=["base",...So,..._o,"editor-draft-finding","draft-finding","finding","MO","unofficial"],Ao=new Map([["cc0",{name:"Creative Commons 0 Public Domain Dedication",short:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}],["w3c-software",{name:"W3C Software Notice and License",short:"W3C Software",url:"https://www.w3.org/copyright/software-license-2002/"}],["w3c-software-doc",{name:"W3C Software and Document Notice and License",short:"permissive document license",url:"https://www.w3.org/copyright/software-license-2023/"}],["cc-by",{name:"Creative Commons Attribution 4.0 International Public License",short:"CC-BY",url:"https://creativecommons.org/licenses/by/4.0/legalcode"}],["document",{name:"W3C Document License",short:"document use",url:"https://www.w3.org/copyright/document-license/"}],["dual",{name:"W3C Dual License",short:"dual license",url:"https://www.w3.org/Consortium/Legal/2013/copyright-documents-dual.html"}]]),Lo=["PP2017","PP2020"];function Po(e,t,n=new Date){const r=e[t]?new Date(e[t]):new Date(n);if(Number.isFinite(r.valueOf())){const e=Xr.format(r);return new Date(e)}return Ni(qi`${t} is not a valid date: "${e[t]}". Expected format 'YYYY-MM-DD'.`,mo),new Date(Xr.format(new Date))}function No(e,{isTagFinding:t=!1}){const n=e.cloneNode(!0),r=document.createDocumentFragment();for(;n.hasChildNodes()&&(n.nodeType!==Node.ELEMENT_NODE||"section"!==n.firstChild.localName);)r.appendChild(n.firstChild);if(t&&!r.hasChildNodes()){Ii(qi`ReSpec does not support automated SotD generation for TAG findings.`,mo,{hint:"Please add the prerequisite content in the 'sotd' section."})}return{additionalContent:r,additionalSections:n.childNodes}}var Io=Object.freeze({__proto__:null,W3CNotes:ko,bgStatus:_o,cgStatus:So,cgbgStatus:To,licenses:Ao,name:mo,noTrackStatus:Eo,recTrackStatus:$o,registryTrackStatus:xo,run:async function(e){const t=e.specStatus??"";if(e.isBasic="base"===t,e.isCGBG=To.includes(t),e.isCGFinal=e.isCGBG&&t.endsWith("G-FINAL"),e.isCR="CR"===t||"CRD"===t,e.isCRDraft="CRD"===t,e.isCRY="CRY"===t||"CRYD"===t,e.isEd="ED"===t,e.isMemberSubmission="Member-SUBM"===t,e.isMO="MO"===t,e.isNote=ko.includes(t),e.isNoTrack=Eo.includes(t),e.isPR="PR"===t,e.isRecTrack=$o.includes(t),e.isRec=e.isRecTrack&&"REC"===t,e.isRegistry=xo.includes(t),e.isRegular=!e.isCGBG&&!e.isBasic,e.isTagEditorFinding="editor-draft-finding"===t,e.isTagFinding=Co.includes(t),e.isUnofficial="unofficial"===t,e.licenseInfo=function(e){let t;if("string"==typeof e.license){const n=e.license.toLowerCase();if(Ao.has(n))t=n;else{const t=`The license "\`${e.license}\`" is not supported.`,n=qi`Please set
700
+ ${"[license]"} to one of: ${ji([...Ao.keys()].filter(e=>e),{quotes:!0})}. If in doubt, remove \`license\` and let ReSpec pick one for you.`;Ni(t,mo,{hint:n})}}if(e.isUnofficial&&!t&&(t="cc-by"),!e.isUnofficial&&["cc-by","cc0"].includes(t)){const t=qi`Please set ${"[license]"} to \`"w3c-software-doc"\` instead.`;Ni(qi`License "\`${e.license}\`" is not allowed for W3C Specifications.`,mo,{hint:t})}return void 0===t?{name:"unlicensed",url:null,short:"UNLICENSED"}:Ao.get(t)}(e),e.prependW3C=!e.isBasic&&!e.isUnofficial,e.longStatus=wo[t],e.textStatus=yo[t],e.showPreviousVersion=!1,e.isRegular&&!e.shortName){const e=qi`Please set ${"[shortName]"} to a short name for the specification.`;Ni(qi`The ${"[shortName]"} configuration option is required for this kind of document.`,mo,{hint:e})}if(e.publishDate=Po(e,"publishDate",document.lastModified),e.publishYear=e.publishDate.getUTCFullYear(),e.modificationDate&&(e.modificationDate=Po(e,"modificationDate",document.lastModified)),e.isRecTrack&&!e.github&&!e.wgPublicList){const e=qi`Use the ${"[github]"} configuration option to add a link to a repository. Alternatively use ${"[wgPublicList]"} to link to a mailing list.`;Ni("W3C Process requires a either a link to a public repository or mailing list.",mo,{hint:e})}if(e.isEd&&!e.edDraftURI){const e=qi`Please set ${"[edDraftURI]"} to the URL of the Editor's Draft. Alternatively, use the set ${"[github]"} option, which automatically sets it for you.`;Ii(qi`Editor's Drafts should set ${"[edDraftURI]"} configuration option.`,mo,{hint:e})}const n=function(e){const{specStatus:t,group:n}=e;if(e.isNoTrack&&!e.isCGBG&&!e.isTagFinding)return"";const r=e.groupType,i="wg"===r||Array.isArray(r)&&r.includes("wg");if(Ro.includes(t??"")||i)return"/TR";switch(t){case"CG-FINAL":case"BG-FINAL":return`/community/reports/${n}`;case"finding":case"draft-finding":return"/2001/tag/doc";case"Member-SUBM":return"/Submission"}if(("tag"===e.group||"ab"===e.group)&&"TR"===e.canonicalURI)return"/TR";return""}(e);if(n&&!e.thisVersion){const r=bo[t]||t,{shortName:i,publishDate:s}=e,o=`${r}-${i}-${hi(s)}`,a=[...Ro,"Member-SUBM"].includes(t)?`${s.getUTCFullYear()}/`:"";e.thisVersion=go(`${n}/${a}${o}/`)}e.isEd&&(e.thisVersion=e.edDraftURI),e.isCGBG&&function(e){const t=yo[e.specStatus],n=e.latestVersion?new URL(go(e.latestVersion)):null;if(!e.wg){return void Ni(qi`The ${"[group]"} configuration option is required for this kind of document (${t}).`,mo)}if(e.isCGFinal){if(!1===("https://www.w3.org"===n?.origin||"https://w3.org/"===n?.origin)){Ni(qi`For ${t}, the ${"[latestVersion]"} URL must point to somewhere at https://www.w3.org/.`,mo,{hint:"Ask a W3C Team Member for a W3C URL where the report can be published."})}}}(e),null!==e.latestVersion&&(e.latestVersion=e.latestVersion?go(e.latestVersion):n?go(`${n}/${e.shortName}/`):""),e.latestVersion&&function(e){const t=new URL(e.latestVersion);if(("https://www.w3.org"===t.origin||"https://w3.org/"===t.origin)&&t.pathname.startsWith("/TR/")&&!1===["ED",...Ro].includes(e.specStatus)){const t=qi`Ask a W3C Team Member for a W3C URL where the report can be published and change ${"[latestVersion]"} to something else.`;Ni(qi`Documents with a status of \`"${e.specStatus}"\` can't be published on the W3C's /TR/ (Technical Report) space.`,mo,{hint:t})}}(e);const r=`${n}/${e.shortName}`;if(e.previousPublishDate){if(!e.previousMaturity&&!e.isTagFinding){Ni(qi`${"[`previousPublishDate`]"} is set, but missing ${"[`previousMaturity`]"}.`,mo)}e.previousPublishDate=Po(e,"previousPublishDate");const t=bo[e.previousMaturity]??e.previousMaturity;if(e.isTagFinding&&e.latestVersion){const t=Xr.format(e.publishDate);e.thisVersion=go(`${r}-${t}`);const n=Xr.format(e.previousPublishDate);e.prevVersion=go(`${r}-${n}`)}else if(e.isCGBG||e.isBasic)e.prevVersion=e.prevVersion||"";else{const r=e.previousPublishDate.getUTCFullYear(),{shortName:i}=e,s=hi(e.previousPublishDate);e.prevVersion=go(`${n}/${r}/${t}-${i}-${s}/`)}}e.prevRecShortname&&!e.prevRecURI&&(e.prevRecURI=go(`${n}/${e.prevRecShortname}`));const i=e.editors??[],s=e.formerEditors??[];for(let e=0;e<i.length;e++){const t=i[e];"retiredDate"in t&&(s.push(t),i.splice(e--,1))}if(e.editors=i,e.formerEditors=s,0===i.length){const e=qi`Add one or more editors using the ${"[editors]"} configuration option.`;Ni("At least one editor is required.",mo,{hint:e})}else i.length&&e.isRecTrack&&i.forEach((e,t)=>{if(e.w3cid)return;const n=qi`See ${"[w3cid]"} for instructions for how to retrieve it and add it.`;Ni(qi`Editor ${e.name?`"${e.name}"`:`number ${t+1}`} is missing their ${"[w3cid]"}.`,mo,{hint:n})});if(e.alternateFormats?.some(({uri:e,label:t})=>!e||!t)){Ni(qi`Every ${"[`alternateFormats`]"} entry must have a \`uri\` and a \`label\`.`,mo)}e.copyrightStart==e.publishYear&&(e.copyrightStart=""),e.dashDate=Xr.format(e.publishDate),e.publishISODate=e.publishDate.toISOString(),e.shortISODate=Xr.format(e.publishDate),function(e){if(!e.wgPatentPolicy)return;const t=new Set([].concat(e.wgPatentPolicy));if(t.size&&![...t].every(e=>Lo.includes(e))){const e=qi`Invalid ${"[wgPatentPolicy]"} value(s): ${zi([...t].filter(e=>!Lo.includes(e)))}.`,n=`Please use one of: ${ji(Lo)}.`;Ni(e,mo,{hint:n})}if(1!==t.size){const e="When collaborating across multiple groups, they must use the same patent policy.",n=qi`For ${"[wgPatentPolicy]"}, please check the patent policies of each group. The patent policies were: ${[...t].join(", ")}.`;Ni(e,mo,{hint:n})}e.wgPatentPolicy=[...t][0]}(e),await async function(e){if(!e.shortName||null===e.historyURI||!e.latestVersion)return;const t=e.isEd||Ro.includes(e.specStatus);if(e.historyURI&&!t){const t=qi`Please remove ${"[historyURI]"}.`;return Ni(qi`The ${"[historyURI]"} can't be used with non /TR/ documents.`,mo,{hint:t}),void(e.historyURI=null)}const n=new URL(e.historyURI??`${e.shortName}/`,"https://www.w3.org/standards/history/");t&&(e.historyURI=n.href)}(e),e.isTagEditorFinding&&(delete e.thisVersion,delete e.latestVersion),e.isTagFinding&&(e.showPreviousVersion=!!e.previousPublishDate);const o={get multipleAlternates(){return!!(e.alternateFormats&&e.alternateFormats.length>1)},get alternatesHTML(){return e.alternateFormats&&bi(e.alternateFormats.map(({label:e})=>e),(t,n)=>{const r=e.alternateFormats[n];return Or`<a
701
701
  rel="alternate"
702
702
  href="${r.uri}"
703
703
  hreflang="${r?.lang??null}"
704
704
  type="${r?.type??null}"
705
705
  >${r.label}</a
706
- >`})}},a=(e.isCGBG?io:to)(e,o);document.body.prepend(a),document.body.classList.add("h-entry");const c=document.getElementById("sotd")||document.createElement("section");if((e.isCGBG||!e.isNoTrack||e.isTagFinding)&&!c.id){Ni("A Status of This Document must include at least on custom paragraph.",ho,{elements:[c],hint:"Add a `<p>` in the 'sotd' section that reflects the status of this specification."})}c.id=c.id||"sotd",c.classList.add("introductory");const l=[e.wg,e.wgURI,e.wgPatentURI];if(l.some(e=>Array.isArray(e))&&!l.every(e=>Array.isArray(e))){const e=qi`Use the ${"[group]"} option with an array instead.`;Ni(qi`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,ho,{hint:e})}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgPatentHTML=bi(e.wg,(t,n)=>Or`a
706
+ >`})}},a=(e.isCGBG?oo:ro)(e,o);document.body.prepend(a),document.body.classList.add("h-entry");const c=document.getElementById("sotd")||document.createElement("section");if((e.isCGBG||!e.isNoTrack||e.isTagFinding)&&!c.id){Ni("A Status of This Document must include at least on custom paragraph.",mo,{elements:[c],hint:"Add a `<p>` in the 'sotd' section that reflects the status of this specification."})}c.id=c.id||"sotd",c.classList.add("introductory");const l=[e.wg,e.wgURI,e.wgPatentURI];if(l.some(e=>Array.isArray(e))&&!l.every(e=>Array.isArray(e))){const e=qi`Use the ${"[group]"} option with an array instead.`;Ni(qi`If one of ${"[wg]"}, ${"[wgURI]"}, or ${"[wgPatentURI]"} is an array, they all have to be.`,mo,{hint:e})}if(Array.isArray(e.wg)?(e.multipleWGs=e.wg.length>1,e.wgPatentHTML=bi(e.wg,(t,n)=>Or`a
707
707
  <a href="${e.wgPatentURI[n]}" rel="disclosure"
708
708
  >public list of any patent disclosures (${t})</a
709
- >`)):e.multipleWGs=!1,e.isPR&&!e.crEnd){Ni(qi`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,ho)}if(e.isCR&&!e.isCRDraft&&!e.crEnd){Ni(qi`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,ho)}if(e.crEnd=Ao(e,"crEnd"),e.isPR&&!e.prEnd){Ni(qi`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,ho)}e.prEnd=Ao(e,"prEnd");const u=c.classList.contains("updateable-rec"),d=null!==document.querySelector(".correction:not(.proposed)"),p=null!==document.querySelector(".correction.proposed"),h=null!==document.querySelector(".addition:not(.proposed)"),f=null!==document.querySelector(".addition.proposed"),m=d||h||f||p;if(e.isRec&&!e.errata&&!m){const e=qi`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;Ni("Recommendations must have an errata link.",ho,{hint:e})}if(e.isRec&&!u&&(h||d||f||p)){Ni(qi`${"[specStatus]"} is "REC" with amendments, but the Recommendation is not marked as allowing revisions.`,ho)}if(e.isRec&&u&&(f||p)&&!e.revisedRecEnd){Ni(qi`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,ho)}if(e.revisedRecEnd=Ao(e,"revisedRecEnd"),e.noRecTrack&&ko.includes(t)){const e=qi`Document configured as ${"[noRecTrack]"}, but its status ("${t}") puts it on the W3C Rec Track.`,n=ji(ko,{quotes:!0});Ni(e,ho,{hint:`Status **can't** be any of: ${n}.`})}if(c.classList.contains("override")||Or.bind(c)`${function(e,t){const n={...Lo(t,e),get mailToWGPublicList(){return`mailto:${e.wgPublicList}@w3.org`},get mailToWGPublicListWithSubject(){const t=e.subjectPrefix?`?subject=${encodeURIComponent(e.subjectPrefix)}`:"";return this.mailToWGPublicList+t},get mailToWGPublicListSubscription(){return`mailto:${e.wgPublicList}-request@w3.org?subject=subscribe`}},r=e.isCGBG?po:co;return r(e,n)}(e,c)}`,!e.implementationReportURI&&e.isCR){const e=qi`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/policies/process/#implementation-experience).`;Ni(qi`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,ho,{hint:e})}if(!e.implementationReportURI&&e.isPR){Ii(qi`PR documents should include an ${"[implementationReportURI]"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/policies/process-20190301/#implementation-experience).`,ho)}Fi("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:ui(document.getElementById("w3c-state")?.textContent??"")})},status2text:go,status2track:yo,tagStatus:$o,trStatus:_o});const No={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,"no-dfn-in-abstract":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0};const Io="w3c/defaults",Oo={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},Do={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211",height:"48"},jo={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"informative-dfn":"warn","no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0,subtitle:"",prevVersion:"",formerEditors:[],editors:[],authors:[]};var zo=Object.freeze({__proto__:null,name:Io,run:function(e){const t=!1!==e.lint&&{...No.lint,...jo.lint,...e.lint};Object.assign(e,{...No,...jo,...e,lint:t}),function(e){if(!e.hasOwnProperty("noToc"))return;e.noTOC??=e.noToc,Ii("The `noToc` configuration option is deprecated.","core/defaults",{hint:qi`Please use ${"[noTOC]"} instead.`})}(e),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const{specStatus:t,groupType:n,group:r}=e;if(!t){const t=qi`Select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;return Ni(qi`The ${"[specStatus]"} configuration option is required.`,Io,{hint:t}),void(e.specStatus="base")}if(void 0===go[t]){const n=qi`The ${"[specStatus]"} "\`${t}\`" is not supported at for this type of document.`,r=qi`set ${"[specStatus]"} to one of: ${ji(Object.keys(go),{quotes:!0})}.`;return Ni(n,Io,{hint:r}),void(e.specStatus="base")}switch(n){case"cg":if(![...xo,"unofficial","UD"].includes(t)){const n=qi`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=ji(xo,{quotes:!0});Ni(n,Io,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![...Co,"unofficial","UD"].includes(t)){const n=qi`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=ji(Co,{quotes:!0});Ni(n,Io,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(![..._o,"unofficial","UD","ED"].includes(t)){const e=qi`Pleas see ${"[specStatus]"} for appropriate status for W3C Working Group documents.`;Ni(qi`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,Io,{hint:e})}break;case"other":if("tag"===r&&!["ED",..._o,...$o].includes(t)){const n=qi`The W3C Technical Architecture Group's documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=ji(["ED",..._o,...$o],{quotes:!0});Ni(n,Io,{hint:`Please use one of: ${r}. Automatically falling back to \`"unofficial"\`.`}),e.specStatus="unofficial"}break;default:if(!e.wgId&&!["unofficial","base","UD","Member-SUBM"].includes(t)){const t="Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.",n=qi`Use the ${"[group]"} configuration option to associated this document with a W3C group.`;e.specStatus="base",Ni(t,Io,{hint:n})}}}(e),function(e){const{specStatus:t,wg:n}=e,r=[...ko,...vo,...wo,...$o,"ED"].includes(t),i=n&&n.length&&r,s=["Member-SUBM"].includes(t);(i||s)&&(e.logos.unshift(Oo),"Member-SUBM"===t&&e.logos.push(Do))}(e)}});const Mo=String.raw,qo=String.raw`color-mix(in srgb, #eaf3ff 15%, transparent)`;const Uo=ds(Mo`@keyframes pop{
709
+ >`)):e.multipleWGs=!1,e.isPR&&!e.crEnd){Ni(qi`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`,mo)}if(e.isCR&&!e.isCRDraft&&!e.crEnd){Ni(qi`${"[specStatus]"} is "CR", but no ${"[crEnd]"} is specified in the ${"[respecConfig]"}.`,mo)}if(e.crEnd=Po(e,"crEnd"),e.isPR&&!e.prEnd){Ni(qi`${"[specStatus]"} is "PR" but no ${"[prEnd]"} is specified in the ${"[respecConfig]"}.`,mo)}e.prEnd=Po(e,"prEnd");const d=c.classList.contains("updateable-rec"),u=null!==document.querySelector(".correction:not(.proposed)"),p=null!==document.querySelector(".correction.proposed"),h=null!==document.querySelector(".addition:not(.proposed)"),f=null!==document.querySelector(".addition.proposed"),m=u||h||f||p;if(e.isRec&&!e.errata&&!m){const e=qi`Add an ${"[errata]"} URL to your ${"[respecConfig]"}.`;Ni("Recommendations must have an errata link.",mo,{hint:e})}if(e.isRec&&!d&&(h||u||f||p)){Ni(qi`${"[specStatus]"} is "REC" with amendments, but the Recommendation is not marked as allowing revisions.`,mo)}if(e.isRec&&d&&(f||p)&&!e.revisedRecEnd){Ni(qi`${"[specStatus]"} is "REC" with proposed corrections or additions but no ${"[revisedRecEnd]"} is specified in the ${"[respecConfig]"}.`,mo)}if(e.revisedRecEnd=Po(e,"revisedRecEnd"),e.noRecTrack&&$o.includes(t)){const e=qi`Document configured as ${"[noRecTrack]"}, but its status ("${t}") puts it on the W3C Rec Track.`,n=ji($o,{quotes:!0});Ni(e,mo,{hint:`Status **can't** be any of: ${n}.`})}if(c.classList.contains("override")||Or.bind(c)`${function(e,t){const n={...No(t,e),get mailToWGPublicList(){return`mailto:${e.wgPublicList}@w3.org`},get mailToWGPublicListWithSubject(){const t=e.subjectPrefix?`?subject=${encodeURIComponent(e.subjectPrefix)}`:"";return this.mailToWGPublicList+t},get mailToWGPublicListSubscription(){return`mailto:${e.wgPublicList}-request@w3.org?subject=subscribe`}},r=e.isCGBG?fo:uo;return r(e,n)}(e,c)}`,!e.implementationReportURI&&e.isCR){const e=qi`CR documents must have an ${"[implementationReportURI]"} that describes the [implementation experience](https://www.w3.org/policies/process/#implementation-experience).`;Ni(qi`Missing ${"[implementationReportURI]"} configuration option in ${"[respecConfig]"}.`,mo,{hint:e})}if(!e.implementationReportURI&&e.isPR){Ii(qi`PR documents should include an ${"[implementationReportURI]"}, which needs to link to a document that describes the [implementation experience](https://www.w3.org/policies/process-20190301/#implementation-experience).`,mo)}Fi("amend-user-config",{publishISODate:e.publishISODate,generatedSubtitle:di(document.getElementById("w3c-state")?.textContent??"")})},status2text:yo,status2track:vo,tagStatus:Co,trStatus:Ro});const Oo={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,"no-dfn-in-abstract":!1},pluralize:!0,specStatus:"base",highlightVars:!0,addSectionLinks:!0};const Do="w3c/defaults",jo={src:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",alt:"W3C",height:48,width:72,url:"https://www.w3.org/"},zo={alt:"W3C Member Submission",href:"https://www.w3.org/Submission/",src:"https://www.w3.org/Icons/member_subm-v.svg",width:"211",height:"48"},Mo={lint:{"privsec-section":!1,"required-sections":!0,"wpt-tests-exist":!1,"informative-dfn":"warn","no-unused-dfns":"warn",a11y:!1},doJsonLd:!1,logos:[],xref:!0,diagrams:!0,wgId:"",otherLinks:[],excludeGithubLinks:!0,subtitle:"",prevVersion:"",formerEditors:[],editors:[],authors:[]};var qo=Object.freeze({__proto__:null,name:Do,run:function(e){const t=!1!==e.lint&&{...Oo.lint,...Mo.lint,...e.lint};Object.assign(e,{...Oo,...Mo,...e,lint:t}),function(e){if(!e.hasOwnProperty("noToc"))return;e.noTOC??=e.noToc,Ii("The `noToc` configuration option is deprecated.","core/defaults",{hint:qi`Please use ${"[noTOC]"} instead.`})}(e),"unofficial"===e.specStatus||e.hasOwnProperty("license")||(e.license="w3c-software-doc"),function(e){const{specStatus:t,groupType:n,group:r}=e;if(!t){const t=qi`Select an appropriate status from ${"[specStatus]"} based on your W3C group. If in doubt, use \`"unofficial"\`.`;return Ni(qi`The ${"[specStatus]"} configuration option is required.`,Do,{hint:t}),void(e.specStatus="base")}if(void 0===yo[t]){const n=qi`The ${"[specStatus]"} "\`${t}\`" is not supported at for this type of document.`,r=qi`set ${"[specStatus]"} to one of: ${ji(Object.keys(yo),{quotes:!0})}.`;return Ni(n,Do,{hint:r}),void(e.specStatus="base")}switch(n){case"cg":if(![...So,"unofficial","UD"].includes(t)){const n=qi`W3C Community Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=ji(So,{quotes:!0});Ni(n,Do,{hint:`Please use one of: ${r}. Automatically falling back to \`"CG-DRAFT"\`.`}),e.specStatus="CG-DRAFT"}break;case"bg":if(![..._o,"unofficial","UD"].includes(t)){const n=qi`W3C Business Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=ji(_o,{quotes:!0});Ni(n,Do,{hint:`Please use one of: ${r}. Automatically falling back to \`"BG-DRAFT"\`.`}),e.specStatus="BG-DRAFT"}break;case"wg":if(![...Ro,"unofficial","UD","ED"].includes(t)){const e=qi`Pleas see ${"[specStatus]"} for appropriate status for W3C Working Group documents.`;Ni(qi`W3C Working Group documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,Do,{hint:e})}break;case"other":if("tag"===r&&!["ED",...Ro,...Co].includes(t)){const n=qi`The W3C Technical Architecture Group's documents can't use \`"${t}"\` for the ${"[specStatus]"} configuration option.`,r=ji(["ED",...Ro,...Co],{quotes:!0});Ni(n,Do,{hint:`Please use one of: ${r}. Automatically falling back to \`"unofficial"\`.`}),e.specStatus="unofficial"}break;default:if(!e.wgId&&!["unofficial","base","UD","Member-SUBM"].includes(t)){const t="Document is not associated with a [W3C group](https://respec.org/w3c/groups/). Defaulting to 'base' status.",n=qi`Use the ${"[group]"} configuration option to associated this document with a W3C group.`;e.specStatus="base",Ni(t,Do,{hint:n})}}}(e),function(e){const{specStatus:t,wg:n}=e,r=[...$o,...xo,...ko,...Co,"ED"].includes(t),i=n&&n.length&&r,s=["Member-SUBM"].includes(t);(i||s)&&(e.logos.unshift(jo),"Member-SUBM"===t&&e.logos.push(zo))}(e)}});const Uo=String.raw,Wo=String.raw`color-mix(in srgb, #eaf3ff 15%, transparent)`;const Fo=us(Uo`@keyframes pop{
710
710
  0%{transform:scale(1,1)}
711
711
  25%{transform:scale(1.25,1.25);opacity:.75}
712
712
  100%{transform:scale(1,1)}
@@ -722,9 +722,9 @@ a.bibref{text-decoration:none}
722
722
  }
723
723
  #references :target{background:#eaf3ff;animation:pop .4s ease-in-out 0s 1}
724
724
  @media (prefers-color-scheme:dark){
725
- #references :target{background:${qo}}
725
+ #references :target{background:${Wo}}
726
726
  }
727
- body:has(input[name=color-scheme][value=dark]:checked) #references :target{background:${qo}}
727
+ body:has(input[name=color-scheme][value=dark]:checked) #references :target{background:${Wo}}
728
728
  cite .bibref{font-style:italic}
729
729
  a[href].orcid{padding-left:4px;padding-right:4px}
730
730
  a[href].orcid>svg{margin-bottom:-2px}
@@ -753,78 +753,78 @@ dd{margin-left:0}
753
753
  .removeOnSave{display:none}
754
754
  }
755
755
  body:has(input[name=color-scheme][value=light]:checked),head:not(:has(meta[name=color-scheme][content~=dark]))+body{color-scheme:light}
756
- body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"respec-mainstyle"});var Wo=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Uo.remove()}});function Fo(){const e=document.createElement("script");e.src="https://www.w3.org/scripts/TR/2021/fixup.js",location.hash&&e.addEventListener("load",()=>{window.location.href=location.hash},{once:!0}),document.body.appendChild(e)}const Bo=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2021/fixup.js",as:"script"},{hint:"preload",href:Go("base.css").href,as:"style"},{hint:"preload",href:Go("dark.css").href,as:"style"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",as:"image",corsMode:"anonymous"}],t=document.createDocumentFragment();for(const n of e.map(ni))t.appendChild(n);return t}();function Ho(e){return t=>{const n=t.querySelector(`head link[href="${e}"]`);n&&t.querySelector("head")?.append(n)}}function Go(e="base.css"){return new URL(`/StyleSheets/TR/2021/${e}`,"https://www.w3.org/")}Bo.appendChild(Or`<link
756
+ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"respec-mainstyle"});var Ho=Object.freeze({__proto__:null,name:"core/style",run:function(e){e.noReSpecCSS&&Fo.remove()}});function Bo(){const e=document.createElement("script");e.src="https://www.w3.org/scripts/TR/2021/fixup.js",location.hash&&e.addEventListener("load",()=>{window.location.href=location.hash},{once:!0}),document.body.appendChild(e)}const Go=function(){const e=[{hint:"preconnect",href:"https://www.w3.org"},{hint:"preload",href:"https://www.w3.org/scripts/TR/2021/fixup.js",as:"script"},{hint:"preload",href:Jo("base.css").href,as:"style"},{hint:"preload",href:Jo("dark.css").href,as:"style"},{hint:"preload",href:"https://www.w3.org/StyleSheets/TR/2021/logos/W3C",as:"image",corsMode:"anonymous"}],t=document.createDocumentFragment();for(const n of e.map(ni))t.appendChild(n);return t}();function Vo(e){return t=>{const n=t.querySelector(`head link[href="${e}"]`);n&&t.querySelector("head")?.append(n)}}function Jo(e="base.css"){return new URL(`/StyleSheets/TR/2021/${e}`,"https://www.w3.org/")}Go.appendChild(Or`<link
757
757
  rel="stylesheet"
758
758
  href="https://www.w3.org/StyleSheets/TR/2021/base.css"
759
759
  class="removeOnSave"
760
- />`),document.head.querySelector("meta[name=viewport]")||Bo.prepend(Or`<meta
760
+ />`),document.head.querySelector("meta[name=viewport]")||Go.prepend(Or`<meta
761
761
  name="viewport"
762
762
  content="width=device-width, initial-scale=1, shrink-to-fit=no"
763
- />`),document.head.prepend(Bo);var Vo=Object.freeze({__proto__:null,name:"w3c/style",run:function(e){e.noTOC||Bi("end-all",Fo,{once:!0});const t=Go(function(e){const t=e.specStatus?.toUpperCase()??"";let n;const r=[...ko,...vo,...wo,"ED","MEMBER-SUBM"].includes(t)&&e.wgId;switch(t){case"WD":case"FPWD":n=r?"W3C-WD":"base.css";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":n=t.toLowerCase();break;case"UD":case"UNOFFICIAL":n="W3C-UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":n="base.css";break;case"MEMBER-SUBM":n="W3C-Member-SUBM";break;default:n=r?`W3C-${e.specStatus}`:"base.css"}return n}(e));if(document.head.appendChild(Or`<link rel="stylesheet" href="${t.href}" />`),Bi("beforesave",Ho(t)),!1===e.darkMode)return ls=!0,cs.forEach(e=>{const t=us(e.textContent);t!==e.textContent&&(e.textContent=t)}),void document.querySelector(`head link[rel~="preload"][href="${Go("dark.css")}"]`)?.remove();let n=document.querySelector("head meta[name=color-scheme]");n||(n=Or`<meta name="color-scheme" content="light" />`,document.head.appendChild(n));const r=Go("dark.css"),i=n.content.includes("dark"),s=Or`<link
763
+ />`),document.head.prepend(Go);var Zo=Object.freeze({__proto__:null,name:"w3c/style",run:function(e){e.noTOC||Hi("end-all",Bo,{once:!0});const t=Jo(function(e){const t=e.specStatus?.toUpperCase()??"";let n;const r=[...$o,...xo,...ko,"ED","MEMBER-SUBM"].includes(t)&&e.wgId;switch(t){case"WD":case"FPWD":n=r?"W3C-WD":"base.css";break;case"CG-DRAFT":case"CG-FINAL":case"BG-DRAFT":case"BG-FINAL":n=t.toLowerCase();break;case"UD":case"UNOFFICIAL":n="W3C-UD";break;case"FINDING":case"DRAFT-FINDING":case"EDITOR-DRAFT-FINDING":case"BASE":n="base.css";break;case"MEMBER-SUBM":n="W3C-Member-SUBM";break;default:n=r?`W3C-${e.specStatus}`:"base.css"}return n}(e));if(document.head.appendChild(Or`<link rel="stylesheet" href="${t.href}" />`),Hi("beforesave",Vo(t)),!1===e.darkMode)return ls=!0,cs.forEach(e=>{const t=ds(e.textContent);t!==e.textContent&&(e.textContent=t)}),void document.querySelector(`head link[rel~="preload"][href="${Jo("dark.css")}"]`)?.remove();let n=document.querySelector("head meta[name=color-scheme]");n||(n=Or`<meta name="color-scheme" content="light" />`,document.head.appendChild(n));const r=Jo("dark.css"),i=n.content.includes("dark"),s=Or`<link
764
764
  rel="stylesheet"
765
765
  href="${r.href}"
766
- />`;i&&(s.media="(prefers-color-scheme: dark)"),i||s.setAttribute("disabled",""),document.head.appendChild(s),Bi("beforesave",e=>{Ho(r)(e),function(e){const t=e.querySelector(`head link[rel~="stylesheet"][href="${Go("dark.css")}"]`);if(!t)return;const n=e.querySelector("head meta[name=color-scheme]");n?.getAttribute("content")?.includes("dark")?(t.setAttribute("media","(prefers-color-scheme: dark)"),t.removeAttribute("disabled")):(t.removeAttribute("media"),t.setAttribute("disabled",""))}(e)})}});const Jo="core/github";let Zo,Ko;const Yo=new Promise((e,t)=>{Zo=e,Ko=e=>{Ni(e,Jo),t(new Error(e))}}),Xo=di({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 Qo=Object.freeze({__proto__:null,github:Yo,name:Jo,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void Zo(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=qi`Config option ${"[github]"} is missing property \`repoURL\`.`;return void Ko(e)}const t="string"==typeof e.github?{}:e.github;let n,r=t.repoURL||String(e.github);r.endsWith("/")||(r+="/");try{n=new URL(r,"https://github.com")}catch{const e=qi`${"[github]"} configuration option is not a valid URL? (${r}).`;return void Ko(e)}if("https://github.com"!==n.origin){const e=qi`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${n.href}).`;return void Ko(e)}const[i,s]=n.pathname.split("/").filter(e=>e);if(!i||!s){const e=qi`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void Ko(e)}const o=t.branch||"gh-pages",a=new URL("./issues/",n).href,c=new URL("./new/choose",a).href;let l,u;if(l="object"==typeof e.github&&e.github.hasOwnProperty("pullsURL")?e.github.pullsURL:new URL("./pulls/",n).href,l)try{const e=new URL(l);if("https://github.com"!==e.origin){const e=qi`${"[github.pullsURL]"} must be HTTPS and pointing to GitHub. (${l}).`;return void Ko(e)}if(!e.pathname.includes("/pulls")){const e=qi`${"[github.pullsURL]"} must point to pull requests. (${l}).`;return void Ko(e)}}catch{const e=qi`${"[github.pullsURL]"} is not a valid URL. (${l}).`;return void Ko(e)}if(u="object"==typeof e.github&&e.github.hasOwnProperty("commitHistoryURL")?e.github.commitHistoryURL:new URL(`./commits/${t.branch??""}`,n.href).href,u)try{const e=new URL(u);if("https://github.com"!==e.origin){const e=qi`${"[github.commitHistoryURL]"} must be HTTPS and pointing to GitHub. (${u}).`;return void Ko(e)}if(!e.pathname.includes("/commits")){const e=qi`${"[github.commitHistoryURL]"} must point to commits. (${u}).`;return void Ko(e)}}catch{const e=qi`${"[github.commitHistoryURL]"} is not a valid URL. (${u}).`;return void Ko(e)}const d={edDraftURI:`https://${i.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:a,atRiskBase:a,otherLinks:[],pullBase:l,shortName:s};let p="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)p=e.githubAPI;else{Ii("The `githubAPI` configuration option is private and should not be added manually.",Jo)}if(!e.excludeGithubLinks){const t={key:Xo.participate,data:[{value:`GitHub ${i}/${s}`,href:n},{value:"All issues",href:a},{value:Xo.file_a_bug,href:c},{value:Xo.commit_history,href:u},{value:"Pull requests",href:l}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(t)}const h={branch:o,repoURL:n.href,apiBase:p,fullName:`${i}/${s}`,issuesURL:a,pullsURL:l,newIssuesURL:c,commitHistoryURL:u};Zo(h);const f={...d,...e,github:h,githubAPI:p};Object.assign(e,f)}});class ea{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}static sectionClasses=new Set(["appendix","informative","notoc"]);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,this.processHeader(e,t)}processHeader(e,t){ea.sectionClasses.intersection(new Set(e.classList)).forEach(e=>{t.classList.add(e)})}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(ta(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function ta(e){const t=new ea(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function na(e){const t=ta(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var ra=Object.freeze({__proto__:null,name:"core/sections",restructure:na,run:function(){na(document.body)}});const ia="core/data-include";function sa(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`);if(!r)return;const i=fi(e,r.dataset.oninclude,n),s="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let i=t;"markdown"===r&&(i=gs(i)),"text"===r?e.textContent=i:e.innerHTML=i,"markdown"===r&&na(e),n&&e.replaceWith(...e.childNodes)}(r,i,{replace:s}),s||function(e){["data-include","data-include-format","data-include-replace","data-include-id","data-oninclude"].forEach(t=>e.removeAttribute(t))}(r)}async function oa(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 i=await fetch(n);if(!i.ok)throw new Error(`Fetching \`${n}\` failed with status code ${i.status} (${i.statusText}).`);sa(await i.text(),r,n),t<3&&await oa(e,t+1)}catch(t){const r=t;Ni(`\`data-include\` failed: \`${n}\` (${r.message}). Please check that the URL is correct and reachable.`,ia,{elements:[e],cause:r})}});await Promise.all(r)}var aa=Object.freeze({__proto__:null,name:ia,run:async function(){await oa(document,1)}});var ca=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Ui(e.innerHTML)}});const la="core/title",ua=di({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"},cs:{default_title:"Bez názvu"},fr:{default_title:"Sans titre"}});var da=Object.freeze({__proto__:null,name:la,run:function(e){const t=document.querySelector("h1#title")||Or`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Ni('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',la,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${ua.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=ui(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:i}=Or`
766
+ />`;i&&(s.media="(prefers-color-scheme: dark)"),i||s.setAttribute("disabled",""),document.head.appendChild(s),Hi("beforesave",e=>{Vo(r)(e),function(e){const t=e.querySelector(`head link[rel~="stylesheet"][href="${Jo("dark.css")}"]`);if(!t)return;const n=e.querySelector("head meta[name=color-scheme]");n?.getAttribute("content")?.includes("dark")?(t.setAttribute("media","(prefers-color-scheme: dark)"),t.removeAttribute("disabled")):(t.removeAttribute("media"),t.setAttribute("disabled",""))}(e)})}});const Ko="core/github";let Yo,Xo;const Qo=new Promise((e,t)=>{Yo=e,Xo=e=>{Ni(e,Ko),t(new Error(e))}}),ea=ui({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 ta=Object.freeze({__proto__:null,github:Qo,name:Ko,run:async function(e){if(!e.hasOwnProperty("github")||!e.github)return void Yo(null);if("object"==typeof e.github&&!e.github.hasOwnProperty("repoURL")){const e=qi`Config option ${"[github]"} is missing property \`repoURL\`.`;return void Xo(e)}const t="string"==typeof e.github?{}:e.github;let n,r=t.repoURL||String(e.github);r.endsWith("/")||(r+="/");try{n=new URL(r,"https://github.com")}catch{const e=qi`${"[github]"} configuration option is not a valid URL? (${r}).`;return void Xo(e)}if("https://github.com"!==n.origin){const e=qi`${"[github]"} configuration option must be HTTPS and pointing to GitHub. (${n.href}).`;return void Xo(e)}const[i,s]=n.pathname.split("/").filter(e=>e);if(!i||!s){const e=qi`${"[github]"} URL needs a path. For example, "w3c/my-spec".`;return void Xo(e)}const o=t.branch||"gh-pages",a=new URL("./issues/",n).href,c=new URL("./new/choose",a).href;let l,d;if(l="object"==typeof e.github&&e.github.hasOwnProperty("pullsURL")?e.github.pullsURL:new URL("./pulls/",n).href,l)try{const e=new URL(l);if("https://github.com"!==e.origin){const e=qi`${"[github.pullsURL]"} must be HTTPS and pointing to GitHub. (${l}).`;return void Xo(e)}if(!e.pathname.includes("/pulls")){const e=qi`${"[github.pullsURL]"} must point to pull requests. (${l}).`;return void Xo(e)}}catch{const e=qi`${"[github.pullsURL]"} is not a valid URL. (${l}).`;return void Xo(e)}if(d="object"==typeof e.github&&e.github.hasOwnProperty("commitHistoryURL")?e.github.commitHistoryURL:new URL(`./commits/${t.branch??""}`,n.href).href,d)try{const e=new URL(d);if("https://github.com"!==e.origin){const e=qi`${"[github.commitHistoryURL]"} must be HTTPS and pointing to GitHub. (${d}).`;return void Xo(e)}if(!e.pathname.includes("/commits")){const e=qi`${"[github.commitHistoryURL]"} must point to commits. (${d}).`;return void Xo(e)}}catch{const e=qi`${"[github.commitHistoryURL]"} is not a valid URL. (${d}).`;return void Xo(e)}const u={edDraftURI:`https://${i.toLowerCase()}.github.io/${s}/`,githubToken:void 0,githubUser:void 0,issueBase:a,atRiskBase:a,otherLinks:[],pullBase:l,shortName:s};let p="https://respec.org/github";if(e.githubAPI)if(new URL(e.githubAPI).hostname===window.parent.location.hostname)p=e.githubAPI;else{Ii("The `githubAPI` configuration option is private and should not be added manually.",Ko)}if(!e.excludeGithubLinks){const t={key:ea.participate,data:[{value:`GitHub ${i}/${s}`,href:n},{value:"All issues",href:a},{value:ea.file_a_bug,href:c},{value:ea.commit_history,href:d},{value:"Pull requests",href:l}]};e.otherLinks||(e.otherLinks=[]),e.otherLinks.unshift(t)}const h={branch:o,repoURL:n.href,apiBase:p,fullName:`${i}/${s}`,issuesURL:a,pullsURL:l,newIssuesURL:c,commitHistoryURL:d};Yo(h);const f={...u,...e,github:h,githubAPI:p};Object.assign(e,f)}});class na{constructor(e){this.doc=e,this.root=e.createDocumentFragment(),this.stack=[this.root],this.current=this.root}static sectionClasses=new Set(["appendix","informative","notoc"]);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,this.processHeader(e,t)}processHeader(e,t){na.sectionClasses.intersection(new Set(e.classList)).forEach(e=>{t.classList.add(e)})}addSection(e){const t=this.findHeader(e),n=t?this.findPosition(t):1,r=this.findParent(n);t&&e.removeChild(t),e.appendChild(ra(e)),t&&e.prepend(t),r.appendChild(e),this.current=r}addElement(e){this.current.appendChild(e)}}function ra(e){const t=new na(e.ownerDocument);for(;e.firstChild;){const n=e.firstChild;switch(n.localName){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.addHeader(n);break;case"section":t.addSection(n);break;default:t.addElement(n)}}return t.root}function ia(e){const t=ra(e);if("section"===t.firstElementChild.localName&&"section"===e.localName){const n=t.firstElementChild;n.remove(),e.append(...n.childNodes)}else e.textContent="";e.appendChild(t)}var sa=Object.freeze({__proto__:null,name:"core/sections",restructure:ia,run:function(){ia(document.body)}});const oa="core/data-include";function aa(e,t,n){const r=document.querySelector(`[data-include-id=${t}]`);if(!r)return;const i=fi(e,r.dataset.oninclude,n),s="string"==typeof r.dataset.includeReplace;!function(e,t,{replace:n}){const{includeFormat:r}=e.dataset;let i=t;"markdown"===r&&(i=ys(i,{inline:!1,raw:!0})),"text"===r?e.textContent=i:e.innerHTML=i,"markdown"===r&&ia(e),n&&e.replaceWith(...e.childNodes)}(r,i,{replace:s}),s||function(e){["data-include","data-include-format","data-include-replace","data-include-id","data-oninclude"].forEach(t=>e.removeAttribute(t))}(r)}async function ca(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 i=await fetch(n);if(!i.ok)throw new Error(`Fetching \`${n}\` failed with status code ${i.status} (${i.statusText}).`);aa(await i.text(),r,n),t<3&&await ca(e,t+1)}catch(t){const r=t;Ni(`\`data-include\` failed: \`${n}\` (${r.message}). Please check that the URL is correct and reachable.`,oa,{elements:[e],cause:r})}});await Promise.all(r)}var la=Object.freeze({__proto__:null,name:oa,run:async function(){await ca(document,1)}});var da=Object.freeze({__proto__:null,name:"core/reindent",run:function(){for(const e of document.getElementsByTagName("pre"))e.innerHTML=Ui(e.innerHTML)}});const ua="core/title",pa=ui({en:{default_title:"No Title"},de:{default_title:"Kein Titel"},zh:{default_title:"无标题"},cs:{default_title:"Bez názvu"},fr:{default_title:"Sans titre"}});var ha=Object.freeze({__proto__:null,name:ua,run:function(e){const t=document.querySelector("h1#title")||Or`<h1 id="title"></h1>`;if(t.isConnected&&""===t.textContent.trim()){Ni('The document is missing a title, so using a default title. To fix this, please give your document a `<title>`. If you need special markup in the document\'s title, please use a `<h1 id="title">`.',ua,{title:"Document is missing a title",elements:[t]})}t.id||(t.id="title"),t.classList.add("title"),function(e,t){t.isConnected||(t.textContent=document.title||`${pa.default_title}`);const n=document.createElement("h1");n.innerHTML=t.innerHTML.replace(/:<br>/g,": ").replace(/<br>/g," - ");let r=di(n.textContent);if(e.isPreview&&e.prNumber){const n=e.prUrl||`${e.github.repoURL}pull/${e.prNumber}`,{childNodes:i}=Or`
767
767
  Preview of PR <a href="${n}">#${e.prNumber}</a>:
768
- `;t.prepend(...i),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const pa="w3c/level",ha=di({en:{level:"Level"},ja:{level:"レベル"},nl:{level:"Niveau"},de:{level:"Stufe"},zh:{level:"级别"}});var fa=Object.freeze({__proto__:null,name:pa,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){return void Ni(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,pa,{title:"Invalid level config.",elements:[t]})}t.append(` ${ha.level} ${n}`),document.title=`${document.title} ${ha.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const ma="w3c/abstract",ga=di({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},fr:{abstract:"Résumé"},de:{abstract:"Zusammenfassung"},cs:{abstract:"Abstrakt"}});var ba=Object.freeze({__proto__:null,name:ma,run:async function(){const e=function(){const e=document.getElementById("abstract");if(e)switch(e.localName){case"section":return e;case"div":return $i(e,"section");default:return Ni("The abstract should be a `<section>` element.",ma,{elements:[e]}),e}const t=ga.abstract.toLocaleLowerCase(r);for(const e of document.querySelectorAll("h2, h3, h4, h5, h6"))if(ui(e.textContent).toLocaleLowerCase(r)===t)return e.closest("section");return e}();e?(e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(Or`<h2>${ga.abstract}</h2>`)):Ni('Document must have one `<section id="abstract">`.',ma)}});var ya=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach(e=>{e.innerHTML=fi(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")})}});const wa="core/dfn-abbr";function ka(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(),i=document.createElement("abbr");i.title=r,i.textContent=t,e.after(" (",i,")");const s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter(e=>e.trim()).concat(t).join("|")}var va=Object.freeze({__proto__:null,name:wa,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)ka(t);else{Ni(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,wa,{elements:[t],title:"Error: unsupported."})}}}});var $a=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black}
768
+ `;t.prepend(...i),r=`Preview of PR #${e.prNumber}: ${r}`}document.title=r,e.title=r}(e,t),document.body.prepend(t)}});const fa="w3c/level",ma=ui({en:{level:"Level"},ja:{level:"レベル"},nl:{level:"Niveau"},de:{level:"Stufe"},zh:{level:"级别"}});var ga=Object.freeze({__proto__:null,name:fa,run:function(e){if(!e.hasOwnProperty("level"))return;const t=document.querySelector("h1#title"),n=parseInt(e.level);if(!Number.isInteger(n)||n<0){return void Ni(`The \`level\` configuration option must be a number greater or equal to 0. It is currently set to \`${n}\``,fa,{title:"Invalid level config.",elements:[t]})}t.append(` ${ma.level} ${n}`),document.title=`${document.title} ${ma.level} ${n}`,e.shortName=`${e.shortName}-${n}`,e.level=n}});const ba="w3c/abstract",ya=ui({en:{abstract:"Abstract"},ko:{abstract:"요약"},zh:{abstract:"摘要"},ja:{abstract:"要約"},nl:{abstract:"Samenvatting"},es:{abstract:"Resumen"},fr:{abstract:"Résumé"},de:{abstract:"Zusammenfassung"},cs:{abstract:"Abstrakt"}});var wa=Object.freeze({__proto__:null,name:ba,run:async function(){const e=function(){const e=document.getElementById("abstract");if(e)switch(e.localName){case"section":return e;case"div":return $i(e,"section");default:return Ni("The abstract should be a `<section>` element.",ba,{elements:[e]}),e}const t=ya.abstract.toLocaleLowerCase(r);for(const e of document.querySelectorAll("h2, h3, h4, h5, h6"))if(di(e.textContent).toLocaleLowerCase(r)===t)return e.closest("section");return e}();e?(e.classList.add("introductory"),e.id="abstract",e.querySelector("h2")||e.prepend(Or`<h2>${ya.abstract}</h2>`)):Ni('Document must have one `<section id="abstract">`.',ba)}});var va=Object.freeze({__proto__:null,name:"core/data-transform",run:function(){document.querySelectorAll("[data-transform]").forEach(e=>{e.innerHTML=fi(e.innerHTML,e.dataset.transform),e.removeAttribute("data-transform")})}});const ka="core/dfn-abbr";function $a(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(),i=document.createElement("abbr");i.title=r,i.textContent=t,e.after(" (",i,")");const s=e.dataset.lt||"";e.dataset.lt=s.split("|").filter(e=>e.trim()).concat(t).join("|")}var xa=Object.freeze({__proto__:null,name:ka,run:function(){const e=document.querySelectorAll("[data-abbr]");for(const t of e){const{localName:e}=t;if("dfn"===e)$a(t);else{Ni(`\`data-abbr\` attribute not supported on \`${e}\` elements.`,ka,{elements:[t],title:"Error: unsupported."})}}}});var Ca=String.raw`:root{--assertion-border:#aaa;--assertion-bg:#eee;--assertion-text:black}
769
769
  .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)}
770
770
  @media (prefers-color-scheme:dark){
771
771
  :root{--assertion-border:#444;--assertion-bg:var(--borderedblock-bg);--assertion-text:var(--text)}
772
- }`;var xa=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){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(Or`<a data-cite="INFRA#assert">Assert</a>`,": "))}ds($a)}}});const Ca=/^[a-z]+(\s+[a-z]+)+\??$/,Sa=/\B"([^"]*)"\B/,_a=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Ta=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Ra=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,Ea=/^(?:\w+)\??$/,Aa=/^(\w+)\["([\w- ]*)"\]$/,La=/\.?(\w+\(.*\)$)/,Pa=/\/(.+)/,Na=/\[\[.+\]\]/;function Ia(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Or`<a
772
+ }`;var Sa=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){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(Or`<a data-cite="INFRA#assert">Assert</a>`,": "))}us(Ca)}}});const _a=/^[a-z]+(\s+[a-z]+)+\??$/,Ta=/\B"([^"]*)"\B/,Ra=/^(\w+)\(([^\\)]*)\)(?:\|(\w+)(?:\((?:([^\\)]*))\))?)?$/,Ea=/\[\[(\w+(?: +\w+)*)\]\](\([^)]*\))?$/,Aa=/^((?:\[\[)?(?:\w+(?: +\w+)*)(?:\]\])?)$/,La=/^(?:\w+)\??$/,Pa=/^(\w+)\["([\w- ]*)"\]$/,Na=/\.?(\w+\(.*\)$)/,Ia=/\/(.+)/,Oa=/\[\[.+\]\]/;function Da(e){const{identifier:t,renderParent:n,nullable:r}=e;if(n)return Or`<a
773
773
  data-xref-type="_IDL_"
774
774
  data-link-type="idl"
775
775
  data-lt="${t}"
776
776
  ><code>${t+(r?"?":"")}</code></a
777
- >`}function Oa(e){const{identifier:t,parent:n,slotType:r,renderParent:i,args:s}=e,{identifier:o}=n||{},a="method"===r,c=s??[],l=a?Or`(${gi(c,Da)})`:null,u=a?`(${c.join(", ")})`:"";return Or`${n&&i?".":""}<a
777
+ >`}function ja(e){const{identifier:t,parent:n,slotType:r,renderParent:i,args:s}=e,{identifier:o}=n||{},a="method"===r,c=s??[],l=a?Or`(${gi(c,za)})`:null,d=a?`(${c.join(", ")})`:"";return Or`${n&&i?".":""}<a
778
778
  data-xref-type="${r}"
779
779
  data-link-type="${r}"
780
780
  data-link-for="${o}"
781
781
  data-xref-for="${o}"
782
- data-lt="${`[[${t}]]${u}`}"
782
+ data-lt="${`[[${t}]]${d}`}"
783
783
  ><code>[[${t}]]${l}</code></a
784
- >`}function Da(e,t,n){if(t<n.length-1)return Or`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),i=r.length>1,s=i?r[2]:r[0];return Or`${i?"...":null}<var>${s}</var>`}function ja(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:i}=t||{};return Or`${r?".":""}<a
784
+ >`}function za(e,t,n){if(t<n.length-1)return Or`<var>${e}</var>`;const r=e.split(/(^\.{3})(.+)/),i=r.length>1,s=i?r[2]:r[0];return Or`${i?"...":null}<var>${s}</var>`}function Ma(e){const{parent:t,identifier:n,renderParent:r}=e,{identifier:i}=t||{};return Or`${r?".":""}<a
785
785
  data-link-type="idl"
786
786
  data-xref-type="attribute|dict-member|const"
787
787
  data-link-for="${i}"
788
788
  data-xref-for="${i}"
789
789
  ><code>${n}</code></a
790
- >`}function za(e){const{args:t,identifier:n,type:r,parent:i,renderParent:s}=e,{renderText:o,renderArgs:a}=e,{identifier:c}=i||{},l=gi(a||t,Da),u=`${n}(${t.join(", ")})`;return Or`${i&&s?".":""}<a
790
+ >`}function qa(e){const{args:t,identifier:n,type:r,parent:i,renderParent:s}=e,{renderText:o,renderArgs:a}=e,{identifier:c}=i||{},l=gi(a||t,za),d=`${n}(${t.join(", ")})`;return Or`${i&&s?".":""}<a
791
791
  data-link-type="idl"
792
792
  data-xref-type="${r}"
793
793
  data-link-for="${c}"
794
794
  data-xref-for="${c}"
795
- data-lt="${u}"
795
+ data-lt="${d}"
796
796
  ><code>${o||n}</code></a
797
- >${!o||a?Or`<code>(${l})</code>`:""}`}function Ma(e){const{identifier:t,enumValue:n,parent:r}=e,i=r?r.identifier:t;return Or`"<a
797
+ >${!o||a?Or`<code>(${l})</code>`:""}`}function Ua(e){const{identifier:t,enumValue:n,parent:r}=e,i=r?r.identifier:t;return Or`"<a
798
798
  data-link-type="idl"
799
799
  data-xref-type="enum-value"
800
800
  data-link-for="${i}"
801
801
  data-xref-for="${i}"
802
802
  data-lt="${n?null:"the-empty-string"}"
803
803
  ><code>${n}</code></a
804
- >"`}function qa(e){const{identifier:t}=e;return Or`"<a
804
+ >"`}function Wa(e){const{identifier:t}=e;return Or`"<a
805
805
  data-link-type="idl"
806
806
  data-cite="webidl"
807
807
  data-xref-type="exception"
808
808
  ><code>${t}</code></a
809
- >"`}function Ua(e){const{identifier:t,nullable:n}=e;return Or`<a
809
+ >"`}function Fa(e){const{identifier:t,nullable:n}=e;return Or`<a
810
810
  data-link-type="idl"
811
811
  data-cite="webidl"
812
812
  data-xref-type="interface"
813
813
  data-lt="${t}"
814
814
  ><code>${t+(n?"?":"")}</code></a
815
- >`}function Wa(e){let t;try{t=function(e){const t=Na.test(e),n=t?Pa:La,[r,i]=e.split(n);if(t&&r&&!i)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const s=r.split(/[./]/).concat(i).filter(e=>e&&e.trim()).map(e=>e.trim()),o=!e.includes("/"),a=[];for(;s.length;){const t=s.pop()??"";if(_a.test(t)){const[,e,n,r,i]=t.match(_a),s=(n??"").split(/,\s*/).filter(e=>e),c=r?.trim(),l=i?.split(/,\s*/).filter(e=>e);a.push({type:"method",identifier:e??"",args:s,renderParent:o,renderText:c,renderArgs:l});continue}if(Aa.test(t)){const[,e,n]=t.match(Aa);a.push({type:"enum",identifier:e??"",enumValue:n??"",renderParent:o});continue}if(Sa.test(t)){const[,e]=t.match(Sa);o?a.push({type:"exception",identifier:e??""}):a.push({type:"enum",enumValue:e??"",renderParent:o});continue}if(Ta.test(t)){const[,e,n]=t.match(Ta),r=n?"method":"attribute",i=n?.slice(1,-1).split(/,\s*/).filter(e=>e)??[];a.push({type:"internal-slot",slotType:r,identifier:e??"",args:i,renderParent:o});continue}if(Ra.test(t)&&s.length){const[,e]=t.match(Ra);a.push({type:"attribute",identifier:e??"",renderParent:o});continue}if(Ca.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:o,nullable:e});continue}if(Ea.test(t)&&0===s.length){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:o,nullable:e});continue}throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``)}return a.forEach((e,t,n)=>{e.parent=n[t+1]||null}),a.reverse()}(e)}catch(t){const n=Or`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Ni(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Or(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Ia(e);t&&r.push(t);break}case"attribute":r.push(ja(e));break;case"internal-slot":r.push(Oa(e));break;case"method":r.push(za(e));break;case"enum":r.push(Ma(e));break;case"exception":r.push(qa(e));break;case"idl-primitive":r.push(Ua(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Fa=new Set(["alias","reference"]),Ba=async function(){const e=await Dr.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[...Fa]){const r=e.transaction(n,"readwrite"),i=IDBKeyRange.lowerBound(t),s=async()=>{let e=await r.store.openCursor(i);for(;e?.value;){const n=e.value;(void 0===n.expires||n.expires<t)&&await r.store.delete(n.id),e=await e.continue()}};await Promise.all([s(),r.done])}return e}();const Ha={get ready(){return Ba},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)??e),await this.get("reference",e)},async has(e,t){if(!Fa.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:null},async get(e,t){if(!Fa.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),i=await n.openCursor(r);return i?i.value:null},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const i={id:r,...e[r],expires:t};i.aliasOf?n.alias.push(i):n.reference.push(i)}const r=[...Fa].flatMap(e=>n[e].map(t=>this.add(e,t)));await Promise.all(r)},async add(e,t){if(!Fa.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 i=await this.get(e,t.id);if(i&&void 0!==i.expires&&i.expires<Date.now()){const i=n.transaction(e,"readwrite");await Promise.all([i.store.delete(t.id),i.done]),r=!1}}const i=n.transaction(e,"readwrite"),[s]=await Promise.all([r?i.store.put(t):i.store.add(t),i.done]);return s},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Fa],n=e.transaction(t,"readwrite"),r=t.map(e=>n.objectStore(e).clear());await Promise.all([...r,n.done])}},Ga={},Va=[new URL("https://api.specref.org/bibrefs?refs="),new URL("https://respec.org/bibrefs?refs=")],Ja=ni({hint:"dns-prefetch",href:Va[0].origin});let Za;document.head.appendChild(Ja);const Ka=new Promise(e=>{Za=e});async function Ya(e){const t=[...new Set(e)].filter(e=>e.trim());if(!t.length||!1===navigator.onLine)return null;const n=await async function(e){for(const t of Va){let n;try{n=await fetch(t.href+e,{signal:AbortSignal.timeout(2e3)})}catch(e){console.warn(`Could not reach ${t.origin} for references.`,e);continue}if(200===n.status)try{return{data:await n.json(),expires:n.headers.get("Expires")}}catch(e){console.warn(`${t.origin} sent references that are not JSON.`,e)}else console.warn(`${t.origin} answered ${n.status} for references.`)}return null}(t.join(","));if(!n)return null;const{data:r,expires:i}=n,s=Date.now()+36e5;try{const e=Date.parse(i||""),t=Number.isNaN(e)?s:Math.min(e,s);await Ha.addAll(r,t)}catch(e){console.error(e)}return r}async function Xa(e){const t=await Ka;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await Xa(n.aliasOf):n}var Qa=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=Ga;const e=Object.keys(this.conf.localBiblio).filter(e=>this.conf.localBiblio?.[e]?.hasOwnProperty("aliasOf")).map(e=>this.conf.localBiblio?.[e]?.aliasOf).filter(e=>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.filter(Boolean)).sort())),r=n.length?await async function(e){const t=[];try{await Ha.ready;const n=e.map(async e=>({id:e,data:await Ha.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):[],i={hasData:[],noData:[]};r.forEach(e=>{(e.data?i.hasData:i.noData).push(e)}),i.hasData.forEach(e=>{e.data&&(Ga[e.id]=e.data)});const s=i.noData.map(e=>e.id);if(s.length){const e=await Ya(s);Object.assign(Ga,e)}Object.assign(Ga,this.conf.localBiblio),(()=>{Za(this.conf.biblio)})()}},biblio:Ga,name:"core/biblio",resolveRef:Xa,updateFromNetwork:Ya});const ec="core/render-biblio";function tc(e){return`bib-${wi(e)}`}const nc=di({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."},fr:{info_references:"Références informatives",norm_references:"Références normatives",references:"Références",reference_not_found:"Référence non trouvée."},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:"参考文献"},cs:{info_references:"Informativní odkazy",norm_references:"Normativní odkazy",references:"Odkazy",reference_not_found:"Odkaz nebyl nalezen."}}),rc=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"]]);function ic(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(sc)),i=function(e){const t=new Map;for(const n of e)t.has(n.refcontent?.id??"")||t.set(n.refcontent?.id??"",n);return[...t.values()]}(n),s=i.concat(r).sort((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase())),o=Or`<section>
815
+ >`}function Ha(e){let t;try{t=function(e){const t=Oa.test(e),n=t?Ia:Na,[r,i]=e.split(n);if(t&&r&&!i)throw new SyntaxError(`Internal slot missing "for" part. Expected \`{{ InterfaceName/${r}}}\` }.`);const s=r.split(/[./]/).concat(i).filter(e=>e&&e.trim()).map(e=>e.trim()),o=!e.includes("/"),a=[];for(;s.length;){const t=s.pop()??"";if(Ra.test(t)){const[,e,n,r,i]=t.match(Ra),s=(n??"").split(/,\s*/).filter(e=>e),c=r?.trim(),l=i?.split(/,\s*/).filter(e=>e);a.push({type:"method",identifier:e??"",args:s,renderParent:o,renderText:c,renderArgs:l});continue}if(Pa.test(t)){const[,e,n]=t.match(Pa);a.push({type:"enum",identifier:e??"",enumValue:n??"",renderParent:o});continue}if(Ta.test(t)){const[,e]=t.match(Ta);o?a.push({type:"exception",identifier:e??""}):a.push({type:"enum",enumValue:e??"",renderParent:o});continue}if(Ea.test(t)){const[,e,n]=t.match(Ea),r=n?"method":"attribute",i=n?.slice(1,-1).split(/,\s*/).filter(e=>e)??[];a.push({type:"internal-slot",slotType:r,identifier:e??"",args:i,renderParent:o});continue}if(Aa.test(t)&&s.length){const[,e]=t.match(Aa);a.push({type:"attribute",identifier:e??"",renderParent:o});continue}if(_a.test(t)){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"idl-primitive",identifier:n,renderParent:o,nullable:e});continue}if(La.test(t)&&0===s.length){const e=t.endsWith("?"),n=e?t.slice(0,-1):t;a.push({type:"base",identifier:n,renderParent:o,nullable:e});continue}throw new SyntaxError(`IDL micro-syntax parsing error in \`{{ ${e} }}\``)}return a.forEach((e,t,n)=>{e.parent=n[t+1]||null}),a.reverse()}(e)}catch(t){const n=Or`<span>{{ ${e} }}</span>`,r="Error: Invalid inline IDL string.";return Ni(t.message,"core/inlines",{title:r,elements:[n]}),n}const n=Or(document.createDocumentFragment()),r=[];for(const e of t)switch(e.type){case"base":{const t=Da(e);t&&r.push(t);break}case"attribute":r.push(Ma(e));break;case"internal-slot":r.push(ja(e));break;case"method":r.push(qa(e));break;case"enum":r.push(Ua(e));break;case"exception":r.push(Wa(e));break;case"idl-primitive":r.push(Fa(e));break;default:throw new Error("Unknown type.")}return n`${r}`}const Ba=new Set(["alias","reference"]),Ga=async function(){const e=await Dr.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[...Ba]){const r=e.transaction(n,"readwrite"),i=IDBKeyRange.lowerBound(t),s=async()=>{let e=await r.store.openCursor(i);for(;e?.value;){const n=e.value;(void 0===n.expires||n.expires<t)&&await r.store.delete(n.id),e=await e.continue()}};await Promise.all([s(),r.done])}return e}();const Va={get ready(){return Ga},async find(e){return await this.isAlias(e)&&(e=await this.resolveAlias(e)??e),await this.get("reference",e)},async has(e,t){if(!Ba.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t);return!!await n.openCursor(r)},async isAlias(e){return await this.has("alias",e)},async resolveAlias(e){if(!e)throw new TypeError("id is required");const t=(await this.ready).transaction("alias","readonly").store,n=IDBKeyRange.only(e),r=await t.openCursor(n);return r?r.value.aliasOf:null},async get(e,t){if(!Ba.has(e))throw new TypeError(`Invalid type: ${e}`);if(!t)throw new TypeError("id is required");const n=(await this.ready).transaction(e,"readonly").store,r=IDBKeyRange.only(t),i=await n.openCursor(r);return i?i.value:null},async addAll(e,t){if(!e)return;const n={alias:[],reference:[]};for(const r of Object.keys(e)){const i={id:r,...e[r],expires:t};i.aliasOf?n.alias.push(i):n.reference.push(i)}const r=[...Ba].flatMap(e=>n[e].map(t=>this.add(e,t)));await Promise.all(r)},async add(e,t){if(!Ba.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 i=await this.get(e,t.id);if(i&&void 0!==i.expires&&i.expires<Date.now()){const i=n.transaction(e,"readwrite");await Promise.all([i.store.delete(t.id),i.done]),r=!1}}const i=n.transaction(e,"readwrite"),[s]=await Promise.all([r?i.store.put(t):i.store.add(t),i.done]);return s},async close(){(await this.ready).close()},async clear(){const e=await this.ready,t=[...Ba],n=e.transaction(t,"readwrite"),r=t.map(e=>n.objectStore(e).clear());await Promise.all([...r,n.done])}},Ja={},Za=[new URL("https://api.specref.org/bibrefs?refs="),new URL("https://respec.org/bibrefs?refs=")],Ka=ni({hint:"dns-prefetch",href:Za[0].origin});let Ya;document.head.appendChild(Ka);const Xa=new Promise(e=>{Ya=e});async function Qa(e){const t=[...new Set(e)].filter(e=>e.trim());if(!t.length||!1===navigator.onLine)return null;const n=await async function(e){for(const t of Za){let n;try{n=await fetch(t.href+e,{signal:AbortSignal.timeout(2e3)})}catch(e){console.warn(`Could not reach ${t.origin} for references.`,e);continue}if(200===n.status)try{return{data:await n.json(),expires:n.headers.get("Expires")}}catch(e){console.warn(`${t.origin} sent references that are not JSON.`,e)}else console.warn(`${t.origin} answered ${n.status} for references.`)}return null}(t.join(","));if(!n)return null;const{data:r,expires:i}=n,s=Date.now()+36e5;try{const e=Date.parse(i||""),t=Number.isNaN(e)?s:Math.min(e,s);await Va.addAll(r,t)}catch(e){console.error(e)}return r}async function ec(e){const t=await Xa;if(!t.hasOwnProperty(e))return null;const n=t[e];return n.aliasOf?await ec(n.aliasOf):n}var tc=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=Ja;const e=Object.keys(this.conf.localBiblio).filter(e=>this.conf.localBiblio?.[e]?.hasOwnProperty("aliasOf")).map(e=>this.conf.localBiblio?.[e]?.aliasOf).filter(e=>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.filter(Boolean)).sort())),r=n.length?await async function(e){const t=[];try{await Va.ready;const n=e.map(async e=>({id:e,data:await Va.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):[],i={hasData:[],noData:[]};r.forEach(e=>{(e.data?i.hasData:i.noData).push(e)}),i.hasData.forEach(e=>{e.data&&(Ja[e.id]=e.data)});const s=i.noData.map(e=>e.id);if(s.length){const e=await Qa(s);Object.assign(Ja,e)}Object.assign(Ja,this.conf.localBiblio),(()=>{Ya(this.conf.biblio)})()}},biblio:Ja,name:"core/biblio",resolveRef:ec,updateFromNetwork:Qa});const nc="core/render-biblio";function rc(e){return`bib-${wi(e)}`}const ic=ui({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."},fr:{info_references:"Références informatives",norm_references:"Références normatives",references:"Références",reference_not_found:"Référence non trouvée."},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:"参考文献"},cs:{info_references:"Informativní odkazy",norm_references:"Normativní odkazy",references:"Odkazy",reference_not_found:"Odkaz nebyl nalezen."}}),sc=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"]]);function oc(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(ac)),i=function(e){const t=new Map;for(const n of e)t.has(n.refcontent?.id??"")||t.set(n.refcontent?.id??"",n);return[...t.values()]}(n),s=i.concat(r).sort((e,t)=>e.ref.toLocaleLowerCase().localeCompare(t.ref.toLocaleLowerCase())),o=Or`<section>
816
816
  <h3>${t}</h3>
817
- <dl class="bibliography">${s.map(ac)}</dl>
818
- </section>`;ki(o,"",t);const a=function(e){const t=new Map;for(const n of e){const e=n.refcontent?.id??"",r=t.has(e)?t.get(e):t.set(e,[]).get(e);r?.push(n.ref)}return t}(n);return function(e,t){e.map(({ref:e,refcontent:n})=>{const r=`#${tc(e)}`,i=(t.get(n.id??"")??[]).map(e=>`a.bibref[href="#${tc(e)}"]`).join(",");return{refUrl:r,elems:document.querySelectorAll(i),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"})})}(i,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#${tc(t)}"]`)].filter(({textContent:e})=>e.toLowerCase()===t.toLowerCase());Ni(`Reference "[${t}]" not found.`,ec,{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),o}function sc(e){let t=Ga[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Ni(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,ec)}else n=t.aliasOf,t=Ga[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function oc(e,t){const n=e.replace(/^(!|\?)/,""),r=`#${tc(n)}`,i=Or`<cite
817
+ <dl class="bibliography">${s.map(lc)}</dl>
818
+ </section>`;vi(o,"",t);const a=function(e){const t=new Map;for(const n of e){const e=n.refcontent?.id??"",r=t.has(e)?t.get(e):t.set(e,[]).get(e);r?.push(n.ref)}return t}(n);return function(e,t){e.map(({ref:e,refcontent:n})=>{const r=`#${rc(e)}`,i=(t.get(n.id??"")??[]).map(e=>`a.bibref[href="#${rc(e)}"]`).join(",");return{refUrl:r,elems:document.querySelectorAll(i),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"})})}(i,a),function(e){for(const{ref:t}of e){const e=[...document.querySelectorAll(`a.bibref[href="#${rc(t)}"]`)].filter(({textContent:e})=>e.toLowerCase()===t.toLowerCase());Ni(`Reference "[${t}]" not found.`,nc,{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),o}function ac(e){let t=Ja[e],n=e;const r=new Set([n]);for(;t&&t.aliasOf;)if(r.has(t.aliasOf)){t=null;Ni(`Circular reference in biblio DB between [\`${e}\`] and [\`${n}\`].`,nc)}else n=t.aliasOf,t=Ja[n],r.add(n);return t&&!t.id&&(t.id=e.toLowerCase()),{ref:e,refcontent:t}}function cc(e,t){const n=e.replace(/^(!|\?)/,""),r=`#${rc(n)}`,i=Or`<cite
819
819
  ><a class="bibref" href="${r}" data-link-type="biblio">${t||n}</a></cite
820
- >`;return t?i:Or`[${i}]`}function ac(e){const{ref:t,refcontent:n}=e,r=tc(t);return Or`
820
+ >`;return t?i:Or`[${i}]`}function lc(e){const{ref:t,refcontent:n}=e,r=rc(t);return Or`
821
821
  <dt id="${r}">[${t}]</dt>
822
822
  <dd>
823
- ${n?{html:cc(n)}:Or`<em class="respec-offending-element"
824
- >${nc.reference_not_found}</em
823
+ ${n?{html:dc(n)}:Or`<em class="respec-offending-element"
824
+ >${ic.reference_not_found}</em
825
825
  >`}
826
826
  </dd>
827
- `}function cc(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;if(t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors){if(!Array.isArray(e.authors)){const t=`The "authors" field in reference "${e.id||e.title}" must be an array.`,n=`Use \`authors: [${JSON.stringify(e.authors)}]\` instead of \`authors: ${JSON.stringify(e.authors)}\`.`;Ni(t,ec,{hint:n}),e.authors=[e.authors]}e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". "))}if(e.publisher){const n=e.pages?",":".",r=e.publisher.trim();t=`${t} ${r.endsWith(".")?r.slice(0,-1):r}${n} `}return e.pages&&(t+=`pp. ${li(e.pages)}. `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${rc.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var lc=Object.freeze({__proto__:null,name:ec,renderInlineCitation:oc,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")||Or`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Or`<h1>${nc.references}</h1>`),r.classList.add("appendix"),n.length){const e=ic(n,nc.norm_references);r.appendChild(e)}if(t.length){const e=ic(t,nc.info_references);r.appendChild(e)}document.body.appendChild(r)}});const uc="core/inlines",dc={},pc=e=>new RegExp(e.map(e=>e.source).join("|")),hc=di({en:{rfc2119Keywords:()=>pc([/\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:()=>pc([/\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/])}}),fc=/(?:`[^`]+`)(?!`)/,mc=/(?:{{[^}]+\?*}})/,gc=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,bc=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,yc=/(?:\[\[\[[^\]]+\]\]\])/,wc=/(?:\[=[^=]+=\])/,kc=/(?:\[\^[^^]+\^\])/,vc=/(?:\{\^[^}^]+\^\})/;function $c(e){const t=e.slice(2,-2).trim(),[n,r,i]=t.split("/",3).map(e=>e&&e.trim()).filter(e=>!!e),[s,o,a]=t.startsWith("/")?["element-attr",null,n]:i?["attr-value",`${n}/${r}`,i]:r?["element-attr",n,r]:["element",null,n];return Or`<code
827
+ `}function dc(e){if("string"==typeof e)return e;let t=`<cite>${e.title}</cite>`;if(t=e.href?`<a href="${e.href}">${t}</a>. `:`${t}. `,e.authors){if(!Array.isArray(e.authors)){const t=`The "authors" field in reference "${e.id||e.title}" must be an array.`,n=`Use \`authors: [${JSON.stringify(e.authors)}]\` instead of \`authors: ${JSON.stringify(e.authors)}\`.`;Ni(t,nc,{hint:n}),e.authors=[e.authors]}e.authors.length&&(t+=e.authors.join("; "),e.etAl&&(t+=" et al"),t.endsWith(".")||(t+=". "))}if(e.publisher){const n=e.pages?",":".",r=e.publisher.trim();t=`${t} ${r.endsWith(".")?r.slice(0,-1):r}${n} `}return e.pages&&(t+=`pp. ${li(e.pages)}. `),e.date&&(t+=`${e.date}. `),e.status&&(t+=`${sc.get(e.status)||e.status}. `),e.href&&(t+=`URL: <a href="${e.href}">${e.href}</a>`),t}var uc=Object.freeze({__proto__:null,name:nc,renderInlineCitation:cc,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")||Or`<section id="references"></section>`;if(document.querySelector("section#references > :is(h2, h1)")||r.prepend(Or`<h1>${ic.references}</h1>`),r.classList.add("appendix"),n.length){const e=oc(n,ic.norm_references);r.appendChild(e)}if(t.length){const e=oc(t,ic.info_references);r.appendChild(e)}document.body.appendChild(r)}});const pc="core/inlines",hc={},fc=e=>new RegExp(e.map(e=>e.source).join("|")),mc=ui({en:{rfc2119Keywords:()=>fc([/\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:()=>fc([/\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/])}}),gc=/(?:`[^`]+`)(?!`)/,bc=/(?:{{[^}]+\?*}})/,yc=/\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/,wc=/(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/,vc=/(?:\[\[\[[^\]]+\]\]\])/,kc=/(?:\[=[^=]+=\])/,$c=/(?:\[\^[^^]+\^\])/,xc=/(?:\{\^[^}^]+\^\})/;function Cc(e){const t=e.slice(2,-2).trim(),[n,r,i]=t.split("/",3).map(e=>e&&e.trim()).filter(e=>!!e),[s,o,a]=t.startsWith("/")?["element-attr",null,n]:i?["attr-value",`${n}/${r}`,i]:r?["element-attr",n,r]:["element",null,n];return Or`<code
828
828
  ><a
829
829
  data-xref-type="${s}"
830
830
  data-xref-for="${o}"
@@ -832,7 +832,7 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
832
832
  data-link-for="${o}"
833
833
  >${a}</a
834
834
  ></code
835
- >`}function xc(e){const t=(e.slice(2,-2).trim().match(/"([^"]*)"|([^/]+)/g)||[]).map(e=>e.trim());if(1===t.length){const e=t[0];return Or`<code
835
+ >`}function Sc(e){const t=(e.slice(2,-2).trim().match(/"([^"]*)"|([^/]+)/g)||[]).map(e=>e.trim());if(1===t.length){const e=t[0];return Or`<code
836
836
  ><a data-link-type="cddl-type" data-xref-type="cddl-type"
837
837
  >${e}</a
838
838
  ></code
@@ -844,8 +844,8 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
844
844
  data-link-for="${n}"
845
845
  >${r}</a
846
846
  ></code
847
- >`}function Cc(e){const t=ui(e),n=Or`<em class="rfc2119">${t}</em>`;return dc[t]=!0,n}const Sc=/^(?:!|\\|\?)?(?:#[\w-.]+|[\w-.]+(?:#[\w-.]+)?)(?:\|[^\]]+)?$/;function _c(e){const t=e.slice(3,-3).trim();if(!Sc.test(t)){return Ii(`Bad syntax: \`${e}\` is not a valid inline expansion.`,uc,{hint:"See https://github.com/speced/respec/wiki/inlines for valid syntax."}),e}const n=t.indexOf("|"),r=-1!==n?t.slice(n+1).trim():null,i=-1!==n?t.slice(0,n).trim():t,s=i.replace(/^[!?\\]/,"");if(i.startsWith("\\"))return`[[[${s}]]]`;if(s.startsWith("#"))return r?Or`<a href="${s}" data-matched-text="${e}"
848
- >${Nc(r)}</a
847
+ >`}function _c(e){const t=di(e),n=Or`<em class="rfc2119">${t}</em>`;return hc[t]=!0,n}const Tc=/^(?:!|\\|\?)?(?:#[\w-.]+|[\w-.]+(?:#[\w-.]+)?)(?:\|[^\]]+)?$/;function Rc(e){const t=e.slice(3,-3).trim();if(!Tc.test(t)){return Ii(`Bad syntax: \`${e}\` is not a valid inline expansion.`,pc,{hint:"See https://github.com/speced/respec/wiki/inlines for valid syntax."}),e}const n=t.indexOf("|"),r=-1!==n?t.slice(n+1).trim():null,i=-1!==n?t.slice(0,n).trim():t,s=i.replace(/^[!?\\]/,"");if(i.startsWith("\\"))return`[[[${s}]]]`;if(s.startsWith("#"))return r?Or`<a href="${s}" data-matched-text="${e}"
848
+ >${Oc(r)}</a
849
849
  >`:Or`<a href="${s}" data-matched-text="${e}"></a>`;if(s.includes("#")){const[t,n]=s.split("#"),o=i.slice(0,i.length-s.length)+t;return Or`<a
850
850
  data-cite="${o}"
851
851
  data-cite-frag="${n}"
@@ -855,24 +855,24 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
855
855
  data-cite="${i}"
856
856
  data-matched-text="${e}"
857
857
  data-lt="${r||null}"
858
- ></a>`}function Tc(e,t){const n=ui(e.slice(2,-2));if(n.startsWith("\\"))return e.replace(/^(\{\{\s*)\\/,"$1");const r=Wa(n);return!!t.parentElement?.closest("dfn,a")?Pc(`\`${r.textContent}\``):r}function Rc(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[i,s]=r.split("|").map(ui),o=i.replace(/^(!|\?)/,"");if(n.shortName&&o.toLowerCase()===n.shortName.toLowerCase()){const e=n.title||o;return[Or`<cite title="${n.shortName}">${e}</cite>`]}const{type:a,illegal:c}=xi(i,t.parentElement),l=oc(i,s);if(c&&!n.normativeReferences.has(o)){const e=l.childNodes[1]||l;Ii("Normative references in informative sections are not allowed. ",uc,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==a||c?n.normativeReferences.add(o):n.informativeReferences.add(o),l.childNodes[1]?l.childNodes:[l]}function Ec(e,t,n){return"ABBR"===t.parentElement?.tagName?e:Or`<abbr title="${n.get(e)}">${e}</abbr>`}function Ac(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map(e=>e.trim());return Or`<var data-type="${r}">${n}</var>`}function Lc(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(ui).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const i=n.substring(0,r),s=n.substring(r+1,n.length);return[t(i),t(s)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[i,s]=r.includes("|")?r.split("|",2).map(e=>e.trim()):[null,r],o=Nc(s),a=n?ui(n):null;return Or`<a
858
+ ></a>`}function Ec(e,t){const n=di(e.slice(2,-2));if(n.startsWith("\\"))return e.replace(/^(\{\{\s*)\\/,"$1");const r=Ha(n);return!!t.parentElement?.closest("dfn,a")?Ic(`\`${r.textContent}\``):r}function Ac(e,t,n){const r=e.slice(2,-2);if(r.startsWith("\\"))return[`[[${r.slice(1)}]]`];const[i,s]=r.split("|").map(di),o=i.replace(/^(!|\?)/,"");if(n.shortName&&o.toLowerCase()===n.shortName.toLowerCase()){const e=n.title||o;return[Or`<cite title="${n.shortName}">${e}</cite>`]}const{type:a,illegal:c}=xi(i,t.parentElement),l=cc(i,s);if(c&&!n.normativeReferences.has(o)){const e=l.childNodes[1]||l;Ii("Normative references in informative sections are not allowed. ",pc,{elements:[e],hint:`Remove '!' from the start of the reference \`[[${r}]]\``})}return"informative"!==a||c?n.normativeReferences.add(o):n.informativeReferences.add(o),l.childNodes[1]?l.childNodes:[l]}function Lc(e,t,n){return"ABBR"===t.parentElement?.tagName?e:Or`<abbr title="${n.get(e)}">${e}</abbr>`}function Pc(e){const t=e.slice(1,-1).split(":",2),[n,r]=t.map(e=>e.trim());return Or`<var data-type="${r}">${n}</var>`}function Nc(e){const t=function(e){const t=e=>e.replace("%%","/").split("/").map(di).join("/"),n=e.replace("\\/","%%"),r=n.lastIndexOf("/");if(-1===r)return[t(n)];const i=n.substring(0,r),s=n.substring(r+1,n.length);return[t(i),t(s)]}(e=e.slice(2,-2)),[n,r]=2===t.length?t:[null,t[0]],[i,s]=r.includes("|")?r.split("|",2).map(e=>e.trim()):[null,r],o=Oc(s),a=n?di(n):null;return Or`<a
859
859
  data-link-type="dfn|abstract-op"
860
860
  data-link-for="${a}"
861
861
  data-xref-for="${a}"
862
862
  data-lt="${i}"
863
863
  >${o}</a
864
- >`}function Pc(e){const t=e.slice(1,-1);return Or`<code>${t}</code>`}function Nc(e){return fc.test(e)?e.split(/(`[^`]+`)(?!`)/).map(e=>e.startsWith("`")?Pc(e):Nc(e)):document.createTextNode(e)}function Ic(e,t){e.textContent="";const n=Nc(t);e.append(...Array.isArray(n)?n:[n])}var Oc=Object.freeze({__proto__:null,name:uc,rfc2119Usage:dc,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ti,e.informativeReferences=new Ti,e.respecRFC2119||(e.respecRFC2119=dc);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=ui(e),i=ui(r);t.set(n,i)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].map(e=>Yr(e)).join("\\b)|(?:\\b")}\\b)`):null,i=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,{acceptNode:e=>n.wsNodes||e.data.trim()?r&&e.parentElement?.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),s=[];let o;for(;o=i.nextNode();)s.push(o);return s}(document.body,["#respec-ui",".head","pre","svg","script","style"],{wsNodes:!1}),s=hc.rfc2119Keywords(),o=new RegExp(`(${pc([s,mc,vc,gc,bc,yc,wc,fc,kc,...r?[r]:[]]).source})`);for(const n of i){const r=n.data.split(o);if(1===r.length)continue;const i=document.createDocumentFragment();let a=!0;for(const o of r)if(a=!a,a)switch(!0){case o.startsWith("{{"):i.append(Tc(o,n));break;case o.startsWith("{^"):i.append(xc(o));break;case o.startsWith("[[["):i.append(_c(o));break;case o.startsWith("[["):i.append(...Rc(o,n,e));break;case o.startsWith("|"):i.append(Ac(o));break;case o.startsWith("[="):i.append(Lc(o));break;case o.startsWith("`"):i.append(Pc(o));break;case o.startsWith("[^"):i.append($c(o));break;case t.has(o):i.append(Ec(o,n,t));break;case s.test(o):i.append(Cc(o))}else i.append(o);n.replaceWith(i)}},setInlineContent:Ic});const Dc="w3c/conformance",jc=di({en:{conformance:"Conformance",normativity:"As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.",keywordInterpretation:(e,t)=>Or`<p>
864
+ >`}function Ic(e){const t=e.slice(1,-1);return Or`<code>${t}</code>`}function Oc(e){return gc.test(e)?e.split(/(`[^`]+`)(?!`)/).map(e=>e.startsWith("`")?Ic(e):Oc(e)):document.createTextNode(e)}function Dc(e,t){e.textContent="";const n=Oc(t);e.append(...Array.isArray(n)?n:[n])}var jc=Object.freeze({__proto__:null,name:pc,rfc2119Usage:hc,run:function(e){const t=new Map;document.normalize(),document.querySelector("section#conformance")||document.body.classList.add("informative"),e.normativeReferences=new Ti,e.informativeReferences=new Ti,e.respecRFC2119||(e.respecRFC2119=hc);const n=document.querySelectorAll("abbr[title]:not(.exclude)");for(const{textContent:e,title:r}of n){const n=di(e),i=di(r);t.set(n,i)}const r=t.size?new RegExp(`(?:\\b${[...t.keys()].map(e=>Yr(e)).join("\\b)|(?:\\b")}\\b)`):null,i=function(e,t=[],n={wsNodes:!0}){const r=t.join(", "),i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,{acceptNode:e=>n.wsNodes||e.data.trim()?r&&e.parentElement?.closest(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),s=[];let o;for(;o=i.nextNode();)s.push(o);return s}(document.body,["#respec-ui",".head","pre","svg","script","style"],{wsNodes:!1}),s=mc.rfc2119Keywords(),o=new RegExp(`(${fc([s,bc,xc,yc,wc,vc,kc,gc,$c,...r?[r]:[]]).source})`);for(const n of i){const r=n.data.split(o);if(1===r.length)continue;const i=document.createDocumentFragment();let a=!0;for(const o of r)if(a=!a,a)switch(!0){case o.startsWith("{{"):i.append(Ec(o,n));break;case o.startsWith("{^"):i.append(Sc(o));break;case o.startsWith("[[["):i.append(Rc(o));break;case o.startsWith("[["):i.append(...Ac(o,n,e));break;case o.startsWith("|"):i.append(Pc(o));break;case o.startsWith("[="):i.append(Nc(o));break;case o.startsWith("`"):i.append(Ic(o));break;case o.startsWith("[^"):i.append(Cc(o));break;case t.has(o):i.append(Lc(o,n,t));break;case s.test(o):i.append(_c(o))}else i.append(o);n.replaceWith(i)}},setInlineContent:Dc});const zc="w3c/conformance",Mc=ui({en:{conformance:"Conformance",normativity:"As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.",keywordInterpretation:(e,t)=>Or`<p>
865
865
  The key word${t?"s":""} ${e} in this document
866
866
  ${t?"are":"is"} to be interpreted as described in
867
867
  <a href="https://www.rfc-editor.org/info/bcp14">BCP 14</a>
868
- ${oc("RFC2119")} ${oc("RFC8174")}
868
+ ${cc("RFC2119")} ${cc("RFC8174")}
869
869
  when, and only when, ${t?"they appear":"it appears"} in all
870
870
  capitals, as shown here.
871
871
  </p>`},de:{conformance:"Anforderungen",normativity:"Neben den explizit als nicht-normativ gekennzeichneten Abschnitten sind auch alle Diagramme, Beispiele und Hinweise in diesem Dokument nicht normativ. Alle anderen Angaben sind normativ.",keywordInterpretation:(e,t)=>Or`<p>
872
872
  ${t?"Die Schlüsselwörter":"Das Schlüsselwort"} ${e} in
873
873
  diesem Dokument ${t?"sind":"ist"} gemäß
874
874
  <a href="https://www.rfc-editor.org/info/bcp14">BCP 14</a>
875
- ${oc("RFC2119")} ${oc("RFC8174")}
875
+ ${cc("RFC2119")} ${cc("RFC8174")}
876
876
  und unter Berücksichtigung von
877
877
  <a href="https://github.com/adfinis-sygroup/2119/blob/master/2119de.rst"
878
878
  >2119de</a
@@ -884,24 +884,24 @@ body:has(input[name=color-scheme][value=dark]:checked){color-scheme:dark}`,{id:"
884
884
  ${t?"doivent":"doit"} être interprété${t?"s":""} comme
885
885
  décrit dans
886
886
  <a href="https://www.rfc-editor.org/info/bcp14">BCP 14</a>
887
- ${oc("RFC2119")} ${oc("RFC8174")}
887
+ ${cc("RFC2119")} ${cc("RFC8174")}
888
888
  lorsque, et seulement lorsque,
889
889
  ${t?"ils apparaissent":"il apparaît"} en majuscules, comme
890
890
  indiqué ici.
891
- </p>`}});var zc=Object.freeze({__proto__:null,name:Dc,run:function(e){const t=document.querySelector("section#conformance");if(t){if(t.classList.contains("informative")){t.classList.remove("informative");Ii("Conformance sections are normative by definition. The `informative` class has been removed.",Dc,{hint:'Remove `class="informative"` from `<section id="conformance">` to avoid this warning.',elements:[t]})}t.classList.contains("override")||function(e,t){const n=[...Object.keys(dc)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=bi(n.sort(),e=>Or`<em class="rfc2119">${e}</em>`),i=n.length>1,s=Or`
892
- <h1>${jc.conformance}</h1>
893
- <p>${jc.normativity}</p>
894
- ${n.length?jc.keywordInterpretation(r,i):null}
895
- `;e.prepend(...s.childNodes)}(t,e)}if(!t&&Object.keys(dc).length){Ii("Document uses RFC2119 keywords but lacks a conformance section.",Dc,{hint:'Please add a `<section id="conformance">`.'})}}});function Mc(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(i){Ni(`Invalid ${t} name "${e}": ${i.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function qc(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Ni(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Uc=new Li;function Wc(e,t){for(const n of t)Uc.has(n)||Uc.set(n,new Set),Uc.get(n)?.add(e)}const Fc="core/dfn",Bc=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:qc}],["element",{requiresFor:!1,validator:Mc}],["element-attr",{requiresFor:!1,validator:Mc}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:qc}],["event",{requiresFor:!1,validator:qc}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new zr(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(i){return Ni(`Invalid ${t} "${e}": ${i.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:qc}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?qc(e.slice(1,-1),t,n,r):(Ni(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Hc=[...Bc.keys()];function Gc(e,t){let n="";switch(!0){case Hc.some(t=>e.classList.contains(t)):n=[...e.classList].find(e=>Bc.has(e))??"",function(e,t,n){const r=Bc.get(t);if(r?.requiresFor&&!n.dataset.dfnFor){const e=qi`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:i}=r,s=qi`Use a ${"[data-dfn-for]"} attribute to associate this with ${i??""}.`;Ni(e,Fc,{hint:s,elements:[n]})}r?.validator&&r.validator(e,t,n,Fc)}(t,n,e);break;case Ta.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=qi`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Ni(`Internal slot "${e}" must be associated with a WebIDL interface.`,Fc,{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 i=["attribute","method"],{dfnType:s}=t.dataset;if(!i.includes(s)||r!==s){const n=qi`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${ji(i,{quotes:!0})}. The slot "${e}" seems to be a "${Di(r)}"?`;return Ni(n,Fc,{hint:s,elements:[t]}),"dfn"}return s}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){const t=e.closest("[data-dfn-type]");n=t?.dataset.dfnType??""}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function Vc(e){switch(!0){case e.matches(".export.no-export"):Ni(qi`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Fc,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Ni(qi`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Fc,{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="";break;case function(e){return!e.matches(".export, [data-export]")&&e.closest("section.informative, section.normative")?.classList.contains("informative")}(e):e.dataset.noexport=""}}var Jc=Object.freeze({__proto__:null,name:Fc,run:function(){for(const e of document.querySelectorAll("dfn")){if(e.closest("del"))continue;const t=vi(e);if(Wc(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Gc(e,n),Vc(e);const r=(e.dataset.localLt||"").split("|").map(ui),i=t.filter(e=>!r.includes(e));(i.length>1||n!==ui(e.textContent))&&(e.dataset.lt=i.join("|"))}}});var Zc=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=ui(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=ui(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=ui(n).toLowerCase(),i=Mr.isSingular(r)?Mr.plural(r):Mr.singular(r);return e.has(i)&&!t.has(i)?i:""}}();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("|"),Wc(e,n)}})}});var Kc=String.raw`span.example-title{text-transform:none}
891
+ </p>`}});var qc=Object.freeze({__proto__:null,name:zc,run:function(e){const t=document.querySelector("section#conformance");if(t){if(t.classList.contains("informative")){t.classList.remove("informative");Ii("Conformance sections are normative by definition. The `informative` class has been removed.",zc,{hint:'Remove `class="informative"` from `<section id="conformance">` to avoid this warning.',elements:[t]})}t.classList.contains("override")||function(e,t){const n=[...Object.keys(hc)];n.length&&(t.normativeReferences.add("RFC2119"),t.normativeReferences.add("RFC8174"));const r=bi(n.sort(),e=>Or`<em class="rfc2119">${e}</em>`),i=n.length>1,s=Or`
892
+ <h1>${Mc.conformance}</h1>
893
+ <p>${Mc.normativity}</p>
894
+ ${n.length?Mc.keywordInterpretation(r,i):null}
895
+ `;e.prepend(...s.childNodes)}(t,e)}if(!t&&Object.keys(hc).length){Ii("Document uses RFC2119 keywords but lacks a conformance section.",zc,{hint:'Please add a `<section id="conformance">`.'})}}});function Uc(e,t,n,r){try{switch(t){case"element-attr":return document.createAttribute(e),!0;case"element":return document.createElement(e),!0}}catch(i){Ni(`Invalid ${t} name "${e}": ${i.message}`,r,{hint:`Check that the ${t} name is allowed per the XML's Name production for ${t}.`,elements:[n]})}return!1}function Wc(e,t,n,r){if(/^[a-z]+(-[a-z]+)*$/i.test(e))return!0;return Ni(`Invalid ${t} name "${e}".`,r,{hint:`Check that the ${t} name is allowed per the naming rules for this type.`,elements:[n]}),!1}const Fc=new Li;function Hc(e,t){for(const n of t)Fc.has(n)||Fc.set(n,new Set),Fc.get(n)?.add(e)}const Bc="core/dfn",Gc=new Map([["abstract-op",{requiresFor:!1}],["attr-value",{requiresFor:!0,associateWith:"a markup attribute",validator:Wc}],["element",{requiresFor:!1,validator:Uc}],["element-attr",{requiresFor:!1,validator:Uc}],["element-state",{requiresFor:!0,associateWith:"a markup attribute",validator:Wc}],["event",{requiresFor:!1,validator:Wc}],["http-header",{requiresFor:!1}],["media-type",{requiresFor:!1,validator:function(e,t,n,r){try{const t=new zr(e);if(t.toString()!==e)throw new Error(`Input doesn't match its canonical form: "${t}".`)}catch(i){return Ni(`Invalid ${t} "${e}": ${i.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:Wc}],["permission",{requiresFor:!1,validator:function(e,t,n,r){return e.startsWith('"')&&e.endsWith('"')?Wc(e.slice(1,-1),t,n,r):(Ni(`Invalid ${t} "${e}".`,r,{hint:`Check that the ${t} is quoted with double quotes.`,elements:[n]}),!1)}}]]),Vc=[...Gc.keys()];function Jc(e,t){let n="";switch(!0){case Vc.some(t=>e.classList.contains(t)):n=[...e.classList].find(e=>Gc.has(e))??"",function(e,t,n){const r=Gc.get(t);if(r?.requiresFor&&!n.dataset.dfnFor){const e=qi`Definition of type "\`${t}\`" requires a ${"[data-dfn-for]"} attribute.`,{associateWith:i}=r,s=qi`Use a ${"[data-dfn-for]"} attribute to associate this with ${i??""}.`;Ni(e,Bc,{hint:s,elements:[n]})}r?.validator&&r.validator(e,t,n,Bc)}(t,n,e);break;case Ea.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=qi`Use a ${"[data-dfn-for]"} attribute to associate this dfn with a WebIDL interface.`;Ni(`Internal slot "${e}" must be associated with a WebIDL interface.`,Bc,{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 i=["attribute","method"],{dfnType:s}=t.dataset;if(!i.includes(s)||r!==s){const n=qi`Invalid ${"[data-dfn-type]"} attribute on internal slot.`,s=`The only allowed types are: ${ji(i,{quotes:!0})}. The slot "${e}" seems to be a "${Di(r)}"?`;return Ni(n,Bc,{hint:s,elements:[t]}),"dfn"}return s}(t,e)}if(!n&&!e.matches("[data-dfn-type]")){const t=e.closest("[data-dfn-type]");n=t?.dataset.dfnType??""}n&&!e.dataset.dfnType&&(e.dataset.dfnType=n)}function Zc(e){switch(!0){case e.matches(".export.no-export"):Ni(qi`Declares both "${"[no-export]"}" and "${"[export]"}" CSS class.`,Bc,{elements:[e],hint:"Please use only one."});break;case e.matches(".no-export, [data-noexport]"):if(e.matches("[data-export]")){Ni(qi`Declares ${"[no-export]"} CSS class, but also has a "${"[data-export]"}" attribute.`,Bc,{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="";break;case function(e){return!e.matches(".export, [data-export]")&&e.closest("section.informative, section.normative")?.classList.contains("informative")}(e):e.dataset.noexport=""}}var Kc=Object.freeze({__proto__:null,name:Bc,run:function(){for(const e of document.querySelectorAll("dfn")){if(e.closest("del"))continue;const t=ki(e);if(Hc(e,t),e.dataset.cite&&/\b#\b/.test(e.dataset.cite))continue;const[n]=t;Jc(e,n),Zc(e);const r=(e.dataset.localLt||"").split("|").map(di),i=t.filter(e=>!r.includes(e));(i.length>1||n!==di(e.textContent))&&(e.dataset.lt=i.join("|"))}}});var Yc=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=di(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=di(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=di(n).toLowerCase(),i=Mr.isSingular(r)?Mr.plural(r):Mr.singular(r);return e.has(i)&&!t.has(i)?i:""}}();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("|"),Hc(e,n)}})}});var Xc=String.raw`span.example-title{text-transform:none}
896
896
  :is(aside,div).example,div.illegal-example{padding:.5em;margin:1em 0;position:relative;clear:both}
897
897
  div.illegal-example{color:red}
898
898
  div.illegal-example p{color:#000}
899
- aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const Yc=di({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},fr:{example:"Exemple"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"},cs:{example:"Příklad"}});function Xc(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",i=n.title?Or`<span class="example-title">: ${n.title}</span>`:"";return Or`<div class="marker">
900
- <a class="self-link">${Yc.example}<bdi>${r}</bdi></a
899
+ aside.example div.example{border-left-width:.1em;border-color:#999;background:#fff}`;const Qc=ui({en:{example:"Example"},nl:{example:"Voorbeeld"},es:{example:"Ejemplo"},fr:{example:"Exemple"},ko:{example:"예시"},ja:{example:"例"},de:{example:"Beispiel"},zh:{example:"例"},cs:{example:"Příklad"}});function el(e,t,n){n.title=e.title,n.title&&e.removeAttribute("title");const r=t>0?` ${t}`:"",i=n.title?Or`<span class="example-title">: ${n.title}</span>`:"";return Or`<div class="marker">
900
+ <a class="self-link">${Qc.example}<bdi>${r}</bdi></a
901
901
  >${i}
902
- </div>`}var Qc=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;ds(Kc,{before:document.querySelector("link")});let t=0;e.forEach(e=>{e.classList.contains("illegal-example");const n={},{title:r}=e;if("aside"===e.localName){++t;const i=Xc(e,t,n);e.prepend(i);const s=ki(e,"example",r||String(t));i.querySelector("a.self-link").href=`#${s}`}else{const i=!!e.closest("aside");i||++t,n.content=e.innerHTML,e.classList.remove("example","illegal-example");const s=e.id?e.id:null;s&&e.removeAttribute("id");const o=Xc(e,i?0:t,n),a=Or`<div class="example" id="${s}">
902
+ </div>`}var tl=Object.freeze({__proto__:null,name:"core/examples",run:function(){const e=document.querySelectorAll("pre.example, pre.illegal-example, aside.example");if(!e.length)return;us(Xc,{before:document.querySelector("link")});let t=0;e.forEach(e=>{e.classList.contains("illegal-example");const n={},{title:r}=e;if("aside"===e.localName){++t;const i=el(e,t,n);e.prepend(i);const s=vi(e,"example",r||String(t));i.querySelector("a.self-link").href=`#${s}`}else{const i=!!e.closest("aside");i||++t,n.content=e.innerHTML,e.classList.remove("example","illegal-example");const s=e.id?e.id:null;s&&e.removeAttribute("id");const o=el(e,i?0:t,n),a=Or`<div class="example" id="${s}">
903
903
  ${o} ${e.cloneNode(!0)}
904
- </div>`;ki(a,"example",r||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}})}});var el=String.raw`.issue-label{text-transform:initial}
904
+ </div>`;vi(a,"example",r||String(t));a.querySelector("a.self-link").href=`#${a.id}`,e.replaceWith(a)}})}});var nl=String.raw`.issue-label{text-transform:initial}
905
905
  .warning>p:first-child{margin-top:0}
906
906
  .warning{padding:.5em;border-left-width:.5em;border-left-style:solid}
907
907
  span.warning{padding:.1em .5em .15em}
@@ -911,29 +911,21 @@ span.warning{padding:.1em .5em .15em}
911
911
  .warning-title:before{content:"⚠";font-size:1.3em;float:left;padding-right:.3em;margin-top:-.3em}
912
912
  li.task-list-item{list-style:none}
913
913
  input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle}
914
- .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 tl="core/issues-notes",nl=di({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"},cs:{editors_note:"Poznámka editora",feature_at_risk:"(Funkce v ohrožení) Problém",issue:"Problém",issue_summary:"Souhrn problémů",no_issues_in_spec:"V této specifikaci nejsou uvedeny žádné problémy.",note:"Poznámka",warning:"Varování"},fr:{editors_note:"Note de l'éditeur",issue:"Problème",issue_summary:"Résumé des problèmes",no_issues_in_spec:"Il n'y a aucun problème répertorié dans cette spécification.",note:"Note",warning:"Avertissement"}});function rl(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}}(),i=document.createElement("ul");e.forEach(e=>{const{type:s,displayType:o,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),i=e.classList.contains("atrisk"),s=t?"issue":n?"warning":r?"ednote":"note",o=t?i?nl.feature_at_risk:nl.issue:n?nl.warning:r?nl.editors_note:nl.note;return{type:s,displayType:o,isFeatureAtRisk:i}}(e),c="issue"===s,l="span"===e.localName,{number:u}=e.dataset,d={title:e.title,number:r(e)};if(!l){const r=Or`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,l=document.createElement("span"),p=Or`<div class="${`${s}-title marker`}">${l}</div>`;ki(p,"h",s);let h,f=o;if(e.id?(r.id=e.id,e.removeAttribute("id")):ki(r,"issue-container",d.number?`number-${d.number}`:""),c){if(void 0!==d.number&&(f+=` ${d.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return Or`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Or`<a href="${t.atRiskBase+e}" />`}(u??"",n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),h=t.get(u??""),!h){Ii(`Failed to fetch issue number ${u}.`,tl)}h&&!d.title&&(d.title=h.title)}i.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,i=t.title?Or`<span style="text-transform: none">: ${t.title}</span>`:"";return Or`<li><a href="${`#${n}`}">${r}</a>${i}</li>`}(nl.issue,d,r.id))}if(l.textContent=f,d.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},i=h?h.labels:[];h&&"CLOSED"===h.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,i=/^[0-9a-f]{6}$/i.test(n)?n:"f6f8fa",s=new URL("./issues/",t);s.searchParams.set("q",`is:issue is:open label:"${r}"`);const o=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[i,s,o]=[t,n,r].map(e=>parseInt(e,16)/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4),a=.2126*i+.7152*s+.0722*o;return a>.179?"#000":"#fff"}(i),a=`background-color: #${i}; color: ${o}`,c=`GitHub label: ${r}`;return Or` <a
914
+ .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 rl="core/issues-notes",il=ui({en:{editors_note:"Editor's note",feature_at_risk:"(Feature at Risk) Issue",issue:"Issue",issue_summary:"Issue summary",no_issues_in_spec:"There are no issues listed in this specification.",note:"Note",warning:"Warning"},ja:{note:"注",editors_note:"編者注",feature_at_risk:"(変更の可能性のある機能) Issue",issue:"Issue",issue_summary:"Issue の要約",no_issues_in_spec:"この仕様には未解決の issues は含まれていません.",warning:"警告"},nl:{editors_note:"Redactionele noot",issue_summary:"Lijst met issues",no_issues_in_spec:"Er zijn geen problemen vermeld in deze specificatie.",note:"Noot",warning:"Waarschuwing"},es:{editors_note:"Nota de editor",issue:"Cuestión",issue_summary:"Resumen de la cuestión",note:"Nota",no_issues_in_spec:"No hay problemas enumerados en esta especificación.",warning:"Aviso"},de:{editors_note:"Redaktioneller Hinweis",issue:"Frage",issue_summary:"Offene Fragen",no_issues_in_spec:"Diese Spezifikation enthält keine offenen Fragen.",note:"Hinweis",warning:"Warnung"},zh:{editors_note:"编者注",feature_at_risk:"(有可能变动的特性)Issue",issue:"Issue",issue_summary:"Issue 总结",no_issues_in_spec:"本规范中未列出任何 issue。",note:"注",warning:"警告"},cs:{editors_note:"Poznámka editora",feature_at_risk:"(Funkce v ohrožení) Problém",issue:"Problém",issue_summary:"Souhrn problémů",no_issues_in_spec:"V této specifikaci nejsou uvedeny žádné problémy.",note:"Poznámka",warning:"Varování"},fr:{editors_note:"Note de l'éditeur",issue:"Problème",issue_summary:"Résumé des problèmes",no_issues_in_spec:"Il n'y a aucun problème répertorié dans cette spécification.",note:"Note",warning:"Avertissement"}});function sl(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}}(),i=document.createElement("ul");e.forEach(e=>{const{type:s,displayType:o,isFeatureAtRisk:a}=function(e){const t=e.classList.contains("issue"),n=e.classList.contains("warning"),r=e.classList.contains("ednote"),i=e.classList.contains("atrisk"),s=t?"issue":n?"warning":r?"ednote":"note",o=t?i?il.feature_at_risk:il.issue:n?il.warning:r?il.editors_note:il.note;return{type:s,displayType:o,isFeatureAtRisk:i}}(e),c="issue"===s,l="span"===e.localName,{number:d}=e.dataset,u={title:e.title,number:r(e)};if(!l){const r=Or`<div class="${a?`${s} atrisk`:s}" role="${"note"===s?"note":null}"></div>`,l=document.createElement("span"),p=Or`<div class="${`${s}-title marker`}">${l}</div>`;vi(p,"h",s);let h,f=o;if(e.id?(r.id=e.id,e.removeAttribute("id")):vi(r,"issue-container",u.number?`number-${u.number}`:""),c){if(void 0!==u.number&&(f+=` ${u.number}`),e.dataset.hasOwnProperty("number")){const e=function(e,t,{isFeatureAtRisk:n=!1}={}){if(!n&&t.issueBase)return Or`<a href="${t.issueBase+e}" />`;if(n&&t.atRiskBase)return Or`<a href="${t.atRiskBase+e}" />`}(d??"",n,{isFeatureAtRisk:a});if(e&&(l.before(e),e.append(l)),l.classList.add("issue-number"),h=t.get(d??""),!h){Ii(`Failed to fetch issue number ${d}.`,rl)}h&&!u.title&&(u.title=h.title)}i.append(function(e,t,n){const r=`${e}${t.number?` ${t.number}`:""}`,i=t.title?Or`<span style="text-transform: none">: ${t.title}</span>`:"";return Or`<li><a href="${`#${n}`}">${r}</a>${i}</li>`}(il.issue,u,r.id))}if(l.textContent=f,u.title){e.removeAttribute("title");const{repoURL:t=""}=n.github||{},i=h?h.labels:[];h&&"CLOSED"===h.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,i=/^[0-9a-f]{6}$/i.test(n)?n:"f6f8fa",s=new URL("./issues/",t);s.searchParams.set("q",`is:issue is:open label:"${r}"`);const o=function(e){const[t,n,r]=[e.slice(0,2),e.slice(2,4),e.slice(4,6)],[i,s,o]=[t,n,r].map(e=>parseInt(e,16)/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4),a=.2126*i+.7152*s+.0722*o;return a>.179?"#000":"#fff"}(i),a=`background-color: #${i}; color: ${o}`,c=`GitHub label: ${r}`;return Or` <a
915
915
  class="respec-gh-label"
916
916
  style="${a}"
917
917
  href="${s.href}"
918
918
  aria-label="${c}"
919
919
  >${r}</a
920
- >`}(e,n));r.length&&r.unshift(document.createTextNode(" "));return Or`<span class="issue-label">: ${t}${r}</span>`}(i,d.title,t))}let m=e;e.replaceWith(r),m.classList.remove(s),m.removeAttribute("data-number"),h&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(h.bodyHTML)),r.append(p,m)}}),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(Or`<p>${nl.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.prepend(Or`<h1>${nl.issue_summary}</h1>`)}(i)}var il=Object.freeze({__proto__:null,name:tl,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 Ni(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,tl),new Map;const i=await r.json();return new Map(Object.entries(i))}(e.github??null);ds(el,{before:document.head.querySelector("link")}),rl(n,r,e),document.querySelectorAll(".ednote").forEach(e=>{e.classList.remove("ednote"),e.classList.add("note")})}});const sl="core/best-practices",ol={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},al=di(ol),cl=r in ol?r:"en";var ll=Object.freeze({__proto__:null,name:sl,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=ki(e,"bp"),i=Or`<a class="marker self-link" href="${`#${r}`}"
921
- ><bdi lang="${cl}">${al.best_practice}${t+1}</bdi></a
922
- >`;if(n){const t=Or`<li>${i}: ${Ri(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const o=Or`${i.cloneNode(!0)}: ${e}`;s.prepend(...o.childNodes)}),e.length)t&&(t.appendChild(Or`<h1>Best Practices Summary</h1>`),n&&t.appendChild(n));else if(t){Ii("Using best practices summary (#bp-summary) but no best practices found.",sl),t.remove()}}});const ul="core/figures",dl=di({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"},fr:{list_of_figures:"Liste des figures",fig:"Figure "},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var pl=Object.freeze({__proto__:null,name:ul,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;ki(e,"fig",r),Ci(t,Or`<span class="fig-title"></span>`),t.prepend(Or`<a class="self-link" href="#${e.id}"
923
- >${dl.fig}<bdi class="figno">${n+1}</bdi></a
920
+ >`}(e,n));r.length&&r.unshift(document.createTextNode(" "));return Or`<span class="issue-label">: ${t}${r}</span>`}(i,u.title,t))}let m=e;e.replaceWith(r),m.classList.remove(s),m.removeAttribute("data-number"),h&&!m.innerHTML.trim()&&(m=document.createRange().createContextualFragment(h.bodyHTML)),r.append(p,m)}}),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(Or`<p>${il.no_issues_in_spec}</p>`),(!n||n&&n!==t.firstElementChild)&&t.prepend(Or`<h1>${il.issue_summary}</h1>`)}(i)}var ol=Object.freeze({__proto__:null,name:rl,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 Ni(`Error fetching issues from GitHub. (HTTP Status ${r.status}).`,rl),new Map;const i=await r.json();return new Map(Object.entries(i))}(e.github??null);us(nl,{before:document.head.querySelector("link")}),sl(n,r,e),document.querySelectorAll(".ednote").forEach(e=>{e.classList.remove("ednote"),e.classList.add("note")})}});const al="core/best-practices",cl={en:{best_practice:"Best Practice "},ja:{best_practice:"最良実施例 "},de:{best_practice:"Musterbeispiel "},zh:{best_practice:"最佳实践 "}},ll=ui(cl),dl=r in cl?r:"en";var ul=Object.freeze({__proto__:null,name:al,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=vi(e,"bp"),i=Or`<a class="marker self-link" href="${`#${r}`}"
921
+ ><bdi lang="${dl}">${ll.best_practice}${t+1}</bdi></a
922
+ >`;if(n){const t=Or`<li>${i}: ${Ri(e)}</li>`;n.appendChild(t)}const s=e.closest("div");if(!s)return void e.classList.add("advisement");s.classList.add("advisement");const o=Or`${i.cloneNode(!0)}: ${e}`;s.prepend(...o.childNodes)}),e.length)t&&(t.appendChild(Or`<h1>Best Practices Summary</h1>`),n&&t.appendChild(n));else if(t){Ii("Using best practices summary (#bp-summary) but no best practices found.",al),t.remove()}}});const pl="core/figures",hl=ui({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"},fr:{list_of_figures:"Liste des figures",fig:"Figure "},zh:{fig:"图 ",list_of_figures:"规范中包含的图"},de:{fig:"Abbildung",list_of_figures:"Abbildungsverzeichnis"}});var fl=Object.freeze({__proto__:null,name:pl,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;vi(e,"fig",r),Ci(t,Or`<span class="fig-title"></span>`),t.prepend(Or`<a class="self-link" href="#${e.id}"
923
+ >${hl.fig}<bdi class="figno">${n+1}</bdi></a
924
924
  >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);return n.querySelectorAll("a").forEach(e=>{$i(e,"span").removeAttribute("href")}),Or`<li class="tofline">
925
925
  <a class="tocxref" href="${`#${e}`}">${n.childNodes}</a>
926
- </li>`}(t.id,r));else{Ii("Found a `<figure>` without a `<figcaption>`.",ul,{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=Si(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(Or`<h1>${dl.list_of_figures}</h1>`,Or`<ul class="tof">
926
+ </li>`}(t.id,r));else{Ii("Found a `<figure>` without a `<figcaption>`.",pl,{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=Si(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(Or`<h1>${hl.list_of_figures}</h1>`,Or`<ul class="tof">
927
927
  ${e}
928
- </ul>`))}});const hl=di({en:{list_of_tables:"List of Tables",table:"Table "},fr:{list_of_tables:"Liste des tables",table:"Table "},nl:{list_of_tables:"Lijst met tabellen",table:"Tabel "}});var fl=Object.freeze({__proto__:null,name:"core/tables",run:function(){const e=function(){const e=[],t=document.querySelectorAll("table.numbered");return[...t].filter(e=>!!e.querySelector("caption")).forEach((t,n)=>{const r=t.querySelector("caption");r&&(!function(e,t,n){const r=t.textContent;ki(e,"table",r),Ci(t,Or`<span class="table-title"></span>`),t.prepend(Or`<a class="self-link" href="#${e.id}"
929
- >${hl.table}<bdi class="tableno">${n+1}</bdi></a
930
- >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);for(const e of n.querySelectorAll("a"))$i(e,"span",{copyAttributes:!1});return Or`<li>
931
- <a class="tocxref" href="${`#${e}`}"
932
- >${n.childNodes}</a
933
- >
934
- </li>`}(t.id,r)))}),e}(),t=document.querySelector("section#list-of-tables");e.length&&t&&(!function(e){if(e.matches(".appendix, .introductory")||e.closest("section"))return;const t=Si(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(Or`<h1>${hl.list_of_tables}</h1>`,Or`<ul class="list-of-tables">
935
- ${e}
936
- </ul>`))}});const ml=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function gl(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return bl(e,t,n);const r=`${n}()`;return bl(e,t,r,n)}(e,n,t);default:return bl(e,n,t)}}function bl(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,i=wl(n,t,e,r);if(0===i.length&&""!==t){n=`${t}.${n}`;const e=Uc.get(n);e&&1===e.size&&(i=[...e],Wc(i[0],[n]))}if(i.length>1){Ni(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:i})}if(i.length)return i[0]}}function yl(e,t,n,r){if(!e.id){const t=n.toLowerCase(),i=t?`${t}-`:"";let s=r.toLowerCase().replace(/[()]/g,"").replace(/\s/g,"-");""===s&&(s="the-empty-string",e.setAttribute("aria-label","the empty string")),e.id=`dom-${i}${s}`}switch(e.dataset.idl=t.type,e.dataset.title=e.textContent,e.dataset.dfnFor=n,t.type){case"operation":case"attribute":case"field":e.dataset.type=kl(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||Ci(e,e.ownerDocument.createElement("code")),t.type){case"attribute":case"constructor":case"operation":{const i=function(e,t,n){const{type:r}=e,i=`${t}.${n}`;switch(r){case"constructor":case"operation":{const t=`${n}()`,r=`${i}()`,s=function(e,t){const n=[];if(0===t.length)return n;const r=[],i=[];for(const{name:e,optional:n,variadic:s}of t)n||s?i.push(e):r.push(e);const s=r.join(", "),o=`${e}(${s})`;n.push(o);const a=i.map((t,n)=>{const s=[...r,...i.slice(0,n+1)].join(", ");return`${e}(${s})`});return n.push(...a),n}(n,e.arguments);return{local:[i,r,n],exportable:[t,...s]}}case"attribute":return{local:[i],exportable:[n]}}}(t,n,r);i&&function(e,t){const{local:n,exportable:r}=t,i=e.dataset.lt?new Set(e.dataset.lt.split("|")):new Set;for(const e of r)i.add(e);n.filter(e=>i.has(e)).forEach(e=>i.delete(e)),e.dataset.lt=[...i].join("|"),e.dataset.localLt=n.join("|"),Wc(e,[...n,...r])}(e,i);break}}return e}function wl(e,t,n,r){const i=Uc.get(e);if(!i||0===i.size)return[];const s=[...i],o=s.filter(e=>{if("dfn"===e.dataset.dfnType)return!1;const n=e.closest("[data-dfn-for]");return n&&n.dataset.dfnFor===t});if(0===o.length&&""===t&&1===s.length)return s[0].textContent===n?s:[];if(ml.has(r)&&s.length){const e=s.find(e=>e.textContent.trim()===n);if(e)return[e]}return o}function kl(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(kl).join("|"):kl(t))}var vl=String.raw`.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;display:none;place-items:center}
928
+ </ul>`))}});var ml=String.raw`.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;display:none;place-items:center}
937
929
  .respec-button-copy-paste>svg{grid-area:1/1}
938
930
  .respec-button-copy-paste:focus{text-decoration:none;border-color:#51a7e8;outline:0;box-shadow:0 0 5px rgba(81,167,232,.5)}
939
931
  .respec-button-copy-paste:is(:focus:hover,.selected:focus){border-color:#51a7e8}
@@ -956,21 +948,132 @@ input.task-list-item-checkbox{margin:0 .35em .25em -1.6em;vertical-align:middle}
956
948
  }
957
949
  .respec-button-copy-paste[data-copy-state=copied] .respec-copy-check{visibility:visible}
958
950
  .respec-button-copy-paste[data-copy-state]::after{visibility:visible;opacity:1;transition:none}
959
- .respec-button-copy-paste[data-copy-state=copied]>svg:not(.respec-copy-check){visibility:hidden}`;const $l=di({en:{copy:"Copy to clipboard",copied:"Copied!",failed:"Could not copy!"},cs:{copy:"Kopírovat do schránky",copied:"Zkopírováno!",failed:"Nelze kopírovat!"},de:{copy:"In die Zwischenablage kopieren",copied:"Kopiert!",failed:"Kopieren fehlgeschlagen!"},es:{copy:"Copiar al portapapeles",copied:"¡Copiado!",failed:"¡No se pudo copiar!"},fr:{copy:"Copier dans le presse-papiers",copied:"Copié !",failed:"Impossible de copier !"},ja:{copy:"クリップボードにコピー",copied:"コピーしました",failed:"コピーできませんでした"},ko:{copy:"클립보드에 복사",copied:"복사됨",failed:"복사 실패"},nl:{copy:"Kopiëren naar klembord",copied:"Gekopieerd!",failed:"Kopiëren mislukt!"},zh:{copy:"复制到剪贴板",copied:"已复制",failed:"无法复制"}}),xl="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z",Cl=`<svg aria-hidden="true" height="16" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="${xl}"/></svg>`,Sl=`<svg class="respec-copy-sprite" aria-hidden="true"><symbol id="respec-copy-icon" viewBox="0 0 14 16"><path fill-rule="evenodd" d="${xl}"/></symbol><symbol id="respec-copy-check" viewBox="0 0 64 64"><path d="M55 17a3 3 0 0 1 0 4L26 50a3 3 0 0 1-4 0L9 37a3 3 0 1 1 4-4l11 11 27-27a3 3 0 0 1 4 0z"/></symbol></svg>`;function _l(e,t=$l.copy){return Or`<button
951
+ .respec-button-copy-paste[data-copy-state=copied]>svg:not(.respec-copy-check){visibility:hidden}`;const gl=ui({en:{copy:"Copy to clipboard",copied:"Copied!",failed:"Could not copy!"},cs:{copy:"Kopírovat do schránky",copied:"Zkopírováno!",failed:"Nelze kopírovat!"},de:{copy:"In die Zwischenablage kopieren",copied:"Kopiert!",failed:"Kopieren fehlgeschlagen!"},es:{copy:"Copiar al portapapeles",copied:"¡Copiado!",failed:"¡No se pudo copiar!"},fr:{copy:"Copier dans le presse-papiers",copied:"Copié !",failed:"Impossible de copier !"},ja:{copy:"クリップボードにコピー",copied:"コピーしました",failed:"コピーできませんでした"},ko:{copy:"클립보드에 복사",copied:"복사됨",failed:"복사 실패"},nl:{copy:"Kopiëren naar klembord",copied:"Gekopieerd!",failed:"Kopiëren mislukt!"},zh:{copy:"复制到剪贴板",copied:"已复制",failed:"无法复制"}}),bl="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z",yl=`<svg aria-hidden="true" height="16" viewBox="0 0 14 16" width="14"><path fill-rule="evenodd" d="${bl}"/></svg>`,wl=`<svg class="respec-copy-sprite" aria-hidden="true"><symbol id="respec-copy-icon" viewBox="0 0 14 16"><path fill-rule="evenodd" d="${bl}"/></symbol><symbol id="respec-copy-check" viewBox="0 0 64 64"><path d="M55 17a3 3 0 0 1 0 4L26 50a3 3 0 0 1-4 0L9 37a3 3 0 1 1 4-4l11 11 27-27a3 3 0 0 1 4 0z"/></symbol></svg>`;function vl(e,t=gl.copy,n,r){return Or`<button
960
952
  type="button"
961
953
  class="respec-button-copy-paste"
962
954
  title="${t}"
963
955
  aria-label="${t}"
964
956
  data-copy-ignore="${e}"
965
- data-copied-label="${$l.copied}"
966
- data-failed-label="${$l.failed}"
957
+ data-copy-source="${n}"
958
+ data-copy-container="${r}"
959
+ data-copied-label="${gl.copied}"
960
+ data-failed-label="${gl.failed}"
967
961
  >
968
962
  ${Or`<svg aria-hidden="true" height="16" width="14">
969
963
  <use href="#respec-copy-icon" /></svg
970
964
  ><svg class="respec-copy-check" aria-hidden="true" height="16" width="16">
971
965
  <use href="#respec-copy-check" />
972
966
  </svg>`}
973
- </button>`}function Tl(e){e.querySelectorAll(".respec-button-copy-paste").forEach(e=>{e.removeAttribute("data-copy-state"),e.removeAttribute("data-label")})}var Rl=Object.freeze({__proto__:null,COPY_SVG:Cl,createCopyButton:_l,name:"core/clipboard",run:async function(){if(!document.querySelector(".respec-button-copy-paste"))return;ds(vl,{before:document.querySelector("link")}),document.body.insertAdjacentHTML("beforeend",Sl),Bi("beforesave",Tl);const e=document.createElement("script");e.id="respec-copy-paste",e.textContent=await async function(){try{return(await Promise.resolve().then(function(){return mf})).default}catch{return Zi("./src/core/clipboard.runtime.js")}}(),document.body.append(e)}});var El=String.raw`pre.idl{padding:1em;position:relative}
967
+ </button>`}function kl(e){e.querySelectorAll(".respec-button-copy-paste").forEach(e=>{e.removeAttribute("data-copy-state"),e.removeAttribute("data-label")})}var $l=Object.freeze({__proto__:null,COPY_SVG:yl,createCopyButton:vl,name:"core/clipboard",run:async function(){if(!document.querySelector(".respec-button-copy-paste"))return;us(ml,{before:document.querySelector("link")}),document.body.insertAdjacentHTML("beforeend",wl),Hi("beforesave",kl);const e=document.createElement("script");e.id="respec-copy-paste",e.textContent=await async function(){try{return(await Promise.resolve().then(function(){return Ef})).default}catch{return Zi("./src/core/clipboard.runtime.js")}}(),document.body.append(e)}});var xl=String.raw`:root{--pele-bg:var(--bg, #fff);--pele-fg:var(--text, #1f1f1f);--pele-line:var(--pele-fg);--pele-muted:color-mix(in srgb, var(--pele-fg) 62%, var(--pele-bg));--pele-surface:color-mix(in srgb, var(--pele-fg) 7%, var(--pele-bg));--pele-surface-alt:color-mix(in srgb, var(--pele-fg) 14%, var(--pele-bg));--pele-border:color-mix(in srgb, var(--pele-fg) 45%, var(--pele-bg));--pele-accent:color-mix(in srgb, #5b7bd5 75%, var(--pele-fg));--diagram-accent:var(--logo-bg, var(--pele-accent));--diagram-bg:color-mix(in srgb, var(--diagram-accent) 6%, var(--pele-bg));--diagram-error-border:var(--issue-border, #d73a49);--diagram-error-bg:var(--issue-bg, #ffeef0);--diagram-error-color:var(--issueheading-text, #86181d);--diagram-header-bg:var(--logo-bg, #005a9c);--diagram-header-color:var(--logo-text, #fff);--diagram-back-bg:color-mix(in srgb, var(--pele-fg) 2%, var(--pele-bg));--diagram-btn-bg:color-mix(in srgb, var(--pele-fg) 8%, var(--pele-bg));--diagram-btn-border:color-mix(in srgb, var(--diagram-accent) 30%, var(--pele-bg));--diagram-btn-color:color-mix(in srgb, var(--diagram-accent) 75%, var(--pele-fg));--diagram-btn-hover-bg:color-mix(in srgb, var(--pele-fg) 14%, var(--pele-bg));--diagram-btn-hover-color:var(--pele-fg);--diagram-gutter-color:var(--pele-muted)}
968
+ .diagram-container{box-sizing:border-box;border:1px solid transparent;border-radius:4px;position:relative}
969
+ .diagram-container:not(.diagram-container--error):focus-within,.diagram-container:not(.diagram-container--error):hover{border-color:color-mix(in srgb,var(--diagram-accent) 80%,var(--pele-bg));background:var(--diagram-bg)}
970
+ .diagram-flip{position:relative;box-sizing:border-box;padding:.75em}
971
+ .diagram-face{position:absolute;inset:0;transition:opacity .3s ease-in-out}
972
+ .diagram-face--front{position:relative;container-type:inline-size}
973
+ .diagram-face--front svg{display:block;max-width:100%;height:auto}
974
+ .diagram-face--front .diagram-svg--mobile{display:none}
975
+ .diagram-face--back{opacity:0;pointer-events:none;overflow:auto;background:var(--diagram-back-bg);border-radius:3px}
976
+ .diagram-container--flipped .diagram-face--front{opacity:0}
977
+ .diagram-container--flipped .diagram-face--back{opacity:1;pointer-events:auto}
978
+ .diagram-error-source{overflow:auto;background:var(--diagram-back-bg);border-end-end-radius:3px}
979
+ .diagram-error-source pre,.diagram-face--back pre{margin:0;padding:1em;width:100%;height:100%;box-sizing:border-box;overflow:auto}
980
+ .diagramHeader{display:flex;align-items:center;justify-content:space-between;gap:.75em;padding:.4em .6em .4em .75em;min-height:2em;box-sizing:border-box}
981
+ .diagramHeader .diagram-label{background:var(--diagram-bg);border-radius:3px;padding:.15em .4em;color:color-mix(in srgb,var(--diagram-accent) 74%,var(--pele-fg));font-family:sans-serif;font-weight:700;font-size:.75em;text-transform:uppercase;letter-spacing:.06em;display:flex;align-items:center;flex-shrink:0}
982
+ .diagram-container:not(.diagram-container--error) .diagramHeader{position:absolute;inset:0 0 auto;z-index:1;opacity:0;pointer-events:none;transition:opacity .3s,left .3s ease-in-out}
983
+ .diagram-container--active:not(.diagram-container--error) .diagramHeader,.diagram-container--flipped:not(.diagram-container--error) .diagramHeader,.diagram-container:not(.diagram-container--error):focus-within .diagramHeader,.diagram-container:not(.diagram-container--error):has([data-copy-state]) .diagramHeader,.diagram-container:not(.diagram-container--error):hover .diagramHeader{opacity:1}
984
+ .diagram-face--back pre{padding:4.5em 1.25em 1.25em}
985
+ .diagram-container:not(.diagram-container--error) .diagram-label{opacity:0;transition:opacity .3s}
986
+ .diagram-container--flipped:not(.diagram-container--error) .diagram-label{opacity:1}
987
+ .diagram-container--flipped:not(.diagram-container--error)::before{content:"";position:absolute;inset:-1px;z-index:2;pointer-events:none;border-radius:4px;background:linear-gradient(color-mix(in srgb,var(--diagram-accent) 80%,var(--pele-bg)),color-mix(in srgb,var(--diagram-accent) 80%,var(--pele-bg))) no-repeat left/8px 100%}
988
+ .diagram-container--flipped:not(.diagram-container--error) .diagramHeader{inset:0 0 auto 7px;background:color-mix(in srgb,var(--diagram-accent) 12%,var(--pele-bg));border-bottom:1px solid color-mix(in srgb,var(--diagram-accent) 35%,transparent);border-top-right-radius:3px}
989
+ .diagram-container--flipped:not(.diagram-container--error) .diagram-label{background:0 0;color:var(--pele-fg);padding:0}
990
+ .diagram-toolbar{display:flex;align-items:stretch;opacity:0;pointer-events:none;transition:opacity .3s;border:1px solid var(--diagram-btn-border);border-radius:4px;background:var(--pele-bg);height:1.75rem;box-sizing:border-box}
991
+ .diagram-container--active .diagram-toolbar,.diagram-container--flipped .diagram-toolbar,.diagram-container:focus-within .diagram-toolbar,.diagram-container:has([data-copy-state]) .diagram-toolbar,.diagram-container:hover .diagram-toolbar{opacity:1;pointer-events:auto}
992
+ .diagram-flip-btn,.diagramHeader .respec-button-copy-paste{color-scheme:light dark;background:0 0;border:none;color:var(--diagram-btn-color);cursor:pointer;padding:0 .5em;text-decoration:none!important;display:inline-flex;align-items:center;justify-content:center}
993
+ .diagram-flip-btn{font-family:monospace;font-size:.8em;border-start-start-radius:3px;border-end-start-radius:3px}
994
+ .diagram-toolbar .respec-button-copy-paste{border-inline-start:1px solid var(--diagram-btn-border);border-start-end-radius:3px;border-end-end-radius:3px}
995
+ .diagramHeader .respec-button-copy-paste{position:relative;inset:auto;width:auto;height:auto;min-width:2.25em;border-radius:0;display:inline-grid;place-items:center}
996
+ .diagram-container--error .diagramHeader .respec-button-copy-paste{border:1px solid var(--diagram-btn-border);border-radius:4px;background:var(--pele-bg);height:1.75rem;flex-shrink:0}
997
+ .diagramHeader .respec-button-copy-paste svg{fill:currentColor;grid-area:1/1}
998
+ @media (max-width:30em){
999
+ .diagramHeader .respec-button-copy-paste::after{inset-inline-start:100%;top:50%;translate:0 -50%;margin:0;margin-inline-start:.5em}
1000
+ }
1001
+ .diagramHeader .diagram-flip-btn:focus-visible,.diagramHeader .respec-button-copy-paste:focus-visible{outline:2px solid var(--pele-fg);outline-offset:-3px}
1002
+ .diagram-flip-btn:hover,.diagramHeader .respec-button-copy-paste:hover{background:var(--diagram-btn-hover-bg);color:var(--diagram-btn-hover-color)}
1003
+ .diagramHeader .respec-button-copy-paste.respec-button-copy-paste:is(:hover, :active, :focus, .selected){border-color:var(--diagram-btn-border);background-image:none;box-shadow:none}
1004
+ .diagramHeader .respec-button-copy-paste.respec-button-copy-paste:is(:active, .selected){background-color:var(--diagram-btn-hover-bg)}
1005
+ .diagram-container--error{border-color:var(--diagram-error-border);border-left-width:8px;background:var(--diagram-error-bg)}
1006
+ .diagram-container--error .diagramHeader{opacity:1;pointer-events:auto;border-bottom:1px solid color-mix(in srgb,var(--diagram-error-border) 35%,transparent)}
1007
+ .diagram-container--error,.diagram-container--error *{text-decoration:none!important}
1008
+ .diagramHeader .diagram-label--error{background:0 0;color:var(--pele-fg)}
1009
+ .diagram-error-message{color:var(--diagram-error-color);font-size:.85em;flex:1;min-width:0;margin-inline-start:.5em;text-align:start;overflow-wrap:anywhere}
1010
+ .diagram-source-grid{display:grid;grid-template-columns:1.5em 2.5em 1fr;padding:.5em 0;white-space:pre}
1011
+ .dg-indicator{text-align:center;user-select:none;display:grid;place-content:center;border-inline-start:3px solid transparent;padding-inline-start:.25em}
1012
+ .dg-indicator--error{border-inline-start-color:var(--diagram-error-border);background:color-mix(in srgb,var(--diagram-error-border) 20%,var(--pele-bg))}
1013
+ .dg-gutter{text-align:end;padding-inline-end:.75em;color:var(--diagram-gutter-color);user-select:none}
1014
+ .dg-gutter--error{color:var(--diagram-error-color);font-weight:700;background:color-mix(in srgb,var(--diagram-error-border) 20%,var(--pele-bg))}
1015
+ .dg-code{padding-inline-end:1em}
1016
+ .dg-code--error{background:color-mix(in srgb,var(--diagram-error-border) 20%,var(--pele-bg))}
1017
+ @media (prefers-color-scheme:dark){
1018
+ .diagram-container--error{--diagram-btn-border:color-mix(in srgb, var(--diagram-error-border) 60%, var(--pele-bg));--diagram-btn-color:var(--diagram-error-color)}
1019
+ }
1020
+ @media (prefers-reduced-motion:reduce){
1021
+ .diagram-container,.diagram-face,.diagram-toolbar,.diagramHeader{transition:none}
1022
+ }
1023
+ @media print{
1024
+ .diagram-container::before,.diagramHeader{display:none}
1025
+ .diagram-container{border-color:transparent;background:0 0}
1026
+ .diagram-flip{min-height:0!important}
1027
+ .diagram-face{transition:none}
1028
+ .diagram-face--back{display:none}
1029
+ .diagram-container--flipped .diagram-face--front{opacity:1}
1030
+ .diagram-face--front .diagram-svg--desktop{display:block!important}
1031
+ .diagram-face--front .diagram-svg--mobile{display:none!important}
1032
+ }`;const Cl="core/diagrams",Sl=ui({en:{show_source:"Show diagram source",copy_aria:"Copy diagram source"},cs:{show_source:"Zobrazit zdroj diagramu",copy_aria:"Kopírovat zdroj diagramu"},de:{show_source:"Diagrammquelle anzeigen",copy_aria:"Diagrammquelle kopieren"},es:{show_source:"Mostrar el código del diagrama",copy_aria:"Copiar el código del diagrama"},fr:{show_source:"Afficher la source du diagramme",copy_aria:"Copier la source du diagramme"},ja:{show_source:"図のソースを表示",copy_aria:"図のソースをコピー"},ko:{show_source:"다이어그램 소스 보기",copy_aria:"다이어그램 소스 복사"},nl:{show_source:"Diagrambron tonen",copy_aria:"Diagrambron kopiëren"},zh:{show_source:"显示图表源代码",copy_aria:"复制图表源代码"}}),_l=".diagram-source, .dg-code:not(.dg-code--hint)";let Tl=0;function Rl(e){return e.textContent?.trim()??""}async function El(e){const t=await fetch(e,{signal:AbortSignal.timeout(6e3)});if(!t.ok)throw new Error(`Could not load ${e}`);const n=document.createElement("script");n.textContent=await t.text(),document.head.append(n),n.remove()}function Al(e,t){const n=Rl(e),r=e.closest("figure")?.querySelector("figcaption")??null,i=function(){let e;do{e="respec-diagram-"+Tl++}while(document.querySelector(`[id^="${e}"]`));return e}();r&&!r.id&&(r.id=`${i}-caption`);const s=self.pele;let o,a,c="";try{const e=s.render(n,{fontFamily:t,idPrefix:i}),a=[Ll(e.svg,"desktop")];if(e.width>320){const r=s.render(n,{fontFamily:t,idPrefix:`${i}-phone`,maxWidth:320});if(r.width<e.width){a.push(Ll(r.svg,"mobile")),a.forEach(e=>e.classList.add(i));const t=`.diagram-face--front .${i}`;c=`@container (max-width: ${Math.floor(.75*e.width)}px) {\n ${t}.diagram-svg--desktop { display: none; }\n ${t}.diagram-svg--mobile { display: block; }\n}`}}o=function(e,t,n){const r=vl(".diagramHeader",Sl.copy_aria,_l,".diagram-container"),i=Or`<div class="diagram-container" role="group">
1033
+ <header class="diagramHeader">
1034
+ <span class="diagram-label">Mermaid</span>
1035
+ <div class="diagram-toolbar">
1036
+ <button
1037
+ type="button"
1038
+ class="diagram-flip-btn"
1039
+ aria-expanded="false"
1040
+ aria-label="${Sl.show_source}"
1041
+ >
1042
+ ${"</>"}
1043
+ </button>
1044
+ ${r}
1045
+ </div>
1046
+ </header>
1047
+ <div class="diagram-flip">
1048
+ <div class="diagram-face diagram-face--front">${t}</div>
1049
+ <div class="diagram-face diagram-face--back">
1050
+ <pre
1051
+ class="nohighlight"
1052
+ tabindex="0"
1053
+ ><code class="diagram-source">${e}</code></pre>
1054
+ </div>
1055
+ </div>
1056
+ </div>`;n&&i.setAttribute("aria-labelledby",n);return i.querySelector(".diagram-face--back").inert=!0,i}(n,a,r?.id)}catch(e){const{PeleError:t}=s;if("function"!=typeof t||!(e instanceof t))throw e;const{line:i,code:c,description:l,message:d}=function(e){const{message:t,line:n,snippet:r,code:i}=e,s=new Set((r??"").split("\n")),o=t.split("\n").filter(e=>e&&!s.has(e)).join(" ");return{line:n||0,code:i,description:o||t,message:t}}(e),u=Math.max(0,Math.min(i,n.split("\n").length));o=function(e,{line:t,description:n},r){const i=function(e,t){const n=document.createElement("code");return n.className="diagram-source-grid nohighlight",e.split("\n").forEach((e,r)=>{const i=r+1,s=i===t,o=document.createElement("span");o.className=s?"dg-indicator dg-indicator--error":"dg-indicator",s&&(o.textContent="⚠️",o.setAttribute("aria-hidden","true"));const a=document.createElement("span");a.className=s?"dg-gutter dg-gutter--error":"dg-gutter",a.textContent=String(i);const c=document.createElement("span");c.className=s?"dg-code dg-code--error":"dg-code",c.textContent=e,n.append(o,a,c)}),n}(e,t),s=vl(".diagramHeader",Sl.copy_aria,_l,".diagram-container"),o=Or`<div
1057
+ class="diagram-container diagram-container--error"
1058
+ role="group"
1059
+ >
1060
+ <header class="diagramHeader">
1061
+ <span class="diagram-label diagram-label--error">Mermaid</span>
1062
+ <span class="diagram-error-message">Error: ${n}</span>
1063
+ ${s}
1064
+ </header>
1065
+ <div class="diagram-error-source">
1066
+ <pre class="nohighlight" tabindex="0">${i}</pre>
1067
+ </div>
1068
+ </div>`;r&&o.setAttribute("aria-labelledby",r);return o}(n,{line:u,description:l},r?.id),a={message:`Could not draw the diagram: ${l}`,hint:Pl({line:u,code:c})},console.warn(d)}for(const{name:t,value:n}of e.attributes)o.hasAttribute(t)||o.setAttribute(t,n);for(const t of e.classList)"mermaid"!==t&&o.classList.add(t);const l=o.querySelector(".diagram-label");return l&&!o.hasAttribute("aria-labelledby")&&(l.id=`${i}-label`,o.setAttribute("aria-labelledby",l.id)),e.replaceWith(o),a&&Ni(a.message,Cl,{...a,elements:[o]}),c}function Ll(e,t){const n=(new DOMParser).parseFromString(e,"image/svg+xml"),r=document.importNode(n.documentElement,!0);if(!(r instanceof SVGSVGElement))throw new Error("The renderer did not return valid SVG.");!function(e){for(const t of e.querySelectorAll("*")){("http://www.w3.org/2000/svg"!==t.namespaceURI||/^(script|foreignObject|style|animate|animateTransform|animateMotion|mpath|set|discard)$/.test(t.localName))&&t.remove()}for(const t of[e,...e.querySelectorAll("*")])for(const{name:e,localName:n,value:r}of[...t.attributes]){const i=[...r].filter(e=>e.charCodeAt(0)>32).join(""),s="href"===n.toLowerCase()&&/^(javascript|data):/i.test(i);(/^on/i.test(n)||s)&&t.removeAttribute(e)}}(r);for(const e of r.querySelectorAll("a"))e.setAttribute("data-no-link-to-dfn","");return r.classList.add("diagram-svg",`diagram-svg--${t}`),r}function Pl({line:e,code:t}){return e?`The card shows the source with line ${e} marked.`:"unsupported-diagram"===t?"Start the diagram with a type such as `flowchart`, `sequenceDiagram` or `classDiagram`.":"The card shows the diagram source."}function Nl(e){e.querySelectorAll(".diagram-container").forEach(e=>{e.classList.remove("diagram-container--active","diagram-container--flipped"),e.querySelector(".diagram-flip-btn")?.setAttribute("aria-expanded","false"),e.querySelector(".diagram-face--front")?.removeAttribute("inert"),e.querySelector(".diagram-face--back")?.setAttribute("inert","");const t=e.querySelector(".diagram-flip");t instanceof HTMLElement&&(t.style.minHeight="",t.getAttribute("style")||t.removeAttribute("style"))})}var Il=Object.freeze({__proto__:null,name:Cl,run:async function(t){if(!1===t.diagrams)return;const n=performance.now(),r=[...document.querySelectorAll("pre.mermaid")];if(!r.length)return;const i=r.filter(e=>!e.closest("figure"));i.length&&Ii("Diagrams should be inside a `<figure>`.",Cl,{hint:"Wrap the `<pre>` in a `<figure>` and add a `<figcaption>`, so the diagram is numbered and listed with the other figures.",elements:i});const s=r.filter(e=>Rl(e));if(!s.length)return;if(us(xl,{before:document.querySelector("head link, head > *:last-child")}),!await async function(){if(self.pele)return!0;const t=(e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href).endsWith("/src/core/diagrams.js"),n=new URL(t?"../../builds/respec-pele.js":"respec-pele.js",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("respec-w3c.js",document.baseURI).href).href;for(const e of[n,"https://www.w3.org/Tools/respec/respec-pele"])try{if(await El(e),self.pele)return!0}catch(t){console.warn(`Could not load the diagram renderer from ${e}.`,t)}return!1}())return void Ii("Could not load the diagram renderer.",Cl,{hint:"Serve `respec-pele.js` next to the ReSpec script. The diagrams stay as text until then.",elements:s});const o=Math.max(0,12e3-(performance.now()-n));if(!await Promise.race([!document.fonts||document.fonts.ready.then(()=>!0),new Promise(e=>setTimeout(()=>e(!1),o))]))return void Ii("Could not draw the diagrams: the fonts were still loading.",Cl,{hint:"The diagrams stay as text. Check that the page's fonts load.",elements:s});const a=getComputedStyle(document.body).fontFamily,c=[];for(const e of s)try{c.push(Al(e,a))}catch(t){console.error(t),Ni("Could not draw a diagram.",Cl,{hint:"This is a bug in ReSpec or the renderer, not in the diagram. The diagram stays as text.",elements:[e],cause:t})}const l=c.filter(Boolean).join("\n");if(l&&us(l,{before:document.querySelector("head link, head > *:last-child")}),Hi("beforesave",Nl),!document.getElementById("respec-diagrams-runtime")){const e=document.createElement("script");e.id="respec-diagrams-runtime",e.textContent=await async function(){try{return(await Promise.resolve().then(function(){return Af})).default}catch{return Zi("./src/core/diagrams.runtime.js")}}(),document.body.append(e)}}});const Ol=ui({en:{list_of_tables:"List of Tables",table:"Table "},fr:{list_of_tables:"Liste des tables",table:"Table "},nl:{list_of_tables:"Lijst met tabellen",table:"Tabel "}});var Dl=Object.freeze({__proto__:null,name:"core/tables",run:function(){const e=function(){const e=[],t=document.querySelectorAll("table.numbered");return[...t].filter(e=>!!e.querySelector("caption")).forEach((t,n)=>{const r=t.querySelector("caption");r&&(!function(e,t,n){const r=t.textContent;vi(e,"table",r),Ci(t,Or`<span class="table-title"></span>`),t.prepend(Or`<a class="self-link" href="#${e.id}"
1069
+ >${Ol.table}<bdi class="tableno">${n+1}</bdi></a
1070
+ >`," ")}(t,r,n),e.push(function(e,t){const n=t.cloneNode(!0);for(const e of n.querySelectorAll("a"))$i(e,"span",{copyAttributes:!1});return Or`<li>
1071
+ <a class="tocxref" href="${`#${e}`}"
1072
+ >${n.childNodes}</a
1073
+ >
1074
+ </li>`}(t.id,r)))}),e}(),t=document.querySelector("section#list-of-tables");e.length&&t&&(!function(e){if(e.matches(".appendix, .introductory")||e.closest("section"))return;const t=Si(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(Or`<h1>${Ol.list_of_tables}</h1>`,Or`<ul class="list-of-tables">
1075
+ ${e}
1076
+ </ul>`))}});const jl=new Set(["callback interface","callback","dictionary","enum","interface mixin","interface","typedef"]);function zl(e,t,{parent:n=""}={}){switch(e.type){case"constructor":case"operation":return function(e,t,n){if(n.includes("!overload"))return Ml(e,t,n);const r=`${n}()`;return Ml(e,t,r,n)}(e,n,t);default:return Ml(e,n,t)}}function Ml(e,t,...n){const{type:r}=e;for(const e of n){let n="enum-value"===r&&""===e?"the-empty-string":e,i=Ul(n,t,e,r);if(0===i.length&&""!==t){n=`${t}.${n}`;const e=Fc.get(n);e&&1===e.size&&(i=[...e],Hc(i[0],[n]))}if(i.length>1){Ni(`WebIDL identifier \`${e}\` ${t?`for \`${t}\``:""} is defined multiple times`,e,{title:"Duplicate definition.",elements:i})}if(i.length)return i[0]}}function ql(e,t,n,r){if(!e.id){const t=n.toLowerCase(),i=t?`${t}-`:"";let s=r.toLowerCase().replace(/[()]/g,"").replace(/\s/g,"-");""===s&&(s="the-empty-string",e.setAttribute("aria-label","the empty string")),e.id=`dom-${i}${s}`}switch(e.dataset.idl=t.type,e.dataset.title=e.textContent,e.dataset.dfnFor=n,t.type){case"operation":case"attribute":case"field":e.dataset.type=Wl(t)}switch(e.querySelector("code")||e.closest("code")||!e.children||Ci(e,e.ownerDocument.createElement("code")),t.type){case"attribute":case"constructor":case"operation":{const i=function(e,t,n){const{type:r}=e,i=`${t}.${n}`;switch(r){case"constructor":case"operation":{const t=`${n}()`,r=`${i}()`,s=function(e,t){const n=[];if(0===t.length)return n;const r=[],i=[];for(const{name:e,optional:n,variadic:s}of t)n||s?i.push(e):r.push(e);const s=r.join(", "),o=`${e}(${s})`;n.push(o);const a=i.map((t,n)=>{const s=[...r,...i.slice(0,n+1)].join(", ");return`${e}(${s})`});return n.push(...a),n}(n,e.arguments);return{local:[i,r,n],exportable:[t,...s]}}case"attribute":return{local:[i],exportable:[n]}}}(t,n,r);i&&function(e,t){const{local:n,exportable:r}=t,i=e.dataset.lt?new Set(e.dataset.lt.split("|")):new Set;for(const e of r)i.add(e);n.filter(e=>i.has(e)).forEach(e=>i.delete(e)),e.dataset.lt=[...i].join("|"),e.dataset.localLt=n.join("|"),Hc(e,[...n,...r])}(e,i);break}}return e}function Ul(e,t,n,r){const i=Fc.get(e);if(!i||0===i.size)return[];const s=[...i],o=s.filter(e=>{if("dfn"===e.dataset.dfnType)return!1;const n=e.closest("[data-dfn-for]");return n&&n.dataset.dfnFor===t});if(0===o.length&&""===t&&1===s.length)return s[0].textContent===n?s:[];if(jl.has(r)&&s.length){const e=s.find(e=>e.textContent.trim()===n);if(e)return[e]}return o}function Wl(e={}){const{idlType:t,generic:n,union:r}=e;return void 0===t?"":"string"==typeof t?t:n||(r?t.map(Wl).join("|"):Wl(t))}var Fl=String.raw`pre.idl{padding:1em;position:relative}
974
1077
  pre.idl>code{color:#000;color:var(--text,#000)}
975
1078
  @media print{
976
1079
  pre.idl{white-space:pre-wrap}
@@ -986,18 +1089,18 @@ a.idlEnumItem{color:#000;border-bottom:1px dotted #ccc;text-decoration:none}
986
1089
  .idlDefaultValue,.idlParamName{font-style:italic}
987
1090
  .extAttr{color:#666}
988
1091
  .idlSectionComment{color:gray}
989
- .idlIncludes a{font-weight:700}`;const Al="core/webidl",Ll=Al,Pl={},Nl={},Il={wrap:e=>e.flat().filter(e=>""!==e).map(e=>"string"==typeof e?new Text(e):e),trivia:e=>e.trim()?Or`<span class="idlSectionComment">${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?Or`<a data-xref-type="interface" data-cite="WEBIDL">${e}</a>`:Or`<a data-xref-type="dfn" data-cite="WEBIDL">${e}</a>`,reference(e,t,n){if("extended-attribute"===n.type)return e;let r="_IDL_",i=null;if("object"===t)r="interface",i="WEBIDL";return Or`<a
1092
+ .idlIncludes a{font-weight:700}`;const Hl="core/webidl",Bl=Hl,Gl={},Vl={},Jl={wrap:e=>e.flat().filter(e=>""!==e).map(e=>"string"==typeof e?new Text(e):e),trivia:e=>e.trim()?Or`<span class="idlSectionComment">${e}</span>`:e,generic:e=>/^[A-Z]/.test(e)?Or`<a data-xref-type="interface" data-cite="WEBIDL">${e}</a>`:Or`<a data-xref-type="dfn" data-cite="WEBIDL">${e}</a>`,reference(e,t,n){if("extended-attribute"===n.type)return e;let r="_IDL_",i=null;if("object"===t)r="interface",i="WEBIDL";return Or`<a
990
1093
  data-link-type="${"_IDL_"===r?"idl":r}"
991
1094
  data-xref-type="${r}"
992
1095
  data-cite="${i}"
993
1096
  >${e}</a
994
- >`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return Or`<span class="idlParamName">${e}</span>`;const r=Ol(e,t,n);if("enum-value"!==t.type){const e=n?"idlName":"idlID";r.classList.add(e)}return r},nameless(e,{data:t,parent:n}){switch(t.type){case"operation":case"constructor":return Ol(e,t,n);default:return e}},type:e=>Or`<span class="idlType">${e}</span>`,inheritance:e=>Or`<span class="idlSuperclass">${e}</span>`,definition(e,{data:t,parent:n}){const r=function(e){switch(e.type){case"callback interface":return"idlInterface";case"operation":return"idlMethod";case"field":return"idlMember";case"enum-value":return"idlEnumItem";case"callback function":return"idlCallback"}return`idl${e.type[0].toUpperCase()}${e.type.slice(1)}`}(t);switch(t.type){case"includes":case"enum-value":return Or`<span class="${r}">${e}</span>`}const i=n?n.name:"",{name:s,idlId:o}=jl(t,i);return Or`<span
1097
+ >`},name(e,{data:t,parent:n}){if(t.idlType&&"argument-type"===t.idlType.type)return Or`<span class="idlParamName">${e}</span>`;const r=Zl(e,t,n);if("enum-value"!==t.type){const e=n?"idlName":"idlID";r.classList.add(e)}return r},nameless(e,{data:t,parent:n}){switch(t.type){case"operation":case"constructor":return Zl(e,t,n);default:return e}},type:e=>Or`<span class="idlType">${e}</span>`,inheritance:e=>Or`<span class="idlSuperclass">${e}</span>`,definition(e,{data:t,parent:n}){const r=function(e){switch(e.type){case"callback interface":return"idlInterface";case"operation":return"idlMethod";case"field":return"idlMember";case"enum-value":return"idlEnumItem";case"callback function":return"idlCallback"}return`idl${e.type[0].toUpperCase()}${e.type.slice(1)}`}(t);switch(t.type){case"includes":case"enum-value":return Or`<span class="${r}">${e}</span>`}const i=n?n.name:"",{name:s,idlId:o}=Yl(t,i);return Or`<span
995
1098
  class="${r}"
996
1099
  id="${o}"
997
1100
  data-idl
998
1101
  data-title="${s}"
999
1102
  >${e}</span
1000
- >`},extendedAttribute:e=>Or`<span class="extAttr">${e}</span>`,extendedAttributeReference:e=>Or`<a data-xref-type="extended-attribute">${e}</a>`};function Ol(e,t,n){const r=n?n.name:"",{name:i}=jl(t,r),s=gl(t,i,{parent:r}),o=function(e){switch(e){case"operation":return"method";case"field":return"dict-member";case"callback interface":case"interface mixin":return"interface";default:return e}}(t.type);if(s){t.partial||(s.matches("[data-noexport]")||(s.dataset.export=""),s.dataset.dfnType=o),yl(s,t,r,i);const n=`#${s.id}`;return Or`<a
1103
+ >`},extendedAttribute:e=>Or`<span class="extAttr">${e}</span>`,extendedAttributeReference:e=>Or`<a data-xref-type="extended-attribute">${e}</a>`};function Zl(e,t,n){const r=n?n.name:"",{name:i}=Yl(t,r),s=zl(t,i,{parent:r}),o=function(e){switch(e){case"operation":return"method";case"field":return"dict-member";case"callback interface":case"interface mixin":return"interface";default:return e}}(t.type);if(s){t.partial||(s.matches("[data-noexport]")||(s.dataset.export=""),s.dataset.dfnType=o),ql(s,t,r,i);const n=`#${s.id}`;return Or`<a
1001
1104
  data-link-for="${r}"
1002
1105
  data-link-type="${o}"
1003
1106
  href="${n}"
@@ -1007,15 +1110,15 @@ a.idlEnumItem{color:#000;border-bottom:1px dotted #ccc;text-decoration:none}
1007
1110
  >${e}</a
1008
1111
  >`;if(!t.partial){const n=Or`<dfn data-export data-dfn-type="${o}"
1009
1112
  >${e}</dfn
1010
- >`;return Wc(n,[i]),yl(n,t,r,i),n}const c=Or`<a
1113
+ >`;return Hc(n,[i]),ql(n,t,r,i),n}const c=Or`<a
1011
1114
  data-idl="${t.partial?"partial":null}"
1012
1115
  data-link-type="${o}"
1013
1116
  data-title="${t.name}"
1014
1117
  data-xref-type="${o}"
1015
1118
  >${e}</a
1016
- >`;if(i&&"typedef"!==t.type&&!(t.partial&&!s)){const e=qi`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;Ii(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${i}()`:i}\` ${t.type}.`,Ll,{elements:[c],hint:e})}return c}const Dl=new WeakMap;function jl(e,t=""){if(Dl.has(e))return Dl.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);const r=e.special&&""===e.name?"anonymous-":"";let i=function(e,t){if(!t)return`idl-def-${e.toLowerCase()}`;return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}(r+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":case"namespace":i+=function(e){if(!e.partial)return"";Nl[e.name]||(Nl[e.name]=0);return Nl[e.name]+=1,`-partial-${Nl[e.name]}`}(e);break;case"constructor":case"operation":{const r=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let i;Pl[r]||(Pl[r]=0);Pl[n]?i=`!overload-${Pl[n]}`:Pl[n]=0;return Pl[r]+=1,Pl[n]+=1,i||""}(n,t);r?(n+=r,i+=r):e.arguments.length&&(i+=e.arguments.map(e=>`-${e.name.toLowerCase()}`).join(""));break}}return{name:n,idlId:i}}(e,t);return Dl.set(e,n),n}const zl=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Ml(e,t){let n;try{n=qr.parse(e.textContent,{sourceName:String(t)})}catch(t){return Ni(`Failed to parse WebIDL: ${t.bareMessage}.`,Ll,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=qr.write(n,{templates:Il});Or.bind(e)`${r}`,Ci(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach(e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!zl.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&Wc(e,[t])});const i=e.closest("[data-cite], body"),{dataset:s}=i;if(s.cite||(s.cite="WEBIDL"),!/\bwebidl\b/i.test(s.cite)){const e=s.cite.trim().split(/\s+/);s.cite=["WEBIDL",...e].join(" ")}return ql(e),n}function ql(e){yi(e,"webidl");const t=Or`<span class="idlHeader"
1119
+ >`;if(i&&"typedef"!==t.type&&!(t.partial&&!s)){const e=qi`See ${"using `data-dfn-for`|#data-dfn-for"} in ReSpec's documentation.`;Ii(`Missing \`<dfn>\` for${r?` \`${r}\`'s`:""} \`${"operation"===t.type?`${i}()`:i}\` ${t.type}.`,Bl,{elements:[c],hint:e})}return c}const Kl=new WeakMap;function Yl(e,t=""){if(Kl.has(e))return Kl.get(e);const n=function(e,t){let n=function(e){switch(e.type){case"enum-value":return e.value;case"operation":return e.name||e.special;default:return e.name||e.type}}(e);const r=e.special&&""===e.name?"anonymous-":"";let i=function(e,t){if(!t)return`idl-def-${e.toLowerCase()}`;return`idl-def-${t.toLowerCase()}-${e.toLowerCase()}`}(r+n,t);switch(e.type){case"callback interface":case"dictionary":case"interface":case"interface mixin":case"namespace":i+=function(e){if(!e.partial)return"";Vl[e.name]||(Vl[e.name]=0);return Vl[e.name]+=1,`-partial-${Vl[e.name]}`}(e);break;case"constructor":case"operation":{const r=function(e,t){const n=`${t}.${e}`,r=`${n}()`;let i;Gl[r]||(Gl[r]=0);Gl[n]?i=`!overload-${Gl[n]}`:Gl[n]=0;return Gl[r]+=1,Gl[n]+=1,i||""}(n,t);r?(n+=r,i+=r):e.arguments.length&&(i+=e.arguments.map(e=>`-${e.name.toLowerCase()}`).join(""));break}}return{name:n,idlId:i}}(e,t);return Kl.set(e,n),n}const Xl=["interface","interface mixin","dictionary","namespace","enum","typedef","callback"];function Ql(e,t){let n;try{n=qr.parse(e.textContent,{sourceName:String(t)})}catch(t){return Ni(`Failed to parse WebIDL: ${t.bareMessage}.`,Bl,{title:t.bareMessage,details:`<pre>${t.context}</pre>`,elements:[e]}),[]}e.classList.add("def","idl");const r=qr.write(n,{templates:Jl});Or.bind(e)`${r}`,Ci(e,document.createElement("code")),e.querySelectorAll("[data-idl]").forEach(e=>{if(e.dataset.dfnFor)return;const t=e.dataset.title,n=e.dataset.dfnType,r=e.parentElement.closest("[data-idl][data-title]");r&&!Xl.includes(n)&&(e.dataset.dfnFor=r.dataset.title),"dfn"===e.localName&&Hc(e,[t])});const i=e.closest("[data-cite], body"),{dataset:s}=i;if(s.cite||(s.cite="WEBIDL"),!/\bwebidl\b/i.test(s.cite)){const e=s.cite.trim().split(/\s+/);s.cite=["WEBIDL",...e].join(" ")}return ed(e),n}function ed(e){yi(e,"webidl");const t=Or`<span class="idlHeader"
1017
1120
  ><a class="self-link" href="${`#${e.id}`}">WebIDL</a></span
1018
- >`;e.prepend(t),t.append(_l(".idlHeader","Copy IDL to clipboard"))}var Ul=Object.freeze({__proto__:null,addIDLHeader:ql,name:Al,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;ds(El,{before:document.querySelector("head link, head > *:last-child")});const t=[...e].map(Ml),n=qr.validate(t);for(const r of n){let n=`<pre>${li(r.context)}</pre>`;if(r.autofix){r.autofix();n+=`Try fixing as:\n <pre>${li(qr.write(t[r.sourceName]))}</pre>`}Ni(`WebIDL validation error: ${r.bareMessage}`,Ll,{details:n,elements:[e[r.sourceName]],title:r.bareMessage})}document.normalize()}});var Wl=String.raw`:root{--cddl-comment:#6a737d;--cddl-kw:#005a9c;--cddl-str:#032f62;--cddl-num:#005cc5;--cddl-op:#6f42c1;--cddl-ctrl:#d73a49;--cddl-occ:#e36209;--cddl-bytes:#22863a;--cddl-param:#e36209;--cddl-type-dfn:#c43a31;--cddl-key-dfn:#005a9c;--cddl-header-bg:var(--def-border, #8ccbf2);--cddl-header-color:#005a9c;--cddl-focus:#51a7e8}
1121
+ >`;e.prepend(t),t.append(vl(".idlHeader","Copy IDL to clipboard"))}var td=Object.freeze({__proto__:null,addIDLHeader:ed,name:Hl,run:async function(){const e=document.querySelectorAll("pre.idl, pre.webidl");if(!e.length)return;us(Fl,{before:document.querySelector("head link, head > *:last-child")});const t=[...e].map(Ql),n=qr.validate(t);for(const r of n){let n=`<pre>${li(r.context)}</pre>`;if(r.autofix){r.autofix();n+=`Try fixing as:\n <pre>${li(qr.write(t[r.sourceName]))}</pre>`}Ni(`WebIDL validation error: ${r.bareMessage}`,Bl,{details:n,elements:[e[r.sourceName]],title:r.bareMessage})}document.normalize()}});var nd=String.raw`:root{--cddl-comment:#6a737d;--cddl-kw:#005a9c;--cddl-str:#032f62;--cddl-num:#005cc5;--cddl-op:#6f42c1;--cddl-ctrl:#d73a49;--cddl-occ:#e36209;--cddl-bytes:#22863a;--cddl-param:#e36209;--cddl-type-dfn:#c43a31;--cddl-key-dfn:#005a9c;--cddl-header-bg:var(--def-border, #8ccbf2);--cddl-header-color:#005a9c;--cddl-focus:#51a7e8}
1019
1122
  @media (prefers-color-scheme:dark){
1020
1123
  :root{--cddl-comment:#8b949e;--cddl-kw:#79c0ff;--cddl-str:#a5d6ff;--cddl-num:#79c0ff;--cddl-op:#d2a8ff;--cddl-ctrl:#ff7b72;--cddl-occ:#ffa657;--cddl-bytes:#7ee787;--cddl-param:#ffa657;--cddl-type-dfn:#ffa198;--cddl-key-dfn:#79c0ff;--cddl-header-bg:#3a6da0;--cddl-header-color:#fff;--cddl-focus:#51a7e8}
1021
1124
  }
@@ -1041,62 +1144,62 @@ pre.cddl a[data-link-type]{text-decoration:none;border-bottom:1px dotted current
1041
1144
  pre.cddl dfn{font-style:normal;font-weight:700}
1042
1145
  .cddlHeader a.self-link:focus-visible,pre.cddl a:focus-visible,pre.cddl dfn:focus-visible{outline:2px solid var(--cddl-focus);outline-offset:2px}
1043
1146
  pre.cddl dfn[data-dfn-type=cddl-type]{color:var(--cddl-type-dfn)}
1044
- pre.cddl dfn[data-dfn-type=cddl-key]{color:var(--cddl-key-dfn)}`;const Fl="core/cddl",Bl=new Set(["any","uint","nint","int","bstr","bytes","tstr","text","tdate","time","number","biguint","bignint","bigint","integer","unsigned","decfrac","bigfloat","eb64url","eb64legacy","eb16","encoded-cbor","uri","b64url","b64legacy","regexp","mime-message","cbor-any","float16","float32","float64","float16-32","float32-64","float","false","true","bool","nil","null","undefined"]);function Hl(e){return e.toLowerCase().replace(/^"(.*)"$/,"$1").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Gl(e){let t=e.parentNode;for(;t;){if(t instanceof Fr)return t.name?.name||null;t=t.parentNode}return null}const Vl=String.raw;class Jl extends Wr{#i=null;#s;constructor(e){super(),this.#s=e}serializeName(e,t){const n=this.#s;if(function(e){let t=e.parentNode;for(;t;){if(t instanceof Hr)return!0;if(t instanceof Fr)return!1;t=t.parentNode}return!1}(t)){const r=Gl(t);return r&&(n.genericParams.has(r)||n.genericParams.set(r,new Set),n.genericParams.get(r)?.add(e)),Vl`<span class="cddl-param">${li(e)}</span>`}if(function(e){let t=e.parentNode;for(;t;){if(t instanceof Gr)return!0;if(t instanceof Fr)return!1;t=t.parentNode}return!1}(t))return this.#o(e);if(function(e){return e.parentNode instanceof Fr}(t))return this.#i=e,this.#a(e);if(function(e){return e.parentNode instanceof Br}(t))return this.#c(e);const r=Gl(t)||this.#i;return r&&n.genericParams.has(r)&&n.genericParams.get(r)?.has(e)?Vl`<span class="cddl-param">${li(e)}</span>`:this.#o(e)}#a(e){const t=this.#s,n=`cddl-type-${Hl(e)}`,r=`cddl-type:${e}`;return t.definitions.has(r)?Vl`<a href="#${n}" class="cddl-name" data-link-type="cddl-type"
1147
+ pre.cddl dfn[data-dfn-type=cddl-key]{color:var(--cddl-key-dfn)}`;const rd="core/cddl",id=new Set(["any","uint","nint","int","bstr","bytes","tstr","text","tdate","time","number","biguint","bignint","bigint","integer","unsigned","decfrac","bigfloat","eb64url","eb64legacy","eb16","encoded-cbor","uri","b64url","b64legacy","regexp","mime-message","cbor-any","float16","float32","float64","float16-32","float32-64","float","false","true","bool","nil","null","undefined"]);function sd(e){return e.toLowerCase().replace(/^"(.*)"$/,"$1").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function od(e){let t=e.parentNode;for(;t;){if(t instanceof Fr)return t.name?.name||null;t=t.parentNode}return null}const ad=String.raw;class cd extends Wr{#i=null;#s;constructor(e){super(),this.#s=e}serializeName(e,t){const n=this.#s;if(function(e){let t=e.parentNode;for(;t;){if(t instanceof Br)return!0;if(t instanceof Fr)return!1;t=t.parentNode}return!1}(t)){const r=od(t);return r&&(n.genericParams.has(r)||n.genericParams.set(r,new Set),n.genericParams.get(r)?.add(e)),ad`<span class="cddl-param">${li(e)}</span>`}if(function(e){let t=e.parentNode;for(;t;){if(t instanceof Gr)return!0;if(t instanceof Fr)return!1;t=t.parentNode}return!1}(t))return this.#o(e);if(function(e){return e.parentNode instanceof Fr}(t))return this.#i=e,this.#a(e);if(function(e){return e.parentNode instanceof Hr}(t))return this.#c(e);const r=od(t)||this.#i;return r&&n.genericParams.has(r)&&n.genericParams.get(r)?.has(e)?ad`<span class="cddl-param">${li(e)}</span>`:this.#o(e)}#a(e){const t=this.#s,n=`cddl-type-${sd(e)}`,r=`cddl-type:${e}`;return t.definitions.has(r)?ad`<a href="#${n}" class="cddl-name" data-link-type="cddl-type"
1045
1148
  >${li(e)}</a
1046
- >`:t.proseDfns.has(n)?(t.definitions.set(r,{type:"cddl-type",for:null,id:n}),Vl`<a href="#${n}" class="cddl-name" data-link-type="cddl-type"
1149
+ >`:t.proseDfns.has(n)?(t.definitions.set(r,{type:"cddl-type",for:null,id:n}),ad`<a href="#${n}" class="cddl-name" data-link-type="cddl-type"
1047
1150
  >${li(e)}</a
1048
- >`):(t.definitions.set(r,{type:"cddl-type",for:null,id:n}),Vl`<dfn data-dfn-type="cddl-type" id="${n}" data-export
1151
+ >`):(t.definitions.set(r,{type:"cddl-type",for:null,id:n}),ad`<dfn data-dfn-type="cddl-type" id="${n}" data-export
1049
1152
  >${li(e)}</dfn
1050
- >`)}#c(e){const t=this.#s,n=this.#i;if(!n)return Vl`<span class="cddl-name">${li(e)}</span>`;const r=`cddl-key-${Hl(n)}-${Hl(e)}`,i=`cddl-key:${n}/${e}`;return t.definitions.has(i)?Vl`<a
1153
+ >`)}#c(e){const t=this.#s,n=this.#i;if(!n)return ad`<span class="cddl-name">${li(e)}</span>`;const r=`cddl-key-${sd(n)}-${sd(e)}`,i=`cddl-key:${n}/${e}`;return t.definitions.has(i)?ad`<a
1051
1154
  href="#${r}"
1052
1155
  class="cddl-name"
1053
1156
  data-link-type="cddl-key"
1054
1157
  data-xref-for="${li(n)}"
1055
1158
  >${li(e)}</a
1056
- >`:t.proseDfns.has(r)?(t.definitions.set(i,{type:"cddl-key",for:n,id:r}),Vl`<a
1159
+ >`:t.proseDfns.has(r)?(t.definitions.set(i,{type:"cddl-key",for:n,id:r}),ad`<a
1057
1160
  href="#${r}"
1058
1161
  class="cddl-name"
1059
1162
  data-link-type="cddl-key"
1060
1163
  data-xref-for="${li(n)}"
1061
1164
  >${li(e)}</a
1062
- >`):(t.definitions.set(i,{type:"cddl-key",for:n,id:r}),Vl`<dfn
1165
+ >`):(t.definitions.set(i,{type:"cddl-key",for:n,id:r}),ad`<dfn
1063
1166
  data-dfn-type="cddl-key"
1064
1167
  data-dfn-for="${li(n)}"
1065
1168
  id="${r}"
1066
1169
  data-export
1067
1170
  >${li(e)}</dfn
1068
- >`)}#o(e){const t=this.#s;if(Bl.has(e))return Vl`<a
1171
+ >`)}#o(e){const t=this.#s;if(id.has(e))return ad`<a
1069
1172
  class="cddl-kw"
1070
1173
  data-link-type="cddl-type"
1071
1174
  data-link-spec="rfc8610"
1072
1175
  href="${"https://www.rfc-editor.org/rfc/rfc8610#appendix-D"}"
1073
1176
  >${li(e)}</a
1074
- >`;const n=`cddl-type:${e}`;if(t.definitions.has(n)){const r=t.definitions.get(n);return r?Vl`<a
1177
+ >`;const n=`cddl-type:${e}`;if(t.definitions.has(n)){const r=t.definitions.get(n);return r?ad`<a
1075
1178
  href="#${r.id}"
1076
1179
  class="cddl-name"
1077
1180
  data-link-type="cddl-type"
1078
1181
  >${li(e)}</a
1079
- >`:Vl`<span class="cddl-name">${li(e)}</span>`}return Vl`<span class="cddl-name" data-cddl-pending="${li(e)}"
1182
+ >`:ad`<span class="cddl-name">${li(e)}</span>`}return ad`<span class="cddl-name" data-cddl-pending="${li(e)}"
1080
1183
  >${li(e)}</span
1081
- >`}serializeValue(e,t,n,r){const i=this.#s,s=e+t+n;if("text"===r.type&&this.#l(r)){const e=this.#i;if(e){const n=`cddl-value-${Hl(e)}-${Hl(t)}`,r=`cddl-value:${e}/"${t}"`;if(i.definitions.has(r)){const t=i.definitions.get(r);return t?Vl`<a
1184
+ >`}serializeValue(e,t,n,r){const i=this.#s,s=e+t+n;if("text"===r.type&&this.#l(r)){const e=this.#i;if(e){const n=`cddl-value-${sd(e)}-${sd(t)}`,r=`cddl-value:${e}/"${t}"`;if(i.definitions.has(r)){const t=i.definitions.get(r);return t?ad`<a
1082
1185
  href="#${t.id}"
1083
1186
  class="cddl-str"
1084
1187
  data-link-type="cddl-value"
1085
1188
  data-xref-for="${li(e)}"
1086
1189
  >${li(s)}</a
1087
- >`:Vl`<span class="cddl-str">${li(s)}</span>`}if(i.proseDfns.has(n))return i.definitions.set(r,{type:"cddl-value",for:e,id:n}),Vl`<a
1190
+ >`:ad`<span class="cddl-str">${li(s)}</span>`}if(i.proseDfns.has(n))return i.definitions.set(r,{type:"cddl-value",for:e,id:n}),ad`<a
1088
1191
  href="#${n}"
1089
1192
  class="cddl-str"
1090
1193
  data-link-type="cddl-value"
1091
1194
  data-xref-for="${li(e)}"
1092
1195
  >${li(s)}</a
1093
- >`;if(!i.definitions.has(r))return i.definitions.set(r,{type:"cddl-value",for:e,id:n}),Vl`<dfn
1196
+ >`;if(!i.definitions.has(r))return i.definitions.set(r,{type:"cddl-value",for:e,id:n}),ad`<dfn
1094
1197
  data-dfn-type="cddl-value"
1095
1198
  data-dfn-for="${li(e)}"
1096
1199
  id="${n}"
1097
1200
  data-export
1098
1201
  >${li(s)}</dfn
1099
- >`}}switch(r.type){case"text":return Vl`<span class="cddl-str">${li(s)}</span>`;case"number":case"float":return Vl`<span class="cddl-num">${li(s)}</span>`;case"bytes":case"hex":case"base64":return Vl`<span class="cddl-bytes">${li(s)}</span>`;default:return li(s)}}#l(e){const t=e.parentNode;return!!t&&t instanceof Vr}serializeToken(e,t){const n=e.type,r=e.serialize();switch(n){case"COMMENT":return this.#u(r);case"CTLOP":return this.#d(r);case"=":case"/=":case"//=":case"/":case"//":case"=>":case"..":case"...":return this.#p(r);case"?":case"*":case"+":return t instanceof Jr?this.#h(r):r;default:return r}}#u(e){return e.replace(/(;[^\n]*)/g,'<span class="cddl-comment">$1</span>')}#d(e){return e.replace(/(\.\w+)/g,'<span class="cddl-ctrl">$1</span>')}#p(e){const t=e.match(/^(\s*)(.*?)(\s*)$/s);return t?`${t[1]}<span class="cddl-op">${t[2]}</span>${t[3]}`:Vl`<span class="cddl-op">${e}</span>`}#h(e){const t=e.match(/^(\s*)(.*?)(\s*)$/s);return t?`${t[1]}<span class="cddl-occ">${t[2]}</span>${t[3]}`:Vl`<span class="cddl-occ">${e}</span>`}}var Zl=Object.freeze({__proto__:null,name:Fl,run:async function(){const e=document.querySelectorAll("pre.cddl:not([data-no-cddl])");if(!e.length)return;ds(Wl,{before:document.querySelector("head link, head > *:last-child")});const t=e=>new Ur(e).parse(),n={definitions:new Map,proseDfns:new Set,genericParams:new Map};var r,i,s,o;r=document,i=n.proseDfns,r.querySelectorAll("dfn[cddl-type], dfn[cddl-key], dfn[cddl-value]").forEach(e=>{const t=["cddl-type","cddl-key","cddl-value"].find(t=>e.hasAttribute(t));e.dataset.dfnType=t,e.removeAttribute(t);const n=e.getAttribute("for");n&&(e.dataset.dfnFor=n,e.removeAttribute("for"));const r=e.textContent.trim(),s=n?`${Hl(n)}-`:"",o=`cddl-${t.replace("cddl-","")}-${s}${Hl(r)}`;e.id||=o,i.add(e.id),Wc(e,[r])}),e.forEach(e=>function(e,t,n){const r=e.textContent;if(r.trim())try{const i=t(r),s=new Jl(n),o=i.serialize(s),a=document.createElement("code");a.innerHTML=o,e.textContent="",e.append(a),e.classList.add("def","highlight"),yi(e,"cddl-block");const c=document.createElement("span");c.className="cddlHeader",c.innerHTML=`<a class="self-link" href="#${e.id}">CDDL</a>`;const l=_l(".cddlHeader");c.append(l),e.prepend(c)}catch(t){Ni(`CDDL processing error: ${t instanceof Error?t.message:String(t)}`,Fl,{elements:[e],hint:'Check the CDDL syntax in the `<pre class="cddl">` block.'})}}(e,t,n)),s=document.body,o=n.definitions,s.querySelectorAll("[data-cddl-pending]").forEach(e=>{const t=`cddl-type:${e.dataset.cddlPending}`;if(o.has(t)){const n=o.get(t);if(!n)return;const r=s.ownerDocument.createElement("a");r.href=`#${n.id}`,r.className="cddl-name",r.dataset.linkType="cddl-type",r.textContent=e.textContent,e.replaceWith(r)}}),document.querySelectorAll("[data-cddl-pending]").forEach(e=>{if(e.closest("[data-cite]")){const t=document.createElement("a");return t.className="cddl-name",t.dataset.linkType="dfn",t.textContent=e.textContent,void e.replaceWith(t)}Ii(`No CDDL definition found for \`${e.getAttribute("data-cddl-pending")}\`.`,Fl,{elements:[e],hint:"Check for typos in the type name."})}),function(e,t){e.querySelectorAll('a[data-link-type^="cddl-"]:not([href]):not([data-cite])').forEach(e=>{const n=e.getAttribute("data-link-type"),r=e.getAttribute("data-xref-for")||e.getAttribute("data-link-for")||"",i=e.textContent.trim();if("cddl-type"!==n&&"cddl-key"!==n&&"cddl-value"!==n)return;const s={"cddl-type":`cddl-type:${i}`,"cddl-key":`cddl-key:${r}/${i}`,"cddl-value":`cddl-value:${r}/${i}`}[n];if(t.has(s)){const n=t.get(s);if(!n)return;e.setAttribute("href",`#${n.id}`),e.classList.add("internalDFN")}else Ii(`CDDL ${n}: no definition found for \`${i}\`${r?`, for \`${r}\`,`:""} in any \`<pre class="cddl">\` block.`,Fl,{elements:[e]}),e.setAttribute("data-no-link-to-dfn","")})}(document,n.definitions),function(e,t){t.forEach(t=>{const n=e.getElementById(t.id);"dfn"===n?.localName&&Wc(n,[n.textContent.trim()])})}(document,n.definitions),Bi("beforesave",e=>{e.querySelectorAll("[data-cddl-pending]").forEach(e=>e.removeAttribute("data-cddl-pending"))})}});const Kl="core/data-cite",Yl="__SPEC__";async function Xl(e){const{key:t,frag:n,path:r,href:i}=e;let s,o="";if(t===Yl)s=document.location.href;else{const e=await Xa(t);if(!e)return null;s=e.href??"",o=e.title}if(i)s=i;else{if(r){const e=r.startsWith("/")?`.${r}`:r;s=new URL(e,s).href}n&&(s=new URL(n,s).href)}return{href:s,title:o}}function Ql(e,t,n){const{href:r,title:i}=t,s=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=i),t.href=r,s){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?Ci(e,t):(t.textContent=i,e.append(t)),s){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Ni("Exporting a linked external definition is not allowed.",Kl,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function eu(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const tu=eu("#"),nu=eu("/");function ru(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:i,citeHref:s}=t;if((n??"").startsWith("#")&&!r){const r=e.parentElement?.closest('[data-cite]:not([data-cite^="#"])')??null,{key:i,isNormative:s}=r?ru(r):{key:Yl,isNormative:!1};return t.cite=s?i:`?${i}`,t.citeFrag=(n??"").replace("#",""),ru(e)}const o=r?`#${r}`:tu(n??""),a=i||nu(n??"").split("#")[0],{type:c}=xi(n??"",e),l="normative"===c,u=/^[?|!]/.test(n??"");return{key:(n??"").split(/[/|#]/)[0].substring(Number(u)),isNormative:l,frag:o,path:a,href:s}}function iu(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 su=Object.freeze({__proto__:null,THIS_SPEC:Yl,name:Kl,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(ru).map(async e=>({entry:e,result:await Xa(e.key)})),n=(await Promise.all(t)).filter(({result:e})=>null===e).map(({entry:{key:e}})=>e),r=await Ya(n);r&&Object.assign(Ga,r)}([...e]);const t=new Map,n=new Map;for(const r of e){t.set(r,r.dataset.cite);const e=ru(r);n.set(r,e)}for(const r of e){const e=t.get(r),i=n.get(r),s=await Xl(i);if(s)r.dataset.citeFrag&&r.dataset.matchedText||!r.dataset.lt||"the-empty-string"===r.dataset.lt||""!==r.textContent||(Ic(r,r.dataset.lt),delete r.dataset.lt),Ql(r,s,i);else{const t=`Couldn't find a match for "${e}"`;r.dataset.matchedText&&(r.textContent=r.dataset.matchedText),Ii(t,Kl,{elements:[r]})}}Bi("beforesave",iu)},toCiteDetails:ru});const ou="core/link-to-dfn",au=[],cu={en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"},cs:{duplicateMsg:e=>`Duplicitní definice '${e}'`,duplicateTitle:"Toto je v dokumentu definováno vícekrát."}},lu=di(cu);function uu(e){const t=new Map,n=[];for(const r of Uc.get(e)??[]){const{dfnType:i="dfn"}=r.dataset,s=r.dataset.dfnFor?.split(",").map(e=>e.trim())??[""];for(const o of s){if(t.has(o)&&t.get(o)?.has(i)){const e=t.get(o)?.get(i),s="dfn"===e?.localName,a="dfn"===r.localName,c=i===(e?.dataset.dfnType||"dfn"),l=!o&&!e?.dataset.dfnFor||e?.dataset.dfnFor?.split(",").map(e=>e.trim()).includes(o);if(s&&a&&c&&l){n.push(r);continue}}t.has(o)||t.set(o,new Map),t.get(o)?.set(i,r),("idl"in r.dataset||"dfn"!==i)&&t.get(o)?.set("idl",r),ki(r,"dfn",e)}}return{result:t,duplicates:n}}function du(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor??"":"",r=vi(e).reduce((e,r)=>{const i=r.split(".");2===i.length&&e.push({for:i[0],title:i[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r});const s=r.replace(Zr,"");return s!==r&&""!==s&&(e.push({for:n,title:s}),t||e.push({for:s,title:s}),""!==n&&e.push({for:"",title:s})),e},[]);return r}(e),r=n.find(e=>t.has(e.title)&&t.get(e.title)?.has(e.for));if(!r)return;const i=t.get(r.title)?.get(r.for),{linkType:s}=e.dataset;if(s){for(const e of s.split("|"))if(i?.get(e))return i.get(e);return i?.get("dfn")}{const e=r.for?"idl":"dfn";return i?.get(e)||i?.get("idl")}}function pu(e,t,n){let r=!1;const{linkFor:i}=e.dataset,{dfnFor:s}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(i&&!n.get(i)&&s&&!s.split(",").map(e=>e.trim()).includes(i))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"),i=hu(e)&&hu(t,n);r&&!i||Ci(e,document.createElement("code"))}(e,t),!r}function hu(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 fu(e){e.forEach(e=>{const t=`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,n=e.closest("[data-link-for]"),r=`Add a matching \`<dfn>\` element, ${qi`use ${"[data-cite]"} to link to an external definition, or enable ${"[xref]"} for automatic cross-spec linking.`}${n?` This link is inside a \`data-link-for="${n.dataset.linkFor}"\` section — \`[=term=]\` links are scoped to that context. To link to a global concept instead, either add \`data-link-for=""\` on this \`<a>\` or move it outside the scoped section.`:""}`;Ii(t,ou,{title:"Linking error: no matching `<dfn>`",hint:r,elements:[e]})})}var mu=Object.freeze({__proto__:null,name:ou,possibleExternalLinks:au,run:async function(e){const t=function(){const e=new Li;for(const t of Uc.keys()){const{result:n,duplicates:r}=uu(t);e.set(t,n),r.length>0&&Ni(lu.duplicateMsg(t),ou,{title:lu.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite='']:not([data-no-link-to-dfn]), a:not([href]):not([data-cite]):not([data-no-link-to-dfn]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){au.push(e);continue}const r=du(e,t);if(r){pu(e,r,t)||au.push(e)}else""===e.dataset.cite?n.push(e):au.push(e)}fu(n),function(e){const{shortName:t=""}=e,n=t?new RegExp(String.raw`^([?!])?${Yr(t)}\b([^-])`,"i"):null,r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){n&&(t.dataset.cite=(t.dataset.cite??"").replace(n,`$1${Yl}$2`));const{key:r,isNormative:i}=ru(t);r!==Yl&&(i||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||fu(au)}});const gu="xrefs",bu=3e5;async function yu(){return await Dr.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t));e.createObjectStore(gu,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function wu(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e)??"",10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-t<bu)return!1;const r=new URL("meta/version",$u).href,i=await fetch(r);if(!i.ok)return!1;const s=await i.text();return localStorage.setItem(e,n.toString()),parseInt(s,10)>t}())return await async function(){try{await yu().then(e=>e.clear(gu))}catch(e){console.error(e)}}(),t;const n=new Set(e.map(e=>e.id));try{const e=await yu();let r=await e.transaction(gu).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 ku="core/xref",vu={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},$u="https://respec.org/xref/",xu=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=ni({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function Cu(e){const t="xrefType"in e.dataset;let n=Su(e,{isIDL:t});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);const e=Tu(r);e.length&&t.push(e)}if(n===e)break;n=n.parentElement?.closest("[data-cite]")??null}if(n!==e){const n=e.closest("section"),r=n?n.querySelectorAll("a.bibref"):[],i=[...new Set([...r].map(e=>e.textContent.toLowerCase()))];if(i.length){t.push(i);const e=Tu(i);e.length&&t.push(e)}}const r=function(e){const t=[],n=new Set;for(const r of e){const e=[...new Set(r).values().filter(e=>!n.has(e))];e.forEach(e=>n.add(e)),t.push(e.sort())}return t}(t);return r}(e),i=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),s=function(e,t){if(e.dataset.xrefFor)return ui(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return ui(t.dataset.xrefFor??"")}return null}(e,t);return{id:"",term:n,types:i,...r.length&&{specs:r},..."string"==typeof s&&{for:s}}}function Su(e,{isIDL:t=!1}={}){const{lt:n}=e.dataset;let r=n?n.split("|",1)[0]:e.textContent;return r=ui(r),"the-empty-string"===r?"":(t||n||(r=r.replace(Zr,"")),r)}function _u(e){return e.replace(/-\d+$/,"")}function Tu(e){return[...new Set(e.map(_u)).difference(new Set(e))]}function Ru(e,t,n,r){const{term:i,specs:s=[]}=t,{uri:o,shortname:a,spec:c,normative:l,type:u,for:d}=n,p=s.flat().includes(c)?c:a,h=new URL(o,"https://partial");let{pathname:f}=h;"/"===f&&(f="");const m={cite:p,citePath:f,citeFrag:h.hash.slice(1),linkType:u};d&&(m.linkFor=d[0]),h.origin&&"https://partial"!==h.origin&&(m.citeHref=h.href),Object.assign(e.dataset,m),function(e,t,n,r,i){const s=function(e){const t=e.closest(".normative"),n=e.closest(ti);return!n||e===t||t&&n&&n.contains(t)}(e);if(!s)return void(i.normativeReferences.has(t)||i.informativeReferences.add(t));if(n){const e=i.informativeReferences.has(t)?i.informativeReferences.getCanonicalKey(t)??t:t;return i.normativeReferences.add(e),void i.informativeReferences.delete(e)}xu.push({term:r,spec:t,element:e})}(e,p,l,i,r)}function Eu(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Au)}function Au(e){const t=new Uint8Array(e);return t.toHex?.()??[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function Lu(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 Pu=Object.freeze({__proto__:null,API_URL:$u,getTermFromElement:Su,informativeRefsInNormative:xu,name:ku,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:new URL("search/",$u).href,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":{const t=e;t.toLowerCase()in vu?Object.assign(n,{specs:vu[t.toLowerCase()]}):r(t);break}case"array":Object.assign(n,{specs:e});break;case"object":{const t=e;if(Object.assign(n,t),t.profile){const e=t.profile.toLowerCase();if(e in vu){const r=(t.specs??[]).concat(vu[e]);Object.assign(n,{specs:r})}else r(t.profile)}break}default:{const t=qi`Expected: \`true\`, a profile name (e.g. \`"web-platform"\`), an array of spec shortnames (e.g. \`["FETCH", "DOM"]\`), or an object with \`url\`, \`specs\`, or \`profile\` properties. See ${"[xref]"}.`;Ni(`Invalid value for \`xref\` configuration option. Received: "${e}".`,ku,{hint:t})}}return n;function r(e){Ni(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${ci(Object.keys(vu),e=>`"${e}"`)}.`,ku)}}(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=au.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=Cu(e);t.id=await Eu(t),r.push(t)}const i=await async function(e,t){const n=new Set,r=e.filter(e=>!n.has(e.id)&&(n.add(e.id)&&!0)),i=await wu(r),s=r.filter(e=>!i.get(e.id)),o=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),i=await r.json();return new Map(i.results.map(({id:e,result:t})=>[e,t]))}(s,t);o.size&&await async function(e,t){try{const n=(await yu()).transaction(gu,"readwrite");for(const r of e){const e=t.get(r.id);e?.length&&n.objectStore(gu).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,o);return new Map([...i,...o])}(r,t.url);!function(e,t,n,r){const i={ambiguous:new Map,notFound:new Map};for(let s=0,o=e.length;s<o;s++){if(e[s].closest("[data-no-xref]"))continue;const o=e[s],a=t[s],{id:c}=a,l=n.get(c)??[];if(1===l.length)Ru(o,a,l[0],r);else{const e=i[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c)?.elems.push(o)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL($u);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)=>qi`[See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:i}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],s=Su(i[0]),o=n(s,e),a=ai(t,e=>`**[${e}]**`);let c=r(o,s);const l=i[0].parentElement?.closest("[data-cite]")??null,u=l?.dataset.cite?.replace(/`/g,"")??"";l&&l!==document.body&&u&&(c+=` A parent element has \`data-cite="${u}"\` — check that the spec shortname is correct.`);Ni(`Couldn't find "**${s}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,ku,{title:"No matching definition found.",elements:i,hint:c})}for(const{query:t,elems:i,results:s}of e.values()){const e=[...new Set(s.map(e=>e.shortname))].sort(),o=ai(e,e=>`**[${e}]**`),a=Su(i[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",u=r(c,a),d=qi`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification.`+String.raw` ${u}`;Ni(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,ku,{title:"Definition is ambiguous.",elements:i,hint:d})}}(i)}(n,r,i,e),Bi("beforesave",Lu)}});const Nu="headings",Iu=864e5;async function Ou(){return await Dr.openDB("respec-headings",1,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t)),e.createObjectStore(Nu)}})}async function Du(e){const t=new Map;if(function(){const e=parseInt(localStorage.getItem("HEADINGS:LAST_CACHED")??"",10);return!isNaN(e)&&Date.now()-e>Iu}())return await async function(){try{const e=await Ou();await e.clear(Nu),localStorage.removeItem("HEADINGS:LAST_CACHED")}catch(e){console.error(e)}}(),t;try{const n=(await Ou()).transaction(Nu);for(const r of e){const e=`${r.spec}#${r.id}`,i=await n.store.get(e);i&&t.set(e,i.result)}}catch(e){console.error(e)}return t}const ju="core/xref-headings",zu="https://respec.org/xref/search/headings";async function Mu(e,t=zu){if(!e.length)return new Map;const n=await Du(e),r=e.filter(e=>!n.has(`${e.spec}#${e.id}`));if(!r.length)return n;try{const e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queries:r})});if(!e.ok){const t=`Failed to fetch heading texts (HTTP ${e.status}).`;return Ii(t,ju,{hint:"Cross-spec section links will fall back to spec titles."}),n}const{result:i=[]}=await e.json(),s=new Map(i.filter(e=>!e.error).map(e=>[`${e.spec}#${e.id}`,{title:e.title,number:e.number||null}]));return await async function(e,t){try{const n=(await Ou()).transaction(Nu,"readwrite");for(const r of e){const e=`${r.spec}#${r.id}`,i=t.get(e);i&&n.objectStore(Nu).put({query:r,result:i},e)}await n.done,localStorage.setItem("HEADINGS:LAST_CACHED",Date.now().toString())}catch(e){console.error(e)}}(r,s),new Map([...n,...s])}catch{return Ii("Failed to fetch heading texts from respec.org.",ju,{hint:"Cross-spec section links will fall back to spec titles."}),n}}function qu(e,{title:t,number:n}){e.classList.add("sec-ref"),e.textContent="",e.append("§ "),n?e.append(Or`<bdi class="secno">${n} </bdi>`,t):e.append(t)}var Uu=Object.freeze({__proto__:null,HEADINGS_API_URL:zu,fetchHeadingTexts:Mu,name:ju,run:async function(e){const t=document.querySelectorAll("a[data-cite-frag][data-matched-text]");if(!t.length)return;const n=function(e){const t="object"!=typeof e.xref||null===e.xref||Array.isArray(e.xref)?{}:e.xref;return"string"==typeof t.headingApiUrl?t.headingApiUrl:zu}(e),r=new Map,i=[];if(t.forEach(e=>{if(e.dataset.lt)Ic(e,e.dataset.lt),delete e.dataset.lt;else{const t=(e.dataset.cite??"").replace(/^[!?]/,""),n=e.dataset.citeFrag??"",s=`${t}#${n}`;i.push({elem:e,key:s}),r.has(s)||r.set(s,{spec:t,id:n})}}),!i.length)return;const s=await Mu([...r.values()],n);i.forEach(({elem:e,key:t})=>{const n=s.get(t);n?.title&&qu(e,n)})},setHeadingContent:qu});var Wu=String.raw`ul.index{columns:30ch;column-gap:1.5em}
1202
+ >`}}switch(r.type){case"text":return ad`<span class="cddl-str">${li(s)}</span>`;case"number":case"float":return ad`<span class="cddl-num">${li(s)}</span>`;case"bytes":case"hex":case"base64":return ad`<span class="cddl-bytes">${li(s)}</span>`;default:return li(s)}}#l(e){const t=e.parentNode;return!!t&&t instanceof Vr}serializeToken(e,t){const n=e.type,r=e.serialize();switch(n){case"COMMENT":return this.#d(r);case"CTLOP":return this.#u(r);case"=":case"/=":case"//=":case"/":case"//":case"=>":case"..":case"...":return this.#p(r);case"?":case"*":case"+":return t instanceof Jr?this.#h(r):r;default:return r}}#d(e){return e.replace(/(;[^\n]*)/g,'<span class="cddl-comment">$1</span>')}#u(e){return e.replace(/(\.\w+)/g,'<span class="cddl-ctrl">$1</span>')}#p(e){const t=e.match(/^(\s*)(.*?)(\s*)$/s);return t?`${t[1]}<span class="cddl-op">${t[2]}</span>${t[3]}`:ad`<span class="cddl-op">${e}</span>`}#h(e){const t=e.match(/^(\s*)(.*?)(\s*)$/s);return t?`${t[1]}<span class="cddl-occ">${t[2]}</span>${t[3]}`:ad`<span class="cddl-occ">${e}</span>`}}var ld=Object.freeze({__proto__:null,name:rd,run:async function(){const e=document.querySelectorAll("pre.cddl:not([data-no-cddl])");if(!e.length)return;us(nd,{before:document.querySelector("head link, head > *:last-child")});const t=e=>new Ur(e).parse(),n={definitions:new Map,proseDfns:new Set,genericParams:new Map};var r,i,s,o;r=document,i=n.proseDfns,r.querySelectorAll("dfn[cddl-type], dfn[cddl-key], dfn[cddl-value]").forEach(e=>{const t=["cddl-type","cddl-key","cddl-value"].find(t=>e.hasAttribute(t));e.dataset.dfnType=t,e.removeAttribute(t);const n=e.getAttribute("for");n&&(e.dataset.dfnFor=n,e.removeAttribute("for"));const r=e.textContent.trim(),s=n?`${sd(n)}-`:"",o=`cddl-${t.replace("cddl-","")}-${s}${sd(r)}`;e.id||=o,i.add(e.id),Hc(e,[r])}),e.forEach(e=>function(e,t,n){const r=e.textContent;if(r.trim())try{const i=t(r),s=new cd(n),o=i.serialize(s),a=document.createElement("code");a.innerHTML=o,e.textContent="",e.append(a),e.classList.add("def","highlight"),yi(e,"cddl-block");const c=document.createElement("span");c.className="cddlHeader",c.innerHTML=`<a class="self-link" href="#${e.id}">CDDL</a>`;const l=vl(".cddlHeader");c.append(l),e.prepend(c)}catch(t){Ni(`CDDL processing error: ${t instanceof Error?t.message:String(t)}`,rd,{elements:[e],hint:'Check the CDDL syntax in the `<pre class="cddl">` block.'})}}(e,t,n)),s=document.body,o=n.definitions,s.querySelectorAll("[data-cddl-pending]").forEach(e=>{const t=`cddl-type:${e.dataset.cddlPending}`;if(o.has(t)){const n=o.get(t);if(!n)return;const r=s.ownerDocument.createElement("a");r.href=`#${n.id}`,r.className="cddl-name",r.dataset.linkType="cddl-type",r.textContent=e.textContent,e.replaceWith(r)}}),document.querySelectorAll("[data-cddl-pending]").forEach(e=>{if(e.closest("[data-cite]")){const t=document.createElement("a");return t.className="cddl-name",t.dataset.linkType="dfn",t.textContent=e.textContent,void e.replaceWith(t)}Ii(`No CDDL definition found for \`${e.getAttribute("data-cddl-pending")}\`.`,rd,{elements:[e],hint:"Check for typos in the type name."})}),function(e,t){e.querySelectorAll('a[data-link-type^="cddl-"]:not([href]):not([data-cite])').forEach(e=>{const n=e.getAttribute("data-link-type"),r=e.getAttribute("data-xref-for")||e.getAttribute("data-link-for")||"",i=e.textContent.trim();if("cddl-type"!==n&&"cddl-key"!==n&&"cddl-value"!==n)return;const s={"cddl-type":`cddl-type:${i}`,"cddl-key":`cddl-key:${r}/${i}`,"cddl-value":`cddl-value:${r}/${i}`}[n];if(t.has(s)){const n=t.get(s);if(!n)return;e.setAttribute("href",`#${n.id}`),e.classList.add("internalDFN")}else Ii(`CDDL ${n}: no definition found for \`${i}\`${r?`, for \`${r}\`,`:""} in any \`<pre class="cddl">\` block.`,rd,{elements:[e]}),e.setAttribute("data-no-link-to-dfn","")})}(document,n.definitions),function(e,t){t.forEach(t=>{const n=e.getElementById(t.id);"dfn"===n?.localName&&Hc(n,[n.textContent.trim()])})}(document,n.definitions),Hi("beforesave",e=>{e.querySelectorAll("[data-cddl-pending]").forEach(e=>e.removeAttribute("data-cddl-pending"))})}});const dd="core/data-cite",ud="__SPEC__";async function pd(e){const{key:t,frag:n,path:r,href:i}=e;let s,o="";if(t===ud)s=document.location.href;else{const e=await ec(t);if(!e)return null;s=e.href??"",o=e.title}if(i)s=i;else{if(r){const e=r.startsWith("/")?`.${r}`:r;s=new URL(e,s).href}n&&(s=new URL(n,s).href)}return{href:s,title:o}}function hd(e,t,n){const{href:r,title:i}=t,s=!n.path&&!n.frag;switch(e.localName){case"a":{const t=e;if(""===t.textContent&&"the-empty-string"!==t.dataset.lt&&(t.textContent=i),t.href=r,s){const e=document.createElement("cite");t.replaceWith(e),e.append(t)}break}case"dfn":{const t=document.createElement("a");if(t.href=r,t.dataset.cite=n.key,t.dataset.citePath=n.path,t.dataset.citeFrag=n.frag,e.textContent?Ci(e,t):(t.textContent=i,e.append(t)),s){const n=document.createElement("cite");n.append(t),e.append(n)}if("export"in e.dataset){Ni("Exporting a linked external definition is not allowed.",dd,{hint:"Please remove the `data-export` attribute.",elements:[e]}),delete e.dataset.export}e.classList.add("externalDFN"),e.dataset.noExport="";break}}}function fd(e){return t=>{const n=t.search(e);return-1!==n?t.substring(n):""}}const md=fd("#"),gd=fd("/");function bd(e){const{dataset:t}=e,{cite:n,citeFrag:r,citePath:i,citeHref:s}=t;if((n??"").startsWith("#")&&!r){const r=e.parentElement?.closest('[data-cite]:not([data-cite^="#"])')??null,{key:i,isNormative:s}=r?bd(r):{key:ud,isNormative:!1};return t.cite=s?i:`?${i}`,t.citeFrag=(n??"").replace("#",""),bd(e)}const o=r?`#${r}`:md(n??""),a=i||gd(n??"").split("#")[0],{type:c}=xi(n??"",e),l="normative"===c,d=/^[?|!]/.test(n??"");return{key:(n??"").split(/[/|#]/)[0].substring(Number(d)),isNormative:l,frag:o,path:a,href:s}}function yd(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 wd=Object.freeze({__proto__:null,THIS_SPEC:ud,name:dd,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(bd).map(async e=>({entry:e,result:await ec(e.key)})),n=(await Promise.all(t)).filter(({result:e})=>null===e).map(({entry:{key:e}})=>e),r=await Qa(n);r&&Object.assign(Ja,r)}([...e]);const t=new Map,n=new Map;for(const r of e){t.set(r,r.dataset.cite);const e=bd(r);n.set(r,e)}for(const r of e){const e=t.get(r),i=n.get(r),s=await pd(i);if(s)r.dataset.citeFrag&&r.dataset.matchedText||!r.dataset.lt||"the-empty-string"===r.dataset.lt||""!==r.textContent||(Dc(r,r.dataset.lt),delete r.dataset.lt),hd(r,s,i);else{const t=`Couldn't find a match for "${e}"`;r.dataset.matchedText&&(r.textContent=r.dataset.matchedText),Ii(t,dd,{elements:[r]})}}Hi("beforesave",yd)},toCiteDetails:bd});const vd="core/link-to-dfn",kd=[],$d={en:{duplicateMsg:e=>`Duplicate definition(s) of '${e}'`,duplicateTitle:"This is defined more than once in the document."},ja:{duplicateMsg:e=>`'${e}' の重複定義`,duplicateTitle:"この文書内で複数回定義されています."},de:{duplicateMsg:e=>`Mehrfache Definition von '${e}'`,duplicateTitle:"Das Dokument enthält mehrere Definitionen dieses Eintrags."},zh:{duplicateMsg:e=>`'${e}' 的重复定义`,duplicateTitle:"在文档中有重复的定义。"},cs:{duplicateMsg:e=>`Duplicitní definice '${e}'`,duplicateTitle:"Toto je v dokumentu definováno vícekrát."}},xd=ui($d);function Cd(e){const t=new Map,n=[];for(const r of Fc.get(e)??[]){const{dfnType:i="dfn"}=r.dataset,s=r.dataset.dfnFor?.split(",").map(e=>e.trim())??[""];for(const o of s){if(t.has(o)&&t.get(o)?.has(i)){const e=t.get(o)?.get(i),s="dfn"===e?.localName,a="dfn"===r.localName,c=i===(e?.dataset.dfnType||"dfn"),l=!o&&!e?.dataset.dfnFor||e?.dataset.dfnFor?.split(",").map(e=>e.trim()).includes(o);if(s&&a&&c&&l){n.push(r);continue}}t.has(o)||t.set(o,new Map),t.get(o)?.set(i,r),("idl"in r.dataset||"dfn"!==i)&&t.get(o)?.set("idl",r),vi(r,"dfn",e)}}return{result:t,duplicates:n}}function Sd(e,t){const n=function(e){const t=e.closest("[data-link-for]"),n=t?t.dataset.linkFor??"":"",r=ki(e).reduce((e,r)=>{const i=r.split(".");2===i.length&&e.push({for:i[0],title:i[1]}),e.push({for:n,title:r}),t||e.push({for:r,title:r}),""!==n&&e.push({for:"",title:r});const s=r.replace(Zr,"");return s!==r&&""!==s&&(e.push({for:n,title:s}),t||e.push({for:s,title:s}),""!==n&&e.push({for:"",title:s})),e},[]);return r}(e),r=n.find(e=>t.has(e.title)&&t.get(e.title)?.has(e.for));if(!r)return;const i=t.get(r.title)?.get(r.for),{linkType:s}=e.dataset;if(s){for(const e of s.split("|"))if(i?.get(e))return i.get(e);return i?.get("dfn")}{const e=r.for?"idl":"dfn";return i?.get(e)||i?.get("idl")}}function _d(e,t,n){let r=!1;const{linkFor:i}=e.dataset,{dfnFor:s}=t.dataset;if(t.dataset.cite)e.dataset.cite=t.dataset.cite;else if(i&&!n.get(i)&&s&&!s.split(",").map(e=>e.trim()).includes(i))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"),i=Td(e)&&Td(t,n);r&&!i||Ci(e,document.createElement("code"))}(e,t),!r}function Td(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 Rd(e){e.forEach(e=>{const t=`Found linkless \`<a>\` element with text "${e.textContent}" but no matching \`<dfn>\``,n=e.closest("[data-link-for]"),r=`Add a matching \`<dfn>\` element, ${qi`use ${"[data-cite]"} to link to an external definition, or enable ${"[xref]"} for automatic cross-spec linking.`}${n?` This link is inside a \`data-link-for="${n.dataset.linkFor}"\` section — \`[=term=]\` links are scoped to that context. To link to a global concept instead, either add \`data-link-for=""\` on this \`<a>\` or move it outside the scoped section.`:""}`;Ii(t,vd,{title:"Linking error: no matching `<dfn>`",hint:r,elements:[e]})})}var Ed=Object.freeze({__proto__:null,name:vd,possibleExternalLinks:kd,run:async function(e){const t=function(){const e=new Li;for(const t of Fc.keys()){const{result:n,duplicates:r}=Cd(t);e.set(t,n),r.length>0&&Ni(xd.duplicateMsg(t),vd,{title:xd.duplicateTitle,elements:r})}return e}(),n=[],r=document.querySelectorAll("a[data-cite='']:not([data-no-link-to-dfn]), a:not([href]):not([data-cite]):not([data-no-link-to-dfn]):not(.logo):not(.externalDFN)");for(const e of r){if(!e.dataset?.linkType&&e.dataset?.xrefType){kd.push(e);continue}const r=Sd(e,t);if(r){_d(e,r,t)||kd.push(e)}else""===e.dataset.cite?n.push(e):kd.push(e)}Rd(n),function(e){const{shortName:t=""}=e,n=t?new RegExp(String.raw`^([?!])?${Yr(t)}\b([^-])`,"i"):null,r=document.querySelectorAll("dfn[data-cite]:not([data-cite='']), a[data-cite]:not([data-cite=''])");for(const t of r){n&&(t.dataset.cite=(t.dataset.cite??"").replace(n,`$1${ud}$2`));const{key:r,isNormative:i}=bd(t);r!==ud&&(i||e.normativeReferences.has(r)?(e.normativeReferences.add(r),e.informativeReferences.delete(r)):e.informativeReferences.add(r))}}(e),e.xref||Rd(kd)}});const Ad="xrefs",Ld=3e5;async function Pd(){return await Dr.openDB("xref",2,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t));e.createObjectStore(Ad,{keyPath:"query.id"}).createIndex("byTerm","query.term",{unique:!1})}})}async function Nd(e){const t=new Map;if(await async function(){const e="XREF:LAST_VERSION_CHECK",t=parseInt(localStorage.getItem(e)??"",10),n=Date.now();if(!t)return localStorage.setItem(e,n.toString()),!1;if(n-t<Ld)return!1;const r=new URL("meta/version",Dd).href,i=await fetch(r);if(!i.ok)return!1;const s=await i.text();return localStorage.setItem(e,n.toString()),parseInt(s,10)>t}())return await async function(){try{await Pd().then(e=>e.clear(Ad))}catch(e){console.error(e)}}(),t;const n=new Set(e.map(e=>e.id));try{const e=await Pd();let r=await e.transaction(Ad).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 Id="core/xref",Od={"web-platform":["HTML","INFRA","URL","WEBIDL","DOM","FETCH"]},Dd="https://respec.org/xref/",jd=[];if(!document.querySelector("link[rel='preconnect'][href='https://respec.org']")){const e=ni({hint:"preconnect",href:"https://respec.org"});document.head.appendChild(e)}function zd(e){const t="xrefType"in e.dataset;let n=Md(e,{isIDL:t});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);const e=Ud(r);e.length&&t.push(e)}if(n===e)break;n=n.parentElement?.closest("[data-cite]")??null}if(n!==e){const n=e.closest("section"),r=n?n.querySelectorAll("a.bibref"):[],i=[...new Set([...r].map(e=>e.textContent.toLowerCase()))];if(i.length){t.push(i);const e=Ud(i);e.length&&t.push(e)}}const r=function(e){const t=[],n=new Set;for(const r of e){const e=[...new Set(r).values().filter(e=>!n.has(e))];e.forEach(e=>n.add(e)),t.push(e.sort())}return t}(t);return r}(e),i=function(e,t){if(t)return e.dataset.xrefType?e.dataset.xrefType.split("|"):["_IDL_"];return["_CONCEPT_"]}(e,t),s=function(e,t){if(e.dataset.xrefFor)return di(e.dataset.xrefFor);if(t){const t=e.closest("[data-xref-for]");if(t)return di(t.dataset.xrefFor??"")}return null}(e,t);return{id:"",term:n,types:i,...r.length&&{specs:r},..."string"==typeof s&&{for:s}}}function Md(e,{isIDL:t=!1}={}){const{lt:n}=e.dataset;let r=n?n.split("|",1)[0]:e.textContent;return r=di(r),"the-empty-string"===r?"":(t||n||(r=r.replace(Zr,"")),r)}function qd(e){return e.replace(/-\d+$/,"")}function Ud(e){return[...new Set(e.map(qd)).difference(new Set(e))]}function Wd(e,t,n,r){const{term:i,specs:s=[]}=t,{uri:o,shortname:a,spec:c,normative:l,type:d,for:u}=n,p=s.flat().includes(c)?c:a,h=new URL(o,"https://partial");let{pathname:f}=h;"/"===f&&(f="");const m={cite:p,citePath:f,citeFrag:h.hash.slice(1),linkType:d};u&&(m.linkFor=u[0]),h.origin&&"https://partial"!==h.origin&&(m.citeHref=h.href),Object.assign(e.dataset,m),function(e,t,n,r,i){const s=function(e){const t=e.closest(".normative"),n=e.closest(ti);return!n||e===t||t&&n&&n.contains(t)}(e);if(!s)return void(i.normativeReferences.has(t)||i.informativeReferences.add(t));if(n){const e=i.informativeReferences.has(t)?i.informativeReferences.getCanonicalKey(t)??t:t;return i.normativeReferences.add(e),void i.informativeReferences.delete(e)}jd.push({term:r,spec:t,element:e})}(e,p,l,i,r)}function Fd(e){const t=JSON.stringify(e,Object.keys(e).sort()),n=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-1",n).then(Hd)}function Hd(e){const t=new Uint8Array(e);return t.toHex?.()??[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function Bd(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 Gd=Object.freeze({__proto__:null,API_URL:Dd,getTermFromElement:Md,informativeRefsInNormative:jd,name:Id,run:async function(e){if(!e.xref)return;const t=function(e){const t={url:new URL("search/",Dd).href,specs:null},n=Object.assign({},t);switch(Array.isArray(e)?"array":typeof e){case"boolean":break;case"string":{const t=e;t.toLowerCase()in Od?Object.assign(n,{specs:Od[t.toLowerCase()]}):r(t);break}case"array":Object.assign(n,{specs:e});break;case"object":{const t=e;if(Object.assign(n,t),t.profile){const e=t.profile.toLowerCase();if(e in Od){const r=(t.specs??[]).concat(Od[e]);Object.assign(n,{specs:r})}else r(t.profile)}break}default:{const t=qi`Expected: \`true\`, a profile name (e.g. \`"web-platform"\`), an array of spec shortnames (e.g. \`["FETCH", "DOM"]\`), or an object with \`url\`, \`specs\`, or \`profile\` properties. See ${"[xref]"}.`;Ni(`Invalid value for \`xref\` configuration option. Received: "${e}".`,Id,{hint:t})}}return n;function r(e){Ni(`Invalid profile "${e}" in \`respecConfig.xref\`. Please use one of the supported profiles: ${ci(Object.keys(Od),e=>`"${e}"`)}.`,Id)}}(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=kd.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=zd(e);t.id=await Fd(t),r.push(t)}const i=await async function(e,t){const n=new Set,r=e.filter(e=>!n.has(e.id)&&(n.add(e.id)&&!0)),i=await Nd(r),s=r.filter(e=>!i.get(e.id)),o=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),i=await r.json();return new Map(i.results.map(({id:e,result:t})=>[e,t]))}(s,t);o.size&&await async function(e,t){try{const n=(await Pd()).transaction(Ad,"readwrite");for(const r of e){const e=t.get(r.id);e?.length&&n.objectStore(Ad).add({query:r,result:e})}await n.done}catch(e){console.error(e)}}(r,o);return new Map([...i,...o])}(r,t.url);!function(e,t,n,r){const i={ambiguous:new Map,notFound:new Map};for(let s=0,o=e.length;s<o;s++){if(e[s].closest("[data-no-xref]"))continue;const o=e[s],a=t[s],{id:c}=a,l=n.get(c)??[];if(1===l.length)Wd(o,a,l[0],r);else{const e=i[0===l.length?"notFound":"ambiguous"];e.has(c)||e.set(c,{elems:[],results:l,query:a}),e.get(c)?.elems.push(o)}}!function({ambiguous:e,notFound:t}){const n=(e,t,n=[])=>{const r=new URL(Dd);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)=>qi`[See search matches for "${t}"](${e}) or ${"[Learn about this error|#error-term-not-found]"}.`;for(const{query:e,elems:i}of t.values()){const t=e.specs?[...new Set(e.specs.flat())].sort():[],s=Md(i[0]),o=n(s,e),a=ai(t,e=>`**[${e}]**`);let c=r(o,s);const l=i[0].parentElement?.closest("[data-cite]")??null,d=l?.dataset.cite?.replace(/`/g,"")??"";l&&l!==document.body&&d&&(c+=` A parent element has \`data-cite="${d}"\` — check that the spec shortname is correct.`);Ni(`Couldn't find "**${s}**"${e.for?`, for **"${e.for}"**, `:""} in this document or other cited documents: ${a}.`,Id,{title:"No matching definition found.",elements:i,hint:c})}for(const{query:t,elems:i,results:s}of e.values()){const e=[...new Set(s.map(e=>e.shortname))].sort(),o=ai(e,e=>`**[${e}]**`),a=Md(i[0]),c=n(a,t,e),l=t.for?`, for **"${t.for}"**, `:"",d=r(c,a),u=qi`To fix, use the ${"[data-cite]"} attribute to pick the one you mean from the appropriate specification.`+String.raw` ${d}`;Ni(`The term "**${a}**"${l} is ambiguous because it's defined in ${o}.`,Id,{title:"Definition is ambiguous.",elements:i,hint:u})}}(i)}(n,r,i,e),Hi("beforesave",Bd)}});const Vd="headings",Jd=864e5;async function Zd(){return await Dr.openDB("respec-headings",1,{upgrade(e){[...e.objectStoreNames].forEach(t=>e.deleteObjectStore(t)),e.createObjectStore(Vd)}})}async function Kd(e){const t=new Map;if(function(){const e=parseInt(localStorage.getItem("HEADINGS:LAST_CACHED")??"",10);return!isNaN(e)&&Date.now()-e>Jd}())return await async function(){try{const e=await Zd();await e.clear(Vd),localStorage.removeItem("HEADINGS:LAST_CACHED")}catch(e){console.error(e)}}(),t;try{const n=(await Zd()).transaction(Vd);for(const r of e){const e=`${r.spec}#${r.id}`,i=await n.store.get(e);i&&t.set(e,i.result)}}catch(e){console.error(e)}return t}const Yd="core/xref-headings",Xd="https://respec.org/xref/search/headings";async function Qd(e,t=Xd){if(!e.length)return new Map;const n=await Kd(e),r=e.filter(e=>!n.has(`${e.spec}#${e.id}`));if(!r.length)return n;try{const e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queries:r})});if(!e.ok){const t=`Failed to fetch heading texts (HTTP ${e.status}).`;return Ii(t,Yd,{hint:"Cross-spec section links will fall back to spec titles."}),n}const{result:i=[]}=await e.json(),s=new Map(i.filter(e=>!e.error).map(e=>[`${e.spec}#${e.id}`,{title:e.title,number:e.number||null}]));return await async function(e,t){try{const n=(await Zd()).transaction(Vd,"readwrite");for(const r of e){const e=`${r.spec}#${r.id}`,i=t.get(e);i&&n.objectStore(Vd).put({query:r,result:i},e)}await n.done,localStorage.setItem("HEADINGS:LAST_CACHED",Date.now().toString())}catch(e){console.error(e)}}(r,s),new Map([...n,...s])}catch{return Ii("Failed to fetch heading texts from respec.org.",Yd,{hint:"Cross-spec section links will fall back to spec titles."}),n}}function eu(e,{title:t,number:n}){e.classList.add("sec-ref"),e.textContent="",e.append("§ "),n?e.append(Or`<bdi class="secno">${n} </bdi>`,t):e.append(t)}var tu=Object.freeze({__proto__:null,HEADINGS_API_URL:Xd,fetchHeadingTexts:Qd,name:Yd,run:async function(e){const t=document.querySelectorAll("a[data-cite-frag][data-matched-text]");if(!t.length)return;const n=function(e){const t="object"!=typeof e.xref||null===e.xref||Array.isArray(e.xref)?{}:e.xref;return"string"==typeof t.headingApiUrl?t.headingApiUrl:Xd}(e),r=new Map,i=[];if(t.forEach(e=>{if(e.dataset.lt)Dc(e,e.dataset.lt),delete e.dataset.lt;else{const t=(e.dataset.cite??"").replace(/^[!?]/,""),n=e.dataset.citeFrag??"",s=`${t}#${n}`;i.push({elem:e,key:s}),r.has(s)||r.set(s,{spec:t,id:n})}}),!i.length)return;const s=await Qd([...r.values()],n);i.forEach(({elem:e,key:t})=>{const n=s.get(t);n?.title&&eu(e,n)})},setHeadingContent:eu});var nu=String.raw`ul.index{columns:30ch;column-gap:1.5em}
1100
1203
  ul.index li{list-style:inherit}
1101
1204
  ul.index li span{color:inherit;cursor:pointer;white-space:normal}
1102
1205
  #index-defined-here ul.index li{font-size:.9rem}
@@ -1104,37 +1207,37 @@ ul.index code{color:inherit}
1104
1207
  #index-defined-here .print-only{display:none}
1105
1208
  @media print{
1106
1209
  #index-defined-here .print-only{display:initial}
1107
- }`;const Fu=di({en:{heading:"Index",headingExternal:"Terms defined by reference",headingLocal:"Terms defined by this specification",dfnOf:"definition of",definesFollowing:"defines the following:"},cs:{heading:"Glosář",headingExternal:"Termíny definované odkazem",headingLocal:"Termíny definované touto specifikací",dfnOf:"definice",definesFollowing:"definuje následující:"},de:{heading:"Index",headingExternal:"Begriffe, die durch Verweis definiert sind",headingLocal:"Begriffe, die in dieser Spezifikation definiert sind",dfnOf:"Definition von",definesFollowing:"definiert Folgendes:"},es:{heading:"Índice",headingExternal:"Términos definidos por referencia",headingLocal:"Términos definidos por esta especificación",dfnOf:"definición de",definesFollowing:"define lo siguiente:"},fr:{heading:"Index",headingExternal:"Termes définis par référence",headingLocal:"Termes définis par cette spécification",dfnOf:"définition de",definesFollowing:"définit les termes suivants :"},ja:{heading:"索引",headingExternal:"参照によって定義された用語",headingLocal:"この仕様で定義された用語",dfnOf:"の定義",definesFollowing:"以下を定義します:"},ko:{heading:"색인",headingExternal:"참조로 정의된 용어",headingLocal:"이 명세서에서 정의된 용어",dfnOf:"정의",definesFollowing:"다음을 정의합니다:"},nl:{heading:"Index",headingExternal:"Termen gedefinieerd door verwijzing",headingLocal:"Termen gedefinieerd door deze specificatie",dfnOf:"definitie van",definesFollowing:"definieert het volgende:"},zh:{heading:"索引",headingExternal:"通过引用定义的术语",headingLocal:"由本规范定义的术语",dfnOf:"的定义",definesFollowing:"定义以下内容:"}}),Bu=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function Hu(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function Gu(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?.dataset.dfnFor||""}function Vu(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${Gu(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${Gu(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${Gu(e)}</code>`;default:return""}}function Ju(){document.querySelectorAll("#index-defined-here li[data-id]").forEach(e=>{const t=(e=>{const t=document.getElementById(e),n=t?.closest("section:not(.notoc)")?.querySelector(".secno");if(!n)return null;const r=`§${n.textContent.trim()}`;return Or`<span class="print-only">${r}</span>`})(e.dataset.id??"");t&&e.append(t)})}function Zu(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;if("noindex"in r.dataset)continue;const{cite:n,citeFrag:i,xrefType:s,linkType:o,matchedText:a}=r.dataset;if(i&&a)continue;if(!(s||o||n.includes("#")||i))continue;const c=r.href;if(e.has(c))continue;const{linkType:l,linkFor:u}=r.dataset,d=Su(r);if(!d)continue;const p=ru(r).key.toUpperCase(),h=t.get(p)||t.set(p,[]).get(p);h?.push({term:d,type:l,linkFor:u,elem:r}),e.add(c)}return t}function Ku(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let i=li(t);Bu.has(n??"")&&("extended-attribute"===n&&(i=`[${i}]`),i=`<code>${i}</code>`);const s=Xu.has(t)?"type":Yu.get(n??"");s&&(i+=` ${s}`);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),i+=` (for ${e})`}return i}(e);return Or`<li>
1210
+ }`;const ru=ui({en:{heading:"Index",headingExternal:"Terms defined by reference",headingLocal:"Terms defined by this specification",dfnOf:"definition of",definesFollowing:"defines the following:"},cs:{heading:"Glosář",headingExternal:"Termíny definované odkazem",headingLocal:"Termíny definované touto specifikací",dfnOf:"definice",definesFollowing:"definuje následující:"},de:{heading:"Index",headingExternal:"Begriffe, die durch Verweis definiert sind",headingLocal:"Begriffe, die in dieser Spezifikation definiert sind",dfnOf:"Definition von",definesFollowing:"definiert Folgendes:"},es:{heading:"Índice",headingExternal:"Términos definidos por referencia",headingLocal:"Términos definidos por esta especificación",dfnOf:"definición de",definesFollowing:"define lo siguiente:"},fr:{heading:"Index",headingExternal:"Termes définis par référence",headingLocal:"Termes définis par cette spécification",dfnOf:"définition de",definesFollowing:"définit les termes suivants :"},ja:{heading:"索引",headingExternal:"参照によって定義された用語",headingLocal:"この仕様で定義された用語",dfnOf:"の定義",definesFollowing:"以下を定義します:"},ko:{heading:"색인",headingExternal:"참조로 정의된 용어",headingLocal:"이 명세서에서 정의된 용어",dfnOf:"정의",definesFollowing:"다음을 정의합니다:"},nl:{heading:"Index",headingExternal:"Termen gedefinieerd door verwijzing",headingLocal:"Termen gedefinieerd door deze specificatie",dfnOf:"definitie van",definesFollowing:"definieert het volgende:"},zh:{heading:"索引",headingExternal:"通过引用定义的术语",headingLocal:"由本规范定义的术语",dfnOf:"的定义",definesFollowing:"定义以下内容:"}}),iu=new Set(["attribute","callback","dict-member","dictionary","element-attr","element","enum-value","enum","exception","extended-attribute","interface","method","typedef"]);function su(e){const t=e.dataset,n=t.dfnType||t.idl||t.linkType||"";switch(n){case"":case"dfn":return"";default:return n}}function ou(e){const t=e.closest("[data-dfn-for]:not([data-dfn-for=''])");return t?.dataset.dfnFor||""}function au(e,t,n=""){if(n.startsWith("[[")){return`internal slot for <code>${ou(e)}</code>`}switch(t){case"dict-member":case"method":case"attribute":case"enum-value":return`${"dict-member"===t?"member":t.replace("-"," ")} for <code>${ou(e)}</code>`;case"interface":case"dictionary":case"enum":return t;case"constructor":return`for <code>${ou(e)}</code>`;default:return""}}function cu(){document.querySelectorAll("#index-defined-here li[data-id]").forEach(e=>{const t=(e=>{const t=document.getElementById(e),n=t?.closest("section:not(.notoc)")?.querySelector(".secno");if(!n)return null;const r=`§${n.textContent.trim()}`;return Or`<span class="print-only">${r}</span>`})(e.dataset.id??"");t&&e.append(t)})}function lu(){const e=new Set,t=new Map,n=document.querySelectorAll("a[data-cite]");for(const r of n){if(!r.dataset.cite)continue;if("noindex"in r.dataset)continue;const{cite:n,citeFrag:i,xrefType:s,linkType:o,matchedText:a}=r.dataset;if(i&&a)continue;if(!(s||o||n.includes("#")||i))continue;const c=r.href;if(e.has(c))continue;const{linkType:l,linkFor:d}=r.dataset,u=Md(r);if(!u)continue;const p=bd(r).key.toUpperCase(),h=t.get(p)||t.set(p,[]).get(p);h?.push({term:u,type:l,linkFor:d,elem:r}),e.add(c)}return t}function du(e){const{elem:t}=e,n=function(e){const{term:t,type:n,linkFor:r}=e;let i=li(t);iu.has(n??"")&&("extended-attribute"===n&&(i=`[${i}]`),i=`<code>${i}</code>`);const s=pu.has(t)?"type":uu.get(n??"");s&&(i+=` ${s}`);if(r){let e=r;/\s/.test(r)||(e=`<code>${e}</code>`),"element-attr"===n&&(e+=" element"),i+=` (for ${e})`}return i}(e);return Or`<li>
1108
1211
  <span class="index-term" data-href="${t.href}">${{html:n}}</span>
1109
- </li>`}const Yu=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),Xu=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 Qu(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")),e.querySelectorAll("a[data-noindex]").forEach(e=>e.removeAttribute("data-noindex"))}var ed=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return;ds(Wu),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(Or`<h1>${Fu.heading}</h1>`);const t=Or`<section id="index-defined-here">
1110
- <h3>${Fu.headingLocal}</h3>
1111
- ${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=ui(n.textContent),r=e.get(t)||e.set(t,[]).get(t);r?.push(n)}const n=[...e].sort(([e],[t])=>e.slice(e.search(/\w/)).localeCompare(t.slice(t.search(/\w/))));return n}();return Or`<ul class="index">
1212
+ </li>`}const uu=new Map([["attribute","attribute"],["element-attr","attribute"],["element","element"],["enum","enum"],["exception","exception"],["extended-attribute","extended attribute"],["interface","interface"]]),pu=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 hu(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")),e.querySelectorAll("a[data-noindex]").forEach(e=>e.removeAttribute("data-noindex"))}var fu=Object.freeze({__proto__:null,name:"core/dfn-index",run:function(){const e=document.querySelector("section#index");if(!e)return;us(nu),e.classList.add("appendix"),e.querySelector("h2, h1")||e.prepend(Or`<h1>${ru.heading}</h1>`);const t=Or`<section id="index-defined-here">
1213
+ <h3>${ru.headingLocal}</h3>
1214
+ ${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=di(n.textContent),r=e.get(t)||e.set(t,[]).get(t);r?.push(n)}const n=[...e].sort(([e],[t])=>e.slice(e.search(/\w/)).localeCompare(t.slice(t.search(/\w/))));return n}();return Or`<ul class="index">
1112
1215
  ${e.map(([e,t])=>function(e,t){const n=(e,t,n="")=>{const r=`#${e.id}`;return Or`<li data-id=${e.id}>
1113
1216
  <a class="index-term" href="${r}">${{html:t}}</a> ${n?{html:n}:""}
1114
- </li>`};if(1===t.length){const r=t[0],i=Hu(r),s=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(Bu.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,i,e),o=Vu(r,i,e);return n(r,s,o)}return Or`<li>
1217
+ </li>`};if(1===t.length){const r=t[0],i=su(r),s=function(e,t,n){let r=n;"enum-value"===t&&(r=`"${r}"`);(iu.has(t)||e.dataset.idl||e.closest("code"))&&(r=`<code>${r}</code>`);return r}(r,i,e),o=au(r,i,e);return n(r,s,o)}return Or`<li>
1115
1218
  ${e}
1116
1219
  <ul>
1117
- ${t.map(t=>{const r=Vu(t,Hu(t),e)||Fu.dfnOf;return n(t,r)})}
1220
+ ${t.map(t=>{const r=au(t,su(t),e)||ru.dfnOf;return n(t,r)})}
1118
1221
  </ul>
1119
1222
  </li>`}(e,t))}
1120
1223
  </ul>`}()}
1121
1224
  </section>`;e.append(t);const n=Or`<section id="index-defined-elsewhere">
1122
- <h3>${Fu.headingExternal}</h3>
1123
- ${function(){const e=[...Zu().entries()].sort(([e],[t])=>e.localeCompare(t)),t=document.querySelector("section#index"),n=!!t?.classList.contains("prefer-full-spec-title");return Or`<ul class="index">
1124
- ${e.map(([e,t])=>{let r;return r=n&&Ga[e]?.title?oc(e,Ga[e].title):oc(e),Or`<li data-spec="${e}">
1125
- ${r} ${Fu.definesFollowing}
1225
+ <h3>${ru.headingExternal}</h3>
1226
+ ${function(){const e=[...lu().entries()].sort(([e],[t])=>e.localeCompare(t)),t=document.querySelector("section#index"),n=!!t?.classList.contains("prefer-full-spec-title");return Or`<ul class="index">
1227
+ ${e.map(([e,t])=>{let r;return r=n&&Ja[e]?.title?cc(e,Ja[e].title):cc(e),Or`<li data-spec="${e}">
1228
+ ${r} ${ru.definesFollowing}
1126
1229
  <ul>
1127
- ${t.sort((e,t)=>e.term.localeCompare(t.term)).map(Ku)}
1230
+ ${t.sort((e,t)=>e.term.localeCompare(t.term)).map(du)}
1128
1231
  </ul>
1129
1232
  </li>`})}
1130
1233
  </ul>`}()}
1131
- </section>`;e.append(n);for(const e of n.querySelectorAll(".index-term"))ki(e,"index-term");Bi("toc",Ju,{once:!0}),Bi("beforesave",Qu)}});const td="core/contrib";var nd=Object.freeze({__proto__:null,name:td,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Ni(qi`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,td)}const t=(e.editors??[]).map(e=>e.name),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await i();null!==r?function(e,t){const n=e.sort((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())});if("UL"===t.tagName)return void Or(t)`${n.map(({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`)}`;const r=n.map(e=>e.name||e.login);t.textContent=ai(r)}(r,n):n.textContent="Failed to fetch contributors.";async function i(){const{href:n}=new URL("contributors",t);try{const t=await mi(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter(t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]"))}catch(e){return Ni("Error loading contributors from GitHub.",td,{cause:e}),null}}}(t,n)}});var rd=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=>null!==e).forEach(e=>{const t=Math.min(function(e,t){const n=[];for(;e&&e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);$i(e,`h${t}`)})}});var id=Object.freeze({__proto__:null,name:"core/webidl-index",run:function(){const e=document.querySelector("section#idl-index");if(!e)return;const t=[2,3,4,5,6].map(e=>`h${e}:first-child`).join(",");if(!e.querySelector(t)){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="IDL Index",e.prepend(t)}const n=Array.from(document.querySelectorAll("pre.idl:not(.exclude) > code")).filter(e=>!e.closest(ti));if(0===n.length){const t="This specification doesn't normatively declare any Web IDL.";return void e.append(t)}const r=document.createElement("pre");r.classList.add("idl","def"),r.id="actual-idl-index",n.map(e=>{const t=document.createDocumentFragment();for(const n of e.children)t.appendChild(n.cloneNode(!0));return t}).forEach(e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)}),r.querySelectorAll("*[id]").forEach(e=>e.removeAttribute("id")),e.appendChild(r),Ci(r,document.createElement("code")),ql(r)}});function sd(e,t){const n=document.createElement("pre");n.classList.add("cddl","def","highlight"),t&&(n.id=t);const r=document.createElement("code");return e.map(e=>{const t=document.createDocumentFragment();return e.childNodes.forEach(e=>t.appendChild(e.cloneNode(!0))),t}).forEach(e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)}),r.querySelectorAll("*[id]").forEach(e=>e.removeAttribute("id")),r.querySelectorAll("dfn").forEach(e=>{const t=$i(e,"span");t.removeAttribute("data-export");for(const e of[...t.attributes])e.name.startsWith("data-dfn")&&t.removeAttribute(e.name)}),n.append(r),n}var od=Object.freeze({__proto__:null,name:"core/cddl-index",run:function(){const e=document.querySelector("section#cddl-index");if(!e)return;if(!e.querySelector(":scope > :is(h2, h3, h4, h5, h6):first-child")){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="CDDL Index",e.prepend(t)}const t=Array.from(document.querySelectorAll("pre.cddl:not(.exclude) > code")).filter(e=>!e.closest(ti));if(0===t.length){const t="This specification doesn't normatively declare any CDDL.";return void e.append(t)}const n=new Map;for(const e of t){const t=e.closest("pre"),r=t?.dataset.cddlModule||"";let i=n.get(r);i||(i=[],n.set(r,i)),i.push(e)}n.size>1||1===n.size&&!n.has("")?n.forEach((t,n)=>{const r=document.createElement("section"),i=document.createElement("h3"),s=n||"Default";i.textContent=`Module: ${s}`,n&&(i.id=`cddl-index-module-${n.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`),r.append(i),r.append(sd(t)),e.append(r)}):e.append(sd(t,"actual-cddl-index"))}});const ad=["h2","h3","h4","h5","h6"],cd="core/structure",ld=di({en:{toc:"Table of Contents",back_to_top:"Back to Top"},zh:{toc:"内容大纲",back_to_top:"返回顶部"},ko:{toc:"목차",back_to_top:"맨 위로"},ja:{toc:"目次",back_to_top:"先頭に戻る"},nl:{toc:"Inhoudsopgave",back_to_top:"Terug naar boven"},es:{toc:"Tabla de Contenidos",back_to_top:"Volver arriba"},fr:{toc:"Table des matières",back_to_top:"Retourner en haut"},de:{toc:"Inhaltsverzeichnis",back_to_top:"Zurück nach oben"},cs:{toc:"Obsah",back_to_top:"Zpět na začátek"}});function ud(e,t,{prefix:n=""}={}){let r=!1,i=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const o=Or`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(i=s,r=!0);let e=a.isIntro?"":r?dd(s-i+1):n+s;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(s+=1,a.header.prepend(Or`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=hd(a.header,n),i=ud(a.subsections,t,{prefix:e});i&&r.append(i),o.append(r)}}return o}function dd(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function pd(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(!ad.includes(r.localName))continue;const i=r.textContent;ki(e,void 0,i),n.push({element:e,header:r,title:i,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:pd(e)})}return n}function hd(e,t){const n=Or`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach(e=>{const t=$i(e,"span");t.className="formerLink",t.removeAttribute("href")}),r.querySelectorAll("dfn").forEach(e=>{$i(e,"span").removeAttribute("id")}),Or`<li class="tocline">${n}</li>`}var fd=Object.freeze({__proto__:null,name:cd,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=Math.min(function(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}(e,"section").length+1,6),n=`h${t}`;e.localName!==n&&$i(e,n)})}(),!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)){Ni("`data-max-toc` must have a value between 0-6 (inclusive).",cd,{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=ud(pd(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Or`<nav id="toc"></nav>`,n=Or`<h2 class="introductory">${ld.toc}</h2>`;ki(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 i=Or`<p role="navigation" id="back-to-top">
1132
- <a href="#title"><abbr title="${ld.back_to_top}">&uarr;</abbr></a>
1133
- </p>`;document.body.append(i)}(t)}Fi("toc",void 0)}});const md=di({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet-normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"},cs:{informative:"Tato sekce není normativní."},fr:{informative:"Cette section est non normative."}});var gd=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=>null!==e).forEach(e=>{e.after(Or`<p><em>${md.informative}</em></p>`)})}});const bd=di({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${ui(t.textContent)}`),n}}});var yd=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||(ki(n),t=n.parentElement?.id||n.id),!e.addSectionLinks)continue;const r=bd.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),i=Or`<div class="header-wrapper"></div>`;n.replaceWith(i);const s=Or`<a
1234
+ </section>`;e.append(n);for(const e of n.querySelectorAll(".index-term"))vi(e,"index-term");Hi("toc",cu,{once:!0}),Hi("beforesave",hu)}});const mu="core/contrib";var gu=Object.freeze({__proto__:null,name:mu,run:async function(e){if(!document.getElementById("gh-contributors"))return;if(!e.github){return void Ni(qi`Requested list of contributors from GitHub, but ${"[github]"} configuration option is not set.`,mu)}const t=(e.editors??[]).map(e=>e.name),n=`${e.github.apiBase}/${e.github.fullName}/`;await async function(e,t){const n=document.getElementById("gh-contributors");if(!n)return;n.textContent="Fetching list of contributors...";const r=await i();null!==r?function(e,t){const n=e.sort((e,t)=>{const n=e.name||e.login,r=t.name||t.login;return n.toLowerCase().localeCompare(r.toLowerCase())});if("UL"===t.tagName)return void Or(t)`${n.map(({name:e,login:t})=>`<li><a href="https://github.com/${t}">${e||t}</a></li>`)}`;const r=n.map(e=>e.name||e.login);t.textContent=ai(r)}(r,n):n.textContent="Failed to fetch contributors.";async function i(){const{href:n}=new URL("contributors",t);try{const t=await mi(n);if(!t.ok)throw new Error(`Request to ${n} failed with status code ${t.status}`);return(await t.json()).filter(t=>!e.includes(t.name||t.login)&&!t.login.includes("[bot]"))}catch(e){return Ni("Error loading contributors from GitHub.",mu,{cause:e}),null}}}(t,n)}});var bu=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=>null!==e).forEach(e=>{const t=Math.min(function(e,t){const n=[];for(;e&&e!=e.ownerDocument.body;)e.matches(t)&&n.push(e),e=e.parentElement;return n}(e,"section").length+1,6);$i(e,`h${t}`)})}});var yu=Object.freeze({__proto__:null,name:"core/webidl-index",run:function(){const e=document.querySelector("section#idl-index");if(!e)return;const t=[2,3,4,5,6].map(e=>`h${e}:first-child`).join(",");if(!e.querySelector(t)){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="IDL Index",e.prepend(t)}const n=Array.from(document.querySelectorAll("pre.idl:not(.exclude) > code")).filter(e=>!e.closest(ti));if(0===n.length){const t="This specification doesn't normatively declare any Web IDL.";return void e.append(t)}const r=document.createElement("pre");r.classList.add("idl","def"),r.id="actual-idl-index",n.map(e=>{const t=document.createDocumentFragment();for(const n of e.children)t.appendChild(n.cloneNode(!0));return t}).forEach(e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)}),r.querySelectorAll("*[id]").forEach(e=>e.removeAttribute("id")),e.appendChild(r),Ci(r,document.createElement("code")),ed(r)}});function wu(e,t){const n=document.createElement("pre");n.classList.add("cddl","def","highlight"),t&&(n.id=t);const r=document.createElement("code");return e.map(e=>{const t=document.createDocumentFragment();return e.childNodes.forEach(e=>t.appendChild(e.cloneNode(!0))),t}).forEach(e=>{r.lastChild&&r.append("\n\n"),r.appendChild(e)}),r.querySelectorAll("*[id]").forEach(e=>e.removeAttribute("id")),r.querySelectorAll("dfn").forEach(e=>{const t=$i(e,"span");t.removeAttribute("data-export");for(const e of[...t.attributes])e.name.startsWith("data-dfn")&&t.removeAttribute(e.name)}),n.append(r),n}var vu=Object.freeze({__proto__:null,name:"core/cddl-index",run:function(){const e=document.querySelector("section#cddl-index");if(!e)return;if(!e.querySelector(":scope > :is(h2, h3, h4, h5, h6):first-child")){const t=document.createElement("h2");e.title?(t.textContent=e.title,e.removeAttribute("title")):t.textContent="CDDL Index",e.prepend(t)}const t=Array.from(document.querySelectorAll("pre.cddl:not(.exclude) > code")).filter(e=>!e.closest(ti));if(0===t.length){const t="This specification doesn't normatively declare any CDDL.";return void e.append(t)}const n=new Map;for(const e of t){const t=e.closest("pre"),r=t?.dataset.cddlModule||"";let i=n.get(r);i||(i=[],n.set(r,i)),i.push(e)}n.size>1||1===n.size&&!n.has("")?n.forEach((t,n)=>{const r=document.createElement("section"),i=document.createElement("h3"),s=n||"Default";i.textContent=`Module: ${s}`,n&&(i.id=`cddl-index-module-${n.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`),r.append(i),r.append(wu(t)),e.append(r)}):e.append(wu(t,"actual-cddl-index"))}});const ku=["h2","h3","h4","h5","h6"],$u="core/structure",xu=ui({en:{toc:"Table of Contents",back_to_top:"Back to Top"},zh:{toc:"内容大纲",back_to_top:"返回顶部"},ko:{toc:"목차",back_to_top:"맨 위로"},ja:{toc:"目次",back_to_top:"先頭に戻る"},nl:{toc:"Inhoudsopgave",back_to_top:"Terug naar boven"},es:{toc:"Tabla de Contenidos",back_to_top:"Volver arriba"},fr:{toc:"Table des matières",back_to_top:"Retourner en haut"},de:{toc:"Inhaltsverzeichnis",back_to_top:"Zurück nach oben"},cs:{toc:"Obsah",back_to_top:"Zpět na začátek"}});function Cu(e,t,{prefix:n=""}={}){let r=!1,i=0,s=1;if(n.length&&!n.endsWith(".")&&(n+="."),0===e.length)return null;const o=Or`<ol class="toc"></ol>`;for(const a of e){!a.isAppendix||n||r||(i=s,r=!0);let e=a.isIntro?"":r?Su(s-i+1):n+s;const c=e.split(".").length;if(1===c&&(e+=".",a.header.before(document.createComment("OddPage"))),a.isIntro||(s+=1,a.header.prepend(Or`<bdi class="secno">${e} </bdi>`)),c<=t){const n=a.header.id||a.element.id,r=Tu(a.header,n),i=Cu(a.subsections,t,{prefix:e});i&&r.append(i),o.append(r)}}return o}function Su(e){let t="";for(;e>0;)e-=1,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t}function _u(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(!ku.includes(r.localName))continue;const i=r.textContent;vi(e,void 0,i),n.push({element:e,header:r,title:i,isIntro:Boolean(e.closest(".introductory")),isAppendix:e.classList.contains("appendix"),subsections:_u(e)})}return n}function Tu(e,t){const n=Or`<a href="${`#${t}`}" class="tocxref" />`;var r;return n.append(...e.cloneNode(!0).childNodes),(r=n).querySelectorAll("a").forEach(e=>{const t=$i(e,"span");t.className="formerLink",t.removeAttribute("href")}),r.querySelectorAll("dfn").forEach(e=>{$i(e,"span").removeAttribute("id")}),Or`<li class="tocline">${n}</li>`}var Ru=Object.freeze({__proto__:null,name:$u,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=Math.min(function(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}(e,"section").length+1,6),n=`h${t}`;e.localName!==n&&$i(e,n)})}(),!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)){Ni("`data-max-toc` must have a value between 0-6 (inclusive).",$u,{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=Cu(_u(document.body),e.maxTocLevel);t&&function(e){if(!e)return;const t=Or`<nav id="toc"></nav>`,n=Or`<h2 class="introductory">${xu.toc}</h2>`;vi(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 i=Or`<p role="navigation" id="back-to-top">
1235
+ <a href="#title"><abbr title="${xu.back_to_top}">&uarr;</abbr></a>
1236
+ </p>`;document.body.append(i)}(t)}Fi("toc",void 0)}});const Eu=ui({en:{informative:"This section is non-normative."},nl:{informative:"Dit onderdeel is niet-normatief."},ko:{informative:"이 부분은 비규범적입니다."},ja:{informative:"この節は仕様には含まれません."},de:{informative:"Dieser Abschnitt ist nicht normativ."},zh:{informative:"本章节不包含规范性内容。"},cs:{informative:"Tato sekce není normativní."},fr:{informative:"Cette section est non normative."}});var Au=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=>null!==e).forEach(e=>{e.after(Or`<p><em>${Eu.informative}</em></p>`)})}});const Lu=ui({en:{permalinkLabel(e,t){let n=`Permalink for${t?"":" this"} ${e}`;return t&&(n+=` ${di(t.textContent)}`),n}}});var Pu=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||(vi(n),t=n.parentElement?.id||n.id),!e.addSectionLinks)continue;const r=Lu.permalinkLabel(n.closest(".appendix")?"Appendix":"Section",n.querySelector(":scope > bdi.secno")),i=Or`<div class="header-wrapper"></div>`;n.replaceWith(i);const s=Or`<a
1134
1237
  href="#${t}"
1135
1238
  class="self-link"
1136
1239
  aria-label="${r}"
1137
- ></a>`;i.append(n,s)}}});var wd=String.raw`.caniuse-stats{display:flex;column-gap:2em}
1240
+ ></a>`;i.append(n,s)}}});var Nu=String.raw`.caniuse-stats{display:flex;column-gap:2em}
1138
1241
  .caniuse-group{display:flex;flex:1;flex-direction:column;justify-content:flex-end;flex-basis:auto}
1139
1242
  .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}
1140
1243
  .caniuse-type{align-self:center;border-top:none;text-transform:capitalize;font-size:.8em;margin-top:-.8em;font-weight:700}
@@ -1152,12 +1255,12 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
1152
1255
  .caniuse-cell.y::before{content:"✔️";padding:.5em}
1153
1256
  .caniuse-cell.n::before{content:"❌";padding:.5em}
1154
1257
  .caniuse-cell:is(.a,.d,.p,.x,.u)::before{content:"⚠️";padding:.5em}
1155
- }`;const kd="core/caniuse",vd="https://respec.org/caniuse/",$d=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"}]]),xd=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 Cd=Object.freeze({__proto__:null,BROWSERS:$d,name:kd,prepare:function(e){if(!e.caniuse)return;!function(e){const t=new Set($d.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=>!$d.has(e));if(n.length){Ii(qi`Invalid browser(s): (${zi(n,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,kd)}}(e);const t=e.caniuse;t.feature&&ds(wd,{id:"caniuse-stylesheet",className:t.removeOnSave?"removeOnSave":""})},run:async function(e){const t=e.caniuse;if(!t?.feature)return;const n=new URL(t.feature,"https://caniuse.com/").href,r=document.querySelector(".head dl"),i=async function(e){const{feature:t,browsers:n,apiURL:r}=e,i=new URL(r||`./${t}`,vd);n.forEach(e=>i.searchParams.append("browsers",e));const s=await fetch(i);if(!s.ok){const{status:e,statusText:t}=s;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return s.json()}(e.caniuse).then(e=>async function(e,{feature:t}){const n=e.result,r=new Map([["desktop",[]],["mobile",[]]]),i=function(e){return(t,{browser:n,version:r,caniuse:i})=>{const s=$d.get(n),{name:o,type:a}=s??{name:n,type:"desktop"},c=xd.get(i),l=r||"—",u=r?` version ${r}`:" (version unknown)",d=`${e} is ${c} since ${o}${u} on ${a}.`,p=`caniuse-cell ${i}`,h=(f=`${c} since ${o}${u}.`).charAt(0).toUpperCase()+f.slice(1);var f;const m=function(e){const t=$d.get(e)?.path??e;return`https://www.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),g=Or`
1258
+ }`;const Iu="core/caniuse",Ou="https://respec.org/caniuse/",Du=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"}]]),ju=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 zu=Object.freeze({__proto__:null,BROWSERS:Du,name:Iu,prepare:function(e){if(!e.caniuse)return;!function(e){const t=new Set(Du.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=>!Du.has(e));if(n.length){Ii(qi`Invalid browser(s): (${zi(n,{quotes:!0})}) in the \`browser\` property of ${"[caniuse]"}.`,Iu)}}(e);const t=e.caniuse;t.feature&&us(Nu,{id:"caniuse-stylesheet",className:t.removeOnSave?"removeOnSave":""})},run:async function(e){const t=e.caniuse;if(!t?.feature)return;const n=new URL(t.feature,"https://caniuse.com/").href,r=document.querySelector(".head dl"),i=async function(e){const{feature:t,browsers:n,apiURL:r}=e,i=new URL(r||`./${t}`,Ou);n.forEach(e=>i.searchParams.append("browsers",e));const s=await fetch(i);if(!s.ok){const{status:e,statusText:t}=s;throw new Error(`Failed to get caniuse data: (${e}) ${t}`)}return s.json()}(e.caniuse).then(e=>async function(e,{feature:t}){const n=e.result,r=new Map([["desktop",[]],["mobile",[]]]),i=function(e){return(t,{browser:n,version:r,caniuse:i})=>{const s=Du.get(n),{name:o,type:a}=s??{name:n,type:"desktop"},c=ju.get(i),l=r||"—",d=r?` version ${r}`:" (version unknown)",u=`${e} is ${c} since ${o}${d} on ${a}.`,p=`caniuse-cell ${i}`,h=(f=`${c} since ${o}${d}.`).charAt(0).toUpperCase()+f.slice(1);var f;const m=function(e){const t=Du.get(e)?.path??e;return`https://www.w3.org/assets/logos/browser-logos/${t}/${t}.svg`}(n),g=Or`
1156
1259
  <div
1157
1260
  class="${p}"
1158
1261
  role="img"
1159
1262
  title="${h}"
1160
- aria-label="${d}"
1263
+ aria-label="${u}"
1161
1264
  >
1162
1265
  <img
1163
1266
  class="caniuse-browser"
@@ -1172,11 +1275,11 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
1172
1275
  <div class="caniuse-type"><span>${e}</div>
1173
1276
  </div>`);return s.push(Or`<a class="caniuse-cell" href="https://caniuse.com/${t}"
1174
1277
  >More info</a
1175
- >`),s}(e,t)).catch(e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,i=qi`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return Ni(r,kd,{hint:i,cause:e}),Or`<a href="${n}">caniuse.com</a>`}(e,t,n)),s=Or`<dt class="caniuse-title">Browser support:</dt>
1278
+ >`),s}(e,t)).catch(e=>function(e,t,n){const r=`Failed to retrieve feature "${t.feature}".`,i=qi`Please check the feature key on [caniuse.com](https://caniuse.com) and update ${"[caniuse]"}.`;return Ni(r,Iu,{hint:i,cause:e}),Or`<a href="${n}">caniuse.com</a>`}(e,t,n)),s=Or`<dt class="caniuse-title">Browser support:</dt>
1176
1279
  <dd class="caniuse-stats">
1177
1280
  ${{any:i,placeholder:"Fetching data from caniuse.com..."}}
1178
- </dd>`;r?.append(...s.childNodes),await i,Fi("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(r?.querySelectorAll(".caniuse-browser").forEach(e=>e.classList.add("removeOnSave")),Bi("beforesave",e=>{const t=e.querySelector(".caniuse-stats");if(!t){return void Ii("Couldn't add the caniuse.com link to the saved document.",kd,{hint:"The support table is appended to the document header's definition list (`.head dl`), so it was never inserted if that list is absent. The browser support cells are removed on save, so the exported document will have no caniuse.com attribution."})}Or.bind(t)`
1179
- <a href="${n}">caniuse.com</a>`}))}});var Sd=String.raw`.baseline-title{display:flex;align-items:center;gap:.4em}
1281
+ </dd>`;r?.append(...s.childNodes),await i,Fi("amend-user-config",{caniuse:t.feature}),t.removeOnSave&&(r?.querySelectorAll(".caniuse-browser").forEach(e=>e.classList.add("removeOnSave")),Hi("beforesave",e=>{const t=e.querySelector(".caniuse-stats");if(!t){return void Ii("Couldn't add the caniuse.com link to the saved document.",Iu,{hint:"The support table is appended to the document header's definition list (`.head dl`), so it was never inserted if that list is absent. The browser support cells are removed on save, so the exported document will have no caniuse.com attribution."})}Or.bind(t)`
1282
+ <a href="${n}">caniuse.com</a>`}))}});var Mu=String.raw`.baseline-title{display:flex;align-items:center;gap:.4em}
1180
1283
  .baseline-icon{width:auto;height:.9em;vertical-align:baseline}
1181
1284
  .baseline-status{display:flex;align-items:center;gap:1em}
1182
1285
  .baseline-browsers{display:flex;gap:.5em;align-items:center}
@@ -1198,7 +1301,7 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
1198
1301
  @media print{
1199
1302
  .baseline-pill{background:0 0!important;border:1px solid #ccc}
1200
1303
  .baseline-support-icon{color:#333!important}
1201
- }`;const _d="core/implementation-status",Td="https://respec.org/api/baseline",Rd="https://respec.org/api/baseline/search",Ed="https://www.w3.org/assets/logos/browser-logos",Ad=new Map([["chrome",{name:"Chrome",engine:"chromium"}],["edge",{name:"Edge",engine:"chromium"}],["firefox",{name:"Firefox",engine:"gecko"}],["safari",{name:"Safari",engine:"webkit"}]]),Ld=new Map([["high","Widely available"],["low","Newly available"],["","Limited availability"]]),Pd=new Map([["",()=>Or`<svg class="baseline-icon" viewBox="0 0 36 20">
1304
+ }`;const qu="core/implementation-status",Uu="https://respec.org/api/baseline",Wu="https://respec.org/api/baseline/search",Fu="https://www.w3.org/assets/logos/browser-logos",Hu=new Map([["chrome",{name:"Chrome",engine:"chromium"}],["edge",{name:"Edge",engine:"chromium"}],["firefox",{name:"Firefox",engine:"gecko"}],["safari",{name:"Safari",engine:"webkit"}]]),Bu=new Map([["high","Widely available"],["low","Newly available"],["","Limited availability"]]),Gu=new Map([["",()=>Or`<svg class="baseline-icon" viewBox="0 0 36 20">
1202
1305
  <path fill="#f09409" d="M10 0L16 6L14 8L8 2L10 0Z" />
1203
1306
  <path fill="#f09409" d="M22 12L20 14L26 20L28 18L22 12Z" />
1204
1307
  <path fill="#f09409" d="M26 0L28 2L10 20L8 18L26 0Z" />
@@ -1218,7 +1321,7 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
1218
1321
  d="m10 0 2 2-2 2-2-2 2-2Zm4 4 2 2-2 2-2-2 2-2Zm16 0 2 2-2 2-2-2 2-2Zm4 4 2 2-2 2-2-2 2-2Zm-4 4 2 2-2 2-2-2 2-2Zm-4 4 2 2-2 2-2-2 2-2Zm-4-4 2 2-2 2-2-2 2-2ZM6 4l2 2-2 2-2-2 2-2Z"
1219
1322
  />
1220
1323
  <path fill="#1b6ef3" d="m26 0 2 2-18 18L0 10l2-2 8 8L26 0Z" />
1221
- </svg>`]]),Nd=()=>Or`<svg
1324
+ </svg>`]]),Vu=()=>Or`<svg
1222
1325
  class="baseline-support-icon"
1223
1326
  xmlns="http://www.w3.org/2000/svg"
1224
1327
  width="17"
@@ -1234,7 +1337,7 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
1234
1337
  fill="currentColor"
1235
1338
  d="M11.348 8.125 6.34 13.056l-3.006-2.954 1.002-.985 1.999 1.965 4.012-3.942 1.002.985Z"
1236
1339
  />
1237
- </svg>`,Id=()=>Or`<svg
1340
+ </svg>`,Ju=()=>Or`<svg
1238
1341
  class="baseline-support-icon"
1239
1342
  xmlns="http://www.w3.org/2000/svg"
1240
1343
  width="17"
@@ -1250,7 +1353,7 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
1250
1353
  fill="currentColor"
1251
1354
  d="m10.321 8.126-1.987 1.972 1.987 1.972-.993.986-1.987-1.972-1.987 1.972-.993-.986 1.986-1.972-1.986-1.972.993-.986 1.987 1.972L9.328 7.14l.993.986Z"
1252
1355
  />
1253
- </svg>`,Od=Map.groupBy(Ad.keys(),e=>Ad.get(e).engine);function Dd(){return{dt:Or`Implementation status:`,dd:Or`<a href="https://webstatus.dev/">Web Platform Status</a>`,moreInfoUrl:"https://webstatus.dev/"}}function jd(e){const t=qi`Check the ${"[implementationStatus]"} configuration.`;return Ii("Failed to retrieve implementation status data.",_d,{hint:t,cause:e instanceof Error?e:void 0}),Dd()}async function zd(e){const t=e.apiURL||Td,n=await mi(t);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);return n.json()}function Md(e){return!e.kind||"feature"===e.kind}function qd(e,t,n){const r=e.features||e;if(n.feature){const e=r[n.feature];return e&&Md(e)?[{id:n.feature,...e}]:[]}const i=Ud(t);return i.length?Object.entries(r).filter(([,e])=>{if(!Md(e))return!1;return[e.spec].flat().filter(Boolean).some(e=>{const t=Wd(e);return i.some(e=>t.startsWith(e))})}).map(([e,t])=>({id:e,...t})):[]}function Ud(e){const t=new Set;return e.edDraftURI&&t.add(Wd(e.edDraftURI)),e.shortName&&(t.add(Wd(`https://www.w3.org/TR/${e.shortName}/`)),t.add(Wd(`https://w3c.github.io/${e.shortName}/`))),e.thisVersion&&t.add(Wd(e.thisVersion)),[...t]}function Wd(e){try{const t=new URL(e);return t.hash="",t.pathname.endsWith("/")||t.pathname.includes(".")||(t.pathname+="/"),t.href}catch{return e}}var Fd=Object.freeze({__proto__:null,name:_d,prepare:function(e){if(!e.implementationStatus)return;!function(e){const t={removeOnSave:!1};if("boolean"==typeof e.implementationStatus)return void(e.implementationStatus={feature:null,...t});if("string"==typeof e.implementationStatus)return void(e.implementationStatus={feature:e.implementationStatus,...t});e.implementationStatus={...t,...e.implementationStatus}}(e);const t=e.implementationStatus;ds(Sd,{id:"baseline-stylesheet",className:t.removeOnSave?"removeOnSave":""})},run:async function(e){if(!e.implementationStatus)return;const t=e.implementationStatus,n=document.querySelector(".head dl");if(!n)return;const r=async function(e,t){const n=await async function(e,t){if(t.apiURL){return qd(await zd(t),e,t)}if(t.feature){const e=`${Td}/${encodeURIComponent(t.feature)}`,n=await mi(e);if(!n.ok){if(404===n.status)return[];throw new Error(`Failed to fetch Baseline data for feature "${t.feature}": HTTP ${n.status}`)}const r=await n.json();return r.split_into?.length?r.split_into.filter(Md):[{id:t.feature,...r}]}const n=Ud(e);if(!n.length)return[];try{const e=await fetch(Rd,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({specs:n})});if(!e.ok)throw new Error(`HTTP ${e.status}`);const{result:t}=await e.json();return t||[]}catch(n){console.warn(`[${_d}] Search endpoint failed, falling back to full dataset`,n);return qd(await zd(t),e,t)}}(e,t);if(!n.length){const e=t.feature?`No Baseline data found for feature "${t.feature}".`:"No Baseline data found for this specification.",n=t.feature?"Find feature IDs in [web-features data](https://github.com/web-platform-dx/web-features/blob/main/data.json).":void 0;return Ii(e,_d,{hint:n}),Dd()}const r=function(e){const t=e.map(e=>e.status?.baseline);return t.every(e=>"high"===e)?"high":t.every(e=>"low"===e||"high"===e)?"low":""}(n),i=Ld.get(r),s=function(e){const t=new Map;for(const n of Ad.keys()){const r=e.every(e=>null!=e.status?.support?.[n]);t.set(n,r)}return t}(n);return Fi("amend-user-config",{implementationStatus:t.feature||!0}),function(e,t,n,r){const i=(Pd.get(e)??Pd.get("")??(()=>Or`<span></span>`))();i.setAttribute("aria-hidden","true");const s=[...Od.values()].map(e=>{const t=e.map(e=>{const t=Ad.get(e)?.name||e,r=n.get(e),i=r?`${t}: Supported`:`${t}: Not supported`,s=r?Nd():Id();return Or`<span
1356
+ </svg>`,Zu=Map.groupBy(Hu.keys(),e=>Hu.get(e).engine);function Ku(){return{dt:Or`Implementation status:`,dd:Or`<a href="https://webstatus.dev/">Web Platform Status</a>`,moreInfoUrl:"https://webstatus.dev/"}}function Yu(e){const t=qi`Check the ${"[implementationStatus]"} configuration.`;return Ii("Failed to retrieve implementation status data.",qu,{hint:t,cause:e instanceof Error?e:void 0}),Ku()}async function Xu(e){const t=e.apiURL||Uu,n=await mi(t);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);return n.json()}function Qu(e){return!e.kind||"feature"===e.kind}function ep(e,t,n){const r=e.features||e;if(n.feature){const e=r[n.feature];return e&&Qu(e)?[{id:n.feature,...e}]:[]}const i=tp(t);return i.length?Object.entries(r).filter(([,e])=>{if(!Qu(e))return!1;return[e.spec].flat().filter(Boolean).some(e=>{const t=np(e);return i.some(e=>t.startsWith(e))})}).map(([e,t])=>({id:e,...t})):[]}function tp(e){const t=new Set;return e.edDraftURI&&t.add(np(e.edDraftURI)),e.shortName&&(t.add(np(`https://www.w3.org/TR/${e.shortName}/`)),t.add(np(`https://w3c.github.io/${e.shortName}/`))),e.thisVersion&&t.add(np(e.thisVersion)),[...t]}function np(e){try{const t=new URL(e);return t.hash="",t.pathname.endsWith("/")||t.pathname.includes(".")||(t.pathname+="/"),t.href}catch{return e}}var rp=Object.freeze({__proto__:null,name:qu,prepare:function(e){if(!e.implementationStatus)return;!function(e){const t={removeOnSave:!1};if("boolean"==typeof e.implementationStatus)return void(e.implementationStatus={feature:null,...t});if("string"==typeof e.implementationStatus)return void(e.implementationStatus={feature:e.implementationStatus,...t});e.implementationStatus={...t,...e.implementationStatus}}(e);const t=e.implementationStatus;us(Mu,{id:"baseline-stylesheet",className:t.removeOnSave?"removeOnSave":""})},run:async function(e){if(!e.implementationStatus)return;const t=e.implementationStatus,n=document.querySelector(".head dl");if(!n)return;const r=async function(e,t){const n=await async function(e,t){if(t.apiURL){return ep(await Xu(t),e,t)}if(t.feature){const e=`${Uu}/${encodeURIComponent(t.feature)}`,n=await mi(e);if(!n.ok){if(404===n.status)return[];throw new Error(`Failed to fetch Baseline data for feature "${t.feature}": HTTP ${n.status}`)}const r=await n.json();return r.split_into?.length?r.split_into.filter(Qu):[{id:t.feature,...r}]}const n=tp(e);if(!n.length)return[];try{const e=await fetch(Wu,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({specs:n})});if(!e.ok)throw new Error(`HTTP ${e.status}`);const{result:t}=await e.json();return t||[]}catch(n){console.warn(`[${qu}] Search endpoint failed, falling back to full dataset`,n);return ep(await Xu(t),e,t)}}(e,t);if(!n.length){const e=t.feature?`No Baseline data found for feature "${t.feature}".`:"No Baseline data found for this specification.",n=t.feature?"Find feature IDs in [web-features data](https://github.com/web-platform-dx/web-features/blob/main/data.json).":void 0;return Ii(e,qu,{hint:n}),Ku()}const r=function(e){const t=e.map(e=>e.status?.baseline);return t.every(e=>"high"===e)?"high":t.every(e=>"low"===e||"high"===e)?"low":""}(n),i=Bu.get(r),s=function(e){const t=new Map;for(const n of Hu.keys()){const r=e.every(e=>null!=e.status?.support?.[n]);t.set(n,r)}return t}(n);return Fi("amend-user-config",{implementationStatus:t.feature||!0}),function(e,t,n,r){const i=(Gu.get(e)??Gu.get("")??(()=>Or`<span></span>`))();i.setAttribute("aria-hidden","true");const s=[...Zu.values()].map(e=>{const t=e.map(e=>{const t=Hu.get(e)?.name||e,r=n.get(e),i=r?`${t}: Supported`:`${t}: Not supported`,s=r?Vu():Ju();return Or`<span
1254
1357
  class="baseline-browser ${r?"support-available":"support-unavailable"}"
1255
1358
  role="img"
1256
1359
  title="${i}"
@@ -1260,21 +1363,21 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
1260
1363
  class="baseline-browser-logo"
1261
1364
  width="24"
1262
1365
  height="24"
1263
- src="${function(e){return`${Ed}/${e}/${e}.svg`}(e)}"
1366
+ src="${function(e){return`${Fu}/${e}/${e}.svg`}(e)}"
1264
1367
  alt=""
1265
1368
  />${s}
1266
- </span>`}),r=e.every(e=>n.get(e));return Or`<span class="${r?"baseline-pill supported":"baseline-pill unsupported"}">${t}</span>`}),o=Or`<span class="baseline-browsers">${s}</span>`,a=1===r.length?r[0]:null,c=a?`https://webstatus.dev/features/${encodeURIComponent(a.id)}`:"https://webstatus.dev/",l=a?.name?`More info about ${a.name} support`:"More info about browser support",u=Or`${t}:${i}`,d=Or`${o}
1369
+ </span>`}),r=e.every(e=>n.get(e));return Or`<span class="${r?"baseline-pill supported":"baseline-pill unsupported"}">${t}</span>`}),o=Or`<span class="baseline-browsers">${s}</span>`,a=1===r.length?r[0]:null,c=a?`https://webstatus.dev/features/${encodeURIComponent(a.id)}`:"https://webstatus.dev/",l=a?.name?`More info about ${a.name} support`:"More info about browser support",d=Or`${t}:${i}`,u=Or`${o}
1267
1370
  <a
1268
1371
  class="baseline-more-info"
1269
1372
  href="${c}"
1270
1373
  aria-label="${l}"
1271
1374
  >More info</a
1272
- >`;return{dt:u,dd:d,moreInfoUrl:c}}(r,i,s,n)}(e,t).catch(jd),i=r.then(e=>e.dt),s=r.then(e=>e.dd),o=Or`<dt class="baseline-title">
1375
+ >`;return{dt:d,dd:u,moreInfoUrl:c}}(r,i,s,n)}(e,t).catch(Yu),i=r.then(e=>e.dt),s=r.then(e=>e.dd),o=Or`<dt class="baseline-title">
1273
1376
  ${{any:i,placeholder:"Implementation status:"}}
1274
1377
  </dt>
1275
1378
  <dd class="baseline-status">
1276
1379
  ${{any:s,placeholder:"Checking availability..."}}
1277
- </dd>`;n.append(...o.childNodes);const a=await r;if(t.removeOnSave){const e=a.moreInfoUrl||"https://webstatus.dev/";Bi("beforesave",t=>{const n=t.querySelector(".baseline-status");n&&Or.bind(n)`<a href="${e}">Web Platform Status</a>`})}}});var Bd=String.raw`.mdn{font-size:.75em;position:absolute;right:.3em;min-width:0;margin-top:3rem}
1380
+ </dd>`;n.append(...o.childNodes);const a=await r;if(t.removeOnSave){const e=a.moreInfoUrl||"https://webstatus.dev/";Hi("beforesave",t=>{const n=t.querySelector(".baseline-status");n&&Or.bind(n)`<a href="${e}">Web Platform Status</a>`})}}});var ip=String.raw`.mdn{font-size:.75em;position:absolute;right:.3em;min-width:0;margin-top:3rem}
1278
1381
  .mdn details{width:100%;margin:1px 0;position:relative;z-index:10;box-sizing:border-box;padding:.4em;padding-top:0}
1279
1382
  .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}
1280
1383
  .mdn summary{text-align:right;cursor:default;margin-right:-.4em}
@@ -1297,33 +1400,33 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
1297
1400
  .mdn .safari::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/safari/safari.svg)}
1298
1401
  .mdn .safari_ios::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/safari-ios/safari-ios.svg)}
1299
1402
  .mdn .samsunginternet_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg)}
1300
- .mdn .webview_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/android-webview/android-webview.png)}`;const Hd="core/mdn-annotation",Gd="https://speced.github.io/mdn-spec-links/",Vd={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"},Jd=di({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"所有主要引擎均支持此特性。",inSomeEngines:"此功能支持有限。"},cs:{inAllEngines:"Tato funkce je podporována ve všech hlavních prohlížečích.",inSomeEngines:"Tato funkce má omezenou podporu."}});function Zd(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=Or`<aside class="mdn"></aside>`;return t.before(r),r}function Kd(e){const{name:t,slug:n,summary:r,support:i,engines:s}=e,o=n.slice(n.indexOf("/")+1),a=`https://developer.mozilla.org/en-US/docs/Web/${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return Or`<span role="img" aria-label="${Jd.inAllEngines}">✅</span>`;if(e.length<2)return Or`<span role="img" aria-label="${Jd.inSomeEngines}">🚫</span>`;return Or`<span aria-hidden="true">&emsp;</span>`}(s);return Or`<details>
1403
+ .mdn .webview_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/android-webview/android-webview.png)}`;const sp="core/mdn-annotation",op="https://speced.github.io/mdn-spec-links/",ap={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"},cp=ui({en:{inAllEngines:"This feature is in all major engines.",inSomeEngines:"This feature has limited support."},zh:{inAllEngines:"所有主要引擎均支持此特性。",inSomeEngines:"此功能支持有限。"},cs:{inAllEngines:"Tato funkce je podporována ve všech hlavních prohlížečích.",inSomeEngines:"Tato funkce má omezenou podporu."}});function lp(e){const t=e.closest("section");if(!t)return;const{previousElementSibling:n}=t;if(n&&n.classList.contains("mdn"))return n;const r=Or`<aside class="mdn"></aside>`;return t.before(r),r}function dp(e){const{name:t,slug:n,summary:r,support:i,engines:s}=e,o=n.slice(n.indexOf("/")+1),a=`https://developer.mozilla.org/en-US/docs/Web/${n}`,c=`Expand MDN details for ${t}`,l=function(e){if(3===e.length)return Or`<span role="img" aria-label="${cp.inAllEngines}">✅</span>`;if(e.length<2)return Or`<span role="img" aria-label="${cp.inSomeEngines}">🚫</span>`;return Or`<span aria-hidden="true">&emsp;</span>`}(s);return Or`<details>
1301
1404
  <summary aria-label="${c}"><span>MDN</span>${l}</summary>
1302
1405
  <a title="${r}" href="${a}">${o}</a>
1303
- ${function(e){if(3===e.length)return Or`<p class="engines-all">${Jd.inAllEngines}</p>`;if(e.length<2)return Or`<p class="engines-some">${Jd.inSomeEngines}</p>`}(s)}
1406
+ ${function(e){if(3===e.length)return Or`<p class="engines-all">${cp.inAllEngines}</p>`;if(e.length<2)return Or`<p class="engines-some">${cp.inSomeEngines}</p>`}(s)}
1304
1407
  ${i?function(e){function t(e,t,n){const r="Unknown"===t?"?":t,i=`${e} ${t.toLowerCase()}`;return Or`<tr class="${i}">
1305
- <td>${Vd[e]}</td>
1408
+ <td>${ap[e]}</td>
1306
1409
  <td>${n||r}</td>
1307
- </tr>`}function n(e,n){if(n.version_removed)return t(e,"No","");const r=n.version_added;return"boolean"==typeof r?t(e,r?"Yes":"No",""):r?t(e,"Yes",`${r}+`):t(e,"Unknown","")}const r=Object.keys(Vd);return Or`<table>
1410
+ </tr>`}function n(e,n){if(n.version_removed)return t(e,"No","");const r=n.version_added;return"boolean"==typeof r?t(e,r?"Yes":"No",""):r?t(e,"Yes",`${r}+`):t(e,"Unknown","")}const r=Object.keys(ap);return Or`<table>
1308
1411
  ${r.map(r=>e[r]?n(r,e[r]):t(r,"Unknown",""))}
1309
1412
  </table>`}(i):Or`<p class="nosupportdata">No support data.</p>`}
1310
- </details>`}var Yd=Object.freeze({__proto__:null,name:Hd,run:async function(e){const t=function(e){const{shortName:t,mdn:n}=e;if(!n)return;return!0===n?t:"string"==typeof n?n:n.key||t}(e);if(!t)return;const n="object"==typeof e.mdn?e.mdn:{},r=await async function(e,t){const{baseJsonPath:n=Gd,maxAge:r=864e5}=t,i=new URL(`${e}.json`,n).href,s=await mi(i,r);return 404===s.status?null:await s.json()}(t,n);if(!r){const n=`Could not find MDN data associated with key "${t}".`,r=!0===e.mdn?qi`When using \`mdn: true\`, the key defaults to ${"[shortName]"} ("${t}"). Check that your shortName matches an entry in the [MDN spec links map](https://github.com/speced/mdn-spec-links/blob/main/SPECMAP.json), or set ${"[mdn]"} to the correct key.`:qi`Search for your spec's URL in the [MDN spec links map](https://github.com/speced/mdn-spec-links/blob/main/SPECMAP.json) to find the correct key, then set ${"[mdn]"} to it.`;return void Ni(n,Hd,{hint:r})}ds(Bd);for(const e of function(e){return[...document.body.querySelectorAll("[id]:not(script)")].filter(({id:t})=>Array.isArray(e[t]))}(r)){const t=r[e.id],n=Zd(e);if(n)for(const e of t)n.append(Kd(e))}}});const Xd="ui/save-html",Qd=di({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),ep=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Vi(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Vi(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];var tp=Object.freeze({__proto__:null,exportDocument:function(e,t){return Ii("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",Xd,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Vi(t)},name:Xd,run:function(e){const t={async show(t){await document.respec.ready;const n=Or`<div class="respec-save-buttons">
1311
- ${ep.map(t=>function(e,t){const{id:n,href:r,ext:i,title:s,type:o}=e,a=hi(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return Or`<a
1413
+ </details>`}var up=Object.freeze({__proto__:null,name:sp,run:async function(e){const t=function(e){const{shortName:t,mdn:n}=e;if(!n)return;return!0===n?t:"string"==typeof n?n:n.key||t}(e);if(!t)return;const n="object"==typeof e.mdn?e.mdn:{},r=await async function(e,t){const{baseJsonPath:n=op,maxAge:r=864e5}=t,i=new URL(`${e}.json`,n).href,s=await mi(i,r);return 404===s.status?null:await s.json()}(t,n);if(!r){const n=`Could not find MDN data associated with key "${t}".`,r=!0===e.mdn?qi`When using \`mdn: true\`, the key defaults to ${"[shortName]"} ("${t}"). Check that your shortName matches an entry in the [MDN spec links map](https://github.com/speced/mdn-spec-links/blob/main/SPECMAP.json), or set ${"[mdn]"} to the correct key.`:qi`Search for your spec's URL in the [MDN spec links map](https://github.com/speced/mdn-spec-links/blob/main/SPECMAP.json) to find the correct key, then set ${"[mdn]"} to it.`;return void Ni(n,sp,{hint:r})}us(ip);for(const e of function(e){return[...document.body.querySelectorAll("[id]:not(script)")].filter(({id:t})=>Array.isArray(e[t]))}(r)){const t=r[e.id],n=lp(e);if(n)for(const e of t)n.append(dp(e))}}});const pp="ui/save-html",hp=ui({en:{save_snapshot:"Export"},nl:{save_snapshot:"Bewaar Snapshot"},ja:{save_snapshot:"保存する"},de:{save_snapshot:"Exportieren"},zh:{save_snapshot:"导出"}}),fp=[{id:"respec-save-as-html",ext:"html",title:"HTML",type:"text/html",get href(){return Vi(this.type)}},{id:"respec-save-as-xml",ext:"xhtml",title:"XML",type:"application/xml",get href(){return Vi(this.type)}},{id:"respec-save-as-epub",ext:"epub",title:"EPUB 3",type:"application/epub+zip",get href(){const e=new URL("https://labs.w3.org/r2epub/");return e.searchParams.append("respec","true"),e.searchParams.append("url",document.location.href),e.href}}];var mp=Object.freeze({__proto__:null,exportDocument:function(e,t){return Ii("Exporting via ui/save-html module's `exportDocument()` is deprecated and will be removed.",pp,{hint:"Use core/exporter `rsDocToDataURL()` instead."}),Vi(t)},name:pp,run:function(e){const t={async show(t){await document.respec.ready;const n=Or`<div class="respec-save-buttons">
1414
+ ${fp.map(t=>function(e,t){const{id:n,href:r,ext:i,title:s,type:o}=e,a=hi(t.publishDate||new Date),c=[t.specStatus,t.shortName||"spec",a].join("-");return Or`<a
1312
1415
  href="${r}"
1313
1416
  id="${n}"
1314
1417
  download="${c}.${i}"
1315
1418
  type="${o}"
1316
1419
  class="respec-save-button"
1317
- onclick=${()=>Os.closeModal()}
1420
+ onclick=${()=>js.closeModal()}
1318
1421
  >${s}</a
1319
1422
  >`}(t,e))}
1320
- </div>`;Os.freshModal(Qd.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=Os.addCommand(Qd.save_snapshot,function(){if(!n)return;t.show(r)},"Ctrl+Shift+Alt+S","💾"))}});const np="https://respec.org/specref/",rp=di({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"},cs:{search_specref:"Hledat ve Specref"}}),ip=Os.addCommand(rp.search_specref,function(){const e=Or`
1321
- <iframe class="respec-iframe" src="${np}" onload=${e=>e.target.classList.add("ready")}></iframe>
1322
- <a href="${np}" target="_blank">Open Search UI in a new tab</a>
1323
- `;Os.freshModal(rp.search_specref,e,ip)},"Ctrl+Shift+Alt+space","🔎");var sp=Object.freeze({__proto__:null});const op="https://respec.org/xref/",ap=di({en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"},cs:{title:"Hledat definice"}}),cp=Os.addCommand(ap.title,function(){const e=Or`
1324
- <iframe class="respec-iframe" src="${op}" onload="${e=>e.target.classList.add("ready")}"></iframe>
1325
- <a href="${op}" target="_blank">Open Search UI in a new tab</a>
1326
- `;Os.freshModal(ap.title,e,cp)},"Ctrl+Shift+Alt+x","📚");var lp=Object.freeze({__proto__:null});const up=di({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"},cs:{about_respec:"O aplikaci"}});window.respecVersion=window.respecVersion||"Developer Edition";const dp=document.createElement("div"),pp=Or.bind(dp),hp=Os.addCommand(`${up.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(fp).forEach(t=>{e.push(t)});pp`
1423
+ </div>`;js.freshModal(hp.save_snapshot,n,t)}},n="download"in HTMLAnchorElement.prototype;let r;n&&(r=js.addCommand(hp.save_snapshot,function(){if(!n)return;t.show(r)},"Ctrl+Shift+Alt+S","💾"))}});const gp="https://respec.org/specref/",bp=ui({en:{search_specref:"Search Specref"},nl:{search_specref:"Doorzoek Specref"},ja:{search_specref:"仕様検索"},de:{search_specref:"Spezifikationen durchsuchen"},zh:{search_specref:"搜索 Specref"},cs:{search_specref:"Hledat ve Specref"}}),yp=js.addCommand(bp.search_specref,function(){const e=Or`
1424
+ <iframe class="respec-iframe" src="${gp}" onload=${e=>e.target.classList.add("ready")}></iframe>
1425
+ <a href="${gp}" target="_blank">Open Search UI in a new tab</a>
1426
+ `;js.freshModal(bp.search_specref,e,yp)},"Ctrl+Shift+Alt+space","🔎");var wp=Object.freeze({__proto__:null});const vp="https://respec.org/xref/",kp=ui({en:{title:"Search definitions"},ja:{title:"定義検索"},de:{title:"Definitionen durchsuchen"},zh:{title:"搜索定义"},cs:{title:"Hledat definice"}}),$p=js.addCommand(kp.title,function(){const e=Or`
1427
+ <iframe class="respec-iframe" src="${vp}" onload="${e=>e.target.classList.add("ready")}"></iframe>
1428
+ <a href="${vp}" target="_blank">Open Search UI in a new tab</a>
1429
+ `;js.freshModal(kp.title,e,$p)},"Ctrl+Shift+Alt+x","📚");var xp=Object.freeze({__proto__:null});const Cp=ui({en:{about_respec:"About"},zh:{about_respec:"关于"},nl:{about_respec:"Over"},ja:{about_respec:"これについて"},de:{about_respec:"Über"},cs:{about_respec:"O aplikaci"}});window.respecVersion=window.respecVersion||"Developer Edition";const Sp=document.createElement("div"),_p=Or.bind(Sp),Tp=js.addCommand(`${Cp.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(Rp).forEach(t=>{e.push(t)});_p`
1327
1430
  <p>
1328
1431
  ReSpec is a document production toolchain, with a notable focus on W3C specifications.
1329
1432
  </p>
@@ -1347,19 +1450,19 @@ img.caniuse-browser{filter:drop-shadow(0 0 .1cm #666);background:0 0}
1347
1450
  </thead>
1348
1451
  <tbody>${e}</tbody>
1349
1452
  </table>
1350
- `,Os.freshModal(`${up.about_respec} - ${window.respecVersion}`,dp,hp)},"Ctrl+Shift+Alt+A","ℹ️");function fp({name:e,duration:t}){return Or`
1453
+ `,js.freshModal(`${Cp.about_respec} - ${window.respecVersion}`,Sp,Tp)},"Ctrl+Shift+Alt+A","ℹ️");function Rp({name:e,duration:t}){return Or`
1351
1454
  <tr>
1352
1455
  <td><a href="${`https://github.com/speced/respec/blob/develop/src/${e}.js`}">${e}</a></td>
1353
1456
  <td>${t}</td>
1354
1457
  </tr>
1355
- `}var mp=Object.freeze({__proto__:null});var gp=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Or`<meta
1458
+ `}var Ep=Object.freeze({__proto__:null});var Ap=Object.freeze({__proto__:null,name:"core/seo",run:function(e){if(e.gitRevision){const t=Or`<meta
1356
1459
  name="revision"
1357
1460
  content="${e.gitRevision}"
1358
- />`;document.head.appendChild(t)}const t=document.querySelector("#abstract p:first-of-type");if(!t)return;const n=t.textContent.replace(/\s+/," ").trim(),r=document.createElement("meta");r.name="description",r.content=n,document.head.appendChild(r)}});const bp="w3c/seo",yp={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",RSCND:"w3p:RSCND"},wp=new Set([...wo,...ko,...vo,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function kp({name:e,url:t,mailto:n,company:r,companyURL:i}){const s={type:"Person",name:e,url:t,"foaf:mbox":n};return(r||i)&&(s.worksFor={name:r,url:i}),s}function vp(e){const{href:t,title:n,href:r}=e,i={id:t,type:"TechArticle",name:n,url:r};return e.authors&&(i.creator=e.authors.map(e=>({name:e}))),e.rawDate&&(i.datePublished=e.rawDate),e.isbn&&(i.identifier=e.isbn),e.publisher&&(i.publisher={name:e.publisher}),i}var $p=Object.freeze({__proto__:null,name:bp,requiresCanonicalLink:wp,run:async function(e){if((e.canonicalURI||wp.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{Ii("Canonical URI set to edDraft, but no edDraftURI is set in configuration",bp),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{Ii("Canonical URI set to TR, but no shortName is set in configuration",bp),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=Or`<link rel="canonical" href="${e.canonicalURI}" />`;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=yp[e.specStatus],r=["TechArticle"];n&&r.push(n);const i={"@context":["https://schema.org",{"@vocab":"https://schema.org/","@language":t.documentElement.lang||"en",w3p:"http://www.w3.org/2001/02pd/rec54#",foaf:"http://xmlns.com/foaf/0.1/",datePublished:{"@type":"http://www.w3.org/2001/XMLSchema#date"},inLanguage:{"@language":null},isBasedOn:{"@type":"@id"},license:{"@type":"@id"}}],id:e.canonicalURI||e.thisVersion,type:r,name:document.title,inLanguage:t.documentElement.lang||"en",license:e.licenseInfo?.url,datePublished:e.dashDate,copyrightHolder:{name:"World Wide Web Consortium",url:"https://www.w3.org/"},discussionUrl:e.issueBase,alternativeHeadline:e.subtitle,isBasedOn:e.prevVersion};if(e.additionalCopyrightHolders){const t=Array.isArray(e.additionalCopyrightHolders)?e.additionalCopyrightHolders:[e.additionalCopyrightHolders];i.copyrightHolder=[i.copyrightHolder,...t.map(e=>({name:e}))]}const s=t.head.querySelector("meta[name=description]");s&&(i.description=s.content);e.editors&&(i.editor=e.editors.map(kp));e.authors&&(i.contributor=e.authors.map(kp));const o=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(o.map(e=>Xa(e)));i.citation=a.filter(e=>null!==e&&"object"==typeof e).map(vp);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(i,null,2),t.head.appendChild(c)}(e,document)}}});const xp="\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";var Cp=String.raw`.hljs,body:has(input[name=color-scheme][value=light]:checked) .hljs,head:not(:has(meta[name=color-scheme][content~=dark]))+body .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}
1461
+ />`;document.head.appendChild(t)}const t=document.querySelector("#abstract p:first-of-type");if(!t)return;const n=t.textContent.replace(/\s+/," ").trim(),r=document.createElement("meta");r.name="description",r.content=n,document.head.appendChild(r)}});const Lp="w3c/seo",Pp={NOTE:"w3p:NOTE",WD:"w3p:WD",LC:"w3p:LastCall",CR:"w3p:CR",CRD:"w3p:CRD",PR:"w3p:PR",REC:"w3p:REC",RSCND:"w3p:RSCND"},Np=new Set([...ko,...$o,...xo,"BG-FINAL","CG-FINAL","CRY","DRY","draft-finding","finding"]);function Ip({name:e,url:t,mailto:n,company:r,companyURL:i}){const s={type:"Person",name:e,url:t,"foaf:mbox":n};return(r||i)&&(s.worksFor={name:r,url:i}),s}function Op(e){const{href:t,title:n,href:r}=e,i={id:t,type:"TechArticle",name:n,url:r};return e.authors&&(i.creator=e.authors.map(e=>({name:e}))),e.rawDate&&(i.datePublished=e.rawDate),e.isbn&&(i.identifier=e.isbn),e.publisher&&(i.publisher={name:e.publisher}),i}var Dp=Object.freeze({__proto__:null,name:Lp,requiresCanonicalLink:Np,run:async function(e){if((e.canonicalURI||Np.has(e.specStatus))&&e.shortName){switch(e.canonicalURI){case"edDraft":if(e.edDraftURI)e.canonicalURI=new URL(e.edDraftURI,document.location.href).href;else{Ii("Canonical URI set to edDraft, but no edDraftURI is set in configuration",Lp),e.canonicalURI=null}break;case"TR":if(e.latestVersion)e.canonicalURI=e.latestVersion;else{Ii("Canonical URI set to TR, but no shortName is set in configuration",Lp),e.canonicalURI=null}break;default:e.latestVersion&&!e.canonicalURI&&(e.canonicalURI=e.latestVersion)}if(e.canonicalURI){const t=Or`<link rel="canonical" href="${e.canonicalURI}" />`;document.head.appendChild(t)}e.doJsonLd&&await async function(e,t){const n=Pp[e.specStatus],r=["TechArticle"];n&&r.push(n);const i={"@context":["https://schema.org",{"@vocab":"https://schema.org/","@language":t.documentElement.lang||"en",w3p:"http://www.w3.org/2001/02pd/rec54#",foaf:"http://xmlns.com/foaf/0.1/",datePublished:{"@type":"http://www.w3.org/2001/XMLSchema#date"},inLanguage:{"@language":null},isBasedOn:{"@type":"@id"},license:{"@type":"@id"}}],id:e.canonicalURI||e.thisVersion,type:r,name:document.title,inLanguage:t.documentElement.lang||"en",license:e.licenseInfo?.url,datePublished:e.dashDate,copyrightHolder:{name:"World Wide Web Consortium",url:"https://www.w3.org/"},discussionUrl:e.issueBase,alternativeHeadline:e.subtitle,isBasedOn:e.prevVersion};if(e.additionalCopyrightHolders){const t=Array.isArray(e.additionalCopyrightHolders)?e.additionalCopyrightHolders:[e.additionalCopyrightHolders];i.copyrightHolder=[i.copyrightHolder,...t.map(e=>({name:e}))]}const s=t.head.querySelector("meta[name=description]");s&&(i.description=s.content);e.editors&&(i.editor=e.editors.map(Ip));e.authors&&(i.contributor=e.authors.map(Ip));const o=[...e.normativeReferences,...e.informativeReferences],a=await Promise.all(o.map(e=>ec(e)));i.citation=a.filter(e=>null!==e&&"object"==typeof e).map(Op);const c=t.createElement("script");c.type="application/ld+json",c.textContent=JSON.stringify(i,null,2),t.head.appendChild(c)}(e,document)}}});const jp="\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";var zp=String.raw`.hljs,body:has(input[name=color-scheme][value=light]:checked) .hljs,head:not(:has(meta[name=color-scheme][content~=dark]))+body .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}
1359
1462
  @media (prefers-color-scheme:dark){
1360
- .hljs{${xp}}
1463
+ .hljs{${jp}}
1361
1464
  }
1362
- body:has(input[name=color-scheme][value=dark]:checked) .hljs{${xp}}
1465
+ body:has(input[name=color-scheme][value=dark]:checked) .hljs{${jp}}
1363
1466
  .hljs{display:block;overflow-x:auto;padding:.5em;color:#383a42;color:var(--mono-1,#383a42);background:#fafafa;background:var(--base,#fafafa)}
1364
1467
  .hljs-comment,.hljs-quote{color:#717277;color:var(--mono-3,#717277);font-style:italic}
1365
1468
  .hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4;color:var(--hue-3,#a626a4)}
@@ -1371,19 +1474,19 @@ body:has(input[name=color-scheme][value=dark]:checked) .hljs{${xp}}
1371
1474
  .hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#336ae3;color:var(--hue-2,#336ae3)}
1372
1475
  .hljs-emphasis{font-style:italic}
1373
1476
  .hljs-strong{font-weight:700}
1374
- .hljs-link{text-decoration:underline}`;const Sp=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function _p(e){const t=e;t.setAttribute("aria-busy","true");const n=(r=t.classList,Array.from(r).filter(e=>"highlight"!==e&&"nolinks"!==e).map(e=>e.toLowerCase()));var r;let i;try{i=await async function(e,t){const n={action:"highlight",code:e,id:Sp(),languages:t},r=await es;return r.postMessage(n),new Promise((e,t)=>{const i=setTimeout(()=>{t(new Error("Timed out waiting for highlight."))},4e3);r.addEventListener("message",function t(s){const{data:{id:o,language:a,value:c}}=s;o===n.id&&(r.removeEventListener("message",t),clearTimeout(i),e({language:a,value:c}))})})}(t.textContent,n)}catch(e){return void console.error(e)}const{language:s,value:o}=i;switch(t.localName){case"pre":t.classList.remove(s),t.innerHTML=`<code class="hljs${s?` ${s}`:""}">${o}</code>`,t.classList.length||t.removeAttribute("class");break;case"code":t.innerHTML=o,t.classList.add("hljs"),s&&t.classList.add(s)}t.setAttribute("aria-busy","false")}var Tp=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=[...document.querySelectorAll("\n pre:not(.idl):not(.cddl):not(.nohighlight) > code:not(.nohighlight),\n pre:not(.idl):not(.cddl):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(_p);ds(Cp),await Promise.all(n)}});const Rp=di({en:{missing_test_suite_uri:qi`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:qi`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:qi`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:qi`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),Ep="core/data-tests";function Ap(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[i]=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"),i=i.replace(".https",""),t.push(e)}if(i.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"),i=i.replace("-manual",""),t.push(e)}return Or`
1477
+ .hljs-link{text-decoration:underline}`;const Mp=function(e,t=0){const n=function*(e,t){for(;;)yield`${e}:${t}`,t++}(e,t);return()=>n.next().value}("highlight");async function qp(e){const t=e;t.setAttribute("aria-busy","true");const n=(r=t.classList,Array.from(r).filter(e=>"highlight"!==e&&"nolinks"!==e).map(e=>e.toLowerCase()));var r;let i;try{i=await async function(e,t){const n={action:"highlight",code:e,id:Mp(),languages:t},r=await es;return r.postMessage(n),new Promise((e,t)=>{const i=setTimeout(()=>{t(new Error("Timed out waiting for highlight."))},4e3);r.addEventListener("message",function t(s){const{data:{id:o,language:a,value:c}}=s;o===n.id&&(r.removeEventListener("message",t),clearTimeout(i),e({language:a,value:c}))})})}(t.textContent,n)}catch(e){return void console.error(e)}const{language:s,value:o}=i;switch(t.localName){case"pre":t.classList.remove(s),t.innerHTML=`<code class="hljs${s?` ${s}`:""}">${o}</code>`,t.classList.length||t.removeAttribute("class");break;case"code":t.innerHTML=o,t.classList.add("hljs"),s&&t.classList.add(s)}t.setAttribute("aria-busy","false")}var Up=Object.freeze({__proto__:null,name:"core/highlight",run:async function(e){if(e.noHighlightCSS)return;const t=e.diagrams?".idl, .cddl, .mermaid, .nohighlight":".idl, .cddl, .nohighlight",n=[...document.querySelectorAll(`\n pre:not(${t}) > code:not(.nohighlight),\n pre:not(${t}),\n code.highlight\n `)].filter(e=>"pre"!==e.localName||!e.querySelector("code"));if(!n.length)return;const r=n.filter(e=>e.textContent.trim()).map(qp);us(zp),await Promise.all(r)}});const Wp=ui({en:{missing_test_suite_uri:qi`Found tests in your spec, but missing ${"[testSuiteURI]"} in your ReSpec config.`,tests:"tests",test:"test"},ja:{missing_test_suite_uri:qi`この仕様内にテストの項目を検出しましたが,ReSpec の設定に ${"[testSuiteURI]"} が見つかりません.`,tests:"テスト",test:"テスト"},de:{missing_test_suite_uri:qi`Die Spezifikation enthält Tests, aber in der ReSpec-Konfiguration ist keine ${"[testSuiteURI]"} angegeben.`,tests:"Tests",test:"Test"},zh:{missing_test_suite_uri:qi`本规范中包含测试,但在 ReSpec 配置中缺少 ${"[testSuiteURI]"}。`,tests:"测试",test:"测试"}}),Fp="core/data-tests";function Hp(e){const t=[],[n]=new URL(e).pathname.split("/").reverse(),r=n.split(".");let[i]=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"),i=i.replace(".https",""),t.push(e)}if(i.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"),i=i.replace("-manual",""),t.push(e)}return Or`
1375
1478
  <li>
1376
1479
  <a href="${e}">${i}</a>
1377
1480
  ${t}
1378
1481
  </li>
1379
- `}function Lp(e,t,n){return e.map(e=>{try{return new URL(e,t).href}catch{Ii(qi`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,Ep,{elements:[n]})}}).filter(e=>e)}function Pp(e,t){const n=e.filter((e,t,n)=>n.indexOf(e)!==t);if(n.length){const e=qi`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=qi`To fix, remove duplicates from ${"[data-tests]"}: ${zi(n,{quotes:!0})}.`;Ii(e,Ep,{hint:r,elements:[t]})}}function Np(e){const t=[...new Set(e)];return Or`
1482
+ `}function Bp(e,t,n){return e.map(e=>{try{return new URL(e,t).href}catch{Ii(qi`Invalid URL in ${"[data-tests]"} attribute: ${e}.`,Fp,{elements:[n]})}}).filter(e=>e)}function Gp(e,t){const n=e.filter((e,t,n)=>n.indexOf(e)!==t);if(n.length){const e=qi`Duplicate tests found in the ${"[data-tests]"} attribute.`,r=qi`To fix, remove duplicates from ${"[data-tests]"}: ${zi(n,{quotes:!0})}.`;Ii(e,Fp,{hint:r,elements:[t]})}}function Vp(e){const t=[...new Set(e)];return Or`
1380
1483
  <details class="respec-tests-details removeOnSave">
1381
1484
  <summary>tests: ${t.length}</summary>
1382
1485
  <ul>
1383
- ${t.map(Ap)}
1486
+ ${t.map(Hp)}
1384
1487
  </ul>
1385
1488
  </details>
1386
- `}var Ip=Object.freeze({__proto__:null,name:Ep,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=Lp((n.dataset.tests??"").split(/,/gm).map(e=>e.trim()),e.testSuiteURI,n).filter(e=>void 0!==e);Pp(t,n);const r=Np(t);n.append(r)}else Ni(Rp.missing_test_suite_uri,Ep)}});const Op="core/list-sorter";function Dp(e){const t="ascending"===e?1:-1;return(e,n)=>{const r=e.textContent??"",i=n.textContent??"";return t*r.trim().localeCompare(i.trim())}}function jp(e,t){return[...e.querySelectorAll(":scope > li")].sort(Dp(t)).reduce((e,t)=>(e.appendChild(t),e),document.createDocumentFragment())}function zp(e,t){return[...e.querySelectorAll(":scope > dt")].sort(Dp(t)).reduce((e,t)=>{const{nodeType:n,nodeName:r}=t,i=document.createDocumentFragment();let{nextSibling:s}=t;for(;s&&s.nextSibling;){i.appendChild(s.cloneNode(!0));const{nodeType:e,nodeName:t}=s.nextSibling;if(e===n&&t===r)break;s=s.nextSibling}return i.prepend(t.cloneNode(!0)),e.appendChild(i),e},document.createDocumentFragment())}var Mp=Object.freeze({__proto__:null,name:Op,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=zp(t,n);break;case"ol":case"ul":e=jp(t,n);break;default:Ii(`ReSpec can't sort ${t.localName} elements.`,Op,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:zp,sortListItems:jp});var qp=String.raw`var:hover{text-decoration:underline;cursor:pointer}
1489
+ `}var Jp=Object.freeze({__proto__:null,name:Fp,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=Bp((n.dataset.tests??"").split(/,/gm).map(e=>e.trim()),e.testSuiteURI,n).filter(e=>void 0!==e);Gp(t,n);const r=Vp(t);n.append(r)}else Ni(Wp.missing_test_suite_uri,Fp)}});const Zp="core/list-sorter";function Kp(e){const t="ascending"===e?1:-1;return(e,n)=>{const r=e.textContent??"",i=n.textContent??"";return t*r.trim().localeCompare(i.trim())}}function Yp(e,t){return[...e.querySelectorAll(":scope > li")].sort(Kp(t)).reduce((e,t)=>(e.appendChild(t),e),document.createDocumentFragment())}function Xp(e,t){return[...e.querySelectorAll(":scope > dt")].sort(Kp(t)).reduce((e,t)=>{const{nodeType:n,nodeName:r}=t,i=document.createDocumentFragment();let{nextSibling:s}=t;for(;s&&s.nextSibling;){i.appendChild(s.cloneNode(!0));const{nodeType:e,nodeName:t}=s.nextSibling;if(e===n&&t===r)break;s=s.nextSibling}return i.prepend(t.cloneNode(!0)),e.appendChild(i),e},document.createDocumentFragment())}var Qp=Object.freeze({__proto__:null,name:Zp,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=Xp(t,n);break;case"ol":case"ul":e=Yp(t,n);break;default:Ii(`ReSpec can't sort ${t.localName} elements.`,Zp,{elements:[t]})}if(e){const n=document.createRange();n.selectNodeContents(t),n.deleteContents(),t.appendChild(e)}}},sortDefinitionTerms:Xp,sortListItems:Yp});var eh=String.raw`var:hover{text-decoration:underline;cursor:pointer}
1387
1490
  var.respec-hl{color:var(--color,#000);background-color:var(--bg-color);box-shadow:0 0 0 2px var(--bg-color)}
1388
1491
  @media (prefers-color-scheme:dark){
1389
1492
  var.respec-hl{filter:saturate(.9) brightness(.9)}
@@ -1397,11 +1500,11 @@ var.respec-hl-c6{--bg-color:#82ddff}
1397
1500
  var.respec-hl-c7{--bg-color:#ffbcf2}
1398
1501
  @media print{
1399
1502
  var.respec-hl{background:0 0;color:#000;box-shadow:unset}
1400
- }`;var Up=Object.freeze({__proto__:null,name:"core/highlight-vars",run:async function(e){if(!e.highlightVars)return;ds(qp);const t=document.createElement("script");t.id="respec-highlight-vars",t.textContent=await async function(){try{return(await Promise.resolve().then(function(){return gf})).default}catch{return Zi("./src/core/highlight-vars.runtime.js")}}(),document.body.append(t),Bi("beforesave",e=>{e.querySelectorAll("var.respec-hl").forEach(e=>{const t=[...e.classList.values()].filter(e=>e.startsWith("respec-hl"));e.classList.remove(...t),e.classList.length||e.removeAttribute("class")})})}});var Wp=String.raw`var[data-type]{position:relative}
1503
+ }`;var th=Object.freeze({__proto__:null,name:"core/highlight-vars",run:async function(e){if(!e.highlightVars)return;us(eh);const t=document.createElement("script");t.id="respec-highlight-vars",t.textContent=await async function(){try{return(await Promise.resolve().then(function(){return Lf})).default}catch{return Zi("./src/core/highlight-vars.runtime.js")}}(),document.body.append(t),Hi("beforesave",e=>{e.querySelectorAll("var.respec-hl").forEach(e=>{const t=[...e.classList.values()].filter(e=>e.startsWith("respec-hl"));e.classList.remove(...t),e.classList.length||e.removeAttribute("class")})})}});var nh=String.raw`var[data-type]{position:relative}
1401
1504
  var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none}
1402
1505
  var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#222}
1403
1506
  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}
1404
- var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Fp=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;ds(Wp);let t=null;const n=new Map,r=document.querySelectorAll("section var");for(const e of r){const r=e.closest("section");if(t!==r&&(t=r,n.clear()),e.dataset.type){n.set(e.textContent.trim(),e.dataset.type);continue}const i=n.get(e.textContent.trim());i&&(e.dataset.type=i)}}});const Bp="core/anchor-expander";function Hp(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Ni(`Found matching element "${t}", but it has no title or marker.`,Bp,{title:"Missing title.",elements:[n]})}const i=Ri(r);n.append(...i.childNodes),n.classList.add("box-ref")}function Gp(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Ni(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,Bp,{title:"Missing figcaption in referenced figure.",elements:[n]})}const i=[...Ri(r.querySelector(".self-link")).childNodes].map(e=>(e.classList?.remove("figno"),e));n.append(...i),n.classList.add("fig-ref");const s=r.querySelector(".fig-title");!n.hasAttribute("title")&&s&&(n.title=ui(s.textContent))}function Vp(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Ni(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,Bp,{title:"Missing caption in referenced table.",elements:[n]})}const i=[...Ri(r.querySelector(".self-link")).childNodes].map(e=>(e.classList?.remove("tableno"),e));n.append(...i),n.classList.add("table-ref");const s=r.querySelector(".table-title");!n.hasAttribute("title")&&s&&(n.title=ui(s.textContent))}function Jp(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(!r){n.textContent=n.getAttribute("href");return void Ni("Found matching section, but the section was lacking a heading element.",Bp,{title:`No matching id in document: "${t}".`,elements:[n]})}Zp(r,n),Kp(r,n)}function Zp(e,t){const n=e.querySelector(".self-link"),r=[...Ri(e).childNodes].filter(e=>!e.classList||!e.classList.contains("self-link"));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild&&t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=(t.lastChild.textContent??"").trimEnd()),t.querySelectorAll("a").forEach(e=>{const t=$i(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)})}function Kp(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const i=t.closest(`[${n}]`);i&&i.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n)??"")}}var Yp=Object.freeze({__proto__:null,name:Bp,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){t.textContent=t.getAttribute("href");Ni(`Couldn't expand inline reference. The id "${e}" is not in the document.`,Bp,{title:`No matching id in document: ${e}.`,elements:[t]});continue}switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":Zp(n,t);break;case"section":Jp(n,e,t);break;case"figure":Gp(n,e,t);break;case"table":Vp(n,e,t);break;case"aside":case"div":Hp(n,e,t);break;case"dfn":{const e=Ri(n);t.append(...e.childNodes),t.classList.add("dfn-ref");break}default:t.textContent=t.getAttribute("href");Ni("ReSpec doesn't support expanding this kind of reference.",Bp,{title:`Can't expand "#${e}".`,elements:[t]})}Kp(n,t),t.normalize()}}});var Xp=String.raw`dfn{cursor:pointer}
1507
+ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var rh=Object.freeze({__proto__:null,name:"core/data-type",run:function(e){if(!e.highlightVars)return;us(nh);let t=null;const n=new Map,r=document.querySelectorAll("section var");for(const e of r){const r=e.closest("section");if(t!==r&&(t=r,n.clear()),e.dataset.type){n.set(e.textContent.trim(),e.dataset.type);continue}const i=n.get(e.textContent.trim());i&&(e.dataset.type=i)}}});const ih="core/anchor-expander";function sh(e,t,n){const r=e.querySelector(".marker .self-link");if(!r){n.textContent=n.getAttribute("href");return void Ni(`Found matching element "${t}", but it has no title or marker.`,ih,{title:"Missing title.",elements:[n]})}const i=Ri(r);n.append(...i.childNodes),n.classList.add("box-ref")}function oh(e,t,n){const r=e.querySelector("figcaption");if(!r){n.textContent=n.getAttribute("href");return void Ni(`Found matching figure "${t}", but figure is lacking a \`<figcaption>\`.`,ih,{title:"Missing figcaption in referenced figure.",elements:[n]})}const i=[...Ri(r.querySelector(".self-link")).childNodes].map(e=>(e.classList?.remove("figno"),e));n.append(...i),n.classList.add("fig-ref");const s=r.querySelector(".fig-title");!n.hasAttribute("title")&&s&&(n.title=di(s.textContent))}function ah(e,t,n){if(!e.classList.contains("numbered"))return;const r=e.querySelector("caption");if(!r){n.textContent=n.getAttribute("href");return void Ni(`Found matching table "${t}", but table is lacking a \`<caption>\`.`,ih,{title:"Missing caption in referenced table.",elements:[n]})}const i=[...Ri(r.querySelector(".self-link")).childNodes].map(e=>(e.classList?.remove("tableno"),e));n.append(...i),n.classList.add("table-ref");const s=r.querySelector(".table-title");!n.hasAttribute("title")&&s&&(n.title=di(s.textContent))}function ch(e,t,n){const r=e.querySelector("h6, h5, h4, h3, h2");if(!r){n.textContent=n.getAttribute("href");return void Ni("Found matching section, but the section was lacking a heading element.",ih,{title:`No matching id in document: "${t}".`,elements:[n]})}lh(r,n),dh(r,n)}function lh(e,t){const n=e.querySelector(".self-link"),r=[...Ri(e).childNodes].filter(e=>!e.classList||!e.classList.contains("self-link"));t.append(...r),n&&t.prepend("§ "),t.classList.add("sec-ref"),t.lastChild&&t.lastChild.nodeType===Node.TEXT_NODE&&(t.lastChild.textContent=(t.lastChild.textContent??"").trimEnd()),t.querySelectorAll("a").forEach(e=>{const t=$i(e,"span");for(const e of[...t.attributes])t.removeAttributeNode(e)})}function dh(e,t){for(const n of["dir","lang"]){if(t.hasAttribute(n))continue;const r=e.closest(`[${n}]`);if(!r)continue;const i=t.closest(`[${n}]`);i&&i.getAttribute(n)===r.getAttribute(n)||t.setAttribute(n,r.getAttribute(n)??"")}}var uh=Object.freeze({__proto__:null,name:ih,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){t.textContent=t.getAttribute("href");Ni(`Couldn't expand inline reference. The id "${e}" is not in the document.`,ih,{title:`No matching id in document: ${e}.`,elements:[t]});continue}switch(n.localName){case"h6":case"h5":case"h4":case"h3":case"h2":lh(n,t);break;case"section":ch(n,e,t);break;case"figure":oh(n,e,t);break;case"table":ah(n,e,t);break;case"aside":case"div":sh(n,e,t);break;case"dfn":{const e=Ri(n);t.append(...e.childNodes),t.classList.add("dfn-ref");break}default:t.textContent=t.getAttribute("href");Ni("ReSpec doesn't support expanding this kind of reference.",ih,{title:`Can't expand "#${e}".`,elements:[t]})}dh(n,t),t.normalize()}}});var ph=String.raw`dfn{cursor:pointer}
1405
1508
  .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}
1406
1509
  .dfn-panel:not(.docked)>.caret{position:absolute;top:-9px}
1407
1510
  .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}
@@ -1427,7 +1530,7 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Fp=Obje
1427
1530
  .dfn-panel .dfn-panel-copy-btn:focus svg,.dfn-panel .dfn-panel-lt li:hover .dfn-panel-copy-btn svg{opacity:1}
1428
1531
  .dfn-panel .dfn-panel-copy-btn:hover svg{background:color-mix(in srgb,currentColor 15%,transparent)}
1429
1532
  .dfn-panel .dfn-panel-copy-btn:active svg{background:color-mix(in srgb,currentColor 30%,transparent);box-shadow:inset 0 1px 2px color-mix(in srgb,currentColor 50%,transparent)}
1430
- .respec-visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`;const Qp="respec-dfn-panel-copy-icon";function eh(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),i=`dfn-panel-for-${e.id}`,s=e.getAttribute("aria-label")||ui(e.textContent),o=Or`
1533
+ .respec-visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`;const hh="respec-dfn-panel-copy-icon";function fh(e){const{id:t}=e,n=e.dataset.href||`#${t}`,r=document.querySelectorAll(`a[href="${n}"]:not(.index-term)`),i=`dfn-panel-for-${e.id}`,s=e.getAttribute("aria-label")||di(e.textContent),o=Or`
1431
1534
  <div
1432
1535
  class="dfn-panel"
1433
1536
  id="${i}"
@@ -1464,34 +1567,34 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Fp=Obje
1464
1567
  <p><b>Referenced in:</b></p>
1465
1568
  ${function(e,t){if(!t.length)return Or`<ul class="dfn-panel-refs">
1466
1569
  <li>Not referenced in this document.</li>
1467
- </ul>`;const n=new Map;t.forEach((t,r)=>{const i=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=i);const s=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`§ ${ui(n.textContent)}`:null}(t)??"";(n.get(s)??n.set(s,[]).get(s)??[]).push(i)});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}))),i=e=>Or`<li>
1570
+ </ul>`;const n=new Map;t.forEach((t,r)=>{const i=t.id||`ref-for-${e}-${r+1}`;t.id||(t.id=i);const s=function(e){const t=e.closest("section");if(!t)return null;const n=t.querySelector("h1, h2, h3, h4, h5, h6");return n?`§ ${di(n.textContent)}`:null}(t)??"";(n.get(s)??n.set(s,[]).get(s)??[]).push(i)});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}))),i=e=>Or`<li>
1468
1571
  ${r(e).map(e=>Or`<a href="#${e.id}" title="${e.title}">${e.text}</a
1469
1572
  >${" "}`)}
1470
1573
  </li>`;return Or`<ul class="dfn-panel-refs">
1471
1574
  ${[...n].map(i)}
1472
- </ul>`}(t,r)} ${function(e){if(!e.matches("dfn[data-export]"))return null;const t=function(e){if(/!overload-/.test(e.dataset.lt??""))return[];const t=e.dataset.dfnType||"dfn",n=e.dataset.dfnFor?.split(",").map(e=>e.trim()).filter(Boolean)??[],r=n.length?n:[null],i=ui(e.textContent);return vi(e).sort((e,t)=>Number(t===i)-Number(e===i)).flatMap(e=>r.map(n=>function(e,t,n){const r=n?`${n}/`:"";if(rh.has(t))return`[=${r}${e.replaceAll("/","\\/")}=]`;if(nh.has(t))return e.includes("/")&&!e.startsWith('"')?"":`{^${r}${e}^}`;if(e.includes("/"))return"";if(th.has(t)){if(n&&e.startsWith(`${n}.`))return"";return`{{${r}${"enum-value"===t&&'""'!==e?`"${e}"`:e}}}`}switch(t){case"element":return n?"":`[^${e}^]`;case"element-attr":return`[^${r||"/"}${e}^]`;case"attr-value":return n?`[^${r}${e}^]`:"";default:return""}}(e,t,n))).filter(Boolean)}(e);if(!t.length)return null;const n=`dfn-panel-lt-heading-${e.id}`;return Or`<p><b id="${n}">Possible linking syntaxes:</b></p>
1575
+ </ul>`}(t,r)} ${function(e){if(!e.matches("dfn[data-export]"))return null;const t=function(e){if(/!overload-/.test(e.dataset.lt??""))return[];const t=e.dataset.dfnType||"dfn",n=e.dataset.dfnFor?.split(",").map(e=>e.trim()).filter(Boolean)??[],r=n.length?n:[null],i=di(e.textContent);return ki(e).sort((e,t)=>Number(t===i)-Number(e===i)).flatMap(e=>r.map(n=>function(e,t,n){const r=n?`${n}/`:"";if(bh.has(t))return`[=${r}${e.replaceAll("/","\\/")}=]`;if(gh.has(t))return e.includes("/")&&!e.startsWith('"')?"":`{^${r}${e}^}`;if(e.includes("/"))return"";if(mh.has(t)){if(n&&e.startsWith(`${n}.`))return"";return`{{${r}${"enum-value"===t&&'""'!==e?`"${e}"`:e}}}`}switch(t){case"element":return n?"":`[^${e}^]`;case"element-attr":return`[^${r||"/"}${e}^]`;case"attr-value":return n?`[^${r}${e}^]`:"";default:return""}}(e,t,n))).filter(Boolean)}(e);if(!t.length)return null;const n=`dfn-panel-lt-heading-${e.id}`;return Or`<p><b id="${n}">Possible linking syntaxes:</b></p>
1473
1576
  <ul class="dfn-panel-lt" aria-labelledby="${n}">
1474
1577
  ${t.map(e=>Or`<li>${function(e){return Or`<button type="button" class="dfn-panel-copy-btn">
1475
1578
  <span class="respec-visually-hidden">Copy </span><code>${e}</code>
1476
1579
  <svg aria-hidden="true" viewBox="0 0 14 16">
1477
- <use href="#${Qp}"></use>
1580
+ <use href="#${hh}"></use>
1478
1581
  </svg>
1479
1582
  </button>`}(e)}</li>`)}
1480
1583
  </ul>`}(e)}
1481
1584
  </div>
1482
- `;return o}const th=new Set(["attribute","callback","const","constructor","dict-member","dictionary","enum-value","enum","exception","extended-attribute","interface","method","namespace","typedef"]),nh=new Set(["cddl-type","cddl-key","cddl-value"]),rh=new Set(["dfn","abstract-op"]);var ih=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){ds(Xp,{before: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(eh(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");t.querySelector(".dfn-panel-copy-btn")&&t.append(function(){const e=document.createElement("template");e.innerHTML=Cl;const t=e.content.firstElementChild;return Or`<svg class="respec-visually-hidden" aria-hidden="true">
1483
- <symbol id="${Qp}" viewBox="${t.getAttribute("viewBox")}">
1585
+ `;return o}const mh=new Set(["attribute","callback","const","constructor","dict-member","dictionary","enum-value","enum","exception","extended-attribute","interface","method","namespace","typedef"]),gh=new Set(["cddl-type","cddl-key","cddl-value"]),bh=new Set(["dfn","abstract-op"]);var yh=Object.freeze({__proto__:null,name:"core/dfn-panel",run:async function(){us(ph,{before: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(fh(n)),n.tabIndex=0,n.setAttribute("aria-haspopup","dialog");t.querySelector(".dfn-panel-copy-btn")&&t.append(function(){const e=document.createElement("template");e.innerHTML=yl;const t=e.content.firstElementChild;return Or`<svg class="respec-visually-hidden" aria-hidden="true">
1586
+ <symbol id="${hh}" viewBox="${t.getAttribute("viewBox")}">
1484
1587
  ${[...t.childNodes]}
1485
1588
  </symbol>
1486
- </svg>`}());const n=document.body.querySelector("script");n?n.before(t):document.body.append(t);const r=document.createElement("script");r.id="respec-dfn-panel",r.textContent=await async function(){try{return(await Promise.resolve().then(function(){return bf})).default}catch{return Zi("./src/core/dfn-panel.runtime.js")}}(),document.body.append(r)}});const sh="rs-changelog",oh=class extends HTMLElement{constructor(){super();const e=this.getAttribute("filter"),t=e&&"function"==typeof window[e]?window[e]:()=>!0;this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",repo:this.getAttribute("repo"),path:this.getAttribute("path"),filter:t}}connectedCallback(){const{from:e,to:t,filter:n,repo:r,path:i}=this.props;Or.bind(this)`
1589
+ </svg>`}());const n=document.body.querySelector("script");n?n.before(t):document.body.append(t);const r=document.createElement("script");r.id="respec-dfn-panel",r.textContent=await async function(){try{return(await Promise.resolve().then(function(){return Pf})).default}catch{return Zi("./src/core/dfn-panel.runtime.js")}}(),document.body.append(r)}});const wh="rs-changelog",vh=class extends HTMLElement{constructor(){super();const e=this.getAttribute("filter"),t=e&&"function"==typeof window[e]?window[e]:()=>!0;this.props={from:this.getAttribute("from"),to:this.getAttribute("to")||"HEAD",repo:this.getAttribute("repo"),path:this.getAttribute("path"),filter:t}}connectedCallback(){const{from:e,to:t,filter:n,repo:r,path:i}=this.props;Or.bind(this)`
1487
1590
  <ul>
1488
- ${{any:ah(e,t,n,r,i).then(e=>async function(e,t){const n=await Yo,r=t?`https://github.com/${t}/`:n?.repoURL;return e.map(e=>{const[t,n=null]=e.message.split(/\(#(\d+)\)/,2),i=`${r}commit/${e.hash}`,s=n&&Or` (<a href="${n?`${r}pull/${n}`:null}">#${n}</a>)`;return Or`<li><a href="${i}">${t.trim()}</a>${s}</li>`})}(e,r)).catch(e=>Ni(e.message,sh,{elements:[this],cause:e})).finally(()=>{this.dispatchEvent(new CustomEvent("done"))}),placeholder:"Loading list of commits..."}}
1591
+ ${{any:kh(e,t,n,r,i).then(e=>async function(e,t){const n=await Qo,r=t?`https://github.com/${t}/`:n?.repoURL;return e.map(e=>{const[t,n=null]=e.message.split(/\(#(\d+)\)/,2),i=`${r}commit/${e.hash}`,s=n&&Or` (<a href="${n?`${r}pull/${n}`:null}">#${n}</a>)`;return Or`<li><a href="${i}">${t.trim()}</a>${s}</li>`})}(e,r)).catch(e=>Ni(e.message,wh,{elements:[this],cause:e})).finally(()=>{this.dispatchEvent(new CustomEvent("done"))}),placeholder:"Loading list of commits..."}}
1489
1592
  </ul>
1490
- `}};async function ah(e,t,n,r,i){let s;try{const o=await Yo;if(!o)throw new Error("`respecConfig.github` is not set");const a=r||o.fullName,c=new URL("commits",`${o.apiBase}/${a}/`);e&&c.searchParams.set("from",e),c.searchParams.set("to",t),i&&c.searchParams.set("path",i);const l=await fetch(c.href);if(!l.ok)throw new Error(`Request to ${c} failed with status code ${l.status}`);if(s=await l.json(),!s.length)throw new Error(`No commits between ${e}..${t}.`);s=s.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw new Error(t,{cause:e})}return s}const ch=[Object.freeze({__proto__:null,element:oh,name:sh})];var lh=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){ch.forEach(e=>{customElements.define(e.name,e.element)});const e=ch.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 uh=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){if(!1===e.monetization)return;const{monetization:t}=e,{removeOnSave:n,paymentPointer:r}=function(e){const t={paymentPointer:"$respec.org",removeOnSave:!0};switch(typeof e){case"string":t.paymentPointer=e;break;case"object":e.paymentPointer&&(t.paymentPointer=String(e.paymentPointer)),!1===e.removeOnSave&&(t.removeOnSave=!1)}return t}(t),i=n?"removeOnSave":null;document.head.append(Or`<meta
1593
+ `}};async function kh(e,t,n,r,i){let s;try{const o=await Qo;if(!o)throw new Error("`respecConfig.github` is not set");const a=r||o.fullName,c=new URL("commits",`${o.apiBase}/${a}/`);e&&c.searchParams.set("from",e),c.searchParams.set("to",t),i&&c.searchParams.set("path",i);const l=await fetch(c.href);if(!l.ok)throw new Error(`Request to ${c} failed with status code ${l.status}`);if(s=await l.json(),!s.length)throw new Error(`No commits between ${e}..${t}.`);s=s.filter(n)}catch(e){const t=`Error loading commits from GitHub. ${e.message}`;throw new Error(t,{cause:e})}return s}const $h=[Object.freeze({__proto__:null,element:vh,name:wh})];var xh=Object.freeze({__proto__:null,name:"core/custom-elements/index",run:async function(){$h.forEach(e=>{customElements.define(e.name,e.element)});const e=$h.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 Ch=Object.freeze({__proto__:null,name:"core/web-monetization",run:function(e){if(!1===e.monetization)return;const{monetization:t}=e,{removeOnSave:n,paymentPointer:r}=function(e){const t={paymentPointer:"$respec.org",removeOnSave:!0};switch(typeof e){case"string":t.paymentPointer=e;break;case"object":e.paymentPointer&&(t.paymentPointer=String(e.paymentPointer)),!1===e.removeOnSave&&(t.removeOnSave=!1)}return t}(t),i=n?"removeOnSave":null;document.head.append(Or`<meta
1491
1594
  name="monetization"
1492
1595
  content="${r}"
1493
1596
  class="${i}"
1494
- />`)}});var dh=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const ph="core/before-save";var hh=Object.freeze({__proto__:null,name:ph,run:function(e){if(e.beforeSave){if(!Array.isArray(e.beforeSave)||e.beforeSave.some(e=>"function"!=typeof e||"AsyncFunction"===e.constructor.name)){return void Ni(qi`${"[beforeSave]"} configuration option must be an array of synchronous JS functions.`,ph)}Bi("beforesave",t=>{!function(e,t){let n=0;for(const r of e)try{r(t)}catch(e){Ni(qi`Function ${r.name?`\`${r.name}\``:`at position ${n}`}\` threw an error during processing of ${"[beforeSave]"}.`,ph,{hint:"See developer console.",cause:e})}finally{n++}}(e.beforeSave,t.ownerDocument)},{once:!0})}}});const fh="core/linter-rules/check-charset",mh=di({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'},cs:{msg:"Dokument smí obsahovat pouze jeden tag `<meta>` s charset nastaveným na 'utf-8'",hint:'Přidejte tento řádek do sekce `<head>` vašeho dokumentu - `<meta charset="utf-8">` nebo nastavte charset na "utf-8", pokud ještě není nastaven.'}});var gh=Object.freeze({__proto__:null,name:fh,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||Ii(mh.msg,fh,{hint:mh.hint,elements:[...t]})}});const bh="core/linter-rules/check-punctuation",yh=[".",":","!","?"],wh=yh.map(e=>`"${e}"`).join(", "),kh=di({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${wh}.`},cs:{msg:"Elementy `p` by měly končit interpunkčním znaménkem.",hint:`Ujistěte se, že elementy \`p\` končí jedním z těchto znaků: ${wh}.`}});var vh=Object.freeze({__proto__:null,name:bh,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${yh.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter(e=>!t.test(e.textContent.trim()));n.length&&Ii(kh.msg,bh,{hint:kh.hint,elements:n})}});const $h="core/linter-rules/check-internal-slots",xh=di({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."},cs:{msg:"Interní sloty by měly být uvedeny s tečkou '.' před názvem",hint:"Přidejte tečku '.' mezi uvedené prvky."}});var Ch=Object.freeze({__proto__:null,name:$h,run:function(e){if(!e.lint?.["check-internal-slots"])return;const t=[...document.querySelectorAll("var+a")].filter(e=>{const t=e.previousSibling?.nodeName;return"VAR"===t});t.length&&Ii(xh.msg,$h,{hint:xh.hint,elements:t})}});const Sh="core/linter-rules/local-refs-exist",_h=di({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."},cs:{msg:"V dokumentu byla nalezena nefunkční lokální reference.",hint:"Opravte prosím uvedené odkazy."}});function Th(e){const t=e.getAttribute("href")?.substring(1);if(!t)return;const n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Rh=Object.freeze({__proto__:null,name:Sh,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Th);t.length&&Ii(_h.msg,Sh,{hint:_h.hint,elements:t})}});const Eh="core/linter-rules/no-captionless-tables",Ah=di({en:{msg:"All tables marked with class='numbered' must start with a caption element.",hint:"Add a `caption` to the offending table."},cs:{msg:"Všechny tabulky označené class='numbered' musí začínat elementem caption.",hint:"Přidejte k dané tabulce element `caption`."},nl:{msg:"Alle tabellen met class='numbered' dienen te beginnen met een caption-element.",hint:"Voeg een `caption` toe aan de betreffende tabel."}});var Lh=Object.freeze({__proto__:null,name:Eh,run:function(e){if(!e.lint?.["no-captionless-tables"])return;const t=[...document.querySelectorAll("table.numbered")].filter(e=>!(e.firstElementChild instanceof HTMLTableCaptionElement));t.length&&Ii(Ah.msg,Eh,{hint:Ah.hint,elements:t})}});const Ph="no-unused-dfns",Nh="core/linter-rules/no-unused-dfns",Ih=di({en:{msg:e=>`Found definition for "${e}", but nothing links to it. This is usually a spec bug!`,get hint(){return qi`
1597
+ />`)}});var Sh=Object.freeze({__proto__:null,name:"core/dfn-contract",run:function(){!function(){const e=document.querySelectorAll("dfn:is([data-dfn-type=''],:not([data-dfn-type]))");for(const t of e)t.dataset.dfnType="dfn";const t=document.querySelectorAll("dfn:not([data-noexport], [data-export], [data-dfn-type='dfn'], [data-cite])");for(const e of t)e.dataset.export=""}(),function(){const e=document.querySelectorAll("dl.definitions dt:has(dfn[data-dfn-type])");for(const t of e){const e=t.querySelector("dfn[data-dfn-type]").id,n=t.nextElementSibling;n&&!n.dataset.defines&&e&&(n.dataset.defines=`#${e}`)}const t=document.querySelectorAll(".definition:has(dfn[data-dfn-type])");for(const e of t){const t=e.querySelector("dfn[data-dfn-type]");t.id&&!e.dataset.defines&&(e.dataset.defines=`#${t.id}`)}}()}});const _h="core/before-save";var Th=Object.freeze({__proto__:null,name:_h,run:function(e){if(e.beforeSave){if(!Array.isArray(e.beforeSave)||e.beforeSave.some(e=>"function"!=typeof e||"AsyncFunction"===e.constructor.name)){return void Ni(qi`${"[beforeSave]"} configuration option must be an array of synchronous JS functions.`,_h)}Hi("beforesave",t=>{!function(e,t){let n=0;for(const r of e)try{r(t)}catch(e){Ni(qi`Function ${r.name?`\`${r.name}\``:`at position ${n}`}\` threw an error during processing of ${"[beforeSave]"}.`,_h,{hint:"See developer console.",cause:e})}finally{n++}}(e.beforeSave,t.ownerDocument)},{once:!0})}}});const Rh="core/linter-rules/check-charset",Eh=ui({en:{msg:"Document must only contain one `<meta>` tag with charset set to 'utf-8'",hint:'Add this line in your document `<head>` section - `<meta charset="utf-8">` or set charset to "utf-8" if not set already.'},zh:{msg:"文档只能包含一个 charset 属性为 utf-8 的 `<meta>` 标签",hint:'将此行添加到文档的 `<head>` 部分—— `<meta charset="utf-8">` 或将 charset 设置为 utf-8(如果尚未设置)。'},cs:{msg:"Dokument smí obsahovat pouze jeden tag `<meta>` s charset nastaveným na 'utf-8'",hint:'Přidejte tento řádek do sekce `<head>` vašeho dokumentu - `<meta charset="utf-8">` nebo nastavte charset na "utf-8", pokud ještě není nastaven.'}});var Ah=Object.freeze({__proto__:null,name:Rh,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||Ii(Eh.msg,Rh,{hint:Eh.hint,elements:[...t]})}});const Lh="core/linter-rules/check-punctuation",Ph=[".",":","!","?"],Nh=Ph.map(e=>`"${e}"`).join(", "),Ih=ui({en:{msg:"`p` elements should end with a punctuation mark.",hint:`Please make sure \`p\` elements end with one of: ${Nh}.`},cs:{msg:"Elementy `p` by měly končit interpunkčním znaménkem.",hint:`Ujistěte se, že elementy \`p\` končí jedním z těchto znaků: ${Nh}.`}});var Oh=Object.freeze({__proto__:null,name:Lh,run:function(e){if(!e.lint?.["check-punctuation"])return;const t=new RegExp(`[${Ph.join("")}\\]]$|^ *$`,"m"),n=[...document.querySelectorAll("p:not(#back-to-top,#w3c-state)")].filter(e=>!t.test(e.textContent.trim()));n.length&&Ii(Ih.msg,Lh,{hint:Ih.hint,elements:n})}});const Dh="core/linter-rules/check-internal-slots",jh=ui({en:{msg:"Internal slots should be preceded by a '.'",hint:"Add a '.' between the elements mentioned."},cs:{msg:"Interní sloty by měly být uvedeny s tečkou '.' před názvem",hint:"Přidejte tečku '.' mezi uvedené prvky."}});var zh=Object.freeze({__proto__:null,name:Dh,run:function(e){if(!e.lint?.["check-internal-slots"])return;const t=[...document.querySelectorAll("var+a")].filter(e=>{const t=e.previousSibling?.nodeName;return"VAR"===t});t.length&&Ii(jh.msg,Dh,{hint:jh.hint,elements:t})}});const Mh="core/linter-rules/local-refs-exist",qh=ui({en:{msg:"Broken local reference found in document.",hint:"Please fix the links mentioned."},cs:{msg:"V dokumentu byla nalezena nefunkční lokální reference.",hint:"Opravte prosím uvedené odkazy."}});function Uh(e){const t=e.getAttribute("href")?.substring(1);if(!t)return;const n=e.ownerDocument;return!n.getElementById(t)&&!n.getElementsByName(t).length}var Wh=Object.freeze({__proto__:null,name:Mh,run:function(e){if(!e.lint?.["local-refs-exist"])return;const t=[...document.querySelectorAll("a[href^='#']")].filter(Uh);t.length&&Ii(qh.msg,Mh,{hint:qh.hint,elements:t})}});const Fh="core/linter-rules/no-captionless-tables",Hh=ui({en:{msg:"All tables marked with class='numbered' must start with a caption element.",hint:"Add a `caption` to the offending table."},cs:{msg:"Všechny tabulky označené class='numbered' musí začínat elementem caption.",hint:"Přidejte k dané tabulce element `caption`."},nl:{msg:"Alle tabellen met class='numbered' dienen te beginnen met een caption-element.",hint:"Voeg een `caption` toe aan de betreffende tabel."}});var Bh=Object.freeze({__proto__:null,name:Fh,run:function(e){if(!e.lint?.["no-captionless-tables"])return;const t=[...document.querySelectorAll("table.numbered")].filter(e=>!(e.firstElementChild instanceof HTMLTableCaptionElement));t.length&&Ii(Hh.msg,Fh,{hint:Hh.hint,elements:t})}});const Gh="no-unused-dfns",Vh="core/linter-rules/no-unused-dfns",Jh=ui({en:{msg:e=>`Found definition for "${e}", but nothing links to it. This is usually a spec bug!`,get hint(){return qi`
1495
1598
  You can do one of the following...
1496
1599
 
1497
1600
  * Add a \`class="lint-ignore"\` attribute the definition.
@@ -1505,28 +1608,28 @@ var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}`;var Fp=Obje
1505
1608
  * Definici buď odstraňte, nebo změňte \`<dfn>\` na jiný typ HTML elementu.
1506
1609
  * Pokud jste chtěli ${"[export|#data-export]"} tuto definici, přidejte k ní \`class="export"\`.
1507
1610
 
1508
- Pro úplné potlačení tohoto varování nastavte \`lint: { "no-unused-dfns": false }\` ve vaší \`respecConfig\`.`}}});function Oh(e){return!document.querySelector(`a[href="#${e.id}"]:not(.index-term, .self-link)`)}var Dh=Object.freeze({__proto__:null,name:Nh,run:function(e){if(!e.lint?.[Ph])return;const t="error"===e.lint[Ph]?Ni:Ii;[...document.querySelectorAll("dfn:not(.lint-ignore, [data-export], [data-cite])")].filter(Oh).forEach(e=>{const n=[e],r=ui(e.textContent);t(Ih.msg(r),Nh,{elements:n,hint:Ih.hint})})}});const jh="core/linter-rules/no-headingless-sections",zh=di({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"},cs:{msg:"Všechny sekce musí začínat elementem `h2-6`.",hint:"Přidejte do problematické sekce `h2-6` nebo použijte `<div>`."}});var Mh=Object.freeze({__proto__:null,name:jh,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,.introductory,#abstract,#sotd)")].filter(({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement));t.length&&Ii(zh.msg,jh,{hint:zh.hint,elements:t})}});const qh="core/linter-rules/no-unused-vars",Uh=di({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."},cs:{msg:"Proměnná byla definována, ale nikdy nebyla použita.",hint:"Přidejte atribut `data-ignore-unused` k elementu `<var>`."}});var Wh=Object.freeze({__proto__:null,name:qh,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 i=new Map;for(const e of r){const t=ui(e.textContent),n=i.get(t)||i.set(t,[]).get(t);n?.push(e)}for(const e of i.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Ii(Uh.msg,qh,{hint:Uh.hint,elements:t})}});const Fh="no-dfn-in-abstract",Bh=`core/linter-rules/${Fh}`,Hh=di({en:{msg:e=>`Definition \`${e}\` is in an unnumbered section (e.g. abstract or SotD).`,get hint(){return qi`Definitions in unnumbered sections (abstract, SotD) are semantically out of place and appear in the terms index without a section number. Move this definition to a numbered section such as "Terminology". See ${"[export|#data-export]"}.`}}}),Gh=["section#abstract","section#sotd","section.introductory"].join(", ");var Vh=Object.freeze({__proto__:null,name:Bh,run:function(e){if(!e.lint?.[Fh])return;const t=[...document.querySelectorAll("dfn")].filter(e=>e.closest(Gh));t.forEach(e=>{const t=ui(e.textContent);Ii(Hh.msg(t),Bh,{hint:Hh.hint,elements:[e]})})}});const Jh="required-sections",Zh="w3c/linter-rules/required-sections",Kh={en:{msg:e=>`W3C Recommendation track documents require a separate "${e}" section.`,hint:e=>qi`Add a \`<section>\` with a "${e}" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).
1611
+ Pro úplné potlačení tohoto varování nastavte \`lint: { "no-unused-dfns": false }\` ve vaší \`respecConfig\`.`}}});function Zh(e){return!document.querySelector(`a[href="#${e.id}"]:not(.index-term, .self-link)`)}var Kh=Object.freeze({__proto__:null,name:Vh,run:function(e){if(!e.lint?.[Gh])return;const t="error"===e.lint[Gh]?Ni:Ii;[...document.querySelectorAll("dfn:not(.lint-ignore, [data-export], [data-cite])")].filter(Zh).forEach(e=>{const n=[e],r=di(e.textContent);t(Jh.msg(r),Vh,{elements:n,hint:Jh.hint})})}});const Yh="core/linter-rules/no-headingless-sections",Xh=ui({en:{msg:"All sections must start with a `h2-6` element.",hint:"Add a `h2-6` to the offending section or use a `<div>`."},nl:{msg:"Alle secties moeten beginnen met een `h2-6` element.",hint:"Voeg een `h2-6` toe aan de conflicterende sectie of gebruik een `<div>`."},zh:{msg:"所有章节(section)都必须以 `h2-6` 元素开头。",hint:"将 `h2-6` 添加到有问题的章节或使用 `<div>`。"},cs:{msg:"Všechny sekce musí začínat elementem `h2-6`.",hint:"Přidejte do problematické sekce `h2-6` nebo použijte `<div>`."}});var Qh=Object.freeze({__proto__:null,name:Yh,run:function(e){if(!e.lint?.["no-headingless-sections"])return;const t=[...document.querySelectorAll("section:not(.head,.introductory,#abstract,#sotd)")].filter(({firstElementChild:e})=>!e||!(e.matches(".header-wrapper")||e instanceof HTMLHeadingElement));t.length&&Ii(Xh.msg,Yh,{hint:Xh.hint,elements:t})}});const ef="core/linter-rules/no-unused-vars",tf=ui({en:{msg:"Variable was defined, but never used.",hint:"Add a `data-ignore-unused` attribute to the `<var>`."},cs:{msg:"Proměnná byla definována, ale nikdy nebyla použita.",hint:"Přidejte atribut `data-ignore-unused` k elementu `<var>`."}});var nf=Object.freeze({__proto__:null,name:ef,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 i=new Map;for(const e of r){const t=di(e.textContent),n=i.get(t)||i.set(t,[]).get(t);n?.push(e)}for(const e of i.values())1!==e.length||e[0].hasAttribute("data-ignore-unused")||t.push(e[0])}t.length&&Ii(tf.msg,ef,{hint:tf.hint,elements:t})}});const rf="no-dfn-in-abstract",sf=`core/linter-rules/${rf}`,of=ui({en:{msg:e=>`Definition \`${e}\` is in an unnumbered section (e.g. abstract or SotD).`,get hint(){return qi`Definitions in unnumbered sections (abstract, SotD) are semantically out of place and appear in the terms index without a section number. Move this definition to a numbered section such as "Terminology". See ${"[export|#data-export]"}.`}}}),af=["section#abstract","section#sotd","section.introductory"].join(", ");var cf=Object.freeze({__proto__:null,name:sf,run:function(e){if(!e.lint?.[rf])return;const t=[...document.querySelectorAll("dfn")].filter(e=>e.closest(af));t.forEach(e=>{const t=di(e.textContent);Ii(of.msg(t),sf,{hint:of.hint,elements:[e]})})}});const lf="required-sections",df="w3c/linter-rules/required-sections",uf={en:{msg:e=>`W3C Recommendation track documents require a separate "${e}" section.`,hint:e=>qi`Add a \`<section>\` with a "${e}" header. See the [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).
1509
1612
  If the document is not intended for the W3C Recommendation track, set ${"[noRecTrack]"} to \`true\`
1510
- or turn off the ${`[${Jh}]`} linter rule.`,privacy_considerations:"Privacy Considerations",security_considerations:"Security Considerations"},es:{msg:e=>`Documentos que van a ser "W3C Recommendation" requieren una sección "${e}" separada.`,hint:e=>qi`Agrega una \`<section>\` con título "${e}". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).
1613
+ or turn off the ${`[${lf}]`} linter rule.`,privacy_considerations:"Privacy Considerations",security_considerations:"Security Considerations"},es:{msg:e=>`Documentos que van a ser "W3C Recommendation" requieren una sección "${e}" separada.`,hint:e=>qi`Agrega una \`<section>\` con título "${e}". Ver los [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).
1511
1614
  Si el documento no está destinado a ser un W3C Recommendation, puedes poner ${"[noRecTrack]"} a \`true\`
1512
- o apaga la regla de linter ${`[${Jh}]`}.`,privacy_considerations:"Consideraciones de privacidad",security_considerations:"Consideraciones de Seguridad"},cs:{msg:e=>`Dokumenty na "W3C Recommendation track" vyžadují samostatnou sekci "${e}".`,hint:e=>qi`Přidejte \`<section>\` s nadpisem "${e}". Viz [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).
1615
+ o apaga la regla de linter ${`[${lf}]`}.`,privacy_considerations:"Consideraciones de privacidad",security_considerations:"Consideraciones de Seguridad"},cs:{msg:e=>`Dokumenty na "W3C Recommendation track" vyžadují samostatnou sekci "${e}".`,hint:e=>qi`Přidejte \`<section>\` s nadpisem "${e}". Viz [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).
1513
1616
  Pokud dokument není určen pro "W3C Recommendation track", nastavte ${"[noRecTrack]"} na \`true\`
1514
- nebo vypněte linter pravidlo ${`[${Jh}]`}.
1617
+ nebo vypněte linter pravidlo ${`[${lf}]`}.
1515
1618
  `,privacy_considerations:"Zásady ochrany soukromí",security_considerations:"Zásady bezpečnosti"},nl:{msg:e=>`Documenten op de "W3C Recommendation track" vereisen een aparte "${e}" sectie.`,hint:e=>qi`Voeg een \`<section>\` toe met als titel "${e}". Zie de [Horizontal review guidelines](https://www.w3.org/Guide/documentreview/#how_to_get_horizontal_review).
1516
1619
  Als het document niet bedoeld is voor de "W3C Recommendation track", zet ${"[noRecTrack]"} dan op \`true\`
1517
- of schakel de linterregel ${`[${Jh}]`} uit.`,privacy_considerations:"Privacyoverwegingen",security_considerations:"Beveiligingsoverwegingen"}},Yh=di(Kh),Xh=new Set([...ko]);Xh.delete("DISC"),wo.forEach(e=>Xh.delete(e));var Qh=Object.freeze({__proto__:null,name:Zh,requiresSomeSectionStatus:Xh,run:function(e){if(!e.lint?.[Jh])return;if(!pi(Kh,"privacy_considerations")){return void Ii("Cannot check for required sections as translations are not available.",Zh,{hint:"File an issue to add translations or use a supported language."})}if(e.noRecTrack||!Xh.has(e.specStatus))return;const t="error"===e.lint[Jh]?Ni:Ii,n=new Ti([Yh.privacy_considerations,Yh.security_considerations]),r=document.querySelectorAll("h2, h3, h4, h5, h6");for(const e of r){const t=e.cloneNode(!0);t.querySelectorAll("bdi")?.forEach(e=>e.remove());const r=ui(t.textContent);if(n.has(r)&&(n.delete(r),0===n.size))return}for(const e of n)t(Yh.msg(e),Zh,{hint:Yh.hint(e)})}});const ef="core/linter-rules/wpt-tests-exist",tf=di({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."},cs:{msg:"Následující test nebyl nalezen ve Web Platform Tests:",hint:"Zkontrolujte [wpt.live](https://wpt.live), zda nebyl smazán nebo přejmenován."}});var nf=Object.freeze({__proto__:null,name:ef,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 Ii("Failed to parse WPT directory from testSuiteURI",`linter/${ef}`),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",`${t}/`);r.searchParams.set("path",n);const i=await fetch(r);if(!i.ok){return Ii(`Failed to fetch files from WPT repository. Request failed with error: ${await i.text()} (${i.status})`,`linter/${ef}`),null}const{entries:s}=await i.json(),o=s.filter(e=>!e.endsWith("/"));return new Set(o)}(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=>{Ii(`${tf.msg} \`${t}\`.`,ef,{hint:tf.hint,elements:[e]})})}});const rf="core/linter-rules/no-http-props",sf=di({en:{msg:qi`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:qi`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"},cs:{msg:qi`V ${"[respecConfig]"} nejsou povoleny nezabezpečené URL adresy.`,hint:"Změňte prosím následující vlastnosti na 'https://': "}});var of=Object.freeze({__proto__:null,name:rf,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=ai(t,e=>qi`${`[${e}]`}`);Ii(sf.msg,rf,{hint:sf.hint+e})}}});const af="core/linter-rules/a11y",cf=["color-contrast","landmark-one-main","landmark-unique","region"];function lf(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),i=r.map(e=>`- ${e.trimEnd()}`).join("\n");t.push(`${e}${i}`)}return t.join("\n\n")}var uf=Object.freeze({__proto__:null,name:af,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(cf.map(e=>[e,{enabled:!1}])),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let i;try{i=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 Ni("Failed to load a11y linter.",af),console.error(e),[]}try{const e=await(i?.run(document,r));return e?.violations??[]}catch(e){return Ni("Error while looking for a11y issues.",af),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,i=t.get(e)||t.set(e,[]).get(e);i?.push(r)}const{id:n,help:r,description:i,helpUrl:s}=e,o=`a11y/${n}: ${r}.`;for(const[e,n]of t){const t=lf(e);Ii(o,af,{details:`\n\n${i}.\n\n${t}. ([Learn more](${s}))`,elements:n})}}}});const df="informative-dfn",pf="core/linter-rules/informative-dfn",hf=di({en:{msg:(e,t)=>`Normative reference to "${e}" found but term is defined "informatively" in "${t}".`,get hint(){return qi`
1620
+ of schakel de linterregel ${`[${lf}]`} uit.`,privacy_considerations:"Privacyoverwegingen",security_considerations:"Beveiligingsoverwegingen"}},pf=ui(uf),hf=new Set([...$o]);hf.delete("DISC"),ko.forEach(e=>hf.delete(e));var ff=Object.freeze({__proto__:null,name:df,requiresSomeSectionStatus:hf,run:function(e){if(!e.lint?.[lf])return;if(!pi(uf,"privacy_considerations")){return void Ii("Cannot check for required sections as translations are not available.",df,{hint:"File an issue to add translations or use a supported language."})}if(e.noRecTrack||!hf.has(e.specStatus))return;const t="error"===e.lint[lf]?Ni:Ii,n=new Ti([pf.privacy_considerations,pf.security_considerations]),r=document.querySelectorAll("h2, h3, h4, h5, h6");for(const e of r){const t=e.cloneNode(!0);t.querySelectorAll("bdi")?.forEach(e=>e.remove());const r=di(t.textContent);if(n.has(r)&&(n.delete(r),0===n.size))return}for(const e of n)t(pf.msg(e),df,{hint:pf.hint(e)})}});const mf="core/linter-rules/wpt-tests-exist",gf=ui({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."},cs:{msg:"Následující test nebyl nalezen ve Web Platform Tests:",hint:"Zkontrolujte [wpt.live](https://wpt.live), zda nebyl smazán nebo přejmenován."}});var bf=Object.freeze({__proto__:null,name:mf,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 Ii("Failed to parse WPT directory from testSuiteURI",`linter/${mf}`),console.error(e),null}const r=new URL("web-platform-tests/wpt/files",`${t}/`);r.searchParams.set("path",n);const i=await fetch(r);if(!i.ok){return Ii(`Failed to fetch files from WPT repository. Request failed with error: ${await i.text()} (${i.status})`,`linter/${mf}`),null}const{entries:s}=await i.json(),o=s.filter(e=>!e.endsWith("/"));return new Set(o)}(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=>{Ii(`${gf.msg} \`${t}\`.`,mf,{hint:gf.hint,elements:[e]})})}});const yf="core/linter-rules/no-http-props",wf=ui({en:{msg:qi`Insecure URLs are not allowed in ${"[respecConfig]"}.`,hint:"Please change the following properties to 'https://': "},zh:{msg:qi`${"[respecConfig]"} 中不允许使用不安全的URL.`,hint:"请将以下属性更改为 https://:"},cs:{msg:qi`V ${"[respecConfig]"} nejsou povoleny nezabezpečené URL adresy.`,hint:"Změňte prosím následující vlastnosti na 'https://': "}});var vf=Object.freeze({__proto__:null,name:yf,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=ai(t,e=>qi`${`[${e}]`}`);Ii(wf.msg,yf,{hint:wf.hint+e})}}});const kf="core/linter-rules/a11y",$f=["color-contrast","landmark-one-main","landmark-unique","region"];function xf(e){const t=[];for(const n of e.split("\n\n")){const[e,...r]=n.split(/^\s{2}/m),i=r.map(e=>`- ${e.trimEnd()}`).join("\n");t.push(`${e}${i}`)}return t.join("\n\n")}var Cf=Object.freeze({__proto__:null,name:kf,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($f.map(e=>[e,{enabled:!1}])),...t},...n,elementRef:!0,resultTypes:["violations"],reporter:"v1"};let i;try{i=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 Ni("Failed to load a11y linter.",kf),console.error(e),[]}try{const e=await(i?.run(document,r));return e?.violations??[]}catch(e){return Ni("Error while looking for a11y issues.",kf),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,i=t.get(e)||t.set(e,[]).get(e);i?.push(r)}const{id:n,help:r,description:i,helpUrl:s}=e,o=`a11y/${n}: ${r}.`;for(const[e,n]of t){const t=xf(e);Ii(o,kf,{details:`\n\n${i}.\n\n${t}. ([Learn more](${s}))`,elements:n})}}}});const Sf="informative-dfn",_f="core/linter-rules/informative-dfn",Tf=ui({en:{msg:(e,t)=>`Normative reference to "${e}" found but term is defined "informatively" in "${t}".`,get hint(){return qi`
1518
1621
  You can do one of the following...
1519
1622
 
1520
1623
  * Get the source definition to be made normative
1521
1624
  * Add a \`class="lint-ignore"\` attribute to the link.
1522
1625
  * Use a local normative proxy for the definition à la \`<dfn data-cite="spec">term</dfn>\`
1523
1626
 
1524
- To silence this warning entirely, set \`lint: { "${df}": false }\` in your \`respecConfig\`.`}},cs:{msg:(e,t)=>`Nalezen normativní odkaz na "${e}", ale pojem je definován pouze informativně v "${t}".`,get hint(){return qi`
1627
+ To silence this warning entirely, set \`lint: { "${Sf}": false }\` in your \`respecConfig\`.`}},cs:{msg:(e,t)=>`Nalezen normativní odkaz na "${e}", ale pojem je definován pouze informativně v "${t}".`,get hint(){return qi`
1525
1628
  Můžete udělat jedno z následujícího...
1526
1629
 
1527
1630
  * Požádejte o to, aby zdrojová definice byla normativní
1528
1631
  * Přidejte atribut \`class=\"lint-ignore\"\` k odkazu.
1529
1632
  * Použijte lokální normativní proxy pro definici, např. \`<dfn data-cite=\"spec\">term</dfn>\`
1530
1633
 
1531
- Pro úplné potlačení tohoto varování nastavte \`lint: { \"${df}\": false }\` ve vaší \`respecConfig\`.`}}});var ff=Object.freeze({__proto__:null,name:pf,run:function(e){if(!e.lint?.[df])return;const t="error"===e.lint[df]?Ni:Ii;xu.forEach(({term:e,spec:n,element:r})=>{r.classList.contains("lint-ignore")||t(hf.msg(e,n),pf,{title:"Normative reference to non-normative term.",elements:[r],hint:hf.hint})})}}),mf=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (typeof document.respec?.ready?.then === "function") {\n document.respec.ready.then(setupClipboard);\n} else {\n setupClipboard();\n}\n\nfunction setupClipboard() {\n const latestWrite = new WeakMap();\n const timers = new WeakMap();\n\n // Created up front: a live region that is created and filled in the same\n // click is often not announced. It goes first in the body, so a page the\n // browser saves holds it before this script runs again. ReSpec\'s own save\n // drops it (removeOnSave), and the saved page\'s script makes a new one.\n /** @type {HTMLElement} */\n const status =\n document.getElementById("respec-copy-status") ?? createStatus();\n\n // A page saved by the browser during a confirmation keeps the attributes and\n // the announcement text, but not the timer that would remove them. In a saved\n // page this script runs while the page is still loading, before every button\n // is parsed, so clean again once the page has loaded, leaving the buttons\n // this script has confirmed.\n const clearSavedConfirmations = () => {\n document.querySelectorAll(".respec-button-copy-paste").forEach(button => {\n if (timers.has(button)) return;\n button.removeAttribute("data-copy-state");\n button.removeAttribute("data-label");\n });\n };\n clearSavedConfirmations();\n document.addEventListener("DOMContentLoaded", clearSavedConfirmations);\n status.textContent = "";\n\n // Capture phase, so an author\'s container that stops propagation cannot\n // stop the copy.\n document.addEventListener("click", onClick, true);\n\n // Last, so the buttons show only once the listener is in place, and only on\n // a page with the clipboard API (a saved file served over plain http has\n // none). An adopted style sheet is not saved with the page, so a saved copy\n // shows its buttons only while its own script runs. A browser without\n // adopted style sheets gets a style element that ReSpec drops when it saves.\n if (navigator.clipboard) {\n const rule =\n "@media not print { .respec-button-copy-paste { display: grid; } }";\n try {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(rule);\n document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];\n } catch {\n const style = document.createElement("style");\n style.className = "removeOnSave";\n document.head.append(style);\n // Inserted through the style sheet, so the rule is not in the markup that\n // a browser saves.\n style.sheet?.insertRule(rule);\n }\n }\n\n /** The span is written with its role before it enters the page, so it is announced. */\n function createStatus() {\n const span = document.createElement("span");\n span.id = "respec-copy-status";\n span.className = "respec-visually-hidden removeOnSave";\n span.setAttribute("role", "status");\n document.body.prepend(span);\n return span;\n }\n\n /** @param {MouseEvent} event */\n function onClick(event) {\n const target = event.target;\n if (!(target instanceof Element)) return;\n const button = /** @type {HTMLElement | null} */ (\n target.closest(".respec-button-copy-paste")\n );\n if (!button) return;\n const text = getCopyText(button);\n if (text === null) return;\n if (!navigator.clipboard) {\n console.warn(\n "Copying needs a secure page, such as one served over https."\n );\n return;\n }\n // Claim a copy only once the clipboard has taken the text. A write is\n // refused in a cross-origin frame or with the permission denied. Two\n // clicks can leave writes pending together, and only the newest reports.\n const write = (latestWrite.get(button) ?? 0) + 1;\n latestWrite.set(button, write);\n navigator.clipboard.writeText(text).then(\n () => {\n if (latestWrite.get(button) === write) acknowledge(button, "copied");\n },\n error => {\n console.warn("Could not write to the clipboard.", error);\n if (latestWrite.get(button) === write) acknowledge(button, "failed");\n }\n );\n }\n\n /**\n * The text a button copies: its code block, minus the part it says to ignore.\n * @param {HTMLElement} button\n * @returns {string | null}\n */\n function getCopyText(button) {\n const pre = button.closest("pre");\n if (!pre) return null;\n const clone = /** @type {HTMLElement} */ (pre.cloneNode(true));\n const ignoreSelector = button.dataset.copyIgnore;\n if (ignoreSelector) clone.querySelector(ignoreSelector)?.remove();\n return clone.textContent;\n }\n\n /**\n * Announce an outcome and show it on the button for a moment.\n * @param {HTMLElement} button\n * @param {"copied" | "failed"} outcome\n */\n function acknowledge(button, outcome) {\n const label =\n (outcome === "copied"\n ? button.dataset.copiedLabel\n : button.dataset.failedLabel) || "";\n if (typeof button.ariaNotify === "function") {\n button.ariaNotify(label);\n } else {\n // A live region ignores an unchanged string, so alternate a zero-width space.\n status.textContent =\n status.textContent === label ? `${label}\\u200B` : label;\n }\n // The label stays on the button after the message ends, so the bubble keeps\n // its text while it fades out.\n button.dataset.label = label;\n // A new result replaces the one on show and the timer that would end it.\n clearTimeout(timers.get(button));\n button.dataset.copyState = outcome;\n timers.set(\n button,\n setTimeout(() => {\n delete button.dataset.copyState;\n // The live region is shared, so another button\'s message may still be showing.\n if (\n !document.querySelector(".respec-button-copy-paste[data-copy-state]")\n ) {\n status.textContent = "";\n }\n }, 1200)\n );\n }\n}\n})()'}),gf=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\n\nif (document.respec) {\n document.respec.ready.then(setupVarHighlighter);\n} else {\n setupVarHighlighter();\n}\n\nfunction setupVarHighlighter() {\n document\n .querySelectorAll("var")\n .forEach(varElem => varElem.addEventListener("click", highlightListener));\n}\n\n/**\n * @param {MouseEvent} ev\n */\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const varElem = /** @type {HTMLElement} */ (ev.target);\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\n/**\n * @param {HTMLElement} target\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\n/**\n * @param {HTMLElement} varElem\n */\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = /** @type {HTMLElement} */ (\n varElem.closest(".algorithm, section")\n );\n if (!parent) return [];\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\n/**\n * @param {HTMLElement} el\n * @param {string} highlightColor\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\n/**\n * @param {HTMLElement} elem\n * @param {string} highlightColor\n */\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add("respec-hl", highlightColor);\n}\n\n/**\n * Same as `norm` from src/core/utils, but our build process doesn\'t allow\n * imports in runtime scripts, so duplicated here.\n * @param {string} str\n */\nfunction norm(str) {\n return str.trim().replace(/\\s+/g, " ");\n}\n})()'}),bf=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 setupCopyButtons();\n}\n\nfunction panelListener() {\n /** @type {HTMLElement | null} */\n let panel = null;\n /**\n * @param {KeyboardEvent|MouseEvent} event\n */\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 (\n type === "keydown" &&\n /** @type {KeyboardEvent} */ (event).key !== "Enter"\n )\n return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement | null} */\n const dfn = target.closest("dfn, .index-term");\n if (!dfn?.id) break;\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n if (!panel) break;\n const coords = deriveCoordinates(\n /** @type {MouseEvent|KeyboardEvent} */ (event)\n );\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n if (panel) {\n panel.style.left = "";\n panel.style.top = "";\n panel.classList.add("docked");\n }\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 // Copy buttons keep the panel open regardless of docked state.\n if (target.closest(".dfn-panel-copy-btn")) {\n return "none";\n }\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n\n const panel = /** @type {HTMLElement} */ (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 | null} */\n const caret = panel.querySelector(".caret");\n if (caret) caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLElement> */\n const focusableElements = panel.querySelectorAll(\n "a[href], button:not([disabled])"\n );\n // No need to trap focus\n if (!focusableElements.length) return;\n\n // Move focus to first anchor element\n const first = focusableElements.item(0);\n first.focus();\n\n const trapListener = createTrapListener(focusableElements, 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<HTMLElement>} focusableElements\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(focusableElements, panel, dfn) {\n const lastIndex = focusableElements.length - 1;\n /**\n * @param {KeyboardEvent} event\n */\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 let index = [...focusableElements].indexOf(\n /** @type {HTMLElement} */ (document.activeElement)\n );\n index += event.shiftKey ? -1 : +1;\n if (index < 0) {\n index = lastIndex;\n } else if (index > lastIndex) {\n index = 0;\n }\n focusableElements.item(index).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n if (\n event.target instanceof HTMLElement &&\n event.target.closest("a[href]")\n ) {\n hidePanel(panel);\n }\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 | null} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n\nfunction setupCopyButtons() {\n document.body.addEventListener("click", event => {\n // The icon is an SVG, which is an Element but not an HTMLElement.\n const target = event.target;\n const btn =\n target instanceof Element && target.closest(".dfn-panel-copy-btn");\n if (!btn) return;\n const text = btn.querySelector("code")?.textContent;\n if (!text) return;\n navigator.clipboard?.writeText(text).then(\n () => btn.ariaNotify?.("Copied"),\n () => {}\n );\n });\n}\n})()'})}();
1634
+ Pro úplné potlačení tohoto varování nastavte \`lint: { \"${Sf}\": false }\` ve vaší \`respecConfig\`.`}}});var Rf=Object.freeze({__proto__:null,name:_f,run:function(e){if(!e.lint?.[Sf])return;const t="error"===e.lint[Sf]?Ni:Ii;jd.forEach(({term:e,spec:n,element:r})=>{r.classList.contains("lint-ignore")||t(Tf.msg(e,n),_f,{title:"Normative reference to non-normative term.",elements:[r],hint:Tf.hint})})}}),Ef=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\nif (typeof document.respec?.ready?.then === "function") {\n document.respec.ready.then(setupClipboard);\n} else {\n setupClipboard();\n}\n\nfunction setupClipboard() {\n const latestWrite = new WeakMap();\n const timers = new WeakMap();\n\n // Created up front: a live region that is created and filled in the same\n // click is often not announced. It goes first in the body, so a page the\n // browser saves holds it before this script runs again. ReSpec\'s own save\n // drops it (removeOnSave), and the saved page\'s script makes a new one.\n /** @type {HTMLElement} */\n const status =\n document.getElementById("respec-copy-status") ?? createStatus();\n\n // A page saved by the browser during a confirmation keeps the attributes and\n // the announcement text, but not the timer that would remove them. In a saved\n // page this script runs while the page is still loading, before every button\n // is parsed, so clean again once the page has loaded, leaving the buttons\n // this script has confirmed.\n const clearSavedConfirmations = () => {\n document.querySelectorAll(".respec-button-copy-paste").forEach(button => {\n if (timers.has(button)) return;\n button.removeAttribute("data-copy-state");\n button.removeAttribute("data-label");\n });\n };\n clearSavedConfirmations();\n document.addEventListener("DOMContentLoaded", clearSavedConfirmations);\n status.textContent = "";\n\n // Capture phase, so an author\'s container that stops propagation cannot\n // stop the copy.\n document.addEventListener("click", onClick, true);\n\n // Last, so the buttons show only once the listener is in place, and only on\n // a page with the clipboard API (a saved file served over plain http has\n // none). An adopted style sheet is not saved with the page, so a saved copy\n // shows its buttons only while its own script runs. A browser without\n // adopted style sheets gets a style element that ReSpec drops when it saves.\n if (navigator.clipboard) {\n const rule =\n "@media not print { .respec-button-copy-paste { display: grid; } }";\n try {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(rule);\n document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];\n } catch {\n const style = document.createElement("style");\n style.className = "removeOnSave";\n document.head.append(style);\n // Inserted through the style sheet, so the rule is not in the markup that\n // a browser saves.\n style.sheet?.insertRule(rule);\n }\n }\n\n /** The span is written with its role before it enters the page, so it is announced. */\n function createStatus() {\n const span = document.createElement("span");\n span.id = "respec-copy-status";\n span.className = "respec-visually-hidden removeOnSave";\n span.setAttribute("role", "status");\n document.body.prepend(span);\n return span;\n }\n\n /** @param {MouseEvent} event */\n function onClick(event) {\n const target = event.target;\n if (!(target instanceof Element)) return;\n const button = /** @type {HTMLElement | null} */ (\n target.closest(".respec-button-copy-paste")\n );\n if (!button) return;\n const text = getCopyText(button);\n if (text === null) return;\n if (!navigator.clipboard) {\n console.warn(\n "Copying needs a secure page, such as one served over https."\n );\n return;\n }\n // Claim a copy only once the clipboard has taken the text. A write is\n // refused in a cross-origin frame or with the permission denied. Two\n // clicks can leave writes pending together, and only the newest reports.\n const write = (latestWrite.get(button) ?? 0) + 1;\n latestWrite.set(button, write);\n navigator.clipboard.writeText(text).then(\n () => {\n if (latestWrite.get(button) === write) acknowledge(button, "copied");\n },\n error => {\n console.warn("Could not write to the clipboard.", error);\n if (latestWrite.get(button) === write) acknowledge(button, "failed");\n }\n );\n }\n\n /**\n * The text a button copies: the text of the source elements it names, one\n * per line, otherwise its code block minus the part it says to ignore.\n * @param {HTMLElement} button\n * @returns {string | null}\n */\n function getCopyText(button) {\n const sourceSelector = button.dataset.copySource;\n const container = button.dataset.copyContainer\n ? button.closest(button.dataset.copyContainer)\n : null;\n if (sourceSelector && container) {\n const sources = container.querySelectorAll(sourceSelector);\n if (sources.length) {\n return Array.from(sources, source => source.textContent).join("\\n");\n }\n }\n const pre = button.closest("pre");\n if (!pre) return null;\n const clone = /** @type {HTMLElement} */ (pre.cloneNode(true));\n const ignoreSelector = button.dataset.copyIgnore;\n if (ignoreSelector) clone.querySelector(ignoreSelector)?.remove();\n return clone.textContent;\n }\n\n /**\n * Announce an outcome and show it on the button for a moment.\n * @param {HTMLElement} button\n * @param {"copied" | "failed"} outcome\n */\n function acknowledge(button, outcome) {\n const label =\n (outcome === "copied"\n ? button.dataset.copiedLabel\n : button.dataset.failedLabel) || "";\n if (typeof button.ariaNotify === "function") {\n button.ariaNotify(label);\n } else {\n // A live region ignores an unchanged string, so alternate a zero-width space.\n status.textContent =\n status.textContent === label ? `${label}\\u200B` : label;\n }\n // The label stays on the button after the message ends, so the bubble keeps\n // its text while it fades out.\n button.dataset.label = label;\n // A new result replaces the one on show and the timer that would end it.\n clearTimeout(timers.get(button));\n button.dataset.copyState = outcome;\n timers.set(\n button,\n setTimeout(() => {\n delete button.dataset.copyState;\n // The live region is shared, so another button\'s message may still be showing.\n if (\n !document.querySelector(".respec-button-copy-paste[data-copy-state]")\n ) {\n status.textContent = "";\n }\n }, 1200)\n );\n }\n}\n})()'}),Af=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\n// Also runs in saved pages, where ReSpec is absent. Declare nothing at the top\n// level: the build wraps this file in a function, and source mode does not.\ndocument.addEventListener("pointerdown", event => {\n if (!(event.target instanceof Element)) return;\n const pressed = event.target.closest(".diagram-container");\n document.querySelectorAll(".diagram-container--active").forEach(card => {\n if (card !== pressed) card.classList.remove("diagram-container--active");\n });\n if (pressed && event.pointerType !== "mouse") {\n pressed.classList.add("diagram-container--active");\n }\n});\n\ndocument.querySelectorAll(".diagram-flip-btn").forEach(button => {\n button.addEventListener("click", () => {\n const container = button.closest(".diagram-container");\n if (!container) return;\n const isFlipped = container.classList.toggle("diagram-container--flipped");\n button.setAttribute("aria-expanded", String(isFlipped));\n const front = /** @type {HTMLElement | null} */ (\n container.querySelector(".diagram-face--front")\n );\n const back = /** @type {HTMLElement | null} */ (\n container.querySelector(".diagram-face--back")\n );\n const flip = /** @type {HTMLElement | null} */ (\n container.querySelector(".diagram-flip")\n );\n if (front) front.inert = isFlipped;\n if (back) back.inert = !isFlipped;\n // A normal card\'s back face is absolute, so only this grows the card to a\n // taller source.\n if (flip && back) {\n flip.style.minHeight = isFlipped ? `${back.scrollHeight}px` : "";\n }\n });\n});\n})()'}),Lf=Object.freeze({__proto__:null,default:'(() => {\n// @ts-check\n\nif (document.respec) {\n document.respec.ready.then(setupVarHighlighter);\n} else {\n setupVarHighlighter();\n}\n\nfunction setupVarHighlighter() {\n document\n .querySelectorAll("var")\n .forEach(varElem => varElem.addEventListener("click", highlightListener));\n}\n\n/**\n * @param {MouseEvent} ev\n */\nfunction highlightListener(ev) {\n ev.stopPropagation();\n const varElem = /** @type {HTMLElement} */ (ev.target);\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\n/**\n * @param {HTMLElement} target\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\n/**\n * @param {HTMLElement} varElem\n */\nfunction highlightVars(varElem) {\n const textContent = norm(varElem.textContent);\n const parent = /** @type {HTMLElement} */ (\n varElem.closest(".algorithm, section")\n );\n if (!parent) return [];\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\n/**\n * @param {HTMLElement} el\n * @param {string} highlightColor\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\n/**\n * @param {HTMLElement} elem\n * @param {string} highlightColor\n */\nfunction addHighlight(elem, highlightColor) {\n elem.classList.add("respec-hl", highlightColor);\n}\n\n/**\n * Same as `norm` from src/core/utils, but our build process doesn\'t allow\n * imports in runtime scripts, so duplicated here.\n * @param {string} str\n */\nfunction norm(str) {\n return str.trim().replace(/\\s+/g, " ");\n}\n})()'}),Pf=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 setupCopyButtons();\n}\n\nfunction panelListener() {\n /** @type {HTMLElement | null} */\n let panel = null;\n /**\n * @param {KeyboardEvent|MouseEvent} event\n */\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 (\n type === "keydown" &&\n /** @type {KeyboardEvent} */ (event).key !== "Enter"\n )\n return;\n\n const action = deriveAction(event);\n\n switch (action) {\n case "show": {\n hidePanel(panel);\n /** @type {HTMLElement | null} */\n const dfn = target.closest("dfn, .index-term");\n if (!dfn?.id) break;\n panel = document.getElementById(`dfn-panel-for-${dfn.id}`);\n if (!panel) break;\n const coords = deriveCoordinates(\n /** @type {MouseEvent|KeyboardEvent} */ (event)\n );\n displayPanel(dfn, panel, coords);\n break;\n }\n case "dock": {\n if (panel) {\n panel.style.left = "";\n panel.style.top = "";\n panel.classList.add("docked");\n }\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 // Copy buttons keep the panel open regardless of docked state.\n if (target.closest(".dfn-panel-copy-btn")) {\n return "none";\n }\n if (hitALink) {\n return target.classList.contains("self-link") ? "hide" : "dock";\n }\n\n const panel = /** @type {HTMLElement} */ (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 | null} */\n const caret = panel.querySelector(".caret");\n if (caret) caret.style.left = `${newCaretOffset}px`;\n }\n\n // As it\'s a dialog, we trap focus.\n // TODO: when <dialog> becomes a implemented, we should really\n // use that.\n trapFocus(panel, dfn);\n}\n\n/**\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction trapFocus(panel, dfn) {\n /** @type NodeListOf<HTMLElement> */\n const focusableElements = panel.querySelectorAll(\n "a[href], button:not([disabled])"\n );\n // No need to trap focus\n if (!focusableElements.length) return;\n\n // Move focus to first anchor element\n const first = focusableElements.item(0);\n first.focus();\n\n const trapListener = createTrapListener(focusableElements, 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<HTMLElement>} focusableElements\n * @param {HTMLElement} panel\n * @param {HTMLElement} dfn\n * @returns\n */\nfunction createTrapListener(focusableElements, panel, dfn) {\n const lastIndex = focusableElements.length - 1;\n /**\n * @param {KeyboardEvent} event\n */\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 let index = [...focusableElements].indexOf(\n /** @type {HTMLElement} */ (document.activeElement)\n );\n index += event.shiftKey ? -1 : +1;\n if (index < 0) {\n index = lastIndex;\n } else if (index > lastIndex) {\n index = 0;\n }\n focusableElements.item(index).focus();\n break;\n }\n\n // Hitting "Enter" on an anchor releases the trap.\n case "Enter":\n if (\n event.target instanceof HTMLElement &&\n event.target.closest("a[href]")\n ) {\n hidePanel(panel);\n }\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 | null} panel */\nfunction hidePanel(panel) {\n if (!panel) return;\n panel.hidden = true;\n panel.classList.remove("docked");\n}\n\nfunction setupCopyButtons() {\n document.body.addEventListener("click", event => {\n // The icon is an SVG, which is an Element but not an HTMLElement.\n const target = event.target;\n const btn =\n target instanceof Element && target.closest(".dfn-panel-copy-btn");\n if (!btn) return;\n const text = btn.querySelector("code")?.textContent;\n if (!text) return;\n navigator.clipboard?.writeText(text).then(\n () => btn.ariaNotify?.("Copied"),\n () => {}\n );\n });\n}\n})()'})}();
1532
1635
  //# sourceMappingURL=respec-w3c.js.map