html-standard 0.0.11 → 0.0.12

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.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var rt=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var yt=Object.prototype.hasOwnProperty;var ct=(p,t)=>{for(var e in t)rt(p,e,{get:t[e],enumerable:!0})},dt=(p,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ut(t))!yt.call(p,l)&&l!==e&&rt(p,l,{get:()=>t[l],enumerable:!(o=lt(t,l))||o.enumerable});return p};var mt=p=>dt(rt({},"__esModule",{value:!0}),p);var ft={};ct(ft,{element:()=>nt});module.exports=mt(ft);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 it={get(p){return null}};var X=class{constructor(t=it){this.options=t}get(t){return this.options.get(t)}has(t){return this.options.get(t)!==null}};var Z=class p{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 p(e.value.name,e.value)}ancestors(){var t,e;return((e=(t=this.options).ancestors)==null?void 0:e.call(t))||[]}};var st={a:p=>p.attributes.has("href")?r.LINK:r.GENERIC,abbr:()=>null,address:()=>r.GROUP,area:p=>p.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:p=>{let t=["article","aside","main","nav","section"];for(let e of p.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:p=>p.attributes.get("alt")===""?null:r.IMG,input:p=>{switch(p.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:p=>p.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 bt={valid:!0};function u(){return bt}function a(p){return{valid:!1,reason:p}}var n=class{constructor(t){this.attributeKey=t}validateValue(t){return t?this.attributeKey===(t==null?void 0:t.toLowerCase())?u():a(`Boolean attribute value must be empty or match the attribute name "${this.attributeKey}", got: "${t}"`):u()}};n.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)?u():a(`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)?u():a(`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(o=>o!=="");if(this.options.unique){let o=new Set(e);if(e.length!==o.size)return a("Tokens must be unique")}if(this.options.allowed){for(let o of e)if(!this.options.allowed.some(b=>o.toLowerCase()===b.toLowerCase()))return a(`Invalid token: "${o}". Allowed tokens: ${this.options.allowed.join(", ")}`)}if(typeof this.options.validateToken=="function"){for(let o of e)if(!this.options.validateToken(o))return a(`Invalid token: "${o}"`)}return u()}};m.type="SpaceSeparatedTokens";var y=class{validateValue(t){return u()}};y.type="Text";var M=class M{constructor(t={}){this.options=t}validateValue(t){if(typeof t!="string")return a("Value must be a string");let e=t;if(this.options.potentiallySurroundedBySpaces&&(e=this.stripASCIIWhitespace(t)),this.options.nonEmpty&&e==="")return a("Value cannot be empty");if(e==="")return u();if(this.hasInvalidURLCharacters(e))return a("URL contains invalid characters");try{return new URL(e),u()}catch(o){try{return new URL(e,"https://www.base.com"),u()}catch(l){return a("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 o=t.charCodeAt(e);if(o<=32||o===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 o,l;if(!j.PATTERN.test(t))return a(`Invalid non-negative integer: "${t}"`);let e=parseInt(t,10);return((o=this.options)==null?void 0:o.min)!==void 0&&e<this.options.min?a(`Value must be at least ${this.options.min}: "${t}"`):((l=this.options)==null?void 0:l.max)!==void 0&&e>this.options.max?a(`Value must be at most ${this.options.max}: "${t}"`):u()}};j.type="NonNegativeInteger",j.PATTERN=/^\d+$/;var c=j;var A=class{constructor(){}validateValue(t){return u()}};A.type="ID";var z=class z{validateValue(t){return z.PATTERN.test(t)?u():a(`Invalid floating-point number: "${t}"`)}};z.type="FloatingPointNumber",z.PATTERN=/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;var f=z;var k=class{validateValue(t){return u()}};k.type="CommaSeparatedTokens";var L=class{validateValue(t){return u()}};L.type="CSSColor";var q=class q{validateValue(t){if(t==="")return u();if(!q.PATTERN.test(t))return a(`Invalid BCP 47 language tag: "${t}"`);let e=t.split("-");for(let o=0;o<e.length;o++){let l=e[o];if(l.length===0)return a(`Invalid BCP 47 language tag: empty subtag in "${t}"`);if(o===0){if(l==="x")continue;if(!/^[a-zA-Z]{2,8}$/.test(l))return a(`Invalid language subtag in "${t}": "${l}"`)}}return u()}};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)?u():a(`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 a(`Invalid date or datetime string: "${t}"`);let e=t.match(/^(\d{4,})-(\d{2})-(\d{2})/);if(e){let l=parseInt(e[1],10),b=parseInt(e[2],10),g=parseInt(e[3],10);if(l===0)return a(`Year must be greater than 0: "${t}"`);if(b<1||b>12)return a(`Month must be between 1 and 12: "${t}"`);if(g<1||g>31)return a(`Day must be between 1 and 31: "${t}"`)}let o=t.match(/[T ](\d{2}):(\d{2})/);if(o){let l=parseInt(o[1],10),b=parseInt(o[2],10);if(l>23)return a(`Hour must be between 0 and 23: "${t}"`);if(b>59)return a(`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 a(`Second must be between 0 and 59: "${t}"`)}return u()}};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),u()}catch(e){return a(`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?a(`Hash-name reference must have a name after "#": "${t}"`):u():a(`Hash-name reference must start with "#": "${t}"`)}};C.type="HashNameReference";var F=class F{constructor(){}validateValue(t){return t.length===0?a("Navigable target name must have at least one character"):t.startsWith("_")?a(`Navigable target name cannot start with "_" (reserved for keywords like _blank, _self): "${t}"`):F.INVALID_CHARS_PATTERN.test(t)?a(`Navigable target name cannot contain tab, newline, or "<" character: "${t}"`):u()}};F.type="NavigableTargetName",F.INVALID_CHARS_PATTERN=/[\t\n<]/;var S=F;var v=class{validateValue(t){if(t.trim()==="")return a("Srcset cannot be empty");let e=t.split(",");for(let o=0;o<e.length;o++){let l=e[o].trim();if(l==="")return a(`Image candidate string ${o+1} is empty`);let b=l.split(/\s+/),g=b[0];if(g.startsWith(",")||g.endsWith(","))return a(`URL cannot start or end with comma: "${g}"`);if(g==="")return a(`URL in candidate string ${o+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 a(`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 a(`Invalid pixel density descriptor: "${h}" (must be positive number followed by 'x')`)}else return a(`Invalid descriptor: "${h}" (must end with 'w' or 'x')`);if(b.length>2&&b.slice(1,-1).some(I=>I!==""))return a(`Invalid image candidate string: "${l}" (extra tokens found)`)}}return u()}};v.type="SrcsetAttribute";var Y=require("vscode-css-languageservice"),R=class{constructor(){this.cssLanguageService=(0,Y.getCSSLanguageService)()}validateValue(t){try{let e=`@media ${t} {}`,o=Y.TextDocument.create("test.css","css",1,e),l=this.cssLanguageService.parseStylesheet(o);return this.cssLanguageService.doValidation(o,l).length>0?a(U.INVALID_MEDIA_QUERY_LIST):u()}catch(e){return a(U.INVALID_MEDIA_QUERY_LIST)}}};R.type="MediaQueryList";var T=class{validateValue(t){return u()}};T.type="SourceSizeList";var _=class{constructor(){this.floatingPointNumberValidator=new f}validateValue(t){if(t.length===0)return a(U.VALUE_CANNOT_BE_EMPTY);let e=t.split(",");for(let o=0;o<e.length;o++){let l=e[o];if(l.length===0)return a(`Empty value at position ${o+1}`);if(!this.floatingPointNumberValidator.validateValue(l).valid)return a(`Invalid floating-point number at position ${o+1}: "${l}"`)}return u()}};_.type="FloatingPointNumberList";var B=class{constructor(t){this.options=t}validateValue(t){let e;for(let o of this.options.items){let b=Q("",o).validateValue(t);if(b.valid)return u();e=b.reason}return a(e!=null?e:"Value does not match any of the allowed formats")}};B.type="#or";var $=class ${validateValue(t){var at;if(t==="")return u();let e=t.toLowerCase().trim();if(e==="on"||e==="off")return u();let o=e.split(K).filter(Boolean);if(o.length===0)return a("Autocomplete value cannot be empty");let l=0,b=!1,g=!1,h=!1,O=!1,I="";if((at=o[l])!=null&&at.startsWith("section-")&&(b=!0,l++),(o[l]==="billing"||o[l]==="shipping")&&(g=!0,l++),l<o.length){let et=o[l];if($.AUTOFILL_FIELD_NAMES.has(et))h=!0,I=et,l++;else return a(`Invalid autofill field name: "${et}". Must be one of the standard autofill field names.`)}else return a("Autocomplete value must include an autofill field name");if(l<o.length&&o[l]==="webauthn"){if(!$.WEBAUTHN_COMPATIBLE_FIELDS.has(I))return a(`"webauthn" token is only valid with username or current-password fields, not "${I}"`);O=!0,l++}return l<o.length?a(`Invalid extra token in autocomplete value: "${o[l]}"`):u()}};$.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 Q(p,t){switch(t.type){case m.type:return new m(t.options);case i.type:return new i(t.options);case n.type:return new n(p);case x.type:return new x;case y.type:return new y;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 Q(this.key,this.definition).validateValue(t)}};var ot=new Map([["accesskey",{type:m.type,options:{unique:!0,validateToken(p){return Array.from(p).length===1}}}],["autocapitalize",{type:i.type,options:{keywords:["off","none","on","sentences","words","characters"]}}],["autocorrect",{type:i.type,options:{keywords:["on","off"]}}],["autofocus",{type:n.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:n.type}],["hidden",{type:i.type,options:{keywords:["","until-found","hidden"]}}],["inert",{type:n.type}],["inputmode",{type:i.type,options:{keywords:["none","text","tel","url","email","numeric","decimal","search"]}}],["is",{type:y.type}],["itemid",d.PotentiallySurroundedBySpaces],["itemprop",{type:m.type,options:{unique:!0}}],["itemref",{type:m.type,options:{unique:!0}}],["itemscope",{type:n.type}],["itemtype",{type:m.type,options:{unique:!0,validateToken(p){try{return new URL(p),!0}catch(t){return!1}}}}],["lang",{type:w.type}],["nonce",{type:y.type}],["popover",{type:"#or",items:[{type:n.type},{type:i.type,options:{keywords:["","auto","manual","hint"]}}]}],["spellcheck",{type:i.type,options:{keywords:["","true","false"]}}],["style",{type:y.type}],["tabindex",{type:x.type}],["title",{type:y.type}],["translate",{type:i.type,options:{keywords:["","yes","no"]}}],["writingsuggestions",{type:i.type,options:{keywords:["","true","false"]}}]]);var s=[],pt={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:y.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(p){if(p.toLowerCase()==="any")return!0;let t=/^([1-9]\d*|0)[xX]([1-9]\d*|0)$/,e=p.match(t);if(!e)return!1;let[,o,l]=e;return!(o.length>1&&o.startsWith("0")||l.length>1&&l.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:n.type}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},meta:{globalAttributes:!0,attributes:[["name",{type:y.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:y.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:n.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:y.type}],["ping",{type:m.type,options:{unique:!1,validateToken(p){if(p.length===0)return!1;try{let t=new URL(p);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:y.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:y.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:n.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:y.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:y.type}],["allowfullscreen",{type:n.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:n.type}],["playsinline",{type:n.type}],["loop",{type:n.type}],["muted",{type:n.type}],["controls",{type:n.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:n.type}],["loop",{type:n.type}],["muted",{type:n.type}],["controls",{type:n.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:y.type}],["default",{type:n.type}]]},map:{globalAttributes:!0,attributes:[["name",{type:y.type}]]},area:{globalAttributes:!0,attributes:[["alt",{type:y.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:y.type}],["ping",{type:m.type,options:{unique:!1,validateToken(p){if(p.length===0)return!1;try{let t=new URL(p);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:y.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:y.type}],["novalidate",{type:n.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:y.type}],["autocomplete",{type:N.type}],["checked",{type:n.type}],["dirname",{type:y.type}],["disabled",{type:n.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:n.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:y.type}],["maxlength",{type:c.type,options:{}}],["min",{type:y.type}],["minlength",{type:c.type,options:{}}],["multiple",{type:n.type}],["name",{type:y.type}],["pattern",{type:P.type}],["placeholder",{type:y.type}],["popovertarget",{type:y.type}],["popovertargetaction",{type:i.type,options:{keywords:["hide","show","toggle"]}}],["readonly",{type:n.type}],["required",{type:n.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:y.type}],["width",{type:c.type,options:{}}]]},button:{globalAttributes:!0,attributes:[["disabled",{type:n.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:n.type}],["formtarget",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["name",{type:y.type}],["popovertarget",{type:y.type}],["popovertargetaction",{type:i.type,options:{keywords:["hide","show","toggle"]}}],["type",{type:i.type,options:{keywords:["submit","reset","button"]}}],["value",{type:y.type}]]},select:{globalAttributes:!0,attributes:[["autocomplete",{type:N.type}],["disabled",{type:n.type}],["form",{type:A.type}],["multiple",{type:n.type}],["name",{type:y.type}],["required",{type:n.type}],["size",{type:c.type,options:{min:1}}]]},datalist:{globalAttributes:!0,attributes:s},optgroup:{globalAttributes:!0,attributes:[["disabled",{type:n.type}],["label",{type:y.type}]]},option:{globalAttributes:!0,attributes:[["disabled",{type:n.type}],["label",{type:y.type}],["selected",{type:n.type}],["value",{type:y.type}]]},textarea:{globalAttributes:!0,attributes:[["autocomplete",{type:N.type}],["cols",{type:c.type,options:{min:1}}],["dirname",{type:y.type}],["disabled",{type:n.type}],["form",{type:A.type}],["maxlength",{type:c.type,options:{}}],["minlength",{type:c.type,options:{}}],["name",{type:y.type}],["placeholder",{type:y.type}],["readonly",{type:n.type}],["required",{type:n.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:y.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:n.type}],["form",{type:A.type}],["name",{type:y.type}]]},legend:{globalAttributes:!0,attributes:s},selectedcontent:{globalAttributes:!0,attributes:s},details:{globalAttributes:!0,attributes:[["open",{type:n.type}],["name",{type:y.type}]]},summary:{globalAttributes:!0,attributes:s},dialog:{globalAttributes:!0,attributes:[["open",{type:n.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:n.type}],["async",{type:n.type}],["defer",{type:n.type}],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["integrity",{type:y.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:n.type}],["shadowrootclonable",{type:n.type}],["shadowrootserializable",{type:n.type}]]},slot:{globalAttributes:!0,attributes:[["name",{type:y.type}]]},canvas:{globalAttributes:!0,attributes:[["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]}};var J=class{constructor(t){this.state=t;this.get=t=>{var l,b,g;let e=this.getSpecDefinition();if(!e)return null;let o=null;return e.globalAttributes&&(o=(l=ot.get(t))!=null?l:null,o)?new W(t,o):(o=(g=(b=e==null?void 0:e.attributes.find(([h])=>t.toLowerCase()===h))==null?void 0:b[1])!=null?g:null,o?new W(t,o):null)};this.has=t=>{let e=this.getSpecDefinition();return e!=null&&e.globalAttributes&&ot.has(t)?!0:!!(e==null?void 0:e.attributes.find(([l])=>t.toLowerCase()===l))}}getSpecDefinition(){let t=pt[this.state.name];return t!=null?t:null}};var tt=class{constructor(t,e){this.implicitRole=()=>{let t=st[this.state.name];return t?t(this.state):null};this.state=new Z(t,e)}get attributes(){return new J(this.state)}};function nt(p,t={}){return new tt(p,t)}0&&(module.exports={element});
1
+ "use strict";var ut=Object.defineProperty;var Tt=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var ht=Object.prototype.hasOwnProperty;var Et=(u,t)=>{for(var e in t)ut(u,e,{get:t[e],enumerable:!0})},wt=(u,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of St(t))!ht.call(u,n)&&n!==e&&ut(u,n,{get:()=>t[n],enumerable:!(o=Tt(t,n))||o.enumerable});return u};var Rt=u=>wt(ut({},"__esModule",{value:!0}),u);var vt={};Et(vt,{element:()=>gt});module.exports=Rt(vt);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 yt={get(u){return null}};var it=class{constructor(t=yt){this.options=t}get(t){return this.options.get(t)}has(t){return this.options.get(t)!==null}};var ot=class u{constructor(t,e){this.options=e;this.name=t.toLowerCase()}get attributes(){return new it(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 u(e.value.name,e.value)}ancestors(){var t,e;return((e=(t=this.options).ancestors)==null?void 0:e.call(t))||[]}};var mt={a:u=>u.attributes.has("href")?r.LINK:r.GENERIC,abbr:()=>null,address:()=>r.GROUP,area:u=>u.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:u=>{let t=["article","aside","main","nav","section"];for(let e of u.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:u=>u.attributes.get("alt")===""?null:r.IMG,input:u=>{switch(u.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:u=>u.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 xt={valid:!0};function l(){return xt}function a(u){return{valid:!1,reason:u}}var Z=class Z{constructor(t){this.attributeKey=t}validateValue(t){return t?this.attributeKey===(t==null?void 0:t.toLowerCase())?l():a(`Boolean attribute value must be empty or match the attribute name "${this.attributeKey}", got: "${t}"`):l()}};Z.type="BooleanAttribute",Z.Type={type:Z.type};var p=Z;var W={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)?l():a(`Value "${t}" is not a valid keyword. Expected one of: ${this.options.keywords.join(", ")}`)}};i.type="EnumeratedAttribute";var M=class M{validateValue(t){return M.PATTERN.test(t)?l():a(`Invalid signed integer: "${t}"`)}};M.type="SignedInteger",M.Type={type:M.type},M.PATTERN=/^-?\d+$/;var w=M;var at=/[\u0009\u000A\u000C\u000D\u0020]/;var m=class{constructor(t){this.options=t}parse(t){return t.split(at)}validateValue(t){let e=this.parse(t).filter(o=>o!=="");if(this.options.unique){let o=new Set(e);if(e.length!==o.size)return a("Tokens must be unique")}if(this.options.allowed){for(let o of e)if(!this.options.allowed.some(b=>o.toLowerCase()===b.toLowerCase()))return a(`Invalid token: "${o}". Allowed tokens: ${this.options.allowed.join(", ")}`)}if(typeof this.options.validateToken=="function"){for(let o of e)if(!this.options.validateToken(o))return a(`Invalid token: "${o}"`)}return l()}};m.type="SpaceSeparatedTokens";var F=class F{validateValue(t){return l()}};F.type="Text",F.Type={type:F.type};var y=F;var $=class ${constructor(t={}){this.options=t}validateValue(t){if(typeof t!="string")return a("Value must be a string");let e=t;if(this.options.potentiallySurroundedBySpaces&&(e=this.stripASCIIWhitespace(t)),this.options.nonEmpty&&e==="")return a("Value cannot be empty");if(e==="")return l();if(this.hasInvalidURLCharacters(e))return a("URL contains invalid characters");try{return new URL(e),l()}catch(o){try{return new URL(e,"https://www.base.com"),l()}catch(n){return a("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 o=t.charCodeAt(e);if(o<=32||o===127)return!0}return!1}};$.type="ValidURL",$.PotentiallySurroundedBySpaces={type:$.type,nonEmpty:!1,potentiallySurroundedBySpaces:!0},$.NonEmptyPotentiallySurroundedBySpaces={type:$.type,nonEmpty:!0,potentiallySurroundedBySpaces:!0};var d=$;var v=class v{constructor(t){this.options=t}validateValue(t){var o,n;if(!v.PATTERN.test(t))return a(`Invalid non-negative integer: "${t}"`);let e=parseInt(t,10);return((o=this.options)==null?void 0:o.min)!==void 0&&e<this.options.min?a(`Value must be at least ${this.options.min}: "${t}"`):((n=this.options)==null?void 0:n.max)!==void 0&&e>this.options.max?a(`Value must be at most ${this.options.max}: "${t}"`):l()}};v.type="NonNegativeInteger",v.Type={type:v.type},v.GreaterThanZero={type:v.type,min:1},v.PATTERN=/^\d+$/;var c=v;var X=class X{constructor(){}validateValue(t){return l()}};X.type="ID",X.Type={type:X.type};var g=X;var U=class U{validateValue(t){return U.PATTERN.test(t)?l():a(`Invalid floating-point number: "${t}"`)}};U.type="FloatingPointNumber",U.Type={type:U.type},U.PATTERN=/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;var f=U;var C=class{validateValue(t){return l()}};C.type="CommaSeparatedTokens";var K=class K{validateValue(t){return l()}};K.type="CSSColor",K.Type={type:K.type};var D=K;var j=class j{validateValue(t){if(t==="")return l();if(!j.PATTERN.test(t))return a(`Invalid BCP 47 language tag: "${t}"`);let e=t.split("-");for(let o=0;o<e.length;o++){let n=e[o];if(n.length===0)return a(`Invalid BCP 47 language tag: empty subtag in "${t}"`);if(o===0){if(n==="x")continue;if(!/^[a-zA-Z]{2,8}$/.test(n))return a(`Invalid language subtag in "${t}": "${n}"`)}}return l()}};j.type="BCP47",j.Type={type:j.type},j.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 E=j;var q=class q{constructor(){}validateValue(t){return q.PATTERN.test(t)?l():a(`Invalid MIME type: "${t}"`)}};q.type="MIMEType",q.Type={type:q.type},q.PATTERN=/^[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+\/[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+(?:\s*;\s*[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+=(?:[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+|"[^"]*"))*$/;var h=q;var I=class I{constructor(){}validateValue(t){if(!I.DATE_PATTERN.test(t)&&!I.DATETIME_PATTERN.test(t))return a(`Invalid date or datetime string: "${t}"`);let e=t.match(/^(\d{4,})-(\d{2})-(\d{2})/);if(e){let n=parseInt(e[1],10),b=parseInt(e[2],10),A=parseInt(e[3],10);if(n===0)return a(`Year must be greater than 0: "${t}"`);if(b<1||b>12)return a(`Month must be between 1 and 12: "${t}"`);if(A<1||A>31)return a(`Day must be between 1 and 31: "${t}"`)}let o=t.match(/[T ](\d{2}):(\d{2})/);if(o){let n=parseInt(o[1],10),b=parseInt(o[2],10);if(n>23)return a(`Hour must be between 0 and 23: "${t}"`);if(b>59)return a(`Minute must be between 0 and 59: "${t}"`);let A=t.match(/[T ]\d{2}:\d{2}:(\d{2})/);if(A&&parseInt(A[1],10)>59)return a(`Second must be between 0 and 59: "${t}"`)}return l()}};I.type="DateString",I.Type={type:I.type},I.DATE_PATTERN=/^\d{4,}-\d{2}-\d{2}$/,I.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=I;var Y=class Y{constructor(){}validateValue(t){try{return new RegExp(t),l()}catch(e){return a(`Invalid regular expression: "${t}" - ${e instanceof Error?e.message:String(e)}`)}}};Y.type="RegularExpression",Y.Type={type:Y.type};var _=Y;var Q=class Q{validateValue(t){return t.startsWith("#")?t.length===1?a(`Hash-name reference must have a name after "#": "${t}"`):l():a(`Hash-name reference must start with "#": "${t}"`)}};Q.type="HashNameReference",Q.Type={type:Q.type};var z=Q;var H=class H{constructor(){}validateValue(t){return t.length===0?a("Navigable target name must have at least one character"):t.startsWith("_")?a(`Navigable target name cannot start with "_" (reserved for keywords like _blank, _self): "${t}"`):H.INVALID_CHARS_PATTERN.test(t)?a(`Navigable target name cannot contain tab, newline, or "<" character: "${t}"`):l()}};H.type="NavigableTargetName",H.Type={type:H.type},H.INVALID_CHARS_PATTERN=/[\t\n<]/;var T=H;var J=class J{validateValue(t){if(t.trim()==="")return a("Srcset cannot be empty");let e=t.split(",");for(let o=0;o<e.length;o++){let n=e[o].trim();if(n==="")return a(`Image candidate string ${o+1} is empty`);let b=n.split(/\s+/),A=b[0];if(A.startsWith(",")||A.endsWith(","))return a(`URL cannot start or end with comma: "${A}"`);if(A==="")return a(`URL in candidate string ${o+1} is empty`);if(b.length>1){let S=b[b.length-1];if(S.endsWith("w")){let P=S.slice(0,-1),x=parseInt(P,10);if(!/^\d+$/.test(P)||x<=0)return a(`Invalid width descriptor: "${S}" (must be positive integer followed by 'w')`)}else if(S.endsWith("x")){let P=S.slice(0,-1),x=parseFloat(P);if(!/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(P)||x<=0)return a(`Invalid pixel density descriptor: "${S}" (must be positive number followed by 'x')`)}else return a(`Invalid descriptor: "${S}" (must end with 'w' or 'x')`);if(b.length>2&&b.slice(1,-1).some(x=>x!==""))return a(`Invalid image candidate string: "${n}" (extra tokens found)`)}}return l()}};J.type="SrcsetAttribute",J.Type={type:J.type};var k=J;var bt=require("vscode-css-languageservice"),ft=require("vscode-languageserver-textdocument"),tt=class tt{constructor(){this.cssLanguageService=(0,bt.getCSSLanguageService)()}validateValue(t){try{let e=`@media ${t} {}`,o=ft.TextDocument.create("test.css","css",1,e),n=this.cssLanguageService.parseStylesheet(o);return this.cssLanguageService.doValidation(o,n).length>0?a(W.INVALID_MEDIA_QUERY_LIST):l()}catch(e){return a(W.INVALID_MEDIA_QUERY_LIST)}}};tt.type="MediaQueryList",tt.Type={type:tt.type};var R=tt;var et=class et{validateValue(t){return l()}};et.type="SourceSizeList",et.Type={type:et.type};var O=et;var G=class{constructor(){this.floatingPointNumberValidator=new f}validateValue(t){if(t.length===0)return a(W.VALUE_CANNOT_BE_EMPTY);let e=t.split(",");for(let o=0;o<e.length;o++){let n=e[o];if(n.length===0)return a(`Empty value at position ${o+1}`);if(!this.floatingPointNumberValidator.validateValue(n).valid)return a(`Invalid floating-point number at position ${o+1}: "${n}"`)}return l()}};G.type="FloatingPointNumberList";var B=class{constructor(t){this.options=t}validateValue(t){let e;for(let o of this.options.items){let b=st("",o).validateValue(t);if(b.valid)return l();e=b.reason}return a(e!=null?e:"Value does not match any of the allowed formats")}};B.type="#or";var N=class N{validateValue(t){var dt;if(t==="")return l();let e=t.toLowerCase().trim();if(e==="on"||e==="off")return l();let o=e.split(at).filter(Boolean);if(o.length===0)return a("Autocomplete value cannot be empty");let n=0,b=!1,A=!1,S=!1,P=!1,x="";if((dt=o[n])!=null&&dt.startsWith("section-")&&(b=!0,n++),(o[n]==="billing"||o[n]==="shipping")&&(A=!0,n++),n<o.length){let lt=o[n];if(N.AUTOFILL_FIELD_NAMES.has(lt))S=!0,x=lt,n++;else return a(`Invalid autofill field name: "${lt}". Must be one of the standard autofill field names.`)}else return a("Autocomplete value must include an autofill field name");if(n<o.length&&o[n]==="webauthn"){if(!N.WEBAUTHN_COMPATIBLE_FIELDS.has(x))return a(`"webauthn" token is only valid with username or current-password fields, not "${x}"`);P=!0,n++}return n<o.length?a(`Invalid extra token in autocomplete value: "${o[n]}"`):l()}};N.type="AutocompleteAttribute",N.Type={type:N.type},N.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"]),N.WEBAUTHN_COMPATIBLE_FIELDS=new Set(["username","current-password"]);var L=N;function st(u,t){switch(t.type){case m.type:return new m({unique:t.unique,allowed:t.allowed,validateToken:t.validateToken});case i.type:return new i({keywords:t.keywords});case p.type:return new p(u);case w.type:return new w;case y.type:return new y;case d.type:return new d({nonEmpty:t.nonEmpty,potentiallySurroundedBySpaces:t.potentiallySurroundedBySpaces});case c.type:return new c({min:t.min,max:t.max});case g.type:return new g;case f.type:return new f;case C.type:return new C;case D.type:return new D;case E.type:return new E;case h.type:return new h;case V.type:return new V;case _.type:return new _;case z.type:return new z;case T.type:return new T;case k.type:return new k;case R.type:return new R;case O.type:return new O;case G.type:return new G;case B.type:return new B({items:t.items});case L.type:return new L}}var rt=class{constructor(t,e){this.key=t;this.definition=e}validateValue(t){return st(this.key,this.definition).validateValue(t)}};var ct=new Map([["accesskey",{type:m.type,unique:!0,validateToken(u){return Array.from(u).length===1}}],["autocapitalize",{type:i.type,keywords:["off","none","on","sentences","words","characters"]}],["autocorrect",{type:i.type,keywords:["on","off"]}],["autofocus",p.Type],["contenteditable",{type:i.type,keywords:["true","false","plaintext-only"]}],["dir",{type:i.type,keywords:["ltr","rtl","auto"]}],["draggable",{type:i.type,keywords:["true","false"]}],["enterkeyhint",{type:i.type,keywords:["enter","done","go","next","previous","search","send"]}],["headingoffset",{type:c.type,min:0,max:8}],["headingreset",p.Type],["hidden",{type:i.type,keywords:["","until-found","hidden"]}],["inert",p.Type],["inputmode",{type:i.type,keywords:["none","text","tel","url","email","numeric","decimal","search"]}],["is",y.Type],["itemid",d.PotentiallySurroundedBySpaces],["itemprop",{type:m.type,unique:!0}],["itemref",{type:m.type,unique:!0}],["itemscope",p.Type],["itemtype",{type:m.type,unique:!0,validateToken(u){try{return new URL(u),!0}catch(t){return!1}}}],["lang",E.Type],["nonce",y.Type],["popover",{type:"#or",items:[p.Type,{type:i.type,keywords:["","auto","manual","hint"]}]}],["spellcheck",{type:i.type,keywords:["","true","false"]}],["style",y.Type],["tabindex",w.Type],["title",y.Type],["translate",{type:i.type,keywords:["","yes","no"]}],["writingsuggestions",{type:i.type,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:[T.Type,{type:i.type,keywords:["_blank","_self","_parent","_top"]}]}]]},link:{globalAttributes:!0,attributes:[["href",d.NonEmptyPotentiallySurroundedBySpaces],["crossorigin",{type:i.type,keywords:["","anonymous","use-credentials"]}],["rel",{type:m.type,unique:!0}],["media",R.Type],["integrity",y.Type],["hreflang",E.Type],["type",h.Type],["referrerpolicy",{type:i.type,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,unique:!0,validateToken(u){if(u.toLowerCase()==="any")return!0;let t=/^([1-9]\d*|0)[xX]([1-9]\d*|0)$/,e=u.match(t);if(!e)return!1;let[,o,n]=e;return!(o.length>1&&o.startsWith("0")||n.length>1&&n.startsWith("0"))}}],["imagesrcset",k.Type],["imagesizes",O.Type],["as",{type:i.type,keywords:["fetch","font","image","script","style","track","json","style","audioworklet","paintworklet","script","serviceworker","sharedworker","worker"]}],["blocking",{type:m.type,unique:!0,allowed:["render"]}],["color",D.Type],["disabled",p.Type],["fetchpriority",{type:i.type,keywords:["high","low","auto"]}]]},meta:{globalAttributes:!0,attributes:[["name",y.Type],["http-equiv",{type:i.type,keywords:["content-language","content-type","default-style","refresh","set-cookie","x-ua-compatible","content-security-policy"]}],["content",y.Type],["charset",{type:i.type,keywords:["utf-8"]}],["media",R.Type]]},style:{globalAttributes:!0,attributes:[["media",R.Type],["blocking",{type:m.type,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",p.Type],["start",w.Type],["type",{type:i.type,keywords:["1","a","A","i","I"]}]]},ul:{globalAttributes:!0,attributes:s},menu:{globalAttributes:!0,attributes:s},li:{globalAttributes:!0,attributes:[["value",w.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:[T.Type,{type:i.type,keywords:["_blank","_self","_parent","_top"]}]}],["download",y.Type],["ping",{type:m.type,unique:!1,validateToken(u){if(u.length===0)return!1;try{let t=new URL(u);return t.protocol==="http:"||t.protocol==="https:"}catch(t){return!1}}}],["rel",{type:m.type,unique:!0,allowed:["alternate","author","bookmark","external","help","license","next","nofollow","noopener","noreferrer","opener","prev","privacy-policy","search","tag","terms-of-service"]}],["hreflang",E.Type],["type",h.Type],["referrerpolicy",{type:i.type,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",y.Type]]},time:{globalAttributes:!0,attributes:[["datetime",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",V.Type]]},del:{globalAttributes:!0,attributes:[["cite",d.PotentiallySurroundedBySpaces],["datetime",V.Type]]},picture:{globalAttributes:!0,attributes:s},source:{globalAttributes:!0,attributes:[["type",h.Type],["media",R.Type],["src",d.NonEmptyPotentiallySurroundedBySpaces],["srcset",k.Type],["sizes",O.Type],["width",c.Type],["height",c.Type]]},img:{globalAttributes:!0,attributes:[["alt",y.Type],["src",d.NonEmptyPotentiallySurroundedBySpaces],["srcset",k.Type],["sizes",O.Type],["crossorigin",{type:i.type,keywords:["","anonymous","use-credentials"]}],["usemap",z.Type],["ismap",p.Type],["width",c.Type],["height",c.Type],["referrerpolicy",{type:i.type,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,keywords:["sync","async","auto"]}],["loading",{type:i.type,keywords:["eager","lazy"]}],["fetchpriority",{type:i.type,keywords:["high","low","auto"]}]]},iframe:{globalAttributes:!0,attributes:[["src",d.NonEmptyPotentiallySurroundedBySpaces],["srcdoc",y.Type],["name",{type:"#or",items:[T.Type,{type:i.type,keywords:["_blank","_self","_parent","_top"]}]}],["sandbox",{type:m.type,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",y.Type],["allowfullscreen",p.Type],["width",c.Type],["height",c.Type],["referrerpolicy",{type:i.type,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,keywords:["eager","lazy"]}]]},embed:{globalAttributes:!0,attributes:[["src",d.NonEmptyPotentiallySurroundedBySpaces],["type",h.Type],["width",c.Type],["height",c.Type]]},object:{globalAttributes:!0,attributes:[["data",d.NonEmptyPotentiallySurroundedBySpaces],["type",h.Type],["name",{type:"#or",items:[T.Type,{type:i.type,keywords:["_blank","_self","_parent","_top"]}]}],["form",g.Type],["width",c.Type],["height",c.Type]]},video:{globalAttributes:!0,attributes:[["src",d.NonEmptyPotentiallySurroundedBySpaces],["crossorigin",{type:i.type,keywords:["","anonymous","use-credentials"]}],["poster",d.NonEmptyPotentiallySurroundedBySpaces],["preload",{type:i.type,keywords:["","none","metadata","auto"]}],["autoplay",p.Type],["playsinline",p.Type],["loop",p.Type],["muted",p.Type],["controls",p.Type],["width",c.Type],["height",c.Type]]},audio:{globalAttributes:!0,attributes:[["src",d.NonEmptyPotentiallySurroundedBySpaces],["crossorigin",{type:i.type,keywords:["","anonymous","use-credentials"]}],["preload",{type:i.type,keywords:["","none","metadata","auto"]}],["autoplay",p.Type],["loop",p.Type],["muted",p.Type],["controls",p.Type]]},track:{globalAttributes:!0,attributes:[["kind",{type:i.type,keywords:["subtitles","captions","descriptions","chapters","metadata"]}],["src",d.NonEmptyPotentiallySurroundedBySpaces],["srclang",E.Type],["label",y.Type],["default",p.Type]]},map:{globalAttributes:!0,attributes:[["name",y.Type]]},area:{globalAttributes:!0,attributes:[["alt",y.Type],["coords",{type:G.type}],["shape",{type:i.type,keywords:["circle","default","poly","rect"]}],["href",d.PotentiallySurroundedBySpaces],["target",{type:"#or",items:[T.Type,{type:i.type,keywords:["_blank","_self","_parent","_top"]}]}],["download",y.Type],["ping",{type:m.type,unique:!1,validateToken(u){if(u.length===0)return!1;try{let t=new URL(u);return t.protocol==="http:"||t.protocol==="https:"}catch(t){return!1}}}],["rel",{type:m.type,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,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",c.GreaterThanZero]]},col:{globalAttributes:!0,attributes:[["span",c.GreaterThanZero]]},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",c.GreaterThanZero],["rowspan",c.Type],["headers",{type:m.type,unique:!0}]]},th:{globalAttributes:!0,attributes:[["colspan",c.GreaterThanZero],["rowspan",c.Type],["headers",{type:m.type,unique:!0}],["scope",{type:i.type,keywords:["row","col","rowgroup","colgroup"]}],["abbr",y.Type]]},form:{globalAttributes:!0,attributes:[["accept-charset",{type:m.type,unique:!0}],["action",d.NonEmptyPotentiallySurroundedBySpaces],["autocomplete",{type:i.type,keywords:["on","off"]}],["enctype",{type:i.type,keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}],["method",{type:i.type,keywords:["get","post","dialog"]}],["name",y.Type],["novalidate",p.Type],["target",{type:"#or",items:[T.Type,{type:i.type,keywords:["_blank","_self","_parent","_top"]}]}],["rel",{type:m.type,unique:!0,allowed:["external","help","license","next","nofollow","noopener","noreferrer","opener","prev","search"]}]]},label:{globalAttributes:!0,attributes:[["for",g.Type]]},input:{globalAttributes:!0,attributes:[["accept",{type:C.type}],["alt",y.Type],["autocomplete",L.Type],["checked",p.Type],["dirname",y.Type],["disabled",p.Type],["form",g.Type],["formaction",d.NonEmptyPotentiallySurroundedBySpaces],["formenctype",{type:i.type,keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}],["formmethod",{type:i.type,keywords:["get","post","dialog"]}],["formnovalidate",p.Type],["formtarget",{type:"#or",items:[T.Type,{type:i.type,keywords:["_blank","_self","_parent","_top"]}]}],["height",c.Type],["list",g.Type],["max",y.Type],["maxlength",c.Type],["min",y.Type],["minlength",c.Type],["multiple",p.Type],["name",y.Type],["pattern",_.Type],["placeholder",y.Type],["popovertarget",y.Type],["popovertargetaction",{type:i.type,keywords:["hide","show","toggle"]}],["readonly",p.Type],["required",p.Type],["size",c.GreaterThanZero],["src",d.NonEmptyPotentiallySurroundedBySpaces],["step",{type:"#or",items:[f.Type,{type:i.type,keywords:["any"]}]}],["type",{type:i.type,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",y.Type],["width",c.Type]]},button:{globalAttributes:!0,attributes:[["disabled",p.Type],["form",g.Type],["formaction",d.NonEmptyPotentiallySurroundedBySpaces],["formenctype",{type:i.type,keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}],["formmethod",{type:i.type,keywords:["get","post","dialog"]}],["formnovalidate",p.Type],["formtarget",{type:"#or",items:[T.Type,{type:i.type,keywords:["_blank","_self","_parent","_top"]}]}],["name",y.Type],["popovertarget",y.Type],["popovertargetaction",{type:i.type,keywords:["hide","show","toggle"]}],["type",{type:i.type,keywords:["submit","reset","button"]}],["value",y.Type]]},select:{globalAttributes:!0,attributes:[["autocomplete",L.Type],["disabled",p.Type],["form",g.Type],["multiple",p.Type],["name",y.Type],["required",p.Type],["size",c.GreaterThanZero]]},datalist:{globalAttributes:!0,attributes:s},optgroup:{globalAttributes:!0,attributes:[["disabled",p.Type],["label",y.Type]]},option:{globalAttributes:!0,attributes:[["disabled",p.Type],["label",y.Type],["selected",p.Type],["value",y.Type]]},textarea:{globalAttributes:!0,attributes:[["autocomplete",L.Type],["cols",c.GreaterThanZero],["dirname",y.Type],["disabled",p.Type],["form",g.Type],["maxlength",c.Type],["minlength",c.Type],["name",y.Type],["placeholder",y.Type],["readonly",p.Type],["required",p.Type],["rows",c.GreaterThanZero],["wrap",{type:i.type,keywords:["soft","hard"]}]]},output:{globalAttributes:!0,attributes:[["for",{type:m.type,unique:!0}],["form",g.Type],["name",y.Type]]},progress:{globalAttributes:!0,attributes:[["value",f.Type],["max",f.Type]]},meter:{globalAttributes:!0,attributes:[["value",f.Type],["min",f.Type],["max",f.Type],["low",f.Type],["high",f.Type],["optimum",f.Type]]},fieldset:{globalAttributes:!0,attributes:[["disabled",p.Type],["form",g.Type],["name",y.Type]]},legend:{globalAttributes:!0,attributes:s},selectedcontent:{globalAttributes:!0,attributes:s},details:{globalAttributes:!0,attributes:[["open",p.Type],["name",y.Type]]},summary:{globalAttributes:!0,attributes:s},dialog:{globalAttributes:!0,attributes:[["open",p.Type]]},script:{globalAttributes:!0,attributes:[["src",d.NonEmptyPotentiallySurroundedBySpaces],["type",{type:B.type,items:[{type:i.type,keywords:["module","importmap","speculationrules"]},h.Type]}],["nomodule",p.Type],["async",p.Type],["defer",p.Type],["crossorigin",{type:i.type,keywords:["","anonymous","use-credentials"]}],["integrity",y.Type],["referrerpolicy",{type:i.type,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,unique:!0}],["fetchpriority",{type:i.type,keywords:["high","low","auto"]}]]},noscript:{globalAttributes:!0,attributes:s},template:{globalAttributes:!0,attributes:[["shadowrootmode",{type:i.type,keywords:["open","closed"]}],["shadowrootdelegatesfocus",p.Type],["shadowrootclonable",p.Type],["shadowrootserializable",p.Type]]},slot:{globalAttributes:!0,attributes:[["name",y.Type]]},canvas:{globalAttributes:!0,attributes:[["width",c.Type],["height",c.Type]]}};var nt=class{constructor(t){this.state=t;this.get=t=>{var n,b,A;let e=this.getSpecDefinition();if(!e)return null;let o=null;return e.globalAttributes&&(o=(n=ct.get(t))!=null?n:null,o)?new rt(t,o):(o=(A=(b=e==null?void 0:e.attributes.find(([S])=>t.toLowerCase()===S))==null?void 0:b[1])!=null?A:null,o?new rt(t,o):null)};this.has=t=>{let e=this.getSpecDefinition();return e!=null&&e.globalAttributes&&ct.has(t)?!0:!!(e==null?void 0:e.attributes.find(([n])=>t.toLowerCase()===n))}}getSpecDefinition(){let t=At[this.state.name];return t!=null?t:null}};var pt=class{constructor(t,e){this.implicitRole=()=>{let t=mt[this.state.name];return t?t(this.state):null};this.state=new ot(t,e)}get attributes(){return new nt(this.state)}};function gt(u,t={}){return new pt(u,t)}0&&(module.exports={element});
2
2
  //# sourceMappingURL=index.cjs.map