(function(f){functione(){vari=f();returni.default||i}if(typeofexports=="object"&&typeofmodule=="object")module.exports=e();elseif(typeofdefine=="function"&&define.amd)define(e);else{vart=typeofglobalThis<"u"?globalThis:typeofglobal<"u"?global:typeofself<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.html=e()}})(function(){"use strict";varor=Object.defineProperty;varri=Object.getOwnPropertyDescriptor;varni=Object.getOwnPropertyNames;varsi=Object.prototype.hasOwnProperty;varXr=t=>{throwTypeError(t)};varJr=(t,e)=>{for(varrine)or(t,r,{get:e[r],enumerable:!0})},ii=(t,e,r,n)=>{if(e&&typeofe=="object"||typeofe=="function")for(letsofni(e))!si.call(t,s)&&s!==r&&or(t,s,{get:()=>e[s],enumerable:!(n=ri(e,s))||n.enumerable});returnt};varai=t=>ii(or({},"__esModule",{value:!0}),t);varZr=(t,e,r)=>e.has(t)||Xr("Cannot "+r);varK=(t,e,r)=>(Zr(t,e,"read from private field"),r?r.call(t):e.get(t)),en=(t,e,r)=>e.has(t)?Xr("Cannot add the same private member more than once"):einstanceofWeakSet?e.add(t):e.set(t,r),tn=(t,e,r,n)=>(Zr(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);varqo={};Jr(qo,{languages:()=>As,options:()=>vs,parsers:()=>Yr,printers:()=>Mo});varoi=(t,e,r,n)=>{if(!(t&&e==null))returne.replaceAll?e.replaceAll(r,n):r.global?e.replace(r,n):e.split(r).join(n)},w=oi;varVe="string",Ue="array",We="cursor",De="indent",ve="align",ze="trim",ye="group",we="fill",be="if-break",Te="indent-if-break",Ge="line-suffix",Ye="line-suffix-boundary",Q="line",je="label",xe="break-parent",St=newSet([We,De,ve,ze,ye,we,be,Te,Ge,Ye,Q,je,xe]);functionui(t){if(typeoft=="string")returnVe;if(Array.isArray(t))returnUe;if(!t)return;let{type:e}=t;if(St.has(e))returne}varKe=ui;varli=t=>newIntl.ListFormat("en-US",{type:"disjunction"}).format(t);functionci(t){lete=t===null?"null":typeoft;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
Expected it to be 'string' or 'object'.`;if(Ke(t))thrownewError("doc is valid.");letr=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;letn=li([...St].map(s=>`'${s}'`));return`Unexpected doc.type '${t.type}'.
Expected it to be ${n}.`}varur=classextendsError{name="InvalidDocError";constructor(e){super(ci(e)),this.doc=e}},lr=ur;varrn=()=>{},re=rn,_t=rn;functionk(t){returnre(t),{type:De,contents:t}}functionnn(t,e){returnre(e),{type:ve,contents:e,n:t}}function_(t,e={}){returnre(t),_t(e.expandedStates,!0),{type:ye,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}functionsn(t){returnnn(Number.NEGATIVE_INFINITY,t)}functionan(t){returnnn({type:"root"},t)}functionEt(t){return_t(t),{type:we,parts:t}}functionle(t,e="",r={}){returnre(t),e!==""&&re(e),{type:be,breakContents:t,flatContents:e,groupId:r.groupId}}functionon(t,e){returnre(t),{type:Te,contents:t,groupId:e.groupId,negate:e.negate}}varne={type:xe};varpi={type:Q,hard:!0},hi={type:Q,hard:!0,literal:!0},E={type:Q},v={type:Q,soft:!0},S=[pi,ne],un=[hi,ne];functionq(t,e){re(t),_t(e);letr=[];for(letn=0;n<e.length;n++)n!==0&&r.push(t),r.push(e[n]);returnr}varmi=(t,e,r)=>{if(!(t&&e==null))returnArray.isArray(e)||typeofe=="string"?e[r<0?e.length+r:r]:e.at(r)},se=mi;functioncr(t,e){if(typeoft=="string")returne(t);letr=newMap;returnn(t);functionn(i){if(r.has(i))returnr.get(i);leta=s(i);returnr.set(i,a),a}functions(i){switch(Ke(i)){caseUe:returne(i.map(n));casewe:returne({...i,parts:i.parts.map(n)});casebe:returne({...i,breakContents:n(i.breakContents),flatContents:n(i.flatContents)});caseye:{let{expandedStates:a,contents:o}=i;returna?(a=a.map(n),o=a[0]):o=n(o),e({...i,contents:o,expandedStates:a})}caseve:caseDe:caseTe:caseje:caseGe:returne({...i,contents:n(i.contents)});caseVe:caseWe:caseze:caseYe:caseQ:casexe:returne(i);default:thrownewlr(i)}}}functionB(t,e=un){returncr(t,r=>typeofr=="string"?q(e,r.split(`
`)):r)}varAt="'",ln='"';functionfi(t,e){letr=e===!0||e===At?At:ln,n=r===At?ln:At,s=0,i=0;for(letaoft)a===r?s++:a===n&&i++;returns>i?n:r}varcn=fi;functionpr(t){if(typeoft!="string")thrownewTypeError("Expected a string");returnt.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}varH,hr=class{constructor(e){en(this,H);tn(this,H,newSet(e))}getLeadingWhitespaceCount(e){letr=K(this,H),n=0;for(lets=0;s<e.length&&r.has(e.charAt(s));s++)n++;returnn}getTrailingWhitespaceCount(e){letr=K(this,H),n=0;for(lets=e.length-1;s>=0&&r.has(e.charAt(s));s--)n++;returnn}getLeadingWhitespace(e){letr=this.getLeadingWhitespaceCount(e);returne.slice(0,r)}getTrailingWhitespace(e){letr=this.getTrailingWhitespaceCount(e);returne.slice(e.length-r)}hasLeadingWhitespace(e){returnK(this,H).has(e.charAt(0))}hasTrailingWhitespace(e){returnK(this,H).has(se(!1,e,-1))}trimStart(e){letr=this.getLeadingWhitespaceCount(e);returne.slice(r)}trimEnd(e){letr=this.getTrailingWhitespaceCount(e);returne.slice(0,e.length-r)}trim(e){returnthis.trimEnd(this.trimStart(e))}split(e,r=!1){letn=`[${pr([...K(this,H)].join(""))}]+`,s=newRegExp(r?`(${n})`:n,"u");returne.split(s)}hasWhitespaceCharacter(e){letr=K(this,H);returnArray.prototype.some.call(e,n=>r.has(n))}hasNonWhitespaceCharacter(e){letr=K(this,H);returnArray.prototype.some.call(e,n=>!r.has(n))}isWhitespaceOnly(e){letr=K(this,H);returnArray.prototype.every.call(e,n=>r.has(n))}};H=newWeakMap;varpn=hr;vardi=[" ",`
`)}tokenize(){for(;this._cursor.peek()!==0;){let e=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(e):this._attemptStr("--")?this._consumeComment(e):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(e):this._consumeBogusComment(e);else if(this._attemptCharCode(47))this._consumeTagClose(e);else{let r=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=r,this._consumeBogusComment(e)):this._consumeTagOpen(e)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._attemptStr("@let")?this._consumeLetDeclaration(e):this._tokenizeBlocks&&this._attemptCharCode(64)?this._consumeBlockStart(e):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(r){this.handleError(r)}}this._beginToken(34),this._endToken([])}_getBlockName(){let e=!1,r=this._cursor.clone();return this._attemptCharCodeUntilFn(n=>at(n)?!e:$s(n)?(e=!0,!1):!0),this._cursor.getChars(r).trim()}_consumeBlockStart(e){this._beginToken(25,e);let r=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(b),this._attemptCharCode(41))this._attemptCharCodeUntilFn(b);else{r.type=29;return}this._attemptCharCode(123)?(this._beginToken(26),this._endToken([])):r.type=29}_consumeBlockEnd(e){this._beginToken(27,e),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(Ms);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(28);let e=this._cursor.clone(),r=null,n=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||r!==null;){let s=this._cursor.peek();if(s===92)this._cursor.advance();else if(s===r)r=null;else if(r===null&&It(s))r=s;else if(s===40&&r===null)n++;else if(s===41&&r===null){if(n===0)break;n>0&&n--}this._cursor.advance()}this._endToken([this._cursor.getChars(e)]),this._attemptCharCodeUntilFn(Ms)}}_consumeLetDeclaration(e){if(this._beginToken(30,e),at(this._cursor.peek()))this._attemptCharCodeUntilFn(b);else{let s=this._endToken([this._cursor.getChars(e)]);s.type=33;return}let r=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(b),!this._attemptCharCode(61)){r.type=33;return}this._attemptCharCodeUntilFn(s=>b(s)&&!Pt(s)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(32),this._endToken([]),this._cursor.advance()):(r.type=33,r.sourceSpan=this._cursor.getSpan(e))}_getLetDeclarationName(){let e=this._cursor.clone(),r=!1;return this._attemptCharCodeUntilFn(n=>ot(n)||n===36||n===95||r&&Nt(n)?(r=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeLetDeclarationValue(){let e=this._cursor.clone();for(this._beginToken(31,e);this._cursor.peek()!==0;){let r=this._cursor.peek();if(r===59)break;It(r)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(n=>n===92?(this._cursor.advance(),!1):n===r)),this._cursor.advance()}this._endToken([this._cursor.getChars(e)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(_o(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(e,r=this._cursor.clone()){this._currentTokenStart=r,this._currentTokenType=e}_endToken(e,r){if(this._currentTokenStart===null)throw new ft("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(r));if(this._currentTokenType===null)throw new ft("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart));let n={type:this._currentTokenType,parts:e,sourceSpan:(
`){leti=this._getContainer();i!=null&&i.children.length===0&&this.getTagDefinition(i.name).ignoreFirstLf&&(s=s.substring(1),r[0]={type:e.type,sourceSpan:e.sourceSpan,parts:[s]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)e=this._advance(),r.push(e),e.type===8?s+=e.parts.join("").replace(/&([^;]+);/g,zs):e.type===9?s+=e.parts[0]:s+=e.parts.join("");if(s.length>0){leti=e.sourceSpan;this._addToParent(newHt(s,newh(n.start,i.end,n.fullStart,n.details),r))}}_closeVoidElement(){lete=this._getContainer();einstanceofG&&this.getTagDefinition(e.name).isVoid&&this._containerStack.pop()}_consumeStartTag(e){let[r,n]=e.parts,s=[];for(;this._peek.type===14;)s.push(this._consumeAttr(this._advance()));leti=this._getElementFullName(r,n,this._getClosestParentElement()),a=!1;if(this._peek.type===2){this._advance(),a=!0;letC=this.getTagDefinition(i);this.canSelfClose||C.canSelfClose||Re(i)!==null||C.isVoid||this.errors.push(L.create(i,e.sourceSpan,`Only void, custom and foreign elements can be self closed "${e.parts[1]}"`))}elsethis._peek.type===1&&(this._advance(),a=!1);leto=this._peek.sourceSpan.fullStart,u=newh(e.sourceSpan.start,o,e.sourceSpan.fullStart),p=newh(e.sourceSpan.start,o,e.sourceSpan.fullStart),l=newh(e.sourceSpan.start.moveBy(1),e.sourceSpan.end),f=newG(i,s,[],u,p,void0,l),d=this._getContainer();this._pushContainer(f,dinstanceofG&&this.getTagDefinition(d.name).isClosedByChild(f.name)),a?this._popContainer(i,G,u):e.type===4&&(this._popContainer(i,G,null),this.errors.push(L.create(i,u,`Opening tag "${i}" not terminated.`)))}_pushContainer(e,r){r&&this._containerStack.pop(),this._addToParent(e),this._containerStack.push(e)}_consumeEndTag(e){letr=this.allowHtmComponentClosingTags&&e.parts.length===0?null:this._getElementFullName(e.parts[0],e.parts[1],this._getClosestParentElement());if(r&&this.getTagDefinition(r).isVoid)this.errors.push(L.create(r,e.sourceSpan,`Void elements do not have end tags "${e.parts[1]}"`));elseif(!this._popContainer(r,G,e.sourceSpan)){letn=`Unexpected closing tag "${r}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(L.create(r,e.sourceSpan,n))}}_popContainer(e,r,n){lets=!1;for(leti=this._containerStack.length-1;i>=0;i--){leta=this._containerStack[i];if(Re(a.name)?a.name===e:(e==null||a.name.toLowerCase()===e.toLowerCase())&&ainstanceofr)returna.endSourceSpan=n,a.sourceSpan.end=n!==null?n.end:a.sourceSpan.end,this._containerStack.splice(i,this._containerStack.length-i),!s;(ainstanceofee||ainstanceofG&&!this.getTagDefinition(a.name).closedByParent)&&(s=!0)}return!1}_consumeAttr(e){letr=Oe(e.parts[0],e.parts[1]),n=e.sourceSpan.end,s;this._peek.type===15&&(s=this._advance());leti="",a=[],o,u;if(this._peek.type===16)for(o=this._peek.sourceSpan,u=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){letf=this._advance();a.push(f),f.type===17?i+=f.parts.join("").replace(/&([^;]+);/g,zs):f.type===9?i+=f.parts[0]:i+=f.parts.join(""),u=n=f.sourceSpan.end}this._peek.type===15&&(u=n=this._advance().sourceSpan.end);letl=o&&u&&newh((s==null?void0:s.sourceSpan.start)??o.start,u,(s==null?void0:s.sourceSpan.fullStart)??o.fullStart);returnnewzt(r,i,newh(e.sourceSpan.start,n,e.sourceSpan.fullStart),e.sourceSpan,l,a.length>0?a:void0,void0)}_consumeBlockOpen(e){letr=[];for(;this._peek.type===28;){leto=this._advance();r.push(newct(o.parts[0],o.sourceSpan))}this._peek.type===26&&this._advance();letn=this._peek.sourceSpan.fullStart,s=newh(e.sourceSpan.start,n,e.sourceSpan.fullStart),i=newh(e.sourceSpan.start,n,e.sourceSpan.fullStart),a=newee(e.parts[0],r,[],s,e.sourceSpan,i);this._pushContainer(a,!1)}_consumeBlockClose(e){this._popContainer(null,ee,e.sourceSpan)||this.errors.push(L.create(null,e.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncomplete