25 lines
167 KiB
JavaScript
25 lines
167 KiB
JavaScript
|
|
(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.html=e()}})(function(){"use strict";var lt=Object.defineProperty;var Ji=Object.getOwnPropertyDescriptor;var Zi=Object.getOwnPropertyNames;var es=Object.prototype.hasOwnProperty;var Pr=e=>{throw TypeError(e)};var ts=(e,t,r)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Or=(e,t)=>{for(var r in t)lt(e,r,{get:t[r],enumerable:!0})},rs=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zi(t))!es.call(e,i)&&i!==r&<(e,i,{get:()=>t[i],enumerable:!(n=Ji(t,i))||n.enumerable});return e};var ns=e=>rs(lt({},"__esModule",{value:!0}),e);var Wt=(e,t,r)=>ts(e,typeof t!="symbol"?t+"":t,r),is=(e,t,r)=>t.has(e)||Pr("Cannot "+r);var Fe=(e,t,r)=>(is(e,t,"read from private field"),r?r.call(e):t.get(e)),Dr=(e,t,r)=>t.has(e)?Pr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var Wo={};Or(Wo,{languages:()=>Vi,options:()=>Wi,parsers:()=>Lr,printers:()=>Uo});var ve=(e,t)=>(r,n,...i)=>r|1&&n==null?void 0:(t.call(n)??n[e]).apply(n,i);var ss=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},as=ve("replaceAll",function(){if(typeof this=="string")return ss}),w=as;function os(e){return this[e<0?this.length+e:e]}var ls=ve("at",function(){if(Array.isArray(this)||typeof this=="string")return os}),M=ls;var cs=()=>{},He=cs;var Ve="string",Ue="array",ct="cursor",Te="indent",be="align",ut="trim",we="group",ke="fill",xe="if-break",ye="indent-if-break",pt="line-suffix",ht="line-suffix-boundary",$="line",mt="label",Ae="break-parent",ft=new Set([ct,Te,be,ut,we,ke,xe,ye,pt,ht,$,mt,Ae]);function us(e){if(typeof e=="string")return Ve;if(Array.isArray(e))return Ue;if(!e)return;let{type:t}=e;if(ft.has(t))return t}var dt=us;var ps=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function hs(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
|
||
|
|
Expected it to be 'string' or 'object'.`;if(dt(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=ps([...ft].map(i=>`'${i}'`));return`Unexpected doc.type '${e.type}'.
|
||
|
|
Expected it to be ${n}.`}var Gt=class extends Error{name="InvalidDocError";constructor(t){super(hs(t)),this.doc=t}},Ir=Gt;function zt(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(s){if(r.has(s))return r.get(s);let a=i(s);return r.set(s,a),a}function i(s){switch(dt(s)){case Ue:return t(s.map(n));case ke:return t({...s,parts:s.parts.map(n)});case xe:return t({...s,breakContents:n(s.breakContents),flatContents:n(s.flatContents)});case we:{let{expandedStates:a,contents:o}=s;return a?(a=a.map(n),o=a[0]):o=n(o),t({...s,contents:o,expandedStates:a})}case be:case Te:case ye:case mt:case pt:return t({...s,contents:n(s.contents)});case Ve:case ct:case ut:case ht:case $:case Ae:return t(s);default:throw new Ir(s)}}}function L(e,t=Rr){return zt(e,r=>typeof r=="string"?B(t,r.split(`
|
||
|
|
`)):r)}var D=He,gt=He,Mr=He,Br=He;function A(e){return D(e),{type:Te,contents:e}}function ms(e,t){return Br(e),D(t),{type:be,contents:t,n:e}}function qr(e){return ms(Number.NEGATIVE_INFINITY,e)}var Y={type:Ae};function _t(e){return Mr(e),{type:ke,parts:e}}function E(e,t={}){return D(e),gt(t.expandedStates,!0),{type:we,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function j(e,t="",r={}){return D(e),t!==""&&D(t),{type:xe,breakContents:e,flatContents:t,groupId:r.groupId}}function Fr(e,t){return D(e),{type:ye,contents:e,groupId:t.groupId,negate:t.negate}}function B(e,t){D(e),gt(t);let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}var S={type:$},k={type:$,soft:!0},fs={type:$,hard:!0},C=[fs,Y],ds={type:$,hard:!0,literal:!0},Rr=[ds,Y];var Hr=Object.freeze({character:"'",codePoint:39}),Vr=Object.freeze({character:'"',codePoint:34}),gs=Object.freeze({preferred:Hr,alternate:Vr}),_s=Object.freeze({preferred:Vr,alternate:Hr});function Ss(e,t){let{preferred:r,alternate:n}=t===!0||t==="'"?gs:_s,{length:i}=e,s=0,a=0;for(let o=0;o<i;o++){let c=e.charCodeAt(o);c===r.codePoint?s++:c===n.codePoint&&a++}return(s>a?n:r).character}var Ur=Ss;function $t(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Yt=class{#e;constructor(t){this.#e=new Set(t)}getLeadingWhitespaceCount(t){let r=this.#e,n=0;for(let i=0;i<t.length&&r.has(t.charAt(i));i++)n++;return n}getTrailingWhitespaceCount(t){let r=this.#e,n=0;for(let i=t.length-1;i>=0&&r.has(t.charAt(i));i--)n++;return n}getLeadingWhitespace(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(0,r)}getTrailingWhitespace(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(t.length-r)}hasLeadingWhitespace(t){return this.#e.has(t.charAt(0))}hasTrailingWhitespace(t){return this.#e.has(M(0,t,-1))}trimStart(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(r)}trimEnd(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-r)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,r=!1){let n=`[${$t([...this.#e].join(""))}]+`,i=new RegExp(r?`(${n})`:n,"u");return t.split(i)}hasWhitespaceCharacter(t){let r=this.#e;return Array.prototype.some.call(t,n=>r.has(n))}hasNonWhitespaceCharacter(t){let r=this.#e;return Array.prototype.some.call(t,n=>!r.has(n))}isWhitespaceOnly(t){let r=this.#e;return Array.prototype.every.call(t,n=>r.has(n))}#t(t){let r=Number.POSITIVE_INFINITY;for(let n of t.split(`
|
||
|
|
`)){if(n.length===0)continue;let i=this.getLeadingWhitespaceCount(n);if(i===0)return 0;n.length!==i&&i<r&&(r=i)}return r===Number.POSITIVE_INFINITY?0:r}dedentString(t){let r=this.#t(t);return r===0?t:t.split(`
|
||
|
|
`).map(n=>n.slice(r)).join(`
|
||
|
|
`)}},Wr=Yt;var Es=[" ",`
|
||
|
|
`,"\f","\r"," "],Cs=new Wr(Es),N=Cs;var jt=class extends Error{name="UnexpectedNodeError";constructor(t,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(t[n])}.`),this.node=t}},Gr=jt;var vs=new Set(["sourceSpan","startSourceSpan","endSourceSpan","nameSpan","valueSpan","keySpan","tagDefinition","tokens","valueTokens","switchValueSourceSpan","expSourceSpan","valueSourceSpan"]),Ts=new Set(["if","else if","for","switch","case"]);function zr(e,t,r){if(e.kind==="text"||e.kind==="comment")return null;if(e.kind==="yaml"&&delete t.value,e.kind==="attribute"){let{fullName:n,value:i}=e;n==="style"||n==="class"||n==="srcset"&&(r.fullName==="img"||r.fullName==="source")||n==="allow"&&r.fullName==="iframe"||n.startsWith("on")||n.startsWith("@")||n.startsWith(":")||n.startsWith(".")||n.startsWith("#")||n.startsWith("v-")||n==="vars"&&r.fullName==="style"||(n==="setup"||n==="generic")&&r.fullName==="script"||n==="slot-scope"||n.startsWith("(")||n.startsWith("[")||n.startsWith("*")||n.startsWith("bind")||n.startsWith("i18n")||n.startsWith("on-")||n.startsWith("ng-")||i?.includes("{{")?delete t.value:i&&(t.value=w(0,i,/'|"|'/gu,'"'))}if(e.kind==="docType"&&(t.value=w(0,e.value.toLowerCase(),/\s+/gu," ")),e.kind==="angularControlFlowBlock"&&e.parameters?.children)for(let n of t.parameters.children)Ts.has(e.name)?delete n.expression:n.expression=n.expression.trim();e.kind==="angularIcuExpression"&&(t.switchValue=e.switchValue.trim()),e.kind==="angularLetDeclarationInitializer"&&delete t.value,e.kind==="element"&&e.isVoid&&!e.isSelfClosing&&(t.isSelfClosing=!0)}zr.ignoredProperties=vs;var $r=zr;function X(e,t=!0){return[A([k,e]),t?k:""]}function V(e,t){let r=e.type==="NGRoot"?e.node.type==="NGMicrosyntax"&&e.node.body.length===1&&e.node.body[0].type==="NGMicrosyntaxExpression"?e.node.body[0].expression:e.node:e.type==="JsExpressionRoot"?e.node:e;return r&&(r.type==="ObjectExpression"||r.type==="ArrayExpression"||(t.parser==="__vue_expression"||t.parser==="__vue_ts_expression"||t.parser==="__ng_binding"||t.parser==="__ng_directive")&&(r.type==="TemplateLiteral"||r.type==="StringLiteral"))}async function x(e,t,r,n){r={__isInHtmlAttribute:!0,__embeddedInHtml:!0,...r};let i=!0;n&&(r.__onHtmlBindingRoot=(a,o)=>{i=n(a,o)});let s=await t(e,r,t);return i?E(s):X(s)}function bs(e,t,r,n){let{node:i}=r,s=n.originalText.slice(i.sourceSpan.start.offset,i.sourceSpan.end.offset);return/^\s*$/u.test(s)?"":x(s,e,{parser:"__ng_directive",__isInHtmlAttribute:!1},V)}var Yr=bs;var ws=Array.prototype.toReversed??function(){return[...this].reverse()},ks=ve("toReversed",function(){if(Array.isArray(this))return ws}),jr=ks;function xs(){let e=globalThis,t=e.Deno?.build?.os;return typeof t=="string"?t==="windows":e.navigator?.platform?.startsWith("Win")??e.process?.platform?.startsWith("win")??!1}var ys=xs();function Xr(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function As(e){return e=Xr(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function Ns(e){e=Xr(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(t=`\\\\${e.hostname}${t}`),t}function Xt(e){return ys?Ns(e):As(e)}var Kr=e=>String(e).split(/[/\\]/u).pop(),Qr=e=>String(e).startsWith("file:");function Ls(e){return Array.isArray(e)&&e.length>0}var Ne=Ls;function Jr(e,t){if(!t)return;let r=Kr(t).toLowerCase();return e.find(({filenames:n})=>n?.some(i=>i.toLowerCase()===r))??e.find(({extensions:n})=>n?.some(i=>r.endsWith(i)))}function Ps(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r?.includes(t))??e.find(({extensions:r})=>r?.includes(`.${t}`))}var Os=void 0;function Zr(e,t){if(t){if(Qr(t))try{t=Xt(t)}catch{return}if(typeof t=="string")return e.find(({isSupported:r})=>r?.({filepath:t}))}}function Ds(e,t){let r=jr(0,e.plugins).flatMap(i=>i.languages??[]);return(Ps(r,t.language)??Jr(r,t.physicalFile)??Jr(r,t.file)??Zr(r,t.physicalFil
|
||
|
|
`,We);if(r===-1)return;let n=e.slice(We,r).trim(),i=e.indexOf(`
|
||
|
|
${t}`,r),s=n;if(s||(s=t==="+++"?"toml":"yaml"),i===-1&&t==="---"&&s==="yaml"&&(i=e.indexOf(`
|
||
|
|
...`,r)),i===-1)return;let a=i+1+We,o=e.charAt(a+1);if(!/\s?/u.test(o))return;let c=e.slice(0,a),u;return{language:s,explicitLanguage:n||null,value:e.slice(r+1,i),startDelimiter:t,endDelimiter:c.slice(-We),raw:c,start:{line:1,column:0,index:0},end:{index:c.length,get line(){return u??(u=c.split(`
|
||
|
|
`)),u.length},get column(){return u??(u=c.split(`
|
||
|
|
`)),M(0,u,-1).length}},[Et]:!0}}function Ms(e){let t=Rs(e);return t?{frontMatter:t,get content(){let{raw:r}=t;return w(0,r,/[^\n]/gu," ")+e.slice(r.length)}}:{content:e}}var Kt=Ms;var en="inline",Qt={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",style:"none",template:"inline",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",dialog:"block",div:"block",figure:"block",figcaption:"block",footer:"block",form:"block",header:"block",hr:"block",legend:"block",listing:"block",main:"block",p:"block",plaintext:"block",pre:"block",search:"block",xmp:"block",slot:"contents",ruby:"ruby",rt:"ruby-text",article:"block",aside:"block",h1:"block",h2:"block",h3:"block",h4:"block",h5:"block",h6:"block",hgroup:"block",nav:"block",section:"block",dir:"block",dd:"block",dl:"block",dt:"block",menu:"block",ol:"block",ul:"block",li:"list-item",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",input:"inline-block",button:"inline-block",fieldset:"block",details:"block",summary:"block",marquee:"inline-block",select:"inline-block",source:"block",track:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block",option:"block",optgroup:"block"},tn="normal",Jt={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function Bs(e){return e.kind==="element"&&!e.hasExplicitNamespace&&!["html","svg"].includes(e.namespace)}var se=Bs;var qs=e=>w(0,e,/^[\t\f\r ]*\n/gu,""),Zt=e=>qs(N.trimEnd(e)),rn=e=>{let t=e,r=N.getLeadingWhitespace(t);r&&(t=t.slice(r.length));let n=N.getTrailingWhitespace(t);return n&&(t=t.slice(0,-n.length)),{leadingWhitespace:r,trailingWhitespace:n,text:t}};function Ct(e,t){return!!(e.kind==="ieConditionalComment"&&e.lastChild&&!e.lastChild.isSelfClosing&&!e.lastChild.endSourceSpan||e.kind==="ieConditionalComment"&&!e.complete||ae(e)&&e.children.some(r=>r.kind!=="text"&&r.kind!=="interpolation")||bt(e,t)&&!q(e,t)&&e.kind!=="interpolation")}function oe(e){return e.kind==="attribute"||!e.parent||!e.prev?!1:Fs(e.prev)}function Fs(e){return e.kind==="comment"&&e.value.trim()==="prettier-ignore"}function O(e){return e.kind==="text"||e.kind==="comment"}function q(e,t){return e.kind==="element"&&(e.fullName==="script"||e.fullName==="style"||e.fullName==="svg:style"||e.fullName==="svg:script"||e.fullName==="mj-style"&&t.parser==="mjml"||se(e)&&(e.name==="script"||e.name==="style"))}function nn(e,t){return e.children&&!q(e,t)}function sn(e,t){return q(e,t)||e.kind==="interpolation"||er(e)}function er(e){return gn(e).startsWith("pre")}function an(e,t){let r=n();if(r&&!e.prev&&e.parent?.tagDefinition?.ignoreFirstLf)return e.kind==="interpolation";return r;function n(){return ie(e)||e.kind==="angularControlFlowBlock"?!1:(e.kind==="text"||e.kind==="interpolation")&&e.prev&&(e.prev.kind==="text"||e.prev.kind==="interpolation")?!0:!e.parent||e.parent.cssDisplay==="none"?!1:ae(e.parent)?!0:!(!e.prev&&(e.parent.kind==="root"||ae(e)&&e.parent||q(e.parent,t)||$e(e.parent,t)||!zs(e.parent.cssDisplay))||e.prev&&!js(e.prev.cssDisplay))}}function on(e,t){return ie(e)||e.kind==="angularControlFlowBlock"?!1:(e.kind==="text"||e.kind==="interpolation")&&e.next&&(e.next.kind==="text"||e.next.kind==="interpolation")?!0:!e.parent||e.parent.cssDisplay==="none"?!1:ae(e.parent)?!0:!(!e.next&&(e.parent.kind==="root"||ae(e)&&e.parent||q(e.parent,t)||$e(e.parent,t)||!$s(e.parent.cssDisplay))||e.next&&!Ys(e.next.cssDisplay))}function ln(e,t){return Xs(e.cssDisplay)&&!q(e,t)}function Ge(e){return ie(e)||e.next&&e.sourceSpan.end&&e.sourceSpan.end.line+1<e.next.sourceSpan.start.line}function cn(e){return tr(e)||e.kind==="element"&&e.children.length>0&&(["body","script","style"].includes(e.name)||e.children.some(t=>Vs(t)))||e.firstChild&&e.firstChild===e.lastChild&&e
|
||
|
|
`||e==="\f"||e==="\r"||e===" "}var ia=/^[ \t\n\r\u000c]+/,sa=/^[, \t\n\r\u000c]+/,aa=/^[^ \t\n\r\u000c]+/,oa=/[,]+$/,Pn=/^\d+$/,la=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function ca(e){let t=e.length,r,n,i,s,a,o=0,c;function u(m){let _,T=m.exec(e.substring(o));if(T)return[_]=T,o+=_.length,_}let p=[];for(;;){if(u(sa),o>=t){if(p.length===0)throw new Error("Must contain one or more image candidate strings.");return p}c=o,r=u(aa),n=[],r.slice(-1)===","?(r=r.replace(oa,""),g()):d()}function d(){for(u(ia),i="",s="in descriptor";;){if(a=e.charAt(o),s==="in descriptor")if(Ln(a))i&&(n.push(i),i="",s="after descriptor");else if(a===","){o+=1,i&&n.push(i),g();return}else if(a==="(")i+=a,s="in parens";else if(a===""){i&&n.push(i),g();return}else i+=a;else if(s==="in parens")if(a===")")i+=a,s="in descriptor";else if(a===""){n.push(i),g();return}else i+=a;else if(s==="after descriptor"&&!Ln(a))if(a===""){g();return}else s="in descriptor",o-=1;o+=1}}function g(){let m=!1,_,T,P,z,ne={},Q,ot,Ce,qe,Ut;for(z=0;z<n.length;z++)Q=n[z],ot=Q[Q.length-1],Ce=Q.substring(0,Q.length-1),qe=parseInt(Ce,10),Ut=parseFloat(Ce),Pn.test(Ce)&&ot==="w"?((_||T)&&(m=!0),qe===0?m=!0:_=qe):la.test(Ce)&&ot==="x"?((_||T||P)&&(m=!0),Ut<0?m=!0:T=Ut):Pn.test(Ce)&&ot==="h"?((P||T)&&(m=!0),qe===0?m=!0:P=qe):m=!0;if(!m)ne.source={value:r,startOffset:c},_&&(ne.width={value:_}),T&&(ne.density={value:T}),P&&(ne.height={value:P}),p.push(ne);else throw new Error(`Invalid srcset descriptor found in "${e}" at "${Q}".`)}}var On=ca;var Dn=e=>e.node.fullName==="srcset"&&(e.parent.fullName==="img"||e.parent.fullName==="source"),In={width:"w",height:"h",density:"x"},ua=Object.keys(In);function Rn(e,t,r){let n=b(r.node),i=On(n),s=ua.filter(m=>i.some(_=>Object.prototype.hasOwnProperty.call(_,m)));if(s.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[a]=s,o=In[a],c=i.map(m=>m.source.value),u=Math.max(...c.map(m=>m.length)),p=i.map(m=>m[a]?String(m[a].value):""),d=p.map(m=>{let _=m.indexOf(".");return _===-1?m.length:_}),g=Math.max(...d);return X(B([",",S],c.map((m,_)=>{let T=[m],P=p[_];if(P){let z=u-m.length+1,ne=g-d[_],Q=" ".repeat(z+ne);T.push(j(Q," "),P+o)}return T})))}var Mn=({node:e},t)=>e.fullName==="style"&&!t.parentParser&&!e.value.includes("{{"),Bn=async(e,t,r)=>X(await e(b(r.node),{parser:"css",__isHTMLStyleAttribute:!0}));var ar=new WeakMap;function pa(e,t){let{root:r}=e;return ar.has(r)||ar.set(r,r.children.some(n=>kt(n,t)&&["ts","typescript"].includes(n.attrMap.lang))),ar.get(r)}var U=pa;function qn(e,t,r){let n=b(r.node);return x(`type T<${n}> = any`,e,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},V)}function Fn(e,t,r,n){let i=b(r.node),s=U(r,n)?"babel-ts":"babel";return x(`function _(${i}) {}`,e,{parser:s,__isVueBindings:!0})}async function Hn(e,t,r,n){let i=b(r.node),{left:s,operator:a,right:o}=ha(i),c=U(r,n);return[E(await x(`function _(${s}) {}`,e,{parser:c?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",a," ",await x(o,e,{parser:c?"__ts_expression":"__js_expression"})]}function ha(e){let t=/(.*?)\s+(in|of)\s+(.*)/su,r=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,n=/^\(|\)$/gu,i=e.match(t);if(!i)return;let s={for:i[3].trim()};if(!s.for)return;let a=w(0,i[1].trim(),n,""),o=a.match(r);o?(s.alias=a.replace(r,""),s.iterator1=o[1].trim(),o[2]&&(s.iterator2=o[2].trim())):s.alias=a;let c=[s.alias,s.iterator1,s.iterator2];if(!c.some((u,p)=>!u&&(p===0||c.slice(p+1).some(Boolean))))return{left:c.filter(Boolean).join(","),operator:i[2],right:s.for}}var ma=[{test:e=>e.node.fullName==="v-for",print:Hn},{test:(e,t)=>e.node.fullName==="generic"&&kt(e.parent,t),print:qn},{test:({node:e},t)=>_n(e)||Sn(e,t),print:Fn},{test(e){let t=e.node.fullName;return t.startsWith("@")||t.startsWith("v-on:")},print:fa},{test(e){let t=e.node.fullName;return t.startsWith(":")||t.startsWith(".")||t.startsWith("v-bind:")},print:da},{test:e=>e.node.fullName.startsWith("v-"),print:Vn}].map(({test:e,print:t})=>({test:(r,n)=>n.parser==="vue"&&e(r,n),print:t}));async function fa(e,t,r,n){try{return await Vn(e,t,r,n)}catch(a){if(a.cause?.code!=="BABEL_PARSER_S
|
||
|
|
|
||
|
|
${e}`;var ri=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])]]);function ni(e){let t=J(e);return e.kind==="element"&&!e.endSourceSpan&&Ne(e.children)?Math.max(t,ni(M(0,e.children,-1))):t}function Ze(e,t,r){let n=e.node;if(oe(n)){let i=ni(n);return[H(n,t),L(N.trimEnd(t.originalText.slice(K(n)+(n.prev&&je(n.prev)?At(n).length:0),i-(n.next&&W(n.next)?ue(n,t).length:0)))),F(n,t)]}return r()}function Pt(e,t){return O(e)&&O(t)?e.isTrailingSpaceSensitive?e.hasTrailingSpaces?vt(t)?C:S:"":vt(t)?C:k:je(e)&&(oe(t)||t.firstChild||t.isSelfClosing||t.kind==="element"&&t.attrs.length>0)||e.kind==="element"&&e.isSelfClosing&&W(t)?"":!t.isLeadingSpaceSensitive||vt(t)||W(t)&&e.lastChild&&he(e.lastChild)&&e.lastChild.lastChild&&he(e.lastChild.lastChild)?C:t.hasLeadingSpaces?S:k}function Le(e,t,r){let{node:n}=e;if(tr(n))return[Y,...e.map(()=>{let s=e.node,a=s.prev?Pt(s.prev,s):"";return[a?[a,Ge(s.prev)?C:""]:"",Ze(e,t,r)]},"children")];let i=n.children.map(()=>Symbol(""));return e.map(({node:s,index:a})=>{if(O(s)){if(s.prev&&O(s.prev)){let m=Pt(s.prev,s);if(m)return Ge(s.prev)?[C,C,Ze(e,t,r)]:[m,Ze(e,t,r)]}return Ze(e,t,r)}let o=[],c=[],u=[],p=[],d=s.prev?Pt(s.prev,s):"",g=s.next?Pt(s,s.next):"";return d&&(Ge(s.prev)?o.push(C,C):d===C?o.push(C):O(s.prev)?c.push(d):c.push(j("",k,{groupId:i[a-1]}))),g&&(Ge(s)?O(s.next)&&p.push(C,C):g===C?O(s.next)&&p.push(C):u.push(g)),[...o,E([...c,E([Ze(e,t,r),...u],{id:i[a]})]),...p]},"children")}function ii(e,t,r){let{node:n}=e,i=[];if(Da(e)&&i.push("} "),i.push("@",n.name),Pa(n))return i.push(";"),i;if(n.parameters&&i.push(" (",E(r("parameters")),")"),!Oa(n)){i.push(" {");let s=si(n);n.children.length>0?(n.firstChild.hasLeadingSpaces=!0,n.lastChild.hasTrailingSpaces=!0,i.push(A([C,Le(e,t,r)])),s&&i.push(C,"}")):s&&i.push("}")}return E(i,{shouldBreak:!0})}function si(e){return!(e.next?.kind==="angularControlFlowBlock"&&ri.get(e.name)?.has(e.next.name))}var La=e=>e?.kind==="angularControlFlowBlock"&&(e.name==="case"||e.name==="default"),Pa=e=>e?.kind==="angularControlFlowBlock"&&e.name==="default never";function Oa(e){return La(e)&&e.endSourceSpan&&e.endSourceSpan.start.offset===e.endSourceSpan.end.offset}function Da(e){let{previous:t}=e;return t?.kind==="angularControlFlowBlock"&&!oe(t)&&!si(t)}function ai(e,t,r){return[A([k,B([";",S],e.map(r,"children"))]),k]}function oi(e,t,r){let{node:n}=e;return[me(n,t),E([n.switchValue.trim(),", ",n.type,n.cases.length>0?[",",A([S,B(S,e.map(r,"cases"))])]:"",k]),ce(n,t)]}function li(e,t,r){let{node:n}=e;return[n.value," {",E([A([k,e.map(({node:i,isLast:s})=>{let a=[r()];return i.kind==="text"&&(i.hasLeadingSpaces&&a.unshift(S),i.hasTrailingSpaces&&!s&&a.push(S)),a},"expression")]),k]),"}"]}function ci(e,t,r){let{node:n}=e;if(Ct(n,t))return[H(n,t),E(Ke(e,t,r)),L(Lt(n,t)),...Ye(n,t),F(n,t)];let i=n.children.length===1&&(n.firstChild.kind==="interpolation"||n.firstChild.kind==="angularIcuExpression")&&n.firstChild.isLeadingSpaceSensitive&&!n.firstChild.hasLeadingSpaces&&n.lastChild.isTrailingSpaceSensitive&&!n.lastChild.hasTrailingSpaces,s=Symbol("element-attr-group-id"),a=p=>E([E(Ke(e,t,r),{id:s}),p,Ye(n,t)]),o=p=>i?Fr(p,{groupId:s}):(q(n,t)||$e(n,t))&&n.parent.kind==="root"&&t.parser==="vue"&&!t.vueIndentScriptAndStyle?p:A(p),c=()=>i?j(k,"",{groupId:s}):n.firstChild.hasLeadingSpaces&&n.firstChild.isLeadingSpaceSensitive?S:n.firstChild.kind==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive?qr(k):k,u=()=>(n.next?W(n.next):pe(n.parent))?n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?" ":"":i?j(k,"",{groupId:s}):n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?S:(n.lastChild.kind==="comment"||n.lastChild.kind==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${t.tabWidth*(e.ancestors.length-1)}}$`,"u").test(n.la
|
||
|
|
If '${e}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${e}' is disallowed for security reasons, please use (${e.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(e){let t=this._schema.get(e.toLowerCase())||this._schema.get("unknown");return Array.from(t.keys()).map(r=>Ha.get(r)??r)}allKnownEventsOfElement(e){return Array.from(this._eventSchema.get(e.toLowerCase())??[])}normalizeAnimationStyleProperty(e){return ui(e)}normalizeAnimationStyleValue(e,t,r){let n="",i=r.toString().trim(),s=null;if(Va(e)&&r!==0&&r!=="0")if(typeof r=="number")n="px";else{let a=r.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&(s=`Please provide a CSS unit value for ${t}:${r}`)}return{error:s,value:i+n}}};function Va(e){switch(e){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var f=class{closedByChildren={};contentType;closedByParent=!1;implicitNamespacePrefix;isVoid;ignoreFirstLf;canSelfClose;preventNamespaceInheritance;constructor({closedByChildren:e,implicitNamespacePrefix:t,contentType:r=R.PARSABLE_DATA,closedByParent:n=!1,isVoid:i=!1,ignoreFirstLf:s=!1,preventNamespaceInheritance:a=!1,canSelfClose:o=!1}={}){e&&e.length>0&&e.forEach(c=>this.closedByChildren[c]=!0),this.isVoid=i,this.closedByParent=n||i,this.implicitNamespacePrefix=t||null,this.contentType=r,this.ignoreFirstLf=s,this.preventNamespaceInheritance=a,this.canSelfClose=o??i}isClosedByChild(e){return this.isVoid||e.toLowerCase()in this.closedByChildren}getContentType(e){return typeof this.contentType=="object"?(e===void 0?void 0:this.contentType[e])??this.contentType.default:this.contentType}},fi,rt;function Oe(e){return rt||(fi=new f({canSelfClose:!0}),rt=Object.assign(Object.create(null),{base:new f({isVoid:!0}),meta:new f({isVoid:!0}),area:new f({isVoid:!0}),embed:new f({isVoid:!0}),link:new f({isVoid:!0}),img:new f({isVoid:!0}),input:new f({isVoid:!0}),param:new f({isVoid:!0}),hr:new f({isVoid:!0}),br:new f({isVoid:!0}),source:new f({isVoid:!0}),track:new f({isVoid:!0}),wbr:new f({isVoid:!0}),p:new f({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new f({closedByChildren:["tbody","tfoot"]}),tbody:new f({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new f({closedByChildren:["tbody"],closedByParent:!0}),tr:new f({closedByChildren:["tr"],closedByParent:!0}),td:new f({closedByChildren:["td","th"],closedByParent:!0}),th:new f({closedByChildren:["td","th"],closedByParent:!0}),col:new f({isVoid:!0}),svg:new f({implicitNamespacePrefix:"svg"}),foreignObject:new f({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new f({implicitNamespacePrefix:"math"}),li:new f({closedByChildren:["li"],closedByParent:!0}),dt:new f({closedByChildren:["dt","dd"]}),dd:new f({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new f({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new f({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new f({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new f({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new f({closedByChildren:["optgroup"],closedByParent:!0}),option:new f({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new f({ignoreFirstLf:!0}),listing:new f({ignoreFirstLf:!0}),style:new f({contentType:R.RAW_TEXT})
|
||
|
|
`);a=o>0?i-o:i}else a--;for(;i<n&&t>0;){let o=r.charCodeAt(i);i++,t--,o==10?(s++,a=0):a++}return new gi(this.file,i,s,a)}getContext(t,r){let n=this.file.content,i=this.offset;if(i!=null){i>n.length-1&&(i=n.length-1);let s=i,a=0,o=0;for(;a<t&&i>0&&(i--,a++,!(n[i]==`
|
||
|
|
`&&++o==r)););for(a=0,o=0;a<t&&s<n.length-1&&(s++,a++,!(n[s]==`
|
||
|
|
`&&++o==r)););return{before:n.substring(i,this.offset),after:n.substring(this.offset,s+1)}}return null}},nt=class{constructor(e,t){this.content=e,this.url=t}},h=class{constructor(e,t,r=e,n=null){this.start=e,this.end=t,this.fullStart=r,this.details=n}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},di=(function(e){return e[e.WARNING=0]="WARNING",e[e.ERROR=1]="ERROR",e})({}),ee=class extends Error{constructor(e,t,r=di.ERROR,n){super(t),this.span=e,this.msg=t,this.level=r,this.relatedError=n,Object.setPrototypeOf(this,new.target.prototype)}contextualMessage(){let e=this.span.start.getContext(100,3);return e?`${this.msg} ("${e.before}[${di[this.level]} ->]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};var de=class{constructor(e,t){this.sourceSpan=e,this.i18n=t}},_i=class extends de{constructor(e,t,r,n){super(t,n),this.value=e,this.tokens=r}visit(e,t){return e.visitText(this,t)}kind="text"},Si=class extends de{constructor(e,t,r,n){super(t,n),this.value=e,this.tokens=r}visit(e,t){return e.visitCdata(this,t)}kind="cdata"},Ei=class extends de{constructor(e,t,r,n,i,s){super(n,s),this.switchValue=e,this.type=t,this.cases=r,this.switchValueSourceSpan=i}visit(e,t){return e.visitExpansion(this,t)}kind="expansion"},Ci=class{constructor(e,t,r,n,i){this.value=e,this.expression=t,this.sourceSpan=r,this.valueSourceSpan=n,this.expSourceSpan=i}visit(e,t){return e.visitExpansionCase(this,t)}kind="expansionCase"},vi=class extends de{constructor(e,t,r,n,i,s,a){super(r,a),this.name=e,this.value=t,this.keySpan=n,this.valueSpan=i,this.valueTokens=s}visit(e,t){return e.visitAttribute(this,t)}kind="attribute";get nameSpan(){return this.keySpan}},te=class extends de{constructor(e,t,r,n,i,s,a,o=null,c=null,u,p){super(s,p),this.name=e,this.attrs=t,this.directives=r,this.children=n,this.isSelfClosing=i,this.startSourceSpan=a,this.endSourceSpan=o,this.nameSpan=c,this.isVoid=u}visit(e,t){return e.visitElement(this,t)}kind="element"},Ti=class{constructor(e,t){this.value=e,this.sourceSpan=t}visit(e,t){return e.visitComment(this,t)}kind="comment"},bi=class{constructor(e,t){this.value=e,this.sourceSpan=t}visit(e,t){return e.visitDocType(this,t)}kind="docType"},ge=class extends de{constructor(e,t,r,n,i,s,a=null,o){super(n,o),this.name=e,this.parameters=t,this.children=r,this.nameSpan=i,this.startSourceSpan=s,this.endSourceSpan=a}visit(e,t){return e.visitBlock(this,t)}kind="block"},G=class extends de{constructor(e,t,r,n,i,s,a,o,c,u=null,p){super(o,p),this.componentName=e,this.tagName=t,this.fullName=r,this.attrs=n,this.directives=i,this.children=s,this.isSelfClosing=a,this.startSourceSpan=c,this.endSourceSpan=u}visit(e,t){return e.visitComponent(this,t)}kind="component"},wi=class{constructor(e,t,r,n,i=null){this.name=e,this.attrs=t,this.sourceSpan=r,this.startSourceSpan=n,this.endSourceSpan=i}visit(e,t){return e.visitDirective(this,t)}kind="directive"},mr=class{constructor(e,t){this.expression=e,this.sourceSpan=t}visit(e,t){return e.visitBlockParameter(this,t)}kind="blockParameter";startSourceSpan=null;endSourceSpan=null},fr=class{constructor(e,t,r,n,i){this.name=e,this.value=t,this.sourceSpan=r,this.nameSpan=n,this.valueSpan=i}visit(e,t){return e.visitLetDeclaration(this,t)}kind="letDeclaration";startSourceSpan=null;endSourceSpan=null};function Dt(e,t,r=null){let n=[],i=e.visit?s=>e.visit(s,r)||s.visit(e,r):s=>s.visit(e,r);return t.forEach(s=>{let a=i(s);a&&n.push(a)}),n}var dr=class{constructor(){}visitElement(e,t){this.visitChildren(t,r=>{r(e.attrs),r(e.directives),r(e.children)})}visitAttribute(e,t){}visitText(e,t){}visitCdata(e,t){}visitComment(e,t){}visitDocType(e,t){}visitExpansion(e,t){return this.visitChildren(t,r=>{r(e.cases)})}visitExpansionCase(e,t){}visitBlock(e,t){this.visitChildren(t,r=>{r(e.parameters),r(e.children)})}visitBlockParameter(e,t){}visitLetDeclaration(e,t){}visitComponent(e,t){this.visitChildren(t,r=>{r(e.attrs),r(e.children)})}visitDirective(e,t){this.visitChildren(t,r=>{r(e.attrs)})}visitCh
|
||
|
|
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nbsp:"\xA0",Nopf:"\u2115",naturals:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",nequiv:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",npar:"\u2226",nparallel:"\u2226",nshortparallel:"\u2226",nspar:"\u2226",NotElement:"\u2209",notin:"\u2209",notinva:"\u2209",NotEqual:"\u2260",ne:"\u2260",NotEqualTilde:"\u2242\u0338",nesim:"\u2242\u0338",NotExists:"\u2204",nexist:"\u2204",nexists:"\u2204",NotGreater:"\u226F",ngt:"\u226F",ngtr:"\u226F",NotGreaterEqual:"\u2271",nge:"\u2271",ngeq:"\u2271",NotGreaterFullEqual:"\u2267\u0338",ngE:"\u2267\u0338",ngeqq:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",nGtv:"\u226B\u0338",NotGreaterLess:"\u2279",ntgl:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",NotGreaterTilde:"\u2275",ngsim:"\u2275",NotHumpDownHump:"\u224E\u0338",nbump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",nbumpe:"\u224F\u0338",NotLeftTriangle:"\u22EA",nltri:"\u22EA",ntriangleleft:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",nltrie:"\u22EC",ntrianglelefteq:"\u22EC",NotLess:"\u226E",nless:"\u226E",nlt:"\u226E",NotLessEqual:"\u2270",nle:"\u2270",nleq:"\u2270",NotLessGreater:"\u2278",ntlg:"\u2278",NotLessLess:"\u226A\u0338",nLtv:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",NotLessTilde:"\u2274",nlsim:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",npr:"\u2280",nprec:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",npre:"\u2AAF\u0338",npreceq:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",nprcue:"\u22E0",NotReverseElement:"\u220C",notni:"\u220C",notniva:"\u220C",NotRightTriangle:"\u22EB",nrtri:"\u22EB",ntriangleright:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",nrtrie:"\u22ED",ntrianglerighteq:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",nsqsube:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",nsqsupe:"\u22E3",NotSubset:"\u2282\u20D2",nsubset:"\u2282\u20D2",vnsub:"\u2282\u20D2",NotSubsetEqual:"\u2288",nsube:"\u2288",nsubseteq:"\u2288",NotSucceeds:"\u2281",nsc:"\u2281",nsucc:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",nsce:"\u2AB0\u0338",nsucceq:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",nsccue:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",nsupset:"\u2283\u20D2",vnsup:"\u2283\u20D2",NotSupersetEqual:"\u2289",nsupe:"\u2289",nsupseteq:"\u2289",NotTilde:"\u2241",nsim:"\u2241",NotTildeEqual:"\u2244",nsime:"\u2244",nsimeq:"\u2244",NotTildeFullEqual:"\u2247",ncong:"\u2247",NotTildeTilde:"\u2249",nap:"\u2249",napprox:"\u2249",NotVerticalBar:"\u2224",nmid:"\u2224",nshortmid:"\u2224",nsmid:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",ohm:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",ldquo:"\u201C",OpenCurlyQuote:"\u2018",lsquo:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",oline:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",tbrk:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",part:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",plusmn:"\xB1",pm:"\xB1",Popf:"\u2119",primes:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",pr:"\u227A",prec:"\u227A",PrecedesEqual:"\u2AAF",pre:"\u2AAF",preceq:"\u2AAF",PrecedesSlantEqual:"\u227C",prcue:"\u227C",preccurlyeq:"\u227C",PrecedesTilde:"\u227E",precsim:"\u227E",prsim:"\u227E",Prime:"\u2033",Product:"\u220F",prod:"\u220F",Proportional:"\u221D",prop:"\u221D",propto:"\u221D",varpropto:"\u221D",vprop:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',quot:'"',Qfr:"\u{1D514}",Qopf:"\u211A",rationals:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",drbkarow:"\u2910",REG:"\xAE",circledR:"\xAE",reg:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",twoheadrightarrow:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:
|
||
|
|
`)}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 t=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=t,this._consumeBogusComment(e)):this._consumeTagOpen(e)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._isLetStart()?this._consumeLetDeclaration(e):this._tokenizeBlocks&&this._isBlockStart()?this._consumeBlockStart(e):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(l.TEXT,l.INTERPOLATION,()=>this._isTextEnd(),()=>this._isTagStart())}catch(t){this.handleError(t)}}this._beginToken(l.EOF),this._endToken([])}_getBlockName(){let e=!1,t=this._cursor.clone();return this._attemptCharCodeUntilFn(r=>it(r)?!e:Ja(r)?(e=!0,!1):!0),this._cursor.getChars(t).trim()}_consumeBlockStart(e){this._requireCharCode(64),this._beginToken(l.BLOCK_OPEN_START,e);let t=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(v),this._attemptCharCode(41))this._attemptCharCodeUntilFn(v);else{t.type=l.INCOMPLETE_BLOCK_OPEN;return}if(t.parts[0]==="default never"&&this._attemptCharCode(59)){this._beginToken(l.BLOCK_OPEN_END),this._endToken([]),this._beginToken(l.BLOCK_CLOSE),this._endToken([]);return}this._attemptCharCode(123)?(this._beginToken(l.BLOCK_OPEN_END),this._endToken([])):this._isBlockStart()&&(t.parts[0]==="case"||t.parts[0]==="default")?(this._beginToken(l.BLOCK_OPEN_END),this._endToken([]),this._beginToken(l.BLOCK_CLOSE),this._endToken([])):t.type=l.INCOMPLETE_BLOCK_OPEN}_consumeBlockEnd(e){this._beginToken(l.BLOCK_CLOSE,e),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(Ai);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(l.BLOCK_PARAMETER);let e=this._cursor.clone(),t=null,r=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||t!==null;){let n=this._cursor.peek();if(n===92)this._cursor.advance();else if(n===t)t=null;else if(t===null&&It(n))t=n;else if(n===40&&t===null)r++;else if(n===41&&t===null){if(r===0)break;r>0&&r--}this._cursor.advance()}this._endToken([this._cursor.getChars(e)]),this._attemptCharCodeUntilFn(Ai)}}_consumeLetDeclaration(e){if(this._requireStr("@let"),this._beginToken(l.LET_START,e),it(this._cursor.peek()))this._attemptCharCodeUntilFn(v);else{let r=this._endToken([this._cursor.getChars(e)]);r.type=l.INCOMPLETE_LET;return}let t=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(v),!this._attemptCharCode(61)){t.type=l.INCOMPLETE_LET;return}this._attemptCharCodeUntilFn(r=>v(r)&&!Me(r)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(l.LET_END),this._endToken([]),this._cursor.advance()):(t.type=l.INCOMPLETE_LET,t.sourceSpan=this._cursor.getSpan(e))}_getLetDeclarationName(){let e=this._cursor.clone(),t=!1;return this._attemptCharCodeUntilFn(r=>Re(r)||r===36||r===95||t&&Ie(r)?(t=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeLetDeclarationValue(){let e=this._cursor.clone();for(this._beginToken(l.LET_VALUE,e);this._cursor.peek()!==0;){let t=this._cursor.peek();if(t===59)break;It(t)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(r=>r===92?(this._cursor.advance(),!1):r===t)),this._cursor.advance()}this._endToken([this._cursor.getChars(e)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(Ka(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isIn
|
||
|
|
`){var n;let i=this._getClosestElementLikeParent();i!=null&&i.children.length==0&&(!((n=this._getTagDefinition(i))===null||n===void 0)&&n.ignoreFirstLf)&&(r=r.substring(1))}return r}_consumeText(t){let r=[t],n=t.sourceSpan,i=t.parts[0];if(i.length>0&&i[0]===`
|
||
|
|
`){var s;let a=this._getContainer();a!=null&&a.children.length===0&&(!((s=this._getTagDefinition(a))===null||s===void 0)&&s.ignoreFirstLf)&&(i=i.substring(1),r[0]={type:t.type,sourceSpan:t.sourceSpan,parts:[i]})}for(;this._peek.type===l.INTERPOLATION||this._peek.type===l.TEXT||this._peek.type===l.ENCODED_ENTITY;)t=this._advance(),r.push(t),t.type===l.INTERPOLATION?i+=t.parts.join("").replace(/&([^;]+);/g,Ii):t.type===l.ENCODED_ENTITY?i+=t.parts[0]:i+=t.parts.join("");if(i.length>0){let a=t.sourceSpan;this._addToParent(new _i(i,new h(n.start,a.end,n.fullStart,n.details),r))}}_closeVoidElement(){var t;let r=this._getContainer();r!==null&&(!((t=this._getTagDefinition(r))===null||t===void 0)&&t.isVoid)&&this._containerStack.pop()}_consumeElementStartTag(t){var r;let n=[],i=[];this._consumeAttributesAndDirectives(n,i);let s=this._getElementFullName(t,this._getClosestElementLikeParent()),a=this._getTagDefinition(s),o=!1;if(this._peek.type===l.TAG_OPEN_END_VOID){this._advance(),o=!0;let T=this._getTagDefinition(s);this.canSelfClose||T?.canSelfClose||Pe(s)!==null||T?.isVoid||this.errors.push(y.create(s,t.sourceSpan,`Only void, custom and foreign elements can be self closed "${t.parts[1]}"`))}else this._peek.type===l.TAG_OPEN_END&&(this._advance(),o=!1);let c=this._peek.sourceSpan.fullStart,u=new h(t.sourceSpan.start,c,t.sourceSpan.fullStart),p=new h(t.sourceSpan.start,c,t.sourceSpan.fullStart),d=new h(t.sourceSpan.start.moveBy(1),t.sourceSpan.end),g=new te(s,n,i,[],o,u,p,void 0,d,a?.isVoid??!1),m=this._getContainer(),_=m!==null&&!!(!((r=this._getTagDefinition(m))===null||r===void 0)&&r.isClosedByChild(g.name));this._pushContainer(g,_),o?this._popContainer(s,te,u):t.type===l.INCOMPLETE_TAG_OPEN&&(this._popContainer(s,te,null),this.errors.push(y.create(s,u,`Opening tag "${s}" not terminated.`)))}_consumeComponentStartTag(t){var r;let n=t.parts[0],i=[],s=[];this._consumeAttributesAndDirectives(i,s);let a=this._getClosestElementLikeParent(),o=this._getComponentTagName(t,a),c=this._getComponentFullName(t,a),u=this._peek.type===l.COMPONENT_OPEN_END_VOID;this._advance();let p=this._peek.sourceSpan.fullStart,d=new h(t.sourceSpan.start,p,t.sourceSpan.fullStart),g=new G(n,o,c,i,s,[],u,d,new h(t.sourceSpan.start,p,t.sourceSpan.fullStart),void 0),m=this._getContainer(),_=m!==null&&g.tagName!==null&&!!(!((r=this._getTagDefinition(m))===null||r===void 0)&&r.isClosedByChild(g.tagName));this._pushContainer(g,_),u?this._popContainer(c,G,d):t.type===l.INCOMPLETE_COMPONENT_OPEN&&(this._popContainer(c,G,null),this.errors.push(y.create(c,d,`Opening tag "${c}" not terminated.`)))}_consumeAttributesAndDirectives(t,r){for(;this._peek.type===l.ATTR_NAME||this._peek.type===l.DIRECTIVE_NAME;)this._peek.type===l.DIRECTIVE_NAME?r.push(this._consumeDirective(this._peek)):t.push(this._consumeAttr(this._advance()))}_consumeComponentEndTag(t){let r=this._getComponentFullName(t,this._getClosestElementLikeParent());if(!this._popContainer(r,G,t.sourceSpan)){let n=this._containerStack[this._containerStack.length-1],i;n instanceof G&&n.componentName===t.parts[0]?i=`, did you mean "${n.fullName}"?`:i=". It may happen when the tag has already been closed by another tag.";let s=`Unexpected closing tag "${r}"${i}`;this.errors.push(y.create(r,t.sourceSpan,s))}}_getTagDefinition(t){return typeof t=="string"?this.tagDefinitionResolver(t):t instanceof te?this.tagDefinitionResolver(t.name):t instanceof G&&t.tagName!==null?this.tagDefinitionResolver(t.tagName):null}_pushContainer(t,r){r&&this._containerStack.pop(),this._addToParent(t),this._containerStack.push(t)}_consumeElementEndTag(t){var r;let n=this.allowHtmComponentClosingTags&&t.parts.length===0?null:this._getElementFullName(t,this._getClosestElementLikeParent());if(n&&(!((r=this._getTagDefinition(n))===null||r===void 0)&&r.isVoid))this.errors.push(y.create(n,t.sourceSpan,`Void elements do not have end tags "${t.parts[1]}"`));else if(!this._popContainer(n,te,t.sourceSpan)){let i=`Unexpected closing tag "${n}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/ht
|
||
|
|
`){let r=t.children[0];r.value.length===1?t.removeChild(r):r.value=r.value.slice(1)}})}function ao(e){let t=r=>r.kind==="element"&&r.prev?.kind==="ieConditionalStartComment"&&r.prev.sourceSpan.end.offset===r.startSourceSpan.start.offset&&r.firstChild?.kind==="ieConditionalEndComment"&&r.firstChild.sourceSpan.start.offset===r.startSourceSpan.end.offset;e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.firstChild;r.removeChild(s),n--;let o=new h(s.sourceSpan.start,a.sourceSpan.end),c=new h(o.start,i.sourceSpan.end);i.condition=s.condition,i.sourceSpan=c,i.startSourceSpan=o,i.removeChild(a)}})}function oo(e,t,r){e.walk(n=>{if(n.children)for(let i=0;i<n.children.length;i++){let s=n.children[i];if(s.kind!=="text"&&!t(s))continue;s.kind!=="text"&&(s.kind="text",s.value=r(s));let a=s.prev;!a||a.kind!=="text"||(a.value+=s.value,a.sourceSpan=new h(a.sourceSpan.start,s.sourceSpan.end),n.removeChild(s),i--)}})}function lo(e){return oo(e,t=>t.kind==="cdata",t=>`<![CDATA[${t.value}]]>`)}function co(e){let t=r=>r.kind==="element"&&r.attrs.length===0&&r.children.length===1&&r.firstChild.kind==="text"&&!N.hasWhitespaceCharacter(r.children[0].value)&&!r.firstChild.hasLeadingSpaces&&!r.firstChild.hasTrailingSpaces&&r.isLeadingSpaceSensitive&&!r.hasLeadingSpaces&&r.isTrailingSpaceSensitive&&!r.hasTrailingSpaces&&r.prev?.kind==="text"&&r.next?.kind==="text";e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.next;s.value+=`<${i.rawName}>`+i.firstChild.value+`</${i.rawName}>`+a.value,s.sourceSpan=new h(s.sourceSpan.start,a.sourceSpan.end),s.isTrailingSpaceSensitive=a.isTrailingSpaceSensitive,s.hasTrailingSpaces=a.hasTrailingSpaces,r.removeChild(i),n--,r.removeChild(a)}})}function uo(e,t){if(t.parser==="html")return;let r=/\{\{(.+?)\}\}/su;e.walk(n=>{if(nn(n,t))for(let i of n.children){if(i.kind!=="text")continue;let s=i.sourceSpan.start,a=null,o=i.value.split(r);for(let c=0;c<o.length;c++,s=a){let u=o[c];if(c%2===0){a=s.moveBy(u.length),u.length>0&&n.insertChildBefore(i,{kind:"text",value:u,sourceSpan:new h(s,a)});continue}a=s.moveBy(u.length+4),n.insertChildBefore(i,{kind:"interpolation",sourceSpan:new h(s,a),children:u.length===0?[]:[{kind:"text",value:u,sourceSpan:new h(s.moveBy(2),a.moveBy(-2))}]})}n.removeChild(i)}})}function po(e,t){e.walk(r=>{let n=r.$children;if(!n)return;if(n.length===0||n.length===1&&n[0].kind==="text"&&N.trim(n[0].value).length===0){r.hasDanglingSpaces=n.length>0,r.$children=[];return}let i=sn(r,t),s=er(r);if(!i)for(let a=0;a<n.length;a++){let o=n[a];if(o.kind!=="text")continue;let{leadingWhitespace:c,text:u,trailingWhitespace:p}=rn(o.value),d=o.prev,g=o.next;u?(o.value=u,o.sourceSpan=new h(o.sourceSpan.start.moveBy(c.length),o.sourceSpan.end.moveBy(-p.length)),c&&(d&&(d.hasTrailingSpaces=!0),o.hasLeadingSpaces=!0),p&&(o.hasTrailingSpaces=!0,g&&(g.hasLeadingSpaces=!0))):(r.removeChild(o),a--,(c||p)&&(d&&(d.hasTrailingSpaces=!0),g&&(g.hasLeadingSpaces=!0)))}r.isWhitespaceSensitive=i,r.isIndentationSensitive=s})}function ho(e){e.walk(t=>{t.isSelfClosing=!t.children||t.kind==="element"&&(t.tagDefinition.isVoid||t.endSourceSpan&&t.startSourceSpan.start===t.endSourceSpan.start&&t.startSourceSpan.end===t.endSourceSpan.end)})}function mo(e,t){e.walk(r=>{r.kind==="element"&&(r.hasHtmComponentClosingTag=r.endSourceSpan&&/^<\s*\/\s*\/\s*>$/u.test(t.originalText.slice(r.endSourceSpan.start.offset,r.endSourceSpan.end.offset)))})}function fo(e,t){e.walk(r=>{r.cssDisplay=dn(r,t)})}function go(e,t){e.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=ln(r,t);return}for(let i of n)i.isLeadingSpaceSensitive=an(i,t),i.isTrailingSpaceSensitive=on(i,t);for(let i=0;i<n.length;i++){let s=n[i];s.isLeadingSpaceSensitive=(i===0||s.prev.isTrailingSpaceSensitive)&&s.isLeadingSpaceSensitive,s.isTrailingSpaceSensitive=(i===n.length-1||s.next.isLeadingSpaceSensitive)&&s.isTrailingSpaceSensitive}}})}var Fi=io;function _o(e,t,r){let{node:n}=e;switch(n.kind){case"root":return t.__onHtmlRoot
|