html-standard 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- type AttributeValue = string | true;
1
+ type AttributeValue = string;
2
2
 
3
3
  /**
4
4
  * Options for accessing element attributes.
@@ -15,10 +15,10 @@ interface AttributesOptions {
15
15
 
16
16
  type AttributeSpecValidateResult = {
17
17
  valid: boolean;
18
- message?: string;
18
+ reason?: string;
19
19
  };
20
20
  interface AttributeSpec {
21
- validate(value: AttributeValue): AttributeSpecValidateResult;
21
+ validateValue(value: AttributeValue): AttributeSpecValidateResult;
22
22
  }
23
23
 
24
24
  interface AttributeSpecMap$1 {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- type AttributeValue = string | true;
1
+ type AttributeValue = string;
2
2
 
3
3
  /**
4
4
  * Options for accessing element attributes.
@@ -15,10 +15,10 @@ interface AttributesOptions {
15
15
 
16
16
  type AttributeSpecValidateResult = {
17
17
  valid: boolean;
18
- message?: string;
18
+ reason?: string;
19
19
  };
20
20
  interface AttributeSpec {
21
- validate(value: AttributeValue): AttributeSpecValidateResult;
21
+ validateValue(value: AttributeValue): AttributeSpecValidateResult;
22
22
  }
23
23
 
24
24
  interface AttributeSpecMap$1 {
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var e={ARTICLE:"article",BLOCKQUOTE:"blockquote",BUTTON:"button",CAPTION:"caption",CELL:"cell",CHECKBOX:"checkbox",CODE:"code",COMBOBOX:"combobox",COMPLEMENTARY:"complementary",CONTENTINFO:"contentinfo",DELETION:"deletion",DIALOG:"dialog",DOCUMENT:"document",EMPHASIS:"emphasis",FIGURE:"figure",FORM:"form",GENERIC:"generic",GROUP:"group",HEADING:"heading",IMG:"img",INSERTION:"insertion",LINK:"link",LIST:"list",LISTBOX:"listbox",MAIN:"main",METER:"meter",NAVIGATION:"navigation",OPTION:"option",PARAGRAPH:"paragraph",PROGRESSBAR:"progressbar",RADIO:"radio",ROW:"row",ROWGROUP:"rowgroup",SEARCH:"search",SEARCHBOX:"searchbox",SEPARATOR:"separator",SLIDER:"slider",SPINBUTTON:"spinbutton",STATUS:"status",STRONG:"strong",TABLE:"table",TERM:"term",TEXTBOX:"textbox",TIME:"time"};var W={get(n){return null}};var q=class{constructor(t=W){this.options=t}get(t){return this.options.get(t)}has(t){return this.options.get(t)!==null}};var z=class n{constructor(t,p){this.options=p;this.name=t.toLowerCase()}get attributes(){return new q(this.options.attributes)}parent(){if(!this.options.ancestors)return null;let p=this.options.ancestors()[Symbol.iterator]().next();return p.done||!p.value?null:new n(p.value.name,p.value)}ancestors(){var t,p;return((p=(t=this.options).ancestors)==null?void 0:p.call(t))||[]}};var K={a:n=>n.attributes.has("href")?e.LINK:e.GENERIC,abbr:()=>null,address:()=>e.GROUP,area:n=>n.attributes.has("href")?e.LINK:e.GENERIC,article:()=>e.ARTICLE,aside:()=>e.COMPLEMENTARY,audio:()=>null,b:()=>e.GENERIC,base:()=>null,bdi:()=>e.GENERIC,bdo:()=>e.GENERIC,blockquote:()=>e.BLOCKQUOTE,body:()=>e.GENERIC,br:()=>null,button:()=>e.BUTTON,canvas:()=>null,caption:()=>e.CAPTION,cite:()=>null,code:()=>e.CODE,col:()=>null,colgroup:()=>null,data:()=>e.GENERIC,datalist:()=>e.LISTBOX,dd:()=>null,del:()=>e.DELETION,details:()=>e.GROUP,dfn:()=>e.TERM,dialog:()=>e.DIALOG,div:()=>e.GENERIC,dl:()=>null,dt:()=>null,em:()=>e.EMPHASIS,embed:()=>null,fieldset:()=>e.GROUP,figcaption:()=>null,figure:()=>e.FIGURE,footer:n=>{let t=["article","aside","main","nav","section"];for(let p of n.ancestors())if(t.includes(p.name.toLowerCase()))return e.GENERIC;return e.CONTENTINFO},form:()=>e.FORM,h1:()=>e.HEADING,h2:()=>e.HEADING,h3:()=>e.HEADING,h4:()=>e.HEADING,h5:()=>e.HEADING,h6:()=>e.HEADING,head:()=>null,header:()=>null,hgroup:()=>e.GROUP,hr:()=>e.SEPARATOR,html:()=>e.DOCUMENT,i:()=>e.GENERIC,iframe:()=>null,img:n=>n.attributes.get("alt")===""?null:e.IMG,input:n=>{switch(n.attributes.get("type")||"text"){case"button":case"image":case"reset":case"submit":return e.BUTTON;case"checkbox":return e.CHECKBOX;case"color":case"date":case"datetime-local":case"file":case"hidden":case"month":case"password":case"time":case"week":return null;case"email":case"tel":case"text":case"url":return e.TEXTBOX;case"number":return e.SPINBUTTON;case"radio":return e.RADIO;case"range":return e.SLIDER;case"search":return e.SEARCHBOX;default:return e.TEXTBOX}},ins:()=>e.INSERTION,kbd:()=>null,label:()=>null,legend:()=>null,li:()=>null,link:()=>null,main:()=>e.MAIN,map:()=>null,mark:()=>null,menu:()=>e.LIST,meta:()=>null,meter:()=>e.METER,nav:()=>e.NAVIGATION,noscript:()=>null,object:()=>null,ol:()=>e.LIST,optgroup:()=>e.GROUP,option:()=>e.OPTION,output:()=>e.STATUS,p:()=>e.PARAGRAPH,param:()=>null,picture:()=>null,pre:()=>e.GENERIC,progress:()=>e.PROGRESSBAR,q:()=>e.GENERIC,rp:()=>null,rt:()=>null,ruby:()=>null,s:()=>e.DELETION,samp:()=>e.GENERIC,script:()=>null,search:()=>e.SEARCH,section:()=>null,select:n=>n.attributes.has("multiple")?e.LISTBOX:e.COMBOBOX,slot:()=>null,small:()=>e.GENERIC,span:()=>e.GENERIC,strong:()=>e.STRONG,style:()=>null,sub:()=>null,summary:()=>e.BUTTON,sup:()=>null,svg:()=>null,table:()=>e.TABLE,tbody:()=>e.ROWGROUP,td:()=>e.CELL,template:()=>null,textarea:()=>e.TEXTBOX,tfoot:()=>e.ROWGROUP,th:()=>null,thead:()=>e.ROWGROUP,time:()=>e.TIME,title:()=>null,tr:()=>e.ROW,track:()=>null,u:()=>null,ul:()=>e.LIST,var:()=>null,video:()=>null,wbr:()=>null};var J={valid:!0};function l(){return J}function r(n){return{valid:!1,message:n}}var s=class{constructor(t){this.attributeKey=t}validate(t){return!t||t===!0?l():this.attributeKey===(t==null?void 0:t.toLowerCase())?l():r(`Boolean attribute value must be empty or match the attribute name "${this.attributeKey}", got: "${t}"`)}};s.type="BooleanAttribute";var b={VALUE_MUST_BE_STRING:"Value must be a string",VALUE_CANNOT_BE_EMPTY:"Value cannot be empty"};var i=class{constructor(t){this.options=t}validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);let p=t.toLowerCase();return this.options.keywords.includes(p)?l():r(`Value "${t}" is not a valid keyword. Expected one of: ${this.options.keywords.join(", ")}`)}};i.type="EnumeratedAttribute";var C=class C{validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):C.PATTERN.test(t)?l():r(`Invalid signed integer: "${t}"`)}};C.type="SignedInteger",C.PATTERN=/^-?\d+$/;var x=C;var Y=/[\u0009\u000A\u000C\u000D\u0020]/;var d=class{constructor(t){this.options=t}parse(t){return t.split(Y)}validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);let p=this.parse(t).filter(u=>u!=="");if(this.options.unique){let u=new Set(p);if(p.length!==u.size)return r("Tokens must be unique")}if(this.options.allowed){for(let u of p)if(!this.options.allowed.some(A=>u.toLowerCase()===A.toLowerCase()))return r(`Invalid token: "${u}". Allowed tokens: ${this.options.allowed.join(", ")}`)}if(typeof this.options.validateToken=="function"){for(let u of p)if(!this.options.validateToken(u))return r(`Invalid token: "${u}"`)}return l()}};d.type="SpaceSeparatedTokens";var a=class{validate(t){return l()}};a.type="Text";var c=class{validate(t){return l()}};c.type="ValidURL";var P=class P{constructor(t){this.options=t}validate(t){var u,m;if(t===!0)return r(b.VALUE_MUST_BE_STRING);if(!P.PATTERN.test(t))return r(`Invalid non-negative integer: "${t}"`);let p=parseInt(t,10);return((u=this.options)==null?void 0:u.min)!==void 0&&p<this.options.min?r(`Value must be at least ${this.options.min}: "${t}"`):((m=this.options)==null?void 0:m.max)!==void 0&&p>this.options.max?r(`Value must be at most ${this.options.max}: "${t}"`):l()}};P.type="NonNegativeInteger",P.PATTERN=/^\d+$/;var y=P;var g=class{constructor(){}validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):l()}};g.type="ID";var B=class B{validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):B.PATTERN.test(t)?l():r(`Invalid floating-point number: "${t}"`)}};B.type="FloatingPointNumber",B.PATTERN=/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;var f=B;var O=class{validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):l()}};O.type="CommaSeparatedTokens";var V=class{validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):l()}};V.type="CSSColor";var $=class ${validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);if(t==="")return l();if(!$.PATTERN.test(t))return r(`Invalid BCP 47 language tag: "${t}"`);let p=t.split("-");for(let u=0;u<p.length;u++){let m=p[u];if(m.length===0)return r(`Invalid BCP 47 language tag: empty subtag in "${t}"`);if(u===0){if(m==="x")continue;if(!/^[a-zA-Z]{2,8}$/.test(m))return r(`Invalid language subtag in "${t}": "${m}"`)}}return l()}};$.type="BCP47",$.PATTERN=/^[a-zA-Z]{2,3}(?:-[a-zA-Z]{3}){0,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|[0-9]{3}))?(?:-(?:[a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*(?:-[0-9a-wyzA-WYZ](?:-[a-zA-Z0-9]{2,8})+)*(?:-x(?:-[a-zA-Z0-9]{1,8})+)?$|^x(?:-[a-zA-Z0-9]{1,8})+$|^[a-zA-Z]{4,8}$/;var R=$;var D=class D{constructor(){}validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):D.PATTERN.test(t)?l():r(`Invalid MIME type: "${t}"`)}};D.type="MIMEType",D.PATTERN=/^[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+\/[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+(?:\s*;\s*[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+=(?:[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+|"[^"]*"))*$/;var h=D;var G=class G{constructor(){}validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);if(!G.DATE_PATTERN.test(t)&&!G.DATETIME_PATTERN.test(t))return r(`Invalid date or datetime string: "${t}"`);let p=t.match(/^(\d{4,})-(\d{2})-(\d{2})/);if(p){let m=parseInt(p[1],10),A=parseInt(p[2],10),E=parseInt(p[3],10);if(m===0)return r(`Year must be greater than 0: "${t}"`);if(A<1||A>12)return r(`Month must be between 1 and 12: "${t}"`);if(E<1||E>31)return r(`Day must be between 1 and 31: "${t}"`)}let u=t.match(/[T ](\d{2}):(\d{2})/);if(u){let m=parseInt(u[1],10),A=parseInt(u[2],10);if(m>23)return r(`Hour must be between 0 and 23: "${t}"`);if(A>59)return r(`Minute must be between 0 and 59: "${t}"`);let E=t.match(/[T ]\d{2}:\d{2}:(\d{2})/);if(E&&parseInt(E[1],10)>59)return r(`Second must be between 0 and 59: "${t}"`)}return l()}};G.type="DateString",G.DATE_PATTERN=/^\d{4,}-\d{2}-\d{2}$/,G.DATETIME_PATTERN=/^\d{4,}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})?$/;var N=G;var v=class{constructor(){}validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);try{return new RegExp(t),l()}catch(p){return r(`Invalid regular expression: "${t}" - ${p instanceof Error?p.message:String(p)}`)}}};v.type="RegularExpression";var _=class{validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):t.startsWith("#")?t.length===1?r(`Hash-name reference must have a name after "#": "${t}"`):l():r(`Hash-name reference must start with "#": "${t}"`)}};_.type="HashNameReference";var j=class j{constructor(){}validate(t){return t===!0?r(b.VALUE_MUST_BE_STRING):t.length===0?r("Navigable target name must have at least one character"):t.startsWith("_")?r(`Navigable target name cannot start with "_" (reserved for keywords like _blank, _self): "${t}"`):j.INVALID_CHARS_PATTERN.test(t)?r(`Navigable target name cannot contain tab, newline, or "<" character: "${t}"`):l()}};j.type="NavigableTargetName",j.INVALID_CHARS_PATTERN=/[\t\n<]/;var S=j;var I=class{validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);if(t.trim()==="")return r("Srcset cannot be empty");let p=t.split(",");for(let u=0;u<p.length;u++){let m=p[u].trim();if(m==="")return r(`Image candidate string ${u+1} is empty`);let A=m.split(/\s+/),E=A[0];if(E.startsWith(",")||E.endsWith(","))return r(`URL cannot start or end with comma: "${E}"`);if(E==="")return r(`URL in candidate string ${u+1} is empty`);if(A.length>1){let T=A[A.length-1];if(T.endsWith("w")){let M=T.slice(0,-1),U=parseInt(M,10);if(!/^\d+$/.test(M)||U<=0)return r(`Invalid width descriptor: "${T}" (must be positive integer followed by 'w')`)}else if(T.endsWith("x")){let M=T.slice(0,-1),U=parseFloat(M);if(!/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(M)||U<=0)return r(`Invalid pixel density descriptor: "${T}" (must be positive number followed by 'x')`)}else return r(`Invalid descriptor: "${T}" (must end with 'w' or 'x')`);if(A.length>2&&A.slice(1,-1).some(U=>U!==""))return r(`Invalid image candidate string: "${m}" (extra tokens found)`)}}return l()}};I.type="SrcsetAttribute";var w=class{validate(t){return!t||t===!0?r(b.VALUE_MUST_BE_STRING):l()}};w.type="MediaQueryList";var k=class{validate(t){return!t||t===!0?r(b.VALUE_MUST_BE_STRING):l()}};k.type="SourceSizeList";var L=class{constructor(){this.floatingPointNumberValidator=new f}validate(t){if(t===!0)return r(b.VALUE_MUST_BE_STRING);if(t.length===0)return r(b.VALUE_CANNOT_BE_EMPTY);let p=t.split(",");for(let u=0;u<p.length;u++){let m=p[u];if(m.length===0)return r(`Empty value at position ${u+1}`);if(!this.floatingPointNumberValidator.validate(m).valid)return r(`Invalid floating-point number at position ${u+1}: "${m}"`)}return l()}};L.type="FloatingPointNumberList";var H=class{constructor(t,p){this.key=t;this.definition=p}validate(t){return tt(this.key,this.definition).validate(t)}};function tt(n,t){switch(t.type){case d.type:return new d(t.options);case i.type:return new i(t.options);case s.type:return new s(n);case x.type:return new x;case a.type:return new a;case c.type:return new c;case y.type:return new y(t.options);case g.type:return new g;case f.type:return new f;case O.type:return new O;case V.type:return new V;case R.type:return new R;case h.type:return new h;case N.type:return new N;case v.type:return new v;case _.type:return new _;case S.type:return new S;case I.type:return new I;case w.type:return new w;case k.type:return new k;case L.type:return new L;case"#or":throw new Error("#or type handling not implemented yet")}}var Z=new Map([["accesskey",{type:d.type,options:{unique:!0,validateToken(n){return Array.from(n).length===1}}}],["autocapitalize",{type:i.type,options:{keywords:["off","none","on","sentences","words","characters"]}}],["autocorrect",{type:i.type,options:{keywords:["on","off"]}}],["autofocus",{type:s.type}],["contenteditable",{type:i.type,options:{keywords:["true","false","plaintext-only"]}}],["dir",{type:i.type,options:{keywords:["ltr","rtl","auto"]}}],["draggable",{type:i.type,options:{keywords:["true","false"]}}],["enterkeyhint",{type:i.type,options:{keywords:["enter","done","go","next","previous","search","send"]}}],["headingoffset",{type:y.type,options:{min:0,max:8}}],["headingreset",{type:s.type}],["hidden",{type:i.type,options:{keywords:["until-found","hidden"]}}],["inert",{type:s.type}],["inputmode",{type:i.type,options:{keywords:["none","text","tel","url","email","numeric","decimal","search"]}}],["is",{type:a.type}],["itemid",{type:c.type}],["itemprop",{type:d.type,options:{unique:!0}}],["itemref",{type:d.type,options:{unique:!0}}],["itemscope",{type:s.type}],["itemtype",{type:d.type,options:{unique:!0,validateToken(n){try{return new URL(n),!0}catch(t){return!1}}}}],["lang",{type:R.type}],["nonce",{type:a.type}],["popover",{type:"#or",items:[{type:s.type},{type:i.type,options:{keywords:["auto","manual","hint"]}}]}],["spellcheck",{type:i.type,options:{keywords:["true","false"]}}],["style",{type:a.type}],["tabindex",{type:x.type}],["title",{type:a.type}],["translate",{type:i.type,options:{keywords:["yes","no"]}}],["writingsuggestions",{type:i.type,options:{keywords:["true","false"]}}]]);var o=[],Q={html:{globalAttributes:!0,attributes:o},head:{globalAttributes:!0,attributes:o},title:{globalAttributes:!0,attributes:o},base:{globalAttributes:!0,attributes:[["href",{type:c.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}]]},link:{globalAttributes:!0,attributes:[["href",{type:c.type}],["crossorigin",{type:i.type,options:{keywords:["anonymous","use-credentials"]}}],["rel",{type:d.type,options:{unique:!1,allowed:["alternate","canonical","author","dns-prefetch","expect","help","icon","manifest","modulepreload","license","next","pingback","preconnect","prefetch","preload","prev","privacy-policy","search","stylesheet","terms-of-service"]}}],["media",{type:w.type}],["integrity",{type:a.type}],["hreflang",{type:R.type}],["type",{type:h.type}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["sizes",{type:d.type,options:{unique:!0,validateToken(n){if(n.toLowerCase()==="any")return!0;let t=/^([1-9]\d*|0)[xX]([1-9]\d*|0)$/,p=n.match(t);if(!p)return!1;let[,u,m]=p;return!(u.length>1&&u.startsWith("0")||m.length>1&&m.startsWith("0"))}}}],["imagesrcset",{type:I.type}],["imagesizes",{type:k.type}],["as",{type:i.type,options:{keywords:["fetch","font","image","script","style","track","json","style","audioworklet","paintworklet","script","serviceworker","sharedworker","worker"]}}],["blocking",{type:d.type,options:{unique:!0,allowed:["render"]}}],["color",{type:V.type}],["disabled",{type:s.type}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},meta:{globalAttributes:!0,attributes:[["name",{type:a.type}],["http-equiv",{type:i.type,options:{keywords:["content-language","content-type","default-style","refresh","set-cookie","x-ua-compatible","content-security-policy"]}}],["content",{type:a.type}],["charset",{type:i.type,options:{keywords:["utf-8"]}}],["media",{type:w.type}]]},style:{globalAttributes:!0,attributes:[["media",{type:w.type}],["blocking",{type:d.type,options:{unique:!0,allowed:["render"]}}]]},body:{globalAttributes:!0,attributes:o},article:{globalAttributes:!0,attributes:o},section:{globalAttributes:!0,attributes:o},nav:{globalAttributes:!0,attributes:o},aside:{globalAttributes:!0,attributes:o},hgroup:{globalAttributes:!0,attributes:o},header:{globalAttributes:!0,attributes:o},footer:{globalAttributes:!0,attributes:o},address:{globalAttributes:!0,attributes:o},p:{globalAttributes:!0,attributes:o},hr:{globalAttributes:!0,attributes:o},pre:{globalAttributes:!0,attributes:o},blockquote:{globalAttributes:!0,attributes:[["cite",{type:c.type}]]},ol:{globalAttributes:!0,attributes:[["reversed",{type:s.type}],["start",{type:x.type}],["type",{type:i.type,options:{keywords:["1","a","A","i","I"]}}]]},ul:{globalAttributes:!0,attributes:o},menu:{globalAttributes:!0,attributes:o},li:{globalAttributes:!0,attributes:[["value",{type:x.type}]]},dl:{globalAttributes:!0,attributes:o},dt:{globalAttributes:!0,attributes:o},dd:{globalAttributes:!0,attributes:o},figure:{globalAttributes:!0,attributes:o},figcaption:{globalAttributes:!0,attributes:o},main:{globalAttributes:!0,attributes:o},search:{globalAttributes:!0,attributes:o},div:{globalAttributes:!0,attributes:o},a:{globalAttributes:!0,attributes:[["href",{type:c.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["download",{type:a.type}],["ping",{type:d.type,options:{unique:!1,validateToken(n){if(n.length===0)return!1;try{let t=new URL(n);return t.protocol==="http:"||t.protocol==="https:"}catch(t){return!1}}}}],["rel",{type:d.type,options:{unique:!1,allowed:["alternate","author","bookmark","external","help","license","next","nofollow","noopener","noreferrer","opener","prev","privacy-policy","search","tag","terms-of-service"]}}],["hreflang",{type:R.type}],["type",{type:h.type}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}]]},em:{globalAttributes:!0,attributes:o},strong:{globalAttributes:!0,attributes:o},small:{globalAttributes:!0,attributes:o},s:{globalAttributes:!0,attributes:o},cite:{globalAttributes:!0,attributes:o},q:{globalAttributes:!0,attributes:[["cite",{type:c.type}]]},dfn:{globalAttributes:!0,attributes:o},abbr:{globalAttributes:!0,attributes:o},ruby:{globalAttributes:!0,attributes:o},rt:{globalAttributes:!0,attributes:o},rp:{globalAttributes:!0,attributes:o},data:{globalAttributes:!0,attributes:[["value",{type:a.type}]]},time:{globalAttributes:!0,attributes:[["datetime",{type:N.type}]]},code:{globalAttributes:!0,attributes:o},var:{globalAttributes:!0,attributes:o},samp:{globalAttributes:!0,attributes:o},kbd:{globalAttributes:!0,attributes:o},i:{globalAttributes:!0,attributes:o},b:{globalAttributes:!0,attributes:o},u:{globalAttributes:!0,attributes:o},mark:{globalAttributes:!0,attributes:o},bdi:{globalAttributes:!0,attributes:o},bdo:{globalAttributes:!0,attributes:o},span:{globalAttributes:!0,attributes:o},br:{globalAttributes:!0,attributes:o},wbr:{globalAttributes:!0,attributes:o},ins:{globalAttributes:!0,attributes:[["cite",{type:c.type}],["datetime",{type:N.type}]]},del:{globalAttributes:!0,attributes:[["cite",{type:c.type}],["datetime",{type:N.type}]]},picture:{globalAttributes:!0,attributes:o},source:{globalAttributes:!0,attributes:[["type",{type:h.type}],["media",{type:w.type}],["src",{type:c.type}],["srcset",{type:I.type}],["sizes",{type:k.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}]]},img:{globalAttributes:!0,attributes:[["alt",{type:a.type}],["src",{type:c.type}],["srcset",{type:I.type}],["sizes",{type:k.type}],["crossorigin",{type:i.type,options:{keywords:["anonymous","use-credentials"]}}],["usemap",{type:_.type}],["ismap",{type:s.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["decoding",{type:i.type,options:{keywords:["sync","async","auto"]}}],["loading",{type:i.type,options:{keywords:["eager","lazy"]}}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},iframe:{globalAttributes:!0,attributes:[["src",{type:c.type}],["srcdoc",{type:a.type}],["name",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["sandbox",{type:d.type,options:{unique:!0,allowed:["allow-downloads","allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols"]}}],["allow",{type:a.type}],["allowfullscreen",{type:s.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["loading",{type:i.type,options:{keywords:["eager","lazy"]}}]]},embed:{globalAttributes:!0,attributes:[["src",{type:c.type}],["type",{type:h.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}]]},object:{globalAttributes:!0,attributes:[["data",{type:c.type}],["type",{type:h.type}],["name",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["form",{type:g.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}]]},video:{globalAttributes:!0,attributes:[["src",{type:c.type}],["crossorigin",{type:i.type,options:{keywords:["anonymous","use-credentials"]}}],["poster",{type:c.type}],["preload",{type:i.type,options:{keywords:["none","metadata","auto"]}}],["autoplay",{type:s.type}],["playsinline",{type:s.type}],["loop",{type:s.type}],["muted",{type:s.type}],["controls",{type:s.type}],["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}]]},audio:{globalAttributes:!0,attributes:[["src",{type:c.type}],["crossorigin",{type:i.type,options:{keywords:["anonymous","use-credentials"]}}],["preload",{type:i.type,options:{keywords:["none","metadata","auto"]}}],["autoplay",{type:s.type}],["loop",{type:s.type}],["muted",{type:s.type}],["controls",{type:s.type}]]},track:{globalAttributes:!0,attributes:[["kind",{type:i.type,options:{keywords:["subtitles","captions","descriptions","chapters","metadata"]}}],["src",{type:c.type}],["srclang",{type:R.type}],["label",{type:a.type}],["default",{type:s.type}]]},map:{globalAttributes:!0,attributes:[["name",{type:a.type}]]},area:{globalAttributes:!0,attributes:[["alt",{type:a.type}],["coords",{type:L.type}],["shape",{type:i.type,options:{keywords:["circle","default","poly","rect"]}}],["href",{type:c.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["download",{type:a.type}],["ping",{type:d.type,options:{unique:!1,validateToken(n){if(n.length===0)return!1;try{let t=new URL(n);return t.protocol==="http:"||t.protocol==="https:"}catch(t){return!1}}}}],["rel",{type:d.type,options:{unique:!1,allowed:["alternate","author","bookmark","external","help","license","next","nofollow","noopener","noreferrer","opener","prev","privacy-policy","search","tag","terms-of-service"]}}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}]]},table:{globalAttributes:!0,attributes:o},caption:{globalAttributes:!0,attributes:o},colgroup:{globalAttributes:!0,attributes:[["span",{type:y.type,options:{min:1}}]]},col:{globalAttributes:!0,attributes:[["span",{type:y.type,options:{min:1}}]]},tbody:{globalAttributes:!0,attributes:o},thead:{globalAttributes:!0,attributes:o},tfoot:{globalAttributes:!0,attributes:o},tr:{globalAttributes:!0,attributes:o},td:{globalAttributes:!0,attributes:[["colspan",{type:y.type,options:{min:1}}],["rowspan",{type:y.type,options:{}}],["headers",{type:d.type,options:{unique:!0}}]]},th:{globalAttributes:!0,attributes:[["colspan",{type:y.type,options:{min:1}}],["rowspan",{type:y.type,options:{}}],["headers",{type:d.type,options:{unique:!0}}],["scope",{type:i.type,options:{keywords:["row","col","rowgroup","colgroup"]}}],["abbr",{type:a.type}]]},form:{globalAttributes:!0,attributes:[["accept-charset",{type:d.type,options:{unique:!0}}],["action",{type:c.type}],["autocomplete",{type:i.type,options:{keywords:["on","off"]}}],["enctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["method",{type:i.type,options:{keywords:["get","post","dialog"]}}],["name",{type:a.type}],["novalidate",{type:s.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["rel",{type:d.type,options:{unique:!1,allowed:["external","help","license","next","nofollow","noopener","noreferrer","opener","prev","search"]}}]]},label:{globalAttributes:!0,attributes:[["for",{type:g.type}]]},input:{globalAttributes:!0,attributes:[["accept",{type:O.type}],["alt",{type:a.type}],["autocomplete",{type:a.type}],["checked",{type:s.type}],["dirname",{type:a.type}],["disabled",{type:s.type}],["form",{type:g.type}],["formaction",{type:c.type}],["formenctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["formmethod",{type:i.type,options:{keywords:["get","post","dialog"]}}],["formnovalidate",{type:s.type}],["formtarget",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["height",{type:y.type,options:{}}],["list",{type:g.type}],["max",{type:a.type}],["maxlength",{type:y.type,options:{}}],["min",{type:a.type}],["minlength",{type:y.type,options:{}}],["multiple",{type:s.type}],["name",{type:a.type}],["pattern",{type:v.type}],["placeholder",{type:a.type}],["popovertarget",{type:a.type}],["popovertargetaction",{type:i.type,options:{keywords:["hide","show","toggle"]}}],["readonly",{type:s.type}],["required",{type:s.type}],["size",{type:y.type,options:{min:1}}],["src",{type:c.type}],["step",{type:"#or",items:[{type:f.type},{type:i.type,options:{keywords:["any"]}}]}],["type",{type:i.type,options:{keywords:["hidden","text","search","tel","url","email","password","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}}],["value",{type:a.type}],["width",{type:y.type,options:{}}]]},button:{globalAttributes:!0,attributes:[["disabled",{type:s.type}],["form",{type:g.type}],["formaction",{type:c.type}],["formenctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["formmethod",{type:i.type,options:{keywords:["get","post","dialog"]}}],["formnovalidate",{type:s.type}],["formtarget",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["name",{type:a.type}],["popovertarget",{type:a.type}],["popovertargetaction",{type:i.type,options:{keywords:["hide","show","toggle"]}}],["type",{type:i.type,options:{keywords:["submit","reset","button"]}}],["value",{type:a.type}]]},select:{globalAttributes:!0,attributes:[["autocomplete",{type:a.type}],["disabled",{type:s.type}],["form",{type:g.type}],["multiple",{type:s.type}],["name",{type:a.type}],["required",{type:s.type}],["size",{type:y.type,options:{min:1}}]]},datalist:{globalAttributes:!0,attributes:o},optgroup:{globalAttributes:!0,attributes:[["disabled",{type:s.type}],["label",{type:a.type}]]},option:{globalAttributes:!0,attributes:[["disabled",{type:s.type}],["label",{type:a.type}],["selected",{type:s.type}],["value",{type:a.type}]]},textarea:{globalAttributes:!0,attributes:[["autocomplete",{type:a.type}],["cols",{type:y.type,options:{min:1}}],["dirname",{type:a.type}],["disabled",{type:s.type}],["form",{type:g.type}],["maxlength",{type:y.type,options:{}}],["minlength",{type:y.type,options:{}}],["name",{type:a.type}],["placeholder",{type:a.type}],["readonly",{type:s.type}],["required",{type:s.type}],["rows",{type:y.type,options:{min:1}}],["wrap",{type:i.type,options:{keywords:["soft","hard"]}}]]},output:{globalAttributes:!0,attributes:[["for",{type:d.type,options:{unique:!0}}],["form",{type:g.type}],["name",{type:a.type}]]},progress:{globalAttributes:!0,attributes:[["value",{type:f.type}],["max",{type:f.type}]]},meter:{globalAttributes:!0,attributes:[["value",{type:f.type}],["min",{type:f.type}],["max",{type:f.type}],["low",{type:f.type}],["high",{type:f.type}],["optimum",{type:f.type}]]},fieldset:{globalAttributes:!0,attributes:[["disabled",{type:s.type}],["form",{type:g.type}],["name",{type:a.type}]]},legend:{globalAttributes:!0,attributes:o},selectedcontent:{globalAttributes:!0,attributes:o},details:{globalAttributes:!0,attributes:[["open",{type:s.type}],["name",{type:a.type}]]},summary:{globalAttributes:!0,attributes:o},dialog:{globalAttributes:!0,attributes:[["open",{type:s.type}]]},script:{globalAttributes:!0,attributes:[["src",{type:c.type}],["type",{type:h.type}],["nomodule",{type:s.type}],["async",{type:s.type}],["defer",{type:s.type}],["crossorigin",{type:i.type,options:{keywords:["anonymous","use-credentials"]}}],["integrity",{type:a.type}],["referrerpolicy",{type:i.type,options:{keywords:["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["blocking",{type:d.type,options:{unique:!0}}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},noscript:{globalAttributes:!0,attributes:o},template:{globalAttributes:!0,attributes:[["shadowrootmode",{type:i.type,options:{keywords:["open","closed"]}}],["shadowrootdelegatesfocus",{type:s.type}],["shadowrootclonable",{type:s.type}],["shadowrootserializable",{type:s.type}]]},slot:{globalAttributes:!0,attributes:[["name",{type:a.type}]]},canvas:{globalAttributes:!0,attributes:[["width",{type:y.type,options:{}}],["height",{type:y.type,options:{}}]]}};var X=class{constructor(t){this.state=t;this.get=t=>{var m,A,E;let p=this.getSpecDefinition();if(!p)return null;let u=null;return p.globalAttributes&&(u=(m=Z.get(t))!=null?m:null,!u)?null:(u=(E=(A=p==null?void 0:p.attributes.find(([T])=>t.toLowerCase()===T))==null?void 0:A[1])!=null?E:null,u?new H(t,u):null)};this.has=t=>{let p=this.getSpecDefinition();return p!=null&&p.globalAttributes&&Z.has(t)?!0:!!(p==null?void 0:p.attributes.find(([m])=>t.toLowerCase()===m))}}getSpecDefinition(){let t=Q[this.state.name];return t!=null?t:null}};var F=class{constructor(t,p){this.implicitRole=()=>{let t=K[this.state.name];return t?t(this.state):null};this.state=new z(t,p)}get attributes(){return new X(this.state)}};function et(n,t={}){return new F(n,t)}export{et as element};
1
+ var r={ARTICLE:"article",BLOCKQUOTE:"blockquote",BUTTON:"button",CAPTION:"caption",CELL:"cell",CHECKBOX:"checkbox",CODE:"code",COMBOBOX:"combobox",COMPLEMENTARY:"complementary",CONTENTINFO:"contentinfo",DELETION:"deletion",DIALOG:"dialog",DOCUMENT:"document",EMPHASIS:"emphasis",FIGURE:"figure",FORM:"form",GENERIC:"generic",GROUP:"group",HEADING:"heading",IMG:"img",INSERTION:"insertion",LINK:"link",LIST:"list",LISTBOX:"listbox",MAIN:"main",METER:"meter",NAVIGATION:"navigation",OPTION:"option",PARAGRAPH:"paragraph",PROGRESSBAR:"progressbar",RADIO:"radio",ROW:"row",ROWGROUP:"rowgroup",SEARCH:"search",SEARCHBOX:"searchbox",SEPARATOR:"separator",SLIDER:"slider",SPINBUTTON:"spinbutton",STATUS:"status",STRONG:"strong",TABLE:"table",TERM:"term",TEXTBOX:"textbox",TIME:"time"};var et={get(l){return null}};var X=class{constructor(t=et){this.options=t}get(t){return this.options.get(t)}has(t){return this.options.get(t)!==null}};var Z=class l{constructor(t,e){this.options=e;this.name=t.toLowerCase()}get attributes(){return new X(this.options.attributes)}parent(){if(!this.options.ancestors)return null;let e=this.options.ancestors()[Symbol.iterator]().next();return e.done||!e.value?null:new l(e.value.name,e.value)}ancestors(){var t,e;return((e=(t=this.options).ancestors)==null?void 0:e.call(t))||[]}};var ot={a:l=>l.attributes.has("href")?r.LINK:r.GENERIC,abbr:()=>null,address:()=>r.GROUP,area:l=>l.attributes.has("href")?r.LINK:r.GENERIC,article:()=>r.ARTICLE,aside:()=>r.COMPLEMENTARY,audio:()=>null,b:()=>r.GENERIC,base:()=>null,bdi:()=>r.GENERIC,bdo:()=>r.GENERIC,blockquote:()=>r.BLOCKQUOTE,body:()=>r.GENERIC,br:()=>null,button:()=>r.BUTTON,canvas:()=>null,caption:()=>r.CAPTION,cite:()=>null,code:()=>r.CODE,col:()=>null,colgroup:()=>null,data:()=>r.GENERIC,datalist:()=>r.LISTBOX,dd:()=>null,del:()=>r.DELETION,details:()=>r.GROUP,dfn:()=>r.TERM,dialog:()=>r.DIALOG,div:()=>r.GENERIC,dl:()=>null,dt:()=>null,em:()=>r.EMPHASIS,embed:()=>null,fieldset:()=>r.GROUP,figcaption:()=>null,figure:()=>r.FIGURE,footer:l=>{let t=["article","aside","main","nav","section"];for(let e of l.ancestors())if(t.includes(e.name.toLowerCase()))return r.GENERIC;return r.CONTENTINFO},form:()=>r.FORM,h1:()=>r.HEADING,h2:()=>r.HEADING,h3:()=>r.HEADING,h4:()=>r.HEADING,h5:()=>r.HEADING,h6:()=>r.HEADING,head:()=>null,header:()=>null,hgroup:()=>r.GROUP,hr:()=>r.SEPARATOR,html:()=>r.DOCUMENT,i:()=>r.GENERIC,iframe:()=>null,img:l=>l.attributes.get("alt")===""?null:r.IMG,input:l=>{switch(l.attributes.get("type")||"text"){case"button":case"image":case"reset":case"submit":return r.BUTTON;case"checkbox":return r.CHECKBOX;case"color":case"date":case"datetime-local":case"file":case"hidden":case"month":case"password":case"time":case"week":return null;case"email":case"tel":case"text":case"url":return r.TEXTBOX;case"number":return r.SPINBUTTON;case"radio":return r.RADIO;case"range":return r.SLIDER;case"search":return r.SEARCHBOX;default:return r.TEXTBOX}},ins:()=>r.INSERTION,kbd:()=>null,label:()=>null,legend:()=>null,li:()=>null,link:()=>null,main:()=>r.MAIN,map:()=>null,mark:()=>null,menu:()=>r.LIST,meta:()=>null,meter:()=>r.METER,nav:()=>r.NAVIGATION,noscript:()=>null,object:()=>null,ol:()=>r.LIST,optgroup:()=>r.GROUP,option:()=>r.OPTION,output:()=>r.STATUS,p:()=>r.PARAGRAPH,param:()=>null,picture:()=>null,pre:()=>r.GENERIC,progress:()=>r.PROGRESSBAR,q:()=>r.GENERIC,rp:()=>null,rt:()=>null,ruby:()=>null,s:()=>r.DELETION,samp:()=>r.GENERIC,script:()=>null,search:()=>r.SEARCH,section:()=>null,select:l=>l.attributes.has("multiple")?r.LISTBOX:r.COMBOBOX,slot:()=>null,small:()=>r.GENERIC,span:()=>r.GENERIC,strong:()=>r.STRONG,style:()=>null,sub:()=>null,summary:()=>r.BUTTON,sup:()=>null,svg:()=>null,table:()=>r.TABLE,tbody:()=>r.ROWGROUP,td:()=>r.CELL,template:()=>null,textarea:()=>r.TEXTBOX,tfoot:()=>r.ROWGROUP,th:()=>null,thead:()=>r.ROWGROUP,time:()=>r.TIME,title:()=>null,tr:()=>r.ROW,track:()=>null,u:()=>null,ul:()=>r.LIST,var:()=>null,video:()=>null,wbr:()=>null};var st={valid:!0};function n(){return st}function o(l){return{valid:!1,reason:l}}var p=class{constructor(t){this.attributeKey=t}validateValue(t){return t?this.attributeKey===(t==null?void 0:t.toLowerCase())?n():o(`Boolean attribute value must be empty or match the attribute name "${this.attributeKey}", got: "${t}"`):n()}};p.type="BooleanAttribute";var U={VALUE_MUST_BE_STRING:"Value must be a string",VALUE_CANNOT_BE_EMPTY:"Value cannot be empty",INVALID_MEDIA_QUERY_LIST:"Invalid media query list"};var i=class{constructor(t){this.options=t}validateValue(t){let e=t.toLowerCase();return this.options.keywords.includes(e)?n():o(`Value "${t}" is not a valid keyword. Expected one of: ${this.options.keywords.join(", ")}`)}};i.type="EnumeratedAttribute";var D=class D{validateValue(t){return D.PATTERN.test(t)?n():o(`Invalid signed integer: "${t}"`)}};D.type="SignedInteger",D.PATTERN=/^-?\d+$/;var x=D;var K=/[\u0009\u000A\u000C\u000D\u0020]/;var m=class{constructor(t){this.options=t}parse(t){return t.split(K)}validateValue(t){let e=this.parse(t).filter(a=>a!=="");if(this.options.unique){let a=new Set(e);if(e.length!==a.size)return o("Tokens must be unique")}if(this.options.allowed){for(let a of e)if(!this.options.allowed.some(b=>a.toLowerCase()===b.toLowerCase()))return o(`Invalid token: "${a}". Allowed tokens: ${this.options.allowed.join(", ")}`)}if(typeof this.options.validateToken=="function"){for(let a of e)if(!this.options.validateToken(a))return o(`Invalid token: "${a}"`)}return n()}};m.type="SpaceSeparatedTokens";var u=class{validateValue(t){return n()}};u.type="Text";var M=class M{constructor(t={}){this.options=t}validateValue(t){if(typeof t!="string")return o("Value must be a string");let e=t;if(this.options.potentiallySurroundedBySpaces&&(e=this.stripASCIIWhitespace(t)),this.options.nonEmpty&&e==="")return o("Value cannot be empty");if(e==="")return n();if(this.hasInvalidURLCharacters(e))return o("URL contains invalid characters");try{return new URL(e),n()}catch(a){try{return new URL(e,"https://www.base.com"),n()}catch(y){return o("Invalid URL format")}}}stripASCIIWhitespace(t){return t.replace(/^[\x20\x09\x0A\x0C\x0D]+|[\x20\x09\x0A\x0C\x0D]+$/g,"")}hasInvalidURLCharacters(t){for(let e=0;e<t.length;e++){let a=t.charCodeAt(e);if(a<=32||a===127)return!0}return!1}};M.type="ValidURL",M.PotentiallySurroundedBySpaces={type:M.type,options:{nonEmpty:!1,potentiallySurroundedBySpaces:!0}},M.NonEmptyPotentiallySurroundedBySpaces={type:M.type,options:{nonEmpty:!0,potentiallySurroundedBySpaces:!0}};var d=M;var j=class j{constructor(t){this.options=t}validateValue(t){var a,y;if(!j.PATTERN.test(t))return o(`Invalid non-negative integer: "${t}"`);let e=parseInt(t,10);return((a=this.options)==null?void 0:a.min)!==void 0&&e<this.options.min?o(`Value must be at least ${this.options.min}: "${t}"`):((y=this.options)==null?void 0:y.max)!==void 0&&e>this.options.max?o(`Value must be at most ${this.options.max}: "${t}"`):n()}};j.type="NonNegativeInteger",j.PATTERN=/^\d+$/;var c=j;var A=class{constructor(){}validateValue(t){return n()}};A.type="ID";var z=class z{validateValue(t){return z.PATTERN.test(t)?n():o(`Invalid floating-point number: "${t}"`)}};z.type="FloatingPointNumber",z.PATTERN=/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;var f=z;var k=class{validateValue(t){return n()}};k.type="CommaSeparatedTokens";var L=class{validateValue(t){return n()}};L.type="CSSColor";var q=class q{validateValue(t){if(t==="")return n();if(!q.PATTERN.test(t))return o(`Invalid BCP 47 language tag: "${t}"`);let e=t.split("-");for(let a=0;a<e.length;a++){let y=e[a];if(y.length===0)return o(`Invalid BCP 47 language tag: empty subtag in "${t}"`);if(a===0){if(y==="x")continue;if(!/^[a-zA-Z]{2,8}$/.test(y))return o(`Invalid language subtag in "${t}": "${y}"`)}}return n()}};q.type="BCP47",q.PATTERN=/^[a-zA-Z]{2,3}(?:-[a-zA-Z]{3}){0,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|[0-9]{3}))?(?:-(?:[a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*(?:-[0-9a-wyzA-WYZ](?:-[a-zA-Z0-9]{2,8})+)*(?:-x(?:-[a-zA-Z0-9]{1,8})+)?$|^x(?:-[a-zA-Z0-9]{1,8})+$|^[a-zA-Z]{4,8}$/;var w=q;var H=class H{constructor(){}validateValue(t){return H.PATTERN.test(t)?n():o(`Invalid MIME type: "${t}"`)}};H.type="MIMEType",H.PATTERN=/^[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+\/[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+(?:\s*;\s*[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+=(?:[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+|"[^"]*"))*$/;var E=H;var G=class G{constructor(){}validateValue(t){if(!G.DATE_PATTERN.test(t)&&!G.DATETIME_PATTERN.test(t))return o(`Invalid date or datetime string: "${t}"`);let e=t.match(/^(\d{4,})-(\d{2})-(\d{2})/);if(e){let y=parseInt(e[1],10),b=parseInt(e[2],10),g=parseInt(e[3],10);if(y===0)return o(`Year must be greater than 0: "${t}"`);if(b<1||b>12)return o(`Month must be between 1 and 12: "${t}"`);if(g<1||g>31)return o(`Day must be between 1 and 31: "${t}"`)}let a=t.match(/[T ](\d{2}):(\d{2})/);if(a){let y=parseInt(a[1],10),b=parseInt(a[2],10);if(y>23)return o(`Hour must be between 0 and 23: "${t}"`);if(b>59)return o(`Minute must be between 0 and 59: "${t}"`);let g=t.match(/[T ]\d{2}:\d{2}:(\d{2})/);if(g&&parseInt(g[1],10)>59)return o(`Second must be between 0 and 59: "${t}"`)}return n()}};G.type="DateString",G.DATE_PATTERN=/^\d{4,}-\d{2}-\d{2}$/,G.DATETIME_PATTERN=/^\d{4,}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})?$/;var V=G;var P=class{constructor(){}validateValue(t){try{return new RegExp(t),n()}catch(e){return o(`Invalid regular expression: "${t}" - ${e instanceof Error?e.message:String(e)}`)}}};P.type="RegularExpression";var C=class{validateValue(t){return t.startsWith("#")?t.length===1?o(`Hash-name reference must have a name after "#": "${t}"`):n():o(`Hash-name reference must start with "#": "${t}"`)}};C.type="HashNameReference";var F=class F{constructor(){}validateValue(t){return t.length===0?o("Navigable target name must have at least one character"):t.startsWith("_")?o(`Navigable target name cannot start with "_" (reserved for keywords like _blank, _self): "${t}"`):F.INVALID_CHARS_PATTERN.test(t)?o(`Navigable target name cannot contain tab, newline, or "<" character: "${t}"`):n()}};F.type="NavigableTargetName",F.INVALID_CHARS_PATTERN=/[\t\n<]/;var S=F;var v=class{validateValue(t){if(t.trim()==="")return o("Srcset cannot be empty");let e=t.split(",");for(let a=0;a<e.length;a++){let y=e[a].trim();if(y==="")return o(`Image candidate string ${a+1} is empty`);let b=y.split(/\s+/),g=b[0];if(g.startsWith(",")||g.endsWith(","))return o(`URL cannot start or end with comma: "${g}"`);if(g==="")return o(`URL in candidate string ${a+1} is empty`);if(b.length>1){let h=b[b.length-1];if(h.endsWith("w")){let O=h.slice(0,-1),I=parseInt(O,10);if(!/^\d+$/.test(O)||I<=0)return o(`Invalid width descriptor: "${h}" (must be positive integer followed by 'w')`)}else if(h.endsWith("x")){let O=h.slice(0,-1),I=parseFloat(O);if(!/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(O)||I<=0)return o(`Invalid pixel density descriptor: "${h}" (must be positive number followed by 'x')`)}else return o(`Invalid descriptor: "${h}" (must end with 'w' or 'x')`);if(b.length>2&&b.slice(1,-1).some(I=>I!==""))return o(`Invalid image candidate string: "${y}" (extra tokens found)`)}}return n()}};v.type="SrcsetAttribute";import{getCSSLanguageService as pt,TextDocument as nt}from"vscode-css-languageservice";var R=class{constructor(){this.cssLanguageService=pt()}validateValue(t){try{let e=`@media ${t} {}`,a=nt.create("test.css","css",1,e),y=this.cssLanguageService.parseStylesheet(a);return this.cssLanguageService.doValidation(a,y).length>0?o(U.INVALID_MEDIA_QUERY_LIST):n()}catch(e){return o(U.INVALID_MEDIA_QUERY_LIST)}}};R.type="MediaQueryList";var T=class{validateValue(t){return n()}};T.type="SourceSizeList";var _=class{constructor(){this.floatingPointNumberValidator=new f}validateValue(t){if(t.length===0)return o(U.VALUE_CANNOT_BE_EMPTY);let e=t.split(",");for(let a=0;a<e.length;a++){let y=e[a];if(y.length===0)return o(`Empty value at position ${a+1}`);if(!this.floatingPointNumberValidator.validateValue(y).valid)return o(`Invalid floating-point number at position ${a+1}: "${y}"`)}return n()}};_.type="FloatingPointNumberList";var B=class{constructor(t){this.options=t}validateValue(t){let e;for(let a of this.options.items){let b=Y("",a).validateValue(t);if(b.valid)return n();e=b.reason}return o(e!=null?e:"Value does not match any of the allowed formats")}};B.type="#or";var $=class ${validateValue(t){var it;if(t==="")return n();let e=t.toLowerCase().trim();if(e==="on"||e==="off")return n();let a=e.split(K).filter(Boolean);if(a.length===0)return o("Autocomplete value cannot be empty");let y=0,b=!1,g=!1,h=!1,O=!1,I="";if((it=a[y])!=null&&it.startsWith("section-")&&(b=!0,y++),(a[y]==="billing"||a[y]==="shipping")&&(g=!0,y++),y<a.length){let tt=a[y];if($.AUTOFILL_FIELD_NAMES.has(tt))h=!0,I=tt,y++;else return o(`Invalid autofill field name: "${tt}". Must be one of the standard autofill field names.`)}else return o("Autocomplete value must include an autofill field name");if(y<a.length&&a[y]==="webauthn"){if(!$.WEBAUTHN_COMPATIBLE_FIELDS.has(I))return o(`"webauthn" token is only valid with username or current-password fields, not "${I}"`);O=!0,y++}return y<a.length?o(`Invalid extra token in autocomplete value: "${a[y]}"`):n()}};$.type="AutocompleteAttribute",$.AUTOFILL_FIELD_NAMES=new Set(["name","honorific-prefix","given-name","additional-name","family-name","honorific-suffix","nickname","username","new-password","current-password","one-time-code","organization-title","organization","street-address","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code","cc-name","cc-given-name","cc-additional-name","cc-family-name","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-type","transaction-currency","transaction-amount","language","bday","bday-day","bday-month","bday-year","sex","url","photo","tel","tel-country-code","tel-national","tel-area-code","tel-local","tel-local-prefix","tel-local-suffix","tel-extension","email","impp"]),$.WEBAUTHN_COMPATIBLE_FIELDS=new Set(["username","current-password"]);var N=$;function Y(l,t){switch(t.type){case m.type:return new m(t.options);case i.type:return new i(t.options);case p.type:return new p(l);case x.type:return new x;case u.type:return new u;case d.type:return new d(t.options);case c.type:return new c(t.options);case A.type:return new A;case f.type:return new f;case k.type:return new k;case L.type:return new L;case w.type:return new w;case E.type:return new E;case V.type:return new V;case P.type:return new P;case C.type:return new C;case S.type:return new S;case v.type:return new v;case R.type:return new R;case T.type:return new T;case _.type:return new _;case B.type:return new B({items:t.items});case N.type:return new N}}var W=class{constructor(t,e){this.key=t;this.definition=e}validateValue(t){return Y(this.key,this.definition).validateValue(t)}};var rt=new Map([["accesskey",{type:m.type,options:{unique:!0,validateToken(l){return Array.from(l).length===1}}}],["autocapitalize",{type:i.type,options:{keywords:["off","none","on","sentences","words","characters"]}}],["autocorrect",{type:i.type,options:{keywords:["on","off"]}}],["autofocus",{type:p.type}],["contenteditable",{type:i.type,options:{keywords:["true","false","plaintext-only"]}}],["dir",{type:i.type,options:{keywords:["ltr","rtl","auto"]}}],["draggable",{type:i.type,options:{keywords:["true","false"]}}],["enterkeyhint",{type:i.type,options:{keywords:["enter","done","go","next","previous","search","send"]}}],["headingoffset",{type:c.type,options:{min:0,max:8}}],["headingreset",{type:p.type}],["hidden",{type:i.type,options:{keywords:["","until-found","hidden"]}}],["inert",{type:p.type}],["inputmode",{type:i.type,options:{keywords:["none","text","tel","url","email","numeric","decimal","search"]}}],["is",{type:u.type}],["itemid",d.PotentiallySurroundedBySpaces],["itemprop",{type:m.type,options:{unique:!0}}],["itemref",{type:m.type,options:{unique:!0}}],["itemscope",{type:p.type}],["itemtype",{type:m.type,options:{unique:!0,validateToken(l){try{return new URL(l),!0}catch(t){return!1}}}}],["lang",{type:w.type}],["nonce",{type:u.type}],["popover",{type:"#or",items:[{type:p.type},{type:i.type,options:{keywords:["","auto","manual","hint"]}}]}],["spellcheck",{type:i.type,options:{keywords:["","true","false"]}}],["style",{type:u.type}],["tabindex",{type:x.type}],["title",{type:u.type}],["translate",{type:i.type,options:{keywords:["","yes","no"]}}],["writingsuggestions",{type:i.type,options:{keywords:["","true","false"]}}]]);var s=[],at={html:{globalAttributes:!0,attributes:s},head:{globalAttributes:!0,attributes:s},title:{globalAttributes:!0,attributes:s},base:{globalAttributes:!0,attributes:[["href",d.PotentiallySurroundedBySpaces],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}]]},link:{globalAttributes:!0,attributes:[["href",d.NonEmptyPotentiallySurroundedBySpaces],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["rel",{type:m.type,options:{unique:!0}}],["media",{type:R.type}],["integrity",{type:u.type}],["hreflang",{type:w.type}],["type",{type:E.type}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["sizes",{type:m.type,options:{unique:!0,validateToken(l){if(l.toLowerCase()==="any")return!0;let t=/^([1-9]\d*|0)[xX]([1-9]\d*|0)$/,e=l.match(t);if(!e)return!1;let[,a,y]=e;return!(a.length>1&&a.startsWith("0")||y.length>1&&y.startsWith("0"))}}}],["imagesrcset",{type:v.type}],["imagesizes",{type:T.type}],["as",{type:i.type,options:{keywords:["fetch","font","image","script","style","track","json","style","audioworklet","paintworklet","script","serviceworker","sharedworker","worker"]}}],["blocking",{type:m.type,options:{unique:!0,allowed:["render"]}}],["color",{type:L.type}],["disabled",{type:p.type}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},meta:{globalAttributes:!0,attributes:[["name",{type:u.type}],["http-equiv",{type:i.type,options:{keywords:["content-language","content-type","default-style","refresh","set-cookie","x-ua-compatible","content-security-policy"]}}],["content",{type:u.type}],["charset",{type:i.type,options:{keywords:["utf-8"]}}],["media",{type:R.type}]]},style:{globalAttributes:!0,attributes:[["media",{type:R.type}],["blocking",{type:m.type,options:{unique:!0,allowed:["render"]}}]]},body:{globalAttributes:!0,attributes:s},article:{globalAttributes:!0,attributes:s},section:{globalAttributes:!0,attributes:s},nav:{globalAttributes:!0,attributes:s},aside:{globalAttributes:!0,attributes:s},hgroup:{globalAttributes:!0,attributes:s},header:{globalAttributes:!0,attributes:s},footer:{globalAttributes:!0,attributes:s},address:{globalAttributes:!0,attributes:s},p:{globalAttributes:!0,attributes:s},hr:{globalAttributes:!0,attributes:s},pre:{globalAttributes:!0,attributes:s},blockquote:{globalAttributes:!0,attributes:[["cite",d.PotentiallySurroundedBySpaces]]},ol:{globalAttributes:!0,attributes:[["reversed",{type:p.type}],["start",{type:x.type}],["type",{type:i.type,options:{keywords:["1","a","A","i","I"]}}]]},ul:{globalAttributes:!0,attributes:s},menu:{globalAttributes:!0,attributes:s},li:{globalAttributes:!0,attributes:[["value",{type:x.type}]]},dl:{globalAttributes:!0,attributes:s},dt:{globalAttributes:!0,attributes:s},dd:{globalAttributes:!0,attributes:s},figure:{globalAttributes:!0,attributes:s},figcaption:{globalAttributes:!0,attributes:s},main:{globalAttributes:!0,attributes:s},search:{globalAttributes:!0,attributes:s},div:{globalAttributes:!0,attributes:s},a:{globalAttributes:!0,attributes:[["href",d.PotentiallySurroundedBySpaces],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["download",{type:u.type}],["ping",{type:m.type,options:{unique:!1,validateToken(l){if(l.length===0)return!1;try{let t=new URL(l);return t.protocol==="http:"||t.protocol==="https:"}catch(t){return!1}}}}],["rel",{type:m.type,options:{unique:!0,allowed:["alternate","author","bookmark","external","help","license","next","nofollow","noopener","noreferrer","opener","prev","privacy-policy","search","tag","terms-of-service"]}}],["hreflang",{type:w.type}],["type",{type:E.type}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}]]},em:{globalAttributes:!0,attributes:s},strong:{globalAttributes:!0,attributes:s},small:{globalAttributes:!0,attributes:s},s:{globalAttributes:!0,attributes:s},cite:{globalAttributes:!0,attributes:s},q:{globalAttributes:!0,attributes:[["cite",d.PotentiallySurroundedBySpaces]]},dfn:{globalAttributes:!0,attributes:s},abbr:{globalAttributes:!0,attributes:s},ruby:{globalAttributes:!0,attributes:s},rt:{globalAttributes:!0,attributes:s},rp:{globalAttributes:!0,attributes:s},data:{globalAttributes:!0,attributes:[["value",{type:u.type}]]},time:{globalAttributes:!0,attributes:[["datetime",{type:V.type}]]},code:{globalAttributes:!0,attributes:s},var:{globalAttributes:!0,attributes:s},samp:{globalAttributes:!0,attributes:s},kbd:{globalAttributes:!0,attributes:s},i:{globalAttributes:!0,attributes:s},b:{globalAttributes:!0,attributes:s},u:{globalAttributes:!0,attributes:s},mark:{globalAttributes:!0,attributes:s},bdi:{globalAttributes:!0,attributes:s},bdo:{globalAttributes:!0,attributes:s},span:{globalAttributes:!0,attributes:s},br:{globalAttributes:!0,attributes:s},wbr:{globalAttributes:!0,attributes:s},ins:{globalAttributes:!0,attributes:[["cite",d.PotentiallySurroundedBySpaces],["datetime",{type:V.type}]]},del:{globalAttributes:!0,attributes:[["cite",d.PotentiallySurroundedBySpaces],["datetime",{type:V.type}]]},picture:{globalAttributes:!0,attributes:s},source:{globalAttributes:!0,attributes:[["type",{type:E.type}],["media",{type:R.type}],["src",d.NonEmptyPotentiallySurroundedBySpaces],["srcset",{type:v.type}],["sizes",{type:T.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]},img:{globalAttributes:!0,attributes:[["alt",{type:u.type}],["src",d.NonEmptyPotentiallySurroundedBySpaces],["srcset",{type:v.type}],["sizes",{type:T.type}],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["usemap",{type:C.type}],["ismap",{type:p.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["decoding",{type:i.type,options:{keywords:["sync","async","auto"]}}],["loading",{type:i.type,options:{keywords:["eager","lazy"]}}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},iframe:{globalAttributes:!0,attributes:[["src",d.NonEmptyPotentiallySurroundedBySpaces],["srcdoc",{type:u.type}],["name",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["sandbox",{type:m.type,options:{unique:!0,allowed:["allow-downloads","allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols"]}}],["allow",{type:u.type}],["allowfullscreen",{type:p.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["loading",{type:i.type,options:{keywords:["eager","lazy"]}}]]},embed:{globalAttributes:!0,attributes:[["src",d.NonEmptyPotentiallySurroundedBySpaces],["type",{type:E.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]},object:{globalAttributes:!0,attributes:[["data",d.NonEmptyPotentiallySurroundedBySpaces],["type",{type:E.type}],["name",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["form",{type:A.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]},video:{globalAttributes:!0,attributes:[["src",d.NonEmptyPotentiallySurroundedBySpaces],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["poster",d.NonEmptyPotentiallySurroundedBySpaces],["preload",{type:i.type,options:{keywords:["","none","metadata","auto"]}}],["autoplay",{type:p.type}],["playsinline",{type:p.type}],["loop",{type:p.type}],["muted",{type:p.type}],["controls",{type:p.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]},audio:{globalAttributes:!0,attributes:[["src",d.NonEmptyPotentiallySurroundedBySpaces],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["preload",{type:i.type,options:{keywords:["","none","metadata","auto"]}}],["autoplay",{type:p.type}],["loop",{type:p.type}],["muted",{type:p.type}],["controls",{type:p.type}]]},track:{globalAttributes:!0,attributes:[["kind",{type:i.type,options:{keywords:["subtitles","captions","descriptions","chapters","metadata"]}}],["src",d.NonEmptyPotentiallySurroundedBySpaces],["srclang",{type:w.type}],["label",{type:u.type}],["default",{type:p.type}]]},map:{globalAttributes:!0,attributes:[["name",{type:u.type}]]},area:{globalAttributes:!0,attributes:[["alt",{type:u.type}],["coords",{type:_.type}],["shape",{type:i.type,options:{keywords:["circle","default","poly","rect"]}}],["href",d.PotentiallySurroundedBySpaces],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["download",{type:u.type}],["ping",{type:m.type,options:{unique:!1,validateToken(l){if(l.length===0)return!1;try{let t=new URL(l);return t.protocol==="http:"||t.protocol==="https:"}catch(t){return!1}}}}],["rel",{type:m.type,options:{unique:!0,allowed:["alternate","author","bookmark","external","help","license","next","nofollow","noopener","noreferrer","opener","prev","privacy-policy","search","tag","terms-of-service"]}}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}]]},table:{globalAttributes:!0,attributes:s},caption:{globalAttributes:!0,attributes:s},colgroup:{globalAttributes:!0,attributes:[["span",{type:c.type,options:{min:1}}]]},col:{globalAttributes:!0,attributes:[["span",{type:c.type,options:{min:1}}]]},tbody:{globalAttributes:!0,attributes:s},thead:{globalAttributes:!0,attributes:s},tfoot:{globalAttributes:!0,attributes:s},tr:{globalAttributes:!0,attributes:s},td:{globalAttributes:!0,attributes:[["colspan",{type:c.type,options:{min:1}}],["rowspan",{type:c.type,options:{}}],["headers",{type:m.type,options:{unique:!0}}]]},th:{globalAttributes:!0,attributes:[["colspan",{type:c.type,options:{min:1}}],["rowspan",{type:c.type,options:{}}],["headers",{type:m.type,options:{unique:!0}}],["scope",{type:i.type,options:{keywords:["row","col","rowgroup","colgroup"]}}],["abbr",{type:u.type}]]},form:{globalAttributes:!0,attributes:[["accept-charset",{type:m.type,options:{unique:!0}}],["action",d.NonEmptyPotentiallySurroundedBySpaces],["autocomplete",{type:i.type,options:{keywords:["on","off"]}}],["enctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["method",{type:i.type,options:{keywords:["get","post","dialog"]}}],["name",{type:u.type}],["novalidate",{type:p.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["rel",{type:m.type,options:{unique:!0,allowed:["external","help","license","next","nofollow","noopener","noreferrer","opener","prev","search"]}}]]},label:{globalAttributes:!0,attributes:[["for",{type:A.type}]]},input:{globalAttributes:!0,attributes:[["accept",{type:k.type}],["alt",{type:u.type}],["autocomplete",{type:N.type}],["checked",{type:p.type}],["dirname",{type:u.type}],["disabled",{type:p.type}],["form",{type:A.type}],["formaction",d.NonEmptyPotentiallySurroundedBySpaces],["formenctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["formmethod",{type:i.type,options:{keywords:["get","post","dialog"]}}],["formnovalidate",{type:p.type}],["formtarget",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["height",{type:c.type,options:{}}],["list",{type:A.type}],["max",{type:u.type}],["maxlength",{type:c.type,options:{}}],["min",{type:u.type}],["minlength",{type:c.type,options:{}}],["multiple",{type:p.type}],["name",{type:u.type}],["pattern",{type:P.type}],["placeholder",{type:u.type}],["popovertarget",{type:u.type}],["popovertargetaction",{type:i.type,options:{keywords:["hide","show","toggle"]}}],["readonly",{type:p.type}],["required",{type:p.type}],["size",{type:c.type,options:{min:1}}],["src",d.NonEmptyPotentiallySurroundedBySpaces],["step",{type:"#or",items:[{type:f.type},{type:i.type,options:{keywords:["any"]}}]}],["type",{type:i.type,options:{keywords:["hidden","text","search","tel","url","email","password","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}}],["value",{type:u.type}],["width",{type:c.type,options:{}}]]},button:{globalAttributes:!0,attributes:[["disabled",{type:p.type}],["form",{type:A.type}],["formaction",d.NonEmptyPotentiallySurroundedBySpaces],["formenctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["formmethod",{type:i.type,options:{keywords:["get","post","dialog"]}}],["formnovalidate",{type:p.type}],["formtarget",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["name",{type:u.type}],["popovertarget",{type:u.type}],["popovertargetaction",{type:i.type,options:{keywords:["hide","show","toggle"]}}],["type",{type:i.type,options:{keywords:["submit","reset","button"]}}],["value",{type:u.type}]]},select:{globalAttributes:!0,attributes:[["autocomplete",{type:N.type}],["disabled",{type:p.type}],["form",{type:A.type}],["multiple",{type:p.type}],["name",{type:u.type}],["required",{type:p.type}],["size",{type:c.type,options:{min:1}}]]},datalist:{globalAttributes:!0,attributes:s},optgroup:{globalAttributes:!0,attributes:[["disabled",{type:p.type}],["label",{type:u.type}]]},option:{globalAttributes:!0,attributes:[["disabled",{type:p.type}],["label",{type:u.type}],["selected",{type:p.type}],["value",{type:u.type}]]},textarea:{globalAttributes:!0,attributes:[["autocomplete",{type:N.type}],["cols",{type:c.type,options:{min:1}}],["dirname",{type:u.type}],["disabled",{type:p.type}],["form",{type:A.type}],["maxlength",{type:c.type,options:{}}],["minlength",{type:c.type,options:{}}],["name",{type:u.type}],["placeholder",{type:u.type}],["readonly",{type:p.type}],["required",{type:p.type}],["rows",{type:c.type,options:{min:1}}],["wrap",{type:i.type,options:{keywords:["soft","hard"]}}]]},output:{globalAttributes:!0,attributes:[["for",{type:m.type,options:{unique:!0}}],["form",{type:A.type}],["name",{type:u.type}]]},progress:{globalAttributes:!0,attributes:[["value",{type:f.type}],["max",{type:f.type}]]},meter:{globalAttributes:!0,attributes:[["value",{type:f.type}],["min",{type:f.type}],["max",{type:f.type}],["low",{type:f.type}],["high",{type:f.type}],["optimum",{type:f.type}]]},fieldset:{globalAttributes:!0,attributes:[["disabled",{type:p.type}],["form",{type:A.type}],["name",{type:u.type}]]},legend:{globalAttributes:!0,attributes:s},selectedcontent:{globalAttributes:!0,attributes:s},details:{globalAttributes:!0,attributes:[["open",{type:p.type}],["name",{type:u.type}]]},summary:{globalAttributes:!0,attributes:s},dialog:{globalAttributes:!0,attributes:[["open",{type:p.type}]]},script:{globalAttributes:!0,attributes:[["src",d.NonEmptyPotentiallySurroundedBySpaces],["type",{type:B.type,items:[{type:i.type,options:{keywords:["module","importmap","speculationrules"]}},{type:E.type}]}],["nomodule",{type:p.type}],["async",{type:p.type}],["defer",{type:p.type}],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["integrity",{type:u.type}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["blocking",{type:m.type,options:{unique:!0}}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},noscript:{globalAttributes:!0,attributes:s},template:{globalAttributes:!0,attributes:[["shadowrootmode",{type:i.type,options:{keywords:["open","closed"]}}],["shadowrootdelegatesfocus",{type:p.type}],["shadowrootclonable",{type:p.type}],["shadowrootserializable",{type:p.type}]]},slot:{globalAttributes:!0,attributes:[["name",{type:u.type}]]},canvas:{globalAttributes:!0,attributes:[["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]}};var Q=class{constructor(t){this.state=t;this.get=t=>{var y,b,g;let e=this.getSpecDefinition();if(!e)return null;let a=null;return e.globalAttributes&&(a=(y=rt.get(t))!=null?y:null,a)?new W(t,a):(a=(g=(b=e==null?void 0:e.attributes.find(([h])=>t.toLowerCase()===h))==null?void 0:b[1])!=null?g:null,a?new W(t,a):null)};this.has=t=>{let e=this.getSpecDefinition();return e!=null&&e.globalAttributes&&rt.has(t)?!0:!!(e==null?void 0:e.attributes.find(([y])=>t.toLowerCase()===y))}}getSpecDefinition(){let t=at[this.state.name];return t!=null?t:null}};var J=class{constructor(t,e){this.implicitRole=()=>{let t=ot[this.state.name];return t?t(this.state):null};this.state=new Z(t,e)}get attributes(){return new Q(this.state)}};function lt(l,t={}){return new J(l,t)}export{lt as element};
2
2
  //# sourceMappingURL=index.js.map