stdproject/frontend/node_modules/prettier/plugins/glimmer.mjs

31 lines
134 KiB
JavaScript
Raw Normal View History

2025-05-30 13:43:31 +08:00
var Ws=Object.defineProperty;var Or=e=>{throw TypeError(e)};var Fe=(e,t)=>{for(var r in t)Ws(e,r,{get:t[r],enumerable:!0})};var Br=(e,t,r)=>t.has(e)||Or("Cannot "+r);var I=(e,t,r)=>(Br(e,t,"read from private field"),r?r.call(e):t.get(e)),Lt=(e,t,r)=>t.has(e)?Or("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,s)=>(Br(e,t,"write to private field"),s?s.call(e,r):t.set(e,r),r);var Pr={};Fe(Pr,{languages:()=>ps,parsers:()=>xr,printers:()=>wi});var js=(e,t,r,s)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,s):r.global?t.replace(r,s):t.split(r).join(s)},He=js;var Dt="string",Gt="array",Kt="cursor",_t="indent",Ot="align",Wt="trim",Bt="group",It="fill",bt="if-break",jt="indent-if-break",Qt="line-suffix",Jt="line-suffix-boundary",j="line",$t="label",Rt="break-parent",fe=new Set([Kt,_t,Ot,Wt,Bt,It,bt,jt,Qt,Jt,j,$t,Rt]);var Qs=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},G=Qs;function Js(e){if(typeof e=="string")return Dt;if(Array.isArray(e))return Gt;if(!e)return;let{type:t}=e;if(fe.has(t))return t}var qt=Js;var $s=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Xs(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(qt(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let s=$s([...fe].map(n=>`'${n}'`));return`Unexpected doc.type '${e.type}'.
Expected it to be ${s}.`}var Ue=class extends Error{name="InvalidDocError";constructor(t){super(Xs(t)),this.doc=t}},Me=Ue;function tn(e,t){if(typeof e=="string")return t(e);let r=new Map;return s(e);function s(i){if(r.has(i))return r.get(i);let a=n(i);return r.set(i,a),a}function n(i){switch(qt(i)){case Gt:return t(i.map(s));case It:return t({...i,parts:i.parts.map(s)});case bt:return t({...i,breakContents:s(i.breakContents),flatContents:s(i.flatContents)});case Bt:{let{expandedStates:a,contents:o}=i;return a?(a=a.map(s),o=a[0]):o=s(o),t({...i,contents:o,expandedStates:a})}case Ot:case _t:case jt:case $t:case Qt:return t({...i,contents:s(i.contents)});case Dt:case Kt:case Wt:case Jt:case j:case Rt:return t(i);default:throw new Me(i)}}}function Ir(e,t=Rr){return tn(e,r=>typeof r=="string"?yt(t,r.split(`
`)):r)}var ze=()=>{},kt=ze,Ye=ze,qr=ze;function B(e){return kt(e),{type:_t,contents:e}}function en(e,t){return kt(t),{type:Ot,contents:t,n:e}}function R(e,t={}){return kt(e),Ye(t.expandedStates,!0),{type:Bt,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Xt(e){return en(-1,e)}function Ge(e){return qr(e),{type:It,parts:e}}function Ke(e,t="",r={}){return kt(e),t!==""&&kt(t),{type:bt,breakContents:e,flatContents:t,groupId:r.groupId}}var Vr={type:Rt};var rn={type:j,hard:!0},sn={type:j,hard:!0,literal:!0},L={type:j},H={type:j,soft:!0},tt=[rn,Vr],Rr=[sn,Vr];function yt(e,t){kt(e),Ye(t);let r=[];for(let s=0;s<t.length;s++)s!==0&&r.push(e),r.push(t[s]);return r}var me="'",Fr='"';function nn(e,t){let r=t===!0||t===me?me:Fr,s=r===me?Fr:me,n=0,i=0;for(let a of e)a===r?n++:a===s&&i++;return n>i?s:r}var de=nn;function We(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var z,je=class{constructor(t){Lt(this,z);Y(this,z,new Set(t))}getLeadingWhitespaceCount(t){let r=I(this,z),s=0;for(let n=0;n<t.length&&r.has(t.charAt(n));n++)s++;return s}getTrailingWhitespaceCount(t){let r=I(this,z),s=0;for(let n=t.length-1;n>=0&&r.has(t.charAt(n));n--)s++;return s}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 I(this,z).has(t.charAt(0))}hasTrailingWhitespace(t){return I(this,z).has(G(!1,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 s=`[${We([...I(this,z)].join(""))}]+`,n=new RegExp(r?`(${s})`:s,"u");return t.split(n)}hasWhitespaceCharacter(t){let r=I(this,z);return Array.prototype.some.call(t,s=>r.has(s))}hasNonWhitespaceCharacter(t){let r=I(this,z);return Array.prototype.some.call(t,s=>!r.has(s))}isWhitespaceOnly(t){let r=I(this,z);return Array.prototype.every.call(t,s=>r.has(s))}};z=new WeakMap;var Hr=je;var an=[" ",`
`,"\f","\r"," "],on=new Hr(an),K=on;function ln(e){return Array.isArray(e)&&e.length>0}var Zt=ln;var Qe=class extends Error{name="UnexpectedNodeError";constructor(t,r,s="type"){super(`Unexpected ${r} node ${s}: ${JSON.stringify(t[s])}.`),this.node=t}},Ur=Qe;function Mr(e,t,r){if(e.type==="TextNode"){let s=e.chars.trim();if(!s)return null;r.tag==="style"&&r.children.length===1&&r.children[0]===e?t.chars="":t.chars=K.split(s).join(" ")}e.type==="ElementNode"&&(delete t.startTag,delete t.openTag,delete t.parts,delete t.endTag,delete t.closeTag,delete t.nameNode,delete t.body,delete t.blockParamNodes,delete t.params,delete t.path),e.type==="Block"&&(delete t.blockParamNodes,delete t.params),e.type==="AttrNode"&&e.name.toLowerCase()==="class"&&delete t.value,e.type==="PathExpression"&&(t.head=e.head.original)}Mr.ignoredProperties=new Set(["loc","selfClosing"]);var zr=Mr;function cn(e){let{node:t}=e;if(t.type!=="TextNode")return;let{parent:r}=e;if(!(r.type==="ElementNode"&&r.tag==="style"&&r.children.length===1&&r.children[0]===t))return;let s=r.attributes.find(n=>n.type==="AttrNode"&&n.name==="lang");if(!(s&&!(s.value.type==="TextNode"&&(s.value.chars===""||s.value.chars==="css"))))return async n=>{let i=await n(t.chars,{parser:"css"});return i?[tt,i,Xt(H)]:[]}}var Yr=cn;var te=null;function ee(e){if(te!==null&&typeof te.property){let t=te;return te=ee.prototype=null,t}return te=ee.prototype=e??Object.create(null),new ee}var un=10;for(let e=0;e<=un;e++)ee();function Je(e){return ee(e)}function hn(e,t="type"){Je(e);function r(s){let n=s[t],i=e[n];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${n}'.`),{node:s});return i}return r}var Gr=hn;var Kr={Template:["body"],Block:["body"],MustacheStatement:["path","params","hash"],BlockStatement:["path","params","hash","program","inverse"],ElementModifierStatement:["path","params","hash"],CommentStatement:[],MustacheCommentStatement:[],ElementNode:["attributes","modifiers","children","comments"],AttrNode:["value"],TextNode:[],ConcatStatement:["parts"],SubExpression:["path","params","hash"],PathExpression:[],StringLiteral:[],BooleanLiteral:[],NumberLiteral:[],NullLiteral:[],UndefinedLiteral:[],Hash:["pairs"],HashPair:["value"]};var pn=Gr(Kr),Wr=pn;function St(e){return e.loc.start.offset}function re(e){return e.loc.end.offset}var jr=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Jr(e){return e.toUpperCase()===e}function fn(e){return e.type==="ElementNode"&&typeof e.tag=="string"&&!e.tag.startsWith(":")&&(Jr(e.tag[0])||e.tag.includes("."))}function mn(e){return jr.has(e.toLowerCase())&&!Jr(e[0])}function $e(e){return e.selfClosing===!0||mn(e.tag)||fn(e)&&e.children.every(t=>ge(t))}function ge(e){return e.type==="TextNode"&&!/\S/u.test(e.chars)}function Qr(e){return(e==null?void 0:e.type)==="MustacheCommentStatement"&&typeof e.value=="string"&&e.value.trim()==="prettier-ignore"}function $r(e){return Qr(e.node)||e.isInArray&&(e.key==="children"||e.key==="body"||e.key==="parts")&&Qr(e.siblings[e.index-2])}var is=2;function dn(e,t,r){var n,i,a,o,c,h,p,m,S;let{node:s}=e;switch(s.type){case"Block":case"Program":case"Template":return R(e.map(r,"body"));case"ElementNode":{let y=R(bn(e,r)),E=t.htmlWhitespaceSensitivity==="ignore"&&((n=e.next)==null?void 0:n.type)==="ElementNode"?H:"";if($e(s))return[y,E];let C=["</",s.tag,">"];return s.children.length===0?[y,B(C),E]:t.htmlWhitespaceSensitivity==="ignore"?[y,B(Xr(e,t,r)),tt,B(C),E]:[y,B(R(Xr(e,t,r))),B(C),E]}case"BlockStatement":return wn(e)?[Tn(e,r),es(e,r,t),rs(e,r,t)]:[vn(e,r),R([es(e,r,t),rs(e,r,t),Nn(e,r,t)])];case"ElementModifierStatement":return R(["{{",ns(e,r),"}}"]);case"MustacheStatement":return R([be(s),ns(e,r),ye(s)]);case"SubExpression":return R(["(",_n(e,r),H,")"]);case"AttrNode":{let{name:y,value:E}=s,C=E.type==="TextNode";if(C&&E.chars===""&&St(E)===re(E))return y;let w=C?de(E.chars,t.singleQuote):E.type==="ConcatStatement"?de(E.parts.map(q=>q.type==="TextNode"?q.chars:"").join(""),t.singleQuote):"",U=r("value");r
`).length-1}function Pn(e){e=typeof e=="string"?e:"";let t=(e.match(/^([^\S\n\r]*[\n\r])+/gu)||[])[0]||"";return Vt(t)}function An(e){e=typeof e=="string"?e:"";let t=(e.match(/([\n\r][^\S\n\r]*)+$/gu)||[])[0]||"";return Vt(t)}function se(e=0){return Array.from({length:Math.min(e,is)}).fill(tt)}function Ln(e,t){let{node:{value:r}}=e,s=de(r,Dn(e)?!t.singleQuote:t.singleQuote);return[s,He(!1,r,s,`\\${s}`),s]}function Dn(e){let{ancestors:t}=e,r=t.findIndex(s=>s.type!=="SubExpression");return r!==-1&&t[r+1].type==="ConcatStatement"&&t[r+2].type==="AttrNode"}function _n(e,t){let r=Xe(e,t),s=ke(e,t);return s?B([r,L,R(s)]):r}function ns(e,t){let r=Xe(e,t),s=ke(e,t);return s?[B([r,L,s]),H]:r}function Xe(e,t){return t("path")}function ke(e,t){var n;let{node:r}=e,s=[];return r.params.length>0&&s.push(...e.map(t,"params")),((n=r.hash)==null?void 0:n.pairs.length)>0&&s.push(t("hash")),s.length===0?"":yt(L,s)}function Ze(e){return["as |",e.blockParams.join(" "),"|"]}var On=new Set("!\"#%&'()*+,./;<=>@[\\]^`{|}~"),Bn=new Set(["true","false","null","undefined"]),In=(e,t)=>t===0&&e.startsWith("@")?!1:t!==0&&Bn.has(e)||/\s/u.test(e)||/^\d/u.test(e)||Array.prototype.some.call(e,r=>On.has(r));function Rn(e){return e.tail.length===0&&e.original.includes("/")?e.original:[e.head.original,...e.tail].map((r,s)=>In(r,s)?`[${r}]`:r).join(".")}var qn={print:dn,massageAstNode:zr,hasPrettierIgnore:$r,getVisitorKeys:Wr,embed:Yr},hs=qn;var ps=[{linguistLanguageId:155,name:"Handlebars",type:"markup",color:"#f7931e",aliases:["hbs","htmlbars"],extensions:[".handlebars",".hbs"],tmScope:"text.html.handlebars",aceMode:"handlebars",parsers:["glimmer"],vscodeLanguageIds:["handlebars"]}];var xr={};Fe(xr,{glimmer:()=>Ei});var Vn=Object.freeze([]);function ms(){return Vn}var Ma=ms(),za=ms();var tr=Object.assign;var fs=console;function ds(e,t="unexpected unreachable branch"){throw fs.log("unreachable",e),fs.log(`${t} :: ${JSON.stringify(e)} (${e})`),new Error("code reached unreachable")}var Fn=function(){var e=function(it,d,k,g){for(k=k||{},g=it.length;g--;k[it[g]]=d);return k},t=[2,44],r=[1,20],s=[5,14,15,19,29,34,39,44,47,48,52,56,60],n=[1,35],i=[1,38],a=[1,30],o=[1,31],c=[1,32],h=[1,33],p=[1,34],m=[1,37],S=[14,15,19,29,34,39,44,47,48,52,56,60],y=[14,15,19,29,34,44,47,48,52,56,60],E=[15,18],C=[14,15,19,29,34,47,48,52,56,60],x=[33,64,71,79,80,81,82,83,84],w=[23,33,55,64,67,71,74,79,80,81,82,83,84],U=[1,51],q=[23,33,55,64,67,71,74,79,80,81,82,83,84,86],$=[2,43],Nt=[55,64,71,79,80,81,82,83,84],Ct=[1,58],X=[1,59],rt=[1,66],V=[33,64,71,74,79,80,81,82,83,84],xt=[23,64,71,79,80,81,82,83,84],F=[1,76],st=[64,67,71,79,80,81,82,83,84],A=[33,74],nt=[23,33,55,67,71,74],ue=[1,106],De=[1,118],Ar=[71,76],_e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,expr:49,mustache_repetition0:50,mustache_option0:51,OPEN_UNESCAPED:52,mustache_repetition1:53,mustache_option1:54,CLOSE_UNESCAPED:55,OPEN_PARTIAL:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,sexpr:63,OPEN_SEXPR:64,sexpr_repetition0:65,sexpr_option0:66,CLOSE_SEXPR:67,hash:68,hash_repetition_plus0:69,hashSegment:70,ID:71,EQUALS:72,blockParams:73,OPEN_BLOCK_PARAMS:74,blockParams_repetition_plus0:75,CLOSE_BLOCK_PARAMS:76,path:77,dataName:78,STRING:79,NUMBER:80
`+P.showPosition()+`
Expecting `+pe.join(", ")+", got '"+(this.terminals_[O]||O)+"'":Ve="Parse error on line "+(at+1)+": Unexpected "+(O==Dr?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(Ve,{text:P.match,token:this.terminals_[O]||O,line:P.yylineno,loc:Ie,expected:pe})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+gt+", token: "+O);switch(M[0]){case 1:g.push(O),N.push(P.yytext),l.push(P.yylloc),g.push(M[1]),O=null,Re?(O=Re,Re=null):(Yt=P.yyleng,u=P.yytext,at=P.yylineno,Ie=P.yylloc,Lr>0&&Lr--);break;case 2:if(Z=this.productions_[M[1]][1],At.$=N[N.length-Z],At._$={first_line:l[l.length-(Z||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(Z||1)].first_column,last_column:l[l.length-1].last_column},Gs&&(At._$.range=[l[l.length-(Z||1)].range[0],l[l.length-1].range[1]]),qe=this.performAction.apply(At,[u,Yt,at,dt.yy,M[1],N,l].concat(Ys)),typeof qe<"u")return qe;Z&&(g=g.slice(0,-1*Z*2),N=N.slice(0,-1*Z),l=l.slice(0,-1*Z)),g.push(this.productions_[M[1]][0]),N.push(At.$),l.push(At._$),_r=Pt[g[g.length-2]][g[g.length-1]],g.push(_r);break;case 3:return!0}}return!0}},Ms=function(){var it={EOF:1,parseError:function(k,g){if(this.yy.parser)this.yy.parser.parseError(k,g);else throw new Error(k)},setInput:function(d,k){return this.yy=k||this.yy||{},this._input=d,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var k=d.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},unput:function(d){var k=d.length,g=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var N=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===b.length?this.yylloc.first_column:0)+b[b.length-g.length].length-g[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[N[0],N[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(d){this.unput(this.match.slice(d))},pastInput:function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var d=this.pastInput(),k=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
`+k+"^"},test_match:function(d,k){var g,b,N;if(this.options.backtrack_lexer&&(N={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(N.yylloc.range=this.yylloc.range.slice(0))),b=d[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],g=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var l in N)this[l]=N[l];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,k,g,b;this._more||(this.yytext="",this.match="");for(var N=this._currentRules(),l=0;l<N.length;l++)if(g=this._input.match(this.rules[N[l]]),g&&(!k||g[0].length>k[0].length)){if(k=g,b=l,this.options.backtrack_lexer){if(d=this.test_match(g,N[l]),d!==!1)return d;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(d=this.test_match(k,N[b]),d!==!1?d:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var k=this.next();return k||this.lex()},begin:function(k){this.conditionStack.push(k)},popState:function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},pushState:function(k){this.begin(k)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(k,g,b,N){function l(u,at){return g.yytext=g.yytext.substring(u,g.yyleng-at+u)}var Pt=N;switch(b){case 0:if(g.yytext.slice(-2)==="\\\\"?(l(0,1),this.begin("mu")):g.yytext.slice(-1)==="\\"?(l(0,1),this.begin("emu")):this.begin("mu"),g.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(l(5,9),18);case 5:return 15;case 6:return this.popState(),14;break;case 7:return 64;case 8:return 67;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 56;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 52;case 20:return 48;case 21:this.unput(g.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 72;case 25:return 71;case 26:return 71;case 27:return 86;case 28:break;case 29:return this.popState(),55;break;case 30:return this.popState(),33;break;case 31:return g.yytext=l(1,2).replace(/\\"/g,'"'),79;break;case 32:return g.yytext=l(1,2).replace(/\\'/g,"'"),79;break;case 33:return 84;case 34:return 81;case 35:return 81;case 36:return 82;case 37:return 83;case 38:return 80;case 39:return 74;case 40:return 76;case 41:return 71;case 42:return g.yytext=g.yytext.replace(/\\([\\\]])/g,"$1"),71;break;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return it}();_e.lexer=Ms;function Oe(){this.yy={}}return Oe.prototype=_e,_e.Parser=Oe,new Oe}(),Se=Fn;var er=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function rr(e,t){var r=t&&t.loc,s,n,i,a;r&&(s=r.start.line,n=r.end.line,i=r.start.column,a=r.end.column,e+=" - "+s+":"+i);for(var o=Error.prototype.constructor.call(this,e),c=0;c<er.length;c++)this[er[c]]=o[er[c]];Error.captureStackTrace&&Error.captureStackTrace(this,rr);try{r&&(this.lineNumber=s,this.endLineNumber=n,Objec
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangle:"\u22EB",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",nprec:"\u2280",npreceq:"\u2AAF\u0338",npre:"\u2AAF\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",Ocirc:"\xD4",ocirc:"\xF4",ocir:"\u229A",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u01
`)}var cr=function(){function e(t,r,s){s===void 0&&(s="precompile"),this.delegate=t,this.entityParser=r,this.mode=s,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var n=this.peek();if(n==="<"&&!this.isIgnoredEndTag())this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(this.mode==="precompile"&&n===`
`){var i=this.tagNameBuffer.toLowerCase();(i==="pre"||i==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data:function(){var n=this.peek(),i=this.tagNameBuffer;n==="<"&&!this.isIgnoredEndTag()?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):n==="&"&&i!=="script"&&i!=="style"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(n))},tagOpen:function(){var n=this.consume();n==="!"?this.transitionTo("markupDeclarationOpen"):n==="/"?this.transitionTo("endTagOpen"):(n==="@"||n===":"||vs(n))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(n))},markupDeclarationOpen:function(){var n=this.consume();if(n==="-"&&this.peek()==="-")this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment();else{var i=n.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase();i==="DOCTYPE"&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())}},doctype:function(){var n=this.consume();_(n)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var n=this.consume();_(n)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase()))},doctypeName:function(){var n=this.consume();_(n)?this.transitionTo("afterDoctypeName"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase())},afterDoctypeName:function(){var n=this.consume();if(!_(n))if(n===">")this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var i=n.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),a=i.toUpperCase()==="PUBLIC",o=i.toUpperCase()==="SYSTEM";(a||o)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),a?this.transitionTo("afterDoctypePublicKeyword"):o&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var n=this.peek();_(n)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):n==='"'?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):n==="'"?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):n===">"&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var n=this.consume();n==='"'?this.transitionTo("afterDoctypePublicIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(n)},doctypePublicIdentifierSingleQuoted:function(){var n=this.consume();n==="'"?this.transitionTo("afterDoctypePublicIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(n)},afterDoctypePublicIdentifier:function(){var n=this.consume();_(n)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):n==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):n==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var n=this.consume();_(n)||(n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):n==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):n==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var n=this.consume();n==='"'?this.transitionTo("afterDoctypeSystemIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegat
`?(this.line++,this.column=0):this.column++,t},e.prototype.consumeCharRef=function(){var t=this.input.indexOf(";",this.index);if(t!==-1){var r=this.input.slice(this.index,t),s=this.entityParser.parse(r);if(s){for(var n=r.length;n;)this.consume(),n--;return this.consume(),s}}},e.prototype.markTagStart=function(){this.delegate.tagOpen()},e.prototype.appendToTagName=function(t){this.tagNameBuffer+=t,this.delegate.appendToTagName(t)},e.prototype.isIgnoredEndTag=function(){var t=this.tagNameBuffer;return t==="title"&&this.input.substring(this.index,this.index+8)!=="</title>"||t==="style"&&this.input.substring(this.index,this.index+8)!=="</style>"||t==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},e}(),eo=function(){function e(t,r){r===void 0&&(r={}),this.options=r,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new cr(this,t,r.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(t){return this.tokens=[],this.tokenizer.tokenize(t),this.tokens},e.prototype.tokenizePart=function(t){return this.tokens=[],this.tokenizer.tokenizePart(t),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var t=this.token;if(t===null)throw new Error("token was unexpectedly null");if(arguments.length===0)return t;for(var r=0;r<arguments.length;r++)if(t.type===arguments[r])return t;throw new Error("token type was unexpectedly "+t.type)},e.prototype.push=function(t){this.token=t,this.tokens.push(t)},e.prototype.currentAttribute=function(){return this._currentAttribute},e.prototype.addLocInfo=function(){this.options.loc&&(this.current().loc={start:{line:this.startLine,column:this.startColumn},end:{line:this.tokenizer.line,column:this.tokenizer.column}}),this.startLine=this.tokenizer.line,this.startColumn=this.tokenizer.column},e.prototype.beginDoctype=function(){this.push({type:"Doctype",name:""})},e.prototype.appendToDoctypeName=function(t){this.current("Doctype").name+=t},e.prototype.appendToDoctypePublicIdentifier=function(t){var r=this.current("Doctype");r.publicIdentifier===void 0?r.publicIdentifier=t:r.publicIdentifier+=t},e.prototype.appendToDoctypeSystemIdentifier=function(t){var r=this.current("Doctype");r.systemIdentifier===void 0?r.systemIdentifier=t:r.systemIdentifier+=t},e.prototype.endDoctype=function(){this.addLocInfo()},e.prototype.beginData=function(){this.push({type:"Chars",chars:""})},e.prototype.appendToData=function(t){this.current("Chars").chars+=t},e.prototype.finishData=function(){this.addLocInfo()},e.prototype.beginComment=function(){this.push({type:"Comment",chars:""})},e.prototype.appendToCommentData=function(t){this.current("Comment").chars+=t},e.prototype.finishComment=function(){this.addLocInfo()},e.prototype.tagOpen=function(){},e.prototype.beginStartTag=function(){this.push({type:"StartTag",tagName:"",attributes:[],selfClosing:!1})},e.prototype.beginEndTag=function(){this.push({type:"EndTag",tagName:""})},e.prototype.finishTag=function(){this.addLocInfo()},e.prototype.markTagAsSelfClosing=function(){this.current("StartTag").selfClosing=!0},e.prototype.appendToTagName=function(t){this.current("StartTag","EndTag").tagName+=t},e.prototype.beginAttribute=function(){this._currentAttribute=["","",!1]},e.prototype.appendToAttributeName=function(t){this.currentAttribute()[0]+=t},e.prototype.beginAttributeValue=function(t){this.currentAttribute()[2]=t},e.prototype.appendToAttributeValue=function(t){this.currentAttribute()[1]+=t},e.prototype.finishAttributeValue=function(){this.current("StartTag").attributes.push(this._currentAttribute)},e.prototype.reportSyntaxError=function(t){this.current().syntaxError=t},e}();var Ne={Append:1,TrustingAppend:2,Comment:3,Modifier:4,StrictModifier:5,Block:6,StrictBlock:7,Component:8,OpenElement:10,OpenElementWithSplat:11,FlushElement:12,CloseElement:13,StaticAttr:14,DynamicAttr:15,ComponentAttr:16,AttrSplat:17,Yield:18,DynamicArg:20,StaticArg:21
`,s);if(t<=n||n===-1)return{line:r+1,column:t-s};r+=1,s=n+1}}charPosFor(t){let{line:r,column:s}=t,n=this.source.length,i=0,a=0;for(;a<n;){let o=this.source.indexOf(`
`,a);if(o===-1&&(o=this.source.length),i===r-1){if(a+s>o)return o;if(Ds){let c=this.hbsPosFor(a+s);c.line,c.column}return a+s}if(o===-1)return 0;i+=1,a=o+1}return n}};function v(e,t){let{module:r,loc:s}=t,{line:n,column:i}=s.start,a=t.asString(),o=a?`
|
| ${a.split(`
`).join(`
| `)}
|
`:"",c=new Error(`${e}: ${o}(error occurred in '${r}' @ line ${n} : column ${i})`);return c.name="SyntaxError",c.location=t,c.code=a,c}var li={Template:["body"],Block:["body"],MustacheStatement:["path","params","hash"],BlockStatement:["path","params","hash","program","inverse"],ElementModifierStatement:["path","params","hash"],CommentStatement:[],MustacheCommentStatement:[],ElementNode:["attributes","modifiers","children","comments"],AttrNode:["value"],TextNode:[],ConcatStatement:["parts"],SubExpression:["path","params","hash"],PathExpression:[],StringLiteral:[],BooleanLiteral:[],NumberLiteral:[],NullLiteral:[],UndefinedLiteral:[],Hash:["pairs"],HashPair:["value"]},Cr=function(){function e(t,r,s,n){let i=Error.call(this,t);this.key=n,this.message=t,this.node=r,this.parent=s,i.stack&&(this.stack=i.stack)}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}();function Ts(e,t,r){return new Cr("Cannot remove a node unless it is part of an array",e,t,r)}function ci(e,t,r){return new Cr("Cannot replace a node with multiple nodes unless it is part of an array",e,t,r)}function Ns(e,t){return new Cr("Replacing and removing in key handlers is not yet supported.",e,null,t)}var zt=class{constructor(t,r=null,s=null){this.node=t,this.parent=r,this.parentKey=s}get parentNode(){return this.parent?this.parent.node:null}parents(){return{[Symbol.iterator]:()=>new Sr(this)}}},Sr=class{constructor(t){this.path=t}next(){return this.path.parent?(this.path=this.path.parent,{done:!1,value:this.path}):{done:!0,value:null}}};function Os(e){return typeof e=="function"?e:e.enter}function Bs(e){return typeof e=="function"?void 0:e.exit}function Ae(e,t){let r,s,n,{node:i,parent:a,parentKey:o}=t,c=function(h,p){if(h.Program&&(p==="Template"&&!h.Template||p==="Block"&&!h.Block))return h.Program;let m=h[p];return m!==void 0?m:h.All}(e,i.type);if(c!==void 0&&(r=Os(c),s=Bs(c)),r!==void 0&&(n=r(i,t)),n!=null){if(JSON.stringify(i)!==JSON.stringify(n))return Array.isArray(n)?(Is(e,n,a,o),n):Ae(e,new zt(n,a,o))||n;n=void 0}if(n===void 0){let h=li[i.type];for(let p=0;p<h.length;p++)ui(e,c,t,h[p]);s!==void 0&&(n=s(i,t))}return n}function Cs(e,t,r){e[t]=r}function ui(e,t,r,s){let n,i,{node:a}=r,o=function(c,h){return c[h]}(a,s);if(o){if(t!==void 0){let c=function(h,p){let m=typeof h!="function"?h.keys:void 0;if(m===void 0)return;let S=m[p];return S!==void 0?S:m.All}(t,s);c!==void 0&&(n=Os(c),i=Bs(c))}if(n!==void 0&&n(a,s)!==void 0)throw Ns(a,s);if(Array.isArray(o))Is(e,o,r,s);else{let c=Ae(e,new zt(o,r,s));c!==void 0&&function(h,p,m,S){if(S===null)throw Ts(m,h,p);if(Array.isArray(S)){if(S.length!==1)throw S.length===0?Ts(m,h,p):ci(m,h,p);Cs(h,p,S[0])}else Cs(h,p,S)}(a,s,o,c)}if(i!==void 0&&i(a,s)!==void 0)throw Ns(a,s)}}function Is(e,t,r,s){for(let n=0;n<t.length;n++){let i=t[n],a=Ae(e,new zt(i,r,s));a!==void 0&&(n+=hi(t,n,a)-1)}}function hi(e,t,r){return r===null?(e.splice(t,1),0):Array.isArray(r)?(e.splice(t,1,...r),r.length):(e.splice(t,1,r),1)}function pi(e,t){Ae(t,new zt(e))}function Ht(e,t){(function(r){switch(r.type){case"Block":case"Template":return r.body;case"ElementNode":return r.children}})(e).push(t)}function Rs(e){return e.type==="StringLiteral"||e.type==="BooleanLiteral"||e.type==="NumberLiteral"||e.type==="NullLiteral"||e.type==="UndefinedLiteral"}var ur;function hr(){return ur||(ur=new wt("","(synthetic)")),ur}function xs(e,t){return f.var({name:e,loc:T(t||null)})}function ct(e,t){let r=T(t||null);if(typeof e!="string"){if("type"in e)return e;{e.head.indexOf(".");let{head:i,tail:a}=e;return f.path({head:f.head({original:i,loc:r.sliceStartChars({chars:i.length})}),tail:a,loc:T(t||null)})}}let{head:s,tail:n}=function(i,a){let[o,...c]=i.split("."),h=f.head({original:o,loc:T(a||null)});return f.path({head:h,tail:c,loc:T(a||null)})}(e,r);return f.path({head:s,tail:n,loc:r})}function xe(e,t,r){return f.literal({type:e,value:t,loc:T(r||null)})}function ie(e=[],t){return f.hash({pairs:e,loc:T(t||null)})}function qs(e){return e.map(t=>typeof t=="string"?f.var({name:t,loc:D.synthetic(t)}):t)}function Ps(e=[],t=[],r=!1,s){return f
`)}},Er=class extends vr{parse(t,r){var i;t.loc;let s=f.template({body:[],blockParams:r,loc:this.source.spanFor(t.loc)}),n=this.parseProgram(s,t);return(i=this.pendingError)==null||i.eof(n.loc.getEnd()),n}Program(t,r){t.loc;let s=f.blockItself({body:[],params:r,chained:t.chained,loc:this.source.spanFor(t.loc)});return this.parseProgram(s,t)}parseProgram(t,r){if(r.body.length===0)return t;let s;try{this.elementStack.push(t);for(let n of r.body)this.acceptNode(n)}finally{s=this.elementStack.pop()}if(t!==s){if((s==null?void 0:s.type)==="ElementNode")throw v(`Unclosed element \`${s.tag}\``,s.loc);t.type}return t}BlockStatement(t){var m;if(this.tokenizer.state==="comment")return t.loc,void this.appendToCommentData(this.sourceForNode(t));if(this.tokenizer.state!=="data"&&this.tokenizer.state!=="beforeData")throw v("A block may only be used inside an HTML element or another block.",this.source.spanFor(t.loc));let{path:r,params:s,hash:n}=fr(this,t),i=this.source.spanFor(t.loc),a,o=[];if((m=t.program.blockParams)!=null&&m.length){let S=n.loc.collapse("end");S=t.program.loc?S.withEnd(this.source.spanFor(t.program.loc).getStart()):t.program.body[0]?S.withEnd(this.source.spanFor(t.program.body[0].loc).getStart()):S.withEnd(i.getEnd()),a=Ls(this.source,t,S);let y=S.asString(),E=y.indexOf("|")+1,C=y.indexOf("|",E);for(let x of t.program.blockParams){let w,U;w=E>=C?-1:y.indexOf(x,E),w===-1||w+x.length>C?(E=C,U=this.source.spanFor(gr)):(E=w,U=S.sliceStartChars({skipStart:E,chars:x.length}),E+=x.length),o.push(f.var({name:x,loc:U}))}}else a=Ls(this.source,t,i);let c=this.Program(a.program,o),h=a.inverse?this.Program(a.inverse,[]):null,p=f.block({path:r,params:s,hash:n,defaultBlock:c,elseBlock:h,loc:this.source.spanFor(t.loc),openStrip:t.openStrip,inverseStrip:t.inverseStrip,closeStrip:t.closeStrip});Ht(this.currentElement(),p)}MustacheStatement(t){var o;(o=this.pendingError)==null||o.mustache(this.source.spanFor(t.loc));let{tokenizer:r}=this;if(r.state==="comment")return void this.appendToCommentData(this.sourceForNode(t));let s,{escaped:n,loc:i,strip:a}=t;if("original"in t.path&&t.path.original==="...attributes")throw v("Illegal use of ...attributes",this.source.spanFor(t.loc));if(Rs(t.path))s=f.mustache({path:this.acceptNode(t.path),params:[],hash:f.hash({pairs:[],loc:this.source.spanFor(t.path.loc).collapse("end")}),trusting:!n,loc:this.source.spanFor(i),strip:a});else{let{path:c,params:h,hash:p}=fr(this,t);s=f.mustache({path:c,params:h,hash:p,trusting:!n,loc:this.source.spanFor(i),strip:a})}switch(r.state){case"tagOpen":case"tagName":throw v("Cannot use mustaches in an elements tagname",s.loc);case"beforeAttributeName":mr(this.currentStartTag,s);break;case"attributeName":case"afterAttributeName":this.beginAttributeValue(!1),this.finishAttributeValue(),mr(this.currentStartTag,s),r.transitionTo("beforeAttributeName");break;case"afterAttributeValueQuoted":mr(this.currentStartTag,s),r.transitionTo("beforeAttributeName");break;case"beforeAttributeValue":this.beginAttributeValue(!1),this.appendDynamicAttributeValuePart(s),r.transitionTo("attributeValueUnquoted");break;case"attributeValueDoubleQuoted":case"attributeValueSingleQuoted":case"attributeValueUnquoted":this.appendDynamicAttributeValuePart(s);break;default:Ht(this.currentElement(),s)}return s}appendDynamicAttributeValuePart(t){this.finalizeTextPart();let r=this.currentAttr;r.isDynamic=!0,r.parts.push(t)}finalizeTextPart(){let t=this.currentAttr.currentPart;t!==null&&(this.currentAttr.parts.push(t),this.startTextPart())}startTextPart(){this.currentAttr.currentPart=null}ContentStatement(t){(function(r,s){let n=s.loc.start.line,i=s.loc.start.column,a=function(o,c){if(c==="")return{lines:o.split(`
`).length-1,columns:0};let[h]=o.split(c),p=h.split(/\n/u),m=p.length-1;return{lines:m,columns:p[m].length}}(s.original,s.value);n+=a.lines,a.lines?i=a.columns:i+=a.columns,r.line=n,r.column=i})(this.tokenizer,t),this.tokenizer.tokenizePart(t.value),this.tokenizer.flushData()}CommentStatement(t){let{tokenizer:r}=this;if(r.state==="comment")return this.appendToCommentData(this.sourceForNode(t)),null;let{value:s,loc:n}=t,i=f.mustacheComment({value:s,loc:this.source.spanFor(n)});switch(r.state){case"beforeAttributeName":case"afterAttributeName":this.currentStartTag.comments.push(i);break;case"beforeData":case"data":Ht(this.currentElement(),i);break;default:throw v(`Using a Handlebars comment when in the \`${r.state}\` state is not supported`,this.source.spanFor(t.loc))}return i}PartialStatement(t){throw v("Handlebars partials are not supported",this.source.spanFor(t.loc))}PartialBlockStatement(t){throw v("Handlebars partial blocks are not supported",this.source.spanFor(t.loc))}Decorator(t){throw v("Handlebars decorators are not supported",this.source.spanFor(t.loc))}DecoratorBlock(t){throw v("Handlebars decorator blocks are not supported",this.source.spanFor(t.loc))}SubExpression(t){let{path:r,params:s,hash:n}=fr(this,t);return f.sexpr({path:r,params:s,hash:n,loc:this.source.spanFor(t.loc)})}PathExpression(t){let{original:r}=t,s;if(r.indexOf("/")!==-1){if(r.slice(0,2)==="./")throw v('Using "./" is not supported in Glimmer and unnecessary',this.source.spanFor(t.loc));if(r.slice(0,3)==="../")throw v('Changing context using "../" is not supported in Glimmer',this.source.spanFor(t.loc));if(r.indexOf(".")!==-1)throw v("Mixing '.' and '/' in paths is not supported in Glimmer; use only '.' to separate property paths",this.source.spanFor(t.loc));s=[t.parts.join("/")]}else{if(r===".")throw v("'.' is not a supported path in Glimmer; check for a path with a trailing '.'",this.source.spanFor(t.loc));s=t.parts}let n,i=!1;if(/^this(?:\..+)?$/u.test(r)&&(i=!0),i)n=f.this({loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+4}})});else if(t.data){let a=s.shift();if(a===void 0)throw v("Attempted to parse a path expression, but it was not valid. Paths beginning with @ must start with a-z.",this.source.spanFor(t.loc));n=f.atName({name:`@${a}`,loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+a.length+1}})})}else{let a=s.shift();if(a===void 0)throw v("Attempted to parse a path expression, but it was not valid. Paths must start with a-z or A-Z.",this.source.spanFor(t.loc));n=f.var({name:a,loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+a.length}})})}return f.path({head:n,tail:s,loc:this.source.spanFor(t.loc)})}Hash(t){let r=t.pairs.map(s=>f.pair({key:s.key,value:this.acceptNode(s.value),loc:this.source.spanFor(s.loc)}));return f.hash({pairs:r,loc:this.source.spanFor(t.loc)})}StringLiteral(t){return f.literal({type:"StringLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}BooleanLiteral(t){return f.literal({type:"BooleanLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}NumberLiteral(t){return f.literal({type:"NumberLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}UndefinedLiteral(t){return f.literal({type:"UndefinedLiteral",value:void 0,loc:this.source.spanFor(t.loc)})}NullLiteral(t){return f.literal({type:"NullLiteral",value:null,loc:this.source.spanFor(t.loc)})}constructor(...t){super(...t),this.pendingError=null}};function fr(e,t){let r;switch(t.path.type){case"PathExpression":r=e.PathExpression(t.path);break;case"SubExpression":r=e.SubExpression(t.path);break;case"StringLiteral":case"UndefinedLiteral":case"NullLiteral":case"NumberLiteral":case"BooleanLiteral":{let i;throw i=t.path.type==="BooleanLiteral"?t.path.original.toString():t.path.type==="StringLiteral"?`"${t.path.original}"`:t.path.type==="NullLiteral"?"null":t.path.type==="NumberLiteral"?t.path.value.toString():"undefined",v(`${t.path.type} "${t.path.type==="StringLiteral"?t.path.original:i}" cannot be called as a sub-expression,
`?s?s.loc.getEnd():this.currentAttr.valueSpan.getStart():i.move(-1),this.currentAttr.currentPart=f.text({chars:t,loc:i.collapsed()})}}finishAttributeValue(){this.finalizeTextPart();let t=this.currentTag,r=this.offset();if(t.type==="EndTag")throw v("Invalid end tag: closing tag must not have attributes",this.source.spanFor({start:t.start.toJSON(),end:r.toJSON()}));let{name:s,parts:n,start:i,isQuoted:a,isDynamic:o,valueSpan:c}=this.currentAttr;if(s.startsWith("|")&&n.length===0&&!a&&!o)throw v("Invalid block parameters syntax: block parameters must be preceded by the `as` keyword",i.until(i.move(s.length)));let h=this.assembleAttributeValue(n,a,o,i.until(r));h.loc=c.withEnd(r);let p=f.attr({name:s,value:h,loc:i.until(r)});this.currentStartTag.attributes.push(p)}parsePossibleBlockParams(){let t=/[!"#%&'()*+./;<=>@[\\\]^`{|}~]/u;this.tokenizer.state;let r=this.currentStartTag,s=this.currentAttr,n={state:"PossibleAs"},i={PossibleAs:o=>{if(n.state,Ft(o))n={state:"BeforeStartPipe"},this.tokenizer.transitionTo("afterAttributeName"),this.tokenizer.consume();else{if(o==="|")throw v('Invalid block parameters syntax: expecting at least one space character between "as" and "|"',s.start.until(this.offset().move(1)));n={state:"Done"}}},BeforeStartPipe:o=>{n.state,Ft(o)?this.tokenizer.consume():o==="|"?(n={state:"BeforeBlockParamName"},this.tokenizer.transitionTo("beforeAttributeName"),this.tokenizer.consume()):n={state:"Done"}},BeforeBlockParamName:o=>{if(n.state,Ft(o))this.tokenizer.consume();else if(o==="")n={state:"Done"},this.pendingError={mustache(c){throw v("Invalid block parameters syntax: mustaches cannot be used inside parameters list",c)},eof(c){throw v('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(c))}};else if(o==="|"){if(r.params.length===0)throw v("Invalid block parameters syntax: empty parameters list, expecting at least one identifier",s.start.until(this.offset().move(1)));n={state:"AfterEndPipe"},this.tokenizer.consume()}else{if(o===">"||o==="/")throw v('Invalid block parameters syntax: incomplete parameters list, expecting "|" but the tag was closed prematurely',s.start.until(this.offset().move(1)));n={state:"BlockParamName",name:o,start:this.offset()},this.tokenizer.consume()}},BlockParamName:o=>{if(n.state,o==="")n={state:"Done"},this.pendingError={mustache(c){throw v("Invalid block parameters syntax: mustaches cannot be used inside parameters list",c)},eof(c){throw v('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(c))}};else if(o==="|"||Ft(o)){let c=n.start.until(this.offset());if(n.name==="this"||t.test(n.name))throw v(`Invalid block parameters syntax: invalid identifier name \`${n.name}\``,c);r.params.push(f.var({name:n.name,loc:c})),n=o==="|"?{state:"AfterEndPipe"}:{state:"BeforeBlockParamName"},this.tokenizer.consume()}else{if(o===">"||o==="/")throw v('Invalid block parameters syntax: expecting "|" but the tag was closed prematurely',s.start.until(this.offset().move(1)));n.name+=o,this.tokenizer.consume()}},AfterEndPipe:o=>{n.state,Ft(o)?this.tokenizer.consume():o===""?(n={state:"Done"},this.pendingError={mustache(c){throw v("Invalid block parameters syntax: modifiers cannot follow parameters list",c)},eof(c){throw v('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(c))}}):o===">"||o==="/"?n={state:"Done"}:(n={state:"Error",message:'Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',start:this.offset()},this.tokenizer.consume())},Error:o=>{if(n.state,o===""||o==="/"||o===">"||Ft(o))throw v(n.message,n.start.until(this.offset()));this.tokenizer.consume()},Done:()=>{}},a;do a=this.tokenizer.peek(),i[n.state](a);while(n.state!=="Done"&&a!=="");n.state}reportSyntaxError(t){throw v(t,this.offset().collapsed())}assembleConcatenatedValue(t){let r=ii(t),s=Nr(t);return f.concat({parts:t,loc:this.source.spanFor(r.loc).extend(this.source.spanFor(s.loc))})}vali
`,Fs="\r",Hs=function(){function e(t){this.length=t.length;for(var r=[0],s=0;s<t.length;)switch(t[s]){case Le:s+=Le.length,r.push(s);break;case Fs:s+=Fs.length,t[s]===Le&&(s+=Le.length),r.push(s);break;default:s++;break}this.offsets=r}return e.prototype.locationForIndex=function(t){if(t<0||t>this.length)return null;for(var r=0,s=this.offsets;s[r+1]<=t;)r++;var n=t-s[r];return{line:r,column:n}},e.prototype.indexForLocation=function(t){var r=t.line,s=t.column;return r<0||r>=this.offsets.length||s<0||s>this.lengthOfLine(r)?null:this.offsets[r]+s},e.prototype.lengthOfLine=function(t){var r=this.offsets[t],s=t===this.offsets.length-1?this.length:this.offsets[t+1];return s-r},e}();function gi(e,t){let r=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(r,t)}var Us=gi;function bi(e){let t=e.children??e.body;if(t)for(let r=0;r<t.length-1;r++)t[r].type==="TextNode"&&t[r+1].type==="MustacheStatement"&&(t[r].chars=t[r].chars.replace(/\\$/u,"\\\\"))}function yi(e){let t=new Hs(e),r=({line:n,column:i})=>t.indexForLocation({line:n-1,column:i}),s=n=>{let{start:i,end:a}=n.loc;i.offset=r(i),a.offset=r(a)};return()=>({name:"prettierParsePlugin",visitor:{All(n){s(n),bi(n)}}})}function ki(e){let t;try{t=Vs(e,{mode:"codemod",plugins:{ast:[yi(e)]}})}catch(r){let s=vi(r);if(s){let n=Si(r);throw Us(n,{loc:s,cause:r})}throw r}return t}function Si(e){let{message:t}=e,r=t.split(`
`);return r.length>=4&&/^Parse error on line \d+:$/u.test(r[0])&&/^-*\^$/u.test(G(!1,r,-2))?G(!1,r,-1):r.length>=4&&/:\s?$/u.test(r[0])&&/^\(error occurred in '.*?' @ line \d+ : column \d+\)$/u.test(G(!1,r,-1))&&r[1]===""&&G(!1,r,-2)===""&&r.slice(2,-2).every(s=>s.startsWith("|"))?r[0].trim().slice(0,-1):t}function vi(e){let{location:t,hash:r}=e;if(t){let{start:s,end:n}=t;return typeof n.line!="number"?{start:s}:t}if(r){let{loc:{last_line:s,last_column:n}}=r;return{start:{line:s,column:n+1}}}}var Ei={parse:ki,astFormat:"glimmer",locStart:St,locEnd:re};var wi={glimmer:hs};var Do=Pr;export{Do as default,ps as languages,xr as parsers,wi as printers};