prettier
Version:
Prettier is an opinionated code formatter
38 lines • 99.4 kB
JavaScript
var _s=Object.defineProperty;var xr=(t,e)=>{for(var r in e)_s(t,r,{get:e[r],enumerable:!0})};var xs={};xr(xs,{languages:()=>Ss,parsers:()=>dr,printers:()=>Ii});var Je=(t,e)=>(r,s,...n)=>r|1&&s==null?void 0:(e.call(s)??s[t]).apply(s,n);var Ls=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},Os=Je("replaceAll",function(){if(typeof this=="string")return Ls}),ce=Os;function Ds(t){return this[t<0?this.length+t:t]}var Is=Je("at",function(){if(Array.isArray(this)||typeof this=="string")return Ds}),F=Is;var Bs=()=>{},Oe=Bs;var De="string",Ie="array",Xe="cursor",Te="indent",we="align",Ze="trim",ke="group",Ne="fill",xe="if-break",et="indent-if-break",tt="line-suffix",rt="line-suffix-boundary",Q="line",st="label",Pe="break-parent",nt=new Set([Xe,Te,we,Ze,ke,Ne,xe,et,tt,rt,Q,st,Pe]);function Pr(t,e,r){if(!t.has(e)){let s=r(e);t.set(e,s)}return t.get(e)}function Rs(t){if(typeof t=="string")return De;if(Array.isArray(t))return Ie;if(!t)return;let{type:e}=t;if(nt.has(e))return e}var it=Rs;var qs=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Vs(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
Expected it to be 'string' or 'object'.`;if(it(t))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let s=qs([...nt].map(n=>`'${n}'`));return`Unexpected doc.type '${t.type}'.
Expected it to be ${s}.`}var Lt=class extends Error{name="InvalidDocError";constructor(e){super(Vs(e)),this.doc=e}},Ar=Lt;function Fs(t,e){if(typeof t=="string")return e(t);let r=new Map;return s(t);function s(i){return Pr(r,i,n)}function n(i){switch(it(i)){case Ie:return e(i.map(s));case Ne:return e({...i,parts:i.parts.map(s)});case xe:return e({...i,breakContents:s(i.breakContents),flatContents:s(i.flatContents)});case ke:{let{expandedStates:a,contents:o}=i;return a?(a=a.map(s),o=a[0]):o=s(o),e({...i,contents:o,expandedStates:a})}case we:case Te:case et:case st:case tt:return e({...i,contents:s(i.contents)});case De:case Xe:case Ze:case rt:case Q:case Pe:return e(i);default:throw new Ar(i)}}}function at(t,e=vr){return Fs(t,r=>typeof r=="string"?ue(e,r.split(`
`)):r)}var Y=Oe,ot=Oe,Cr=Oe,_r=Oe;function H(t){return Y(t),{type:Te,contents:t}}function Hs(t,e){return _r(t),Y(e),{type:we,contents:e,n:t}}function Ot(t){return Hs(-1,t)}var Dt={type:Pe};function It(t){return Cr(t),{type:Ne,parts:t}}function I(t,e={}){return Y(t),ot(e.expandedStates,!0),{type:ke,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function Bt(t,e="",r={}){return Y(t),e!==""&&Y(e),{type:xe,breakContents:t,flatContents:e,groupId:r.groupId}}function ue(t,e){Y(t),ot(e);let r=[];for(let s=0;s<e.length;s++)s!==0&&r.push(t),r.push(e[s]);return r}var A={type:Q},U={type:Q,soft:!0},Us={type:Q,hard:!0},he=[Us,Dt],Ms={type:Q,hard:!0,literal:!0},vr=[Ms,Dt];var Lr=Object.freeze({character:"'",codePoint:39}),Or=Object.freeze({character:'"',codePoint:34}),Ys=Object.freeze({preferred:Lr,alternate:Or}),Gs=Object.freeze({preferred:Or,alternate:Lr});function lt(t,e){let{preferred:r,alternate:s}=e===!0||e==="'"?Ys:Gs,{length:n}=t,i=0,a=0;for(let o=0;o<n;o++){let l=t.charCodeAt(o);l===r.codePoint?i++:l===s.codePoint&&a++}return(i>a?s:r).character}function Rt(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var qt=class{#e;constructor(e){this.#e=new Set(e)}getLeadingWhitespaceCount(e){let r=this.#e,s=0;for(let n=0;n<e.length&&r.has(e.charAt(n));n++)s++;return s}getTrailingWhitespaceCount(e){let r=this.#e,s=0;for(let n=e.length-1;n>=0&&r.has(e.charAt(n));n--)s++;return s}getLeadingWhitespace(e){let r=this.getLeadingWhitespaceCount(e);return e.slice(0,r)}getTrailingWhitespace(e){let r=this.getTrailingWhitespaceCount(e);return e.slice(e.length-r)}hasLeadingWhitespace(e){return this.#e.has(e.charAt(0))}hasTrailingWhitespace(e){return this.#e.has(F(0,e,-1))}trimStart(e){let r=this.getLeadingWhitespaceCount(e);return e.slice(r)}trimEnd(e){let r=this.getTrailingWhitespaceCount(e);return e.slice(0,e.length-r)}trim(e){return this.trimEnd(this.trimStart(e))}split(e,r=!1){let s=`[${Rt([...this.#e].join(""))}]+`,n=new RegExp(r?`(${s})`:s);return e.split(n)}hasWhitespaceCharacter(e){let r=this.#e;return Array.prototype.some.call(e,s=>r.has(s))}hasNonWhitespaceCharacter(e){let r=this.#e;return Array.prototype.some.call(e,s=>!r.has(s))}isWhitespaceOnly(e){let r=this.#e;return Array.prototype.every.call(e,s=>r.has(s))}#t(e){let r=Number.POSITIVE_INFINITY;for(let s of e.split(`
`)){if(s.length===0)continue;let n=this.getLeadingWhitespaceCount(s);if(n===0)return 0;s.length!==n&&n<r&&(r=n)}return r===Number.POSITIVE_INFINITY?0:r}dedentString(e){let r=this.#t(e);return r===0?e:e.split(`
`).map(s=>s.slice(r)).join(`
`)}},Dr=qt;var zs=[" ",`
`,"\f","\r"," "],Ks=new Dr(zs),B=Ks;function Ws(t){return Array.isArray(t)&&t.length>0}var Be=Ws;var Vt=class extends Error{name="UnexpectedNodeError";constructor(e,r,s="type"){super(`Unexpected ${r} node ${s}: ${JSON.stringify(e[s])}.`),this.node=e}},Ir=Vt;var js=/["\x26\xa0]/u,Za=new RegExp(js.source,"gu"),$s=/[&<>\xa0]/u,eo=new RegExp($s.source,"gu");var Yt=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Gr(){return[...Yt]}function mt(t){return t?t.length>0:!1}function pt(t,e="unexpected empty list"){return t}function nr(t){return t.length===0?void 0:t[t.length-1]}function Qs(t){return t.length===0?void 0:t[0]}var zr=Object.assign,Ft=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function re(t,e){let r=e&&e.loc,s,n,i,a;r&&(s=r.start.line,n=r.end.line,i=r.start.column,a=r.end.column,t+=" - "+s+":"+i);let o=Error.prototype.constructor.call(this,t);for(let l=0;l<Ft.length;l++)this[Ft[l]]=o[Ft[l]];Error.captureStackTrace&&Error.captureStackTrace(this,re);try{r&&(this.lineNumber=s,this.endLineNumber=n,Object.defineProperty?(Object.defineProperty(this,"column",{value:i,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:a,enumerable:!0})):(this.column=i,this.endColumn=a))}catch{}}re.prototype=new Error;function Re(){this.parents=[]}Re.prototype={constructor:Re,mutating:!1,acceptKey:function(t,e){let r=this.accept(t[e]);if(this.mutating){if(r&&!Re.prototype[r.type])throw new re('Unexpected node type "'+r.type+'" found when accepting '+e+" on "+t.type);t[e]=r}},acceptRequired:function(t,e){if(this.acceptKey(t,e),!t[e])throw new re(t.type+" requires "+e)},acceptArray:function(t){for(let e=0,r=t.length;e<r;e++)this.acceptKey(t,e),t[e]||(t.splice(e,1),e--,r--)},accept:function(t){if(!t)return;if(!this[t.type])throw new re("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;let e=this[t.type](t);if(this.current=this.parents.shift(),!this.mutating||e)return e;if(e!==!1)return t},Program:function(t){this.acceptArray(t.body)},MustacheStatement:ht,Decorator:ht,BlockStatement:Br,DecoratorBlock:Br,PartialStatement:Rr,PartialBlockStatement:function(t){Rr.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:ht,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}};function ht(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function Br(t){ht.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function Rr(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function W(t={}){this.options=t}W.prototype=new Re;W.prototype.Program=function(t){let e=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;let s=t.body;for(let n=0,i=s.length;n<i;n++){let a=s[n],o=this.accept(a);if(!o)continue;let l=Gt(s,n,r),h=zt(s,n,r),g=o.openStandalone&&l,E=o.closeStandalone&&h,d=o.inlineStandalone&&l&&h;o.close&&pe(s,n,!0),o.open&&ee(s,n,!0),e&&d&&(pe(s,n),ee(s,n)&&a.type==="PartialStatement"&&(a.indent=/([ \t]+$)/.exec(s[n-1].original)[1])),e&&g&&(pe((a.program||a.inverse).body),ee(s,n)),e&&E&&(pe(s,n),ee((a.inverse||a.program).body))}return t};W.prototype.BlockStatement=W.prototype.DecoratorBlock=W.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);let e=t.program||t.inverse,r=t.program&&t.inverse,s=r,n=r;if(r&&r.chained)for(s=r.body[0].program;n.chained;)n=n.body[n.body.length-1].program;let i={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:zt(e.body),closeStandalone:Gt((s||e).body)};if(t.openStrip.close&&pe(e.body,null,!0),r){let a=t.inverseStrip;a.open&&ee(e.body,null,!0),a.close&&pe(s.body,null,!0),t.closeStrip.open&&ee(n.body,null,!0),!this.options.ignoreStandalone&&Gt(e.body)&&zt(s.body)&&(ee(e.body),pe(s.body))}else t.closeStrip.open&&ee(e.body,null,!0);return i};W.prototype.Decorator=W.prototype.MustacheStatement=function(t){return t.strip};W.prototype.PartialStatement=W.prototype.CommentStatement=function(t){let e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}};function Gt(t,e,r){e===void 0&&(e=t.length);let s=t[e-1],n=t[e-2];if(!s)return r;if(s.type==="ContentStatement")return(n||!r?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(s.original)}function zt(t,e,r){e===void 0&&(e=-1);let s=t[e+1],n=t[e+2];if(!s)return r;if(s.type==="ContentStatement")return(n||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(s.original)}function pe(t,e,r){let s=t[e==null?0:e+1];if(!s||s.type!=="ContentStatement"||!r&&s.rightStripped)return;let n=s.value;s.value=s.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),s.rightStripped=s.value!==n}function ee(t,e,r){let s=t[e==null?t.length-1:e-1];if(!s||s.type!=="ContentStatement"||!r&&s.leftStripped)return;let n=s.value;return s.value=s.value.replace(r?/\s+$/:/[ \t]+$/,""),s.leftStripped=s.value!==n,s.leftStripped}var ct=(function(){var t=function(Z,f,b,m){for(b=b||{},m=Z.length;m--;b[Z[m]]=f);return b},e=[2,52],r=[1,20],s=[5,14,15,19,29,34,39,44,47,48,53,57,61],n=[1,44],i=[1,40],a=[1,43],o=[1,33],l=[1,34],h=[1,35],g=[1,36],E=[1,37],d=[1,42],w=[1,46],N=[14,15,19,29,34,39,44,47,48,53,57,61],q=[14,15,19,29,34,44,47,48,53,57,61],L=[15,18],v=[14,15,19,29,34,47,48,53,57,61],O=[33,67,73,75,84,85,86,87,88,89],C=[23,33,56,67,68,73,75,77,79,84,85,86,87,88,89],M=[1,62],_=[1,63],X=[23,33,56,68,73,79],j=[23,33,56,67,68,73,75,77,79,84,85,86,87,88,89,92,93],mr=[2,51],gr=[1,64],br=[67,73,75,77,84,85,86,87,88,89],yr=[56,67,73,75,84,85,86,87,88,89],Er=[1,75],wt=[1,76],kt=[1,83],ge=[33,67,73,75,79,84,85,86,87,88,89],Sr=[23,67,73,75,84,85,86,87,88,89],Tr=[67,68,73,75,84,85,86,87,88,89],be=[33,79],Nt=[1,134],wr=[73,81],xt={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,hash:49,expr:50,mustache_repetition0:51,mustache_option0:52,OPEN_UNESCAPED:53,mustache_repetition1:54,mustache_option1:55,CLOSE_UNESCAPED:56,OPEN_PARTIAL:57,partial_repetition0:58,partial_option0:59,openPartialBlock:60,OPEN_PARTIAL_BLOCK:61,openPartialBlock_repetition0:62,openPartialBlock_option0:63,exprHead:64,arrayLiteral:65,sexpr:66,OPEN_SEXPR:67,CLOSE_SEXPR:68,sexpr_repetition0:69,sexpr_option0:70,hash_repetition_plus0:71,hashSegment:72,ID:73,EQUALS:74,OPEN_ARRAY:75,arrayLiteral_repetition0:76,CLOSE_ARRAY:77,blockParams:78,OPEN_BLOCK_PARAMS:79,blockParams_repetition_plus0:80,CLOSE_BLOCK_PARAMS:81,path:82,dataName:83,STRING:84,NUMBER:85,BOOLEAN:86,UNDEFINED:87,NULL:88,DATA:89,pathSegments:90,sep:91,SEP:92,PRIVATE_SEP:93,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",53:"OPEN_UNESCAPED",56:"CLOSE_UNESCAPED",57:"OPEN_PARTIAL",61:"OPEN_PARTIAL_BLOCK",67:"OPEN_SEXPR",68:"CLOSE_SEXPR",73:"ID",74:"EQUALS",75:"OPEN_ARRAY",77:"CLOSE_ARRAY",79:"OPEN_BLOCK_PARAMS",81:"CLOSE_BLOCK_PARAMS",84:"STRING",85:"NUMBER",86:"BOOLEAN",87:"UNDEFINED",88:"NULL",89:"DATA",92:"SEP",93:"PRIVATE_SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,3],[8,5],[8,5],[11,5],[12,3],[60,5],[50,1],[50,1],[64,1],[64,1],[66,3],[66,5],[49,1],[72,3],[65,3],[78,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[83,2],[91,1],[91,1],[82,3],[82,1],[90,3],[90,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[51,0],[51,2],[52,0],[52,1],[54,0],[54,2],[55,0],[55,1],[58,0],[58,2],[59,0],[59,1],[62,0],[62,2],[63,0],[63,1],[69,0],[69,2],[70,0],[70,1],[71,1],[71,2],[76,0],[76,2],[80,1],[80,2]],performAction:function(f,b,m,p,S,c,ye){var u=c.length-1;switch(S){case 1:return c[u-1];case 2:this.$=p.prepareProgram(c[u]);break;case 3:case 4:case 5:case 6:case 7:case 8:case 20:case 28:case 29:case 30:case 31:case 38:case 39:case 46:case 47:this.$=c[u];break;case 9:this.$={type:"CommentStatement",value:p.stripComment(c[u]),strip:p.stripFlags(c[u],c[u]),loc:p.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:c[u],value:c[u],loc:p.locInfo(this._$)};break;case 11:this.$=p.prepareRawBlock(c[u-2],c[u-1],c[u],this._$);break;case 12:this.$={path:c[u-3],params:c[u-2],hash:c[u-1]};break;case 13:this.$=p.prepareBlock(c[u-3],c[u-2],c[u-1],c[u],!1,this._$);break;case 14:this.$=p.prepareBlock(c[u-3],c[u-2],c[u-1],c[u],!0,this._$);break;case 15:this.$={open:c[u-5],path:c[u-4],params:c[u-3],hash:c[u-2],blockParams:c[u-1],strip:p.stripFlags(c[u-5],c[u])};break;case 16:case 17:this.$={path:c[u-4],params:c[u-3],hash:c[u-2],blockParams:c[u-1],strip:p.stripFlags(c[u-5],c[u])};break;case 18:this.$={strip:p.stripFlags(c[u-1],c[u-1]),program:c[u]};break;case 19:var We=p.prepareBlock(c[u-2],c[u-1],c[u],c[u],!1,this._$),je=p.prepareProgram([We],c[u-1].loc);je.chained=!0,this.$={strip:c[u-2].strip,program:je,chain:!0};break;case 21:this.$={path:c[u-1],strip:p.stripFlags(c[u-2],c[u])};break;case 22:this.$=p.prepareMustache(p.syntax.hash(c[u-1],p.locInfo(this._$),{yy:p,syntax:"expr"}),[],void 0,c[u-2],p.stripFlags(c[u-2],c[u]),this._$);break;case 23:case 24:this.$=p.prepareMustache(c[u-3],c[u-2],c[u-1],c[u-4],p.stripFlags(c[u-4],c[u]),this._$);break;case 25:this.$={type:"PartialStatement",name:c[u-3],params:c[u-2],hash:c[u-1],indent:"",strip:p.stripFlags(c[u-4],c[u]),loc:p.locInfo(this._$)};break;case 26:this.$=p.preparePartialBlock(c[u-2],c[u-1],c[u],this._$);break;case 27:this.$={path:c[u-3],params:c[u-2],hash:c[u-1],strip:p.stripFlags(c[u-4],c[u])};break;case 32:this.$=p.syntax.hash(c[u-1],p.locInfo(this._$),{yy:p,syntax:"expr"});break;case 33:this.$={type:"SubExpression",path:c[u-3],params:c[u-2],hash:c[u-1],loc:p.locInfo(this._$)};break;case 34:this.$={type:"Hash",pairs:c[u],loc:p.locInfo(this._$)};break;case 35:this.$={type:"HashPair",key:p.id(c[u-2]),value:c[u],loc:p.locInfo(this._$)};break;case 36:this.$=p.syntax.square(c[u-1],p.locInfo(this._$),{yy:p,syntax:"expr"});break;case 37:this.$=p.id(c[u-1]);break;case 40:this.$={type:"StringLiteral",value:c[u],original:c[u],loc:p.locInfo(this._$)};break;case 41:this.$={type:"NumberLiteral",value:Number(c[u]),original:Number(c[u]),loc:p.locInfo(this._$)};break;case 42:this.$={type:"BooleanLiteral",value:c[u]==="true",original:c[u]==="true",loc:p.locInfo(this._$)};break;case 43:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:p.locInfo(this._$)};break;case 44:this.$={type:"NullLiteral",original:null,value:null,loc:p.locInfo(this._$)};break;case 45:this.$=p.preparePath(!0,!1,c[u],this._$);break;case 48:this.$=p.preparePath(!1,c[u-2],c[u],this._$);break;case 49:this.$=p.preparePath(!1,!1,c[u],this._$);break;case 50:c[u-2].push({part:p.id(c[u]),original:c[u],separator:c[u-1]}),this.$=c[u-2];break;case 51:this.$=[{part:p.id(c[u]),original:c[u]}];break;case 52:case 54:case 56:case 64:case 70:case 76:case 84:case 88:case 92:case 96:case 100:case 106:this.$=[];break;case 53:case 55:case 57:case 65:case 71:case 77:case 85:case 89:case 93:case 97:case 101:case 105:case 107:case 109:c[u-1].push(c[u]);break;case 104:case 108:this.$=[c[u]];break}},table:[t([5,14,15,19,29,34,48,53,57,61],e,{3:1,4:2,6:3}),{1:[3]},{5:[1,4]},t([5,39,44,47],[2,2],{7:5,8:6,9:7,10:8,11:9,12:10,13:11,24:15,27:16,16:17,60:19,14:[1,12],15:r,19:[1,23],29:[1,21],34:[1,22],48:[1,13],53:[1,14],57:[1,18],61:[1,24]}),{1:[2,1]},t(s,[2,53]),t(s,[2,3]),t(s,[2,4]),t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),t(s,[2,9]),{20:28,49:25,50:26,64:29,65:38,66:39,67:n,71:27,72:30,73:i,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{20:28,50:45,64:29,65:38,66:39,67:n,73:w,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},t(N,e,{6:3,4:47}),t(q,e,{6:3,4:48}),t(L,[2,54],{17:49}),{20:28,50:50,64:29,65:38,66:39,67:n,73:w,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},t(v,e,{6:3,4:51}),t([5,14,15,18,19,29,34,39,44,47,48,53,57,61],[2,10]),{20:52,64:53,65:38,66:39,67:n,73:w,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{20:54,64:53,65:38,66:39,67:n,73:w,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{20:55,64:53,65:38,66:39,67:n,73:w,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{20:28,50:56,64:29,65:38,66:39,67:n,73:w,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{33:[1,57]},t(O,[2,84],{51:58}),t([23,33,56,68,79],[2,34],{72:59,73:[1,60]}),t(C,[2,28]),t(C,[2,29],{91:61,92:M,93:_}),t(X,[2,104]),t(C,[2,38]),t(C,[2,39]),t(C,[2,40]),t(C,[2,41]),t(C,[2,42]),t(C,[2,43]),t(C,[2,44]),t(j,[2,30]),t(j,[2,31]),t([23,33,56,67,68,73,75,79,84,85,86,87,88,89,92,93],mr,{74:gr}),t(C,[2,49],{91:65,92:M,93:_}),{73:w,90:66},t(br,[2,106],{76:67}),{20:28,49:68,50:69,64:29,65:38,66:39,67:n,71:27,72:30,73:i,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},t(yr,[2,88],{54:70}),t(j,mr),{25:71,38:73,39:Er,43:74,44:wt,45:72,47:[2,60]},{28:77,43:78,44:wt,47:[2,62]},{13:80,15:r,18:[1,79]},t(O,[2,92],{58:81}),{26:82,47:kt},t(ge,[2,64],{30:84}),{91:61,92:M,93:_},t(ge,[2,70],{35:85}),t(Sr,[2,56],{21:86}),t(O,[2,96],{62:87}),t(s,[2,22]),{20:28,33:[2,86],49:90,50:89,52:88,64:29,65:38,66:39,67:n,71:27,72:30,73:i,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},t(X,[2,105]),{74:gr},{73:w,90:91},{73:[2,46]},{73:[2,47]},{20:28,50:92,64:29,65:38,66:39,67:n,73:w,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{73:[1,93]},t(C,[2,45],{91:65,92:M,93:_}),{20:28,50:95,64:29,65:38,66:39,67:n,73:w,75:a,77:[1,94],82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{68:[1,96]},t(Tr,[2,100],{69:97}),{20:28,49:100,50:99,55:98,56:[2,90],64:29,65:38,66:39,67:n,71:27,72:30,73:i,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{26:101,47:kt},{47:[2,61]},t(N,e,{6:3,4:102}),{47:[2,20]},{20:103,64:53,65:38,66:39,67:n,73:w,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},t(v,e,{6:3,4:104}),{26:105,47:kt},{47:[2,63]},t(s,[2,11]),t(L,[2,55]),{20:28,33:[2,94],49:108,50:107,59:106,64:29,65:38,66:39,67:n,71:27,72:30,73:i,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},t(s,[2,26]),{20:109,64:53,65:38,66:39,67:n,73:w,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},t(be,[2,66],{71:27,20:28,64:29,72:30,82:31,83:32,65:38,66:39,90:41,31:110,50:111,49:112,67:n,73:i,75:a,84:o,85:l,86:h,87:g,88:E,89:d}),t(be,[2,72],{71:27,20:28,64:29,72:30,82:31,83:32,65:38,66:39,90:41,36:113,50:114,49:115,67:n,73:i,75:a,84:o,85:l,86:h,87:g,88:E,89:d}),{20:28,22:116,23:[2,58],49:118,50:117,64:29,65:38,66:39,67:n,71:27,72:30,73:i,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{20:28,33:[2,98],49:121,50:120,63:119,64:29,65:38,66:39,67:n,71:27,72:30,73:i,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{33:[1,122]},t(O,[2,85]),{33:[2,87]},t(C,[2,48],{91:65,92:M,93:_}),t(X,[2,35]),t(j,[2,50]),t(j,[2,36]),t(br,[2,107]),t(j,[2,32]),{20:28,49:125,50:124,64:29,65:38,66:39,67:n,68:[2,102],70:123,71:27,72:30,73:i,75:a,82:31,83:32,84:o,85:l,86:h,87:g,88:E,89:d,90:41},{56:[1,126]},t(yr,[2,89]),{56:[2,91]},t(s,[2,13]),{38:73,39:Er,43:74,44:wt,45:128,46:127,47:[2,82]},t(ge,[2,76],{40:129}),{47:[2,18]},t(s,[2,14]),{33:[1,130]},t(O,[2,93]),{33:[2,95]},{33:[1,131]},{32:132,33:[2,68],78:133,79:Nt},t(ge,[2,65]),t(be,[2,67]),{33:[2,74],37:135,78:136,79:Nt},t(ge,[2,71]),t(be,[2,73]),{23:[1,137]},t(Sr,[2,57]),{23:[2,59]},{33:[1,138]},t(O,[2,97]),{33:[2,99]},t(s,[2,23]),{68:[1,139]},t(Tr,[2,101]),{68:[2,103]},t(s,[2,24]),{47:[2,19]},{47:[2,83]},t(be,[2,78],{71:27,20:28,64:29,72:30,82:31,83:32,65:38,66:39,90:41,41:140,50:141,49:142,67:n,73:i,75:a,84:o,85:l,86:h,87:g,88:E,89:d}),t(s,[2,25]),t(s,[2,21]),{33:[1,143]},{33:[2,69]},{73:[1,145],80:144},{33:[1,146]},{33:[2,75]},t(L,[2,12]),t(v,[2,27]),t(j,[2,33]),{33:[2,80],42:147,78:148,79:Nt},t(ge,[2,77]),t(be,[2,79]),t(N,[2,15]),{73:[1,150],81:[1,149]},t(wr,[2,108]),t(q,[2,16]),{33:[1,151]},{33:[2,81]},{33:[2,37]},t(wr,[2,109]),t(N,[2,17])],defaultActions:{4:[2,1],62:[2,46],63:[2,47],72:[2,61],74:[2,20],78:[2,63],90:[2,87],100:[2,91],104:[2,18],108:[2,95],118:[2,59],121:[2,99],125:[2,103],127:[2,19],128:[2,83],133:[2,69],136:[2,75],148:[2,81],149:[2,37]},parseError:function(f,b){if(b.recoverable)this.trace(f);else{var m=new Error(f);throw m.hash=b,m}},parse:function(f){var b=this,m=[0],p=[null],S=[],c=this.table,ye="",u=0,We=0,je=2,kr=1,As=S.slice.call(arguments,1),x=Object.create(this.lexer),oe={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(oe.yy[At]=this.yy[At]);x.setInput(f,oe.yy),oe.yy.lexer=x,oe.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var vt=x.yylloc;S.push(vt);var vs=x.options&&x.options.ranges;typeof oe.yy.parseError=="function"?this.parseError=oe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var Cs=function(){var Se;return Se=x.lex()||kr,typeof Se!="number"&&(Se=b.symbols_[Se]||Se),Se},D,le,V,Ct,Ee={},$e,$,Nr,Qe;;){if(le=m[m.length-1],this.defaultActions[le]?V=this.defaultActions[le]:((D===null||typeof D>"u")&&(D=Cs()),V=c[le]&&c[le][D]),typeof V>"u"||!V.length||!V[0]){var _t="";Qe=[];for($e in c[le])this.terminals_[$e]&&$e>je&&Qe.push("'"+this.terminals_[$e]+"'");x.showPosition?_t="Parse error on line "+(u+1)+`:
`+x.showPosition()+`
Expecting `+Qe.join(", ")+", got '"+(this.terminals_[D]||D)+"'":_t="Parse error on line "+(u+1)+": Unexpected "+(D==kr?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(_t,{text:x.match,token:this.terminals_[D]||D,line:x.yylineno,loc:vt,expected:Qe})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+le+", token: "+D);switch(V[0]){case 1:m.push(D),p.push(x.yytext),S.push(x.yylloc),m.push(V[1]),D=null,We=x.yyleng,ye=x.yytext,u=x.yylineno,vt=x.yylloc;break;case 2:if($=this.productions_[V[1]][1],Ee.$=p[p.length-$],Ee._$={first_line:S[S.length-($||1)].first_line,last_line:S[S.length-1].last_line,first_column:S[S.length-($||1)].first_column,last_column:S[S.length-1].last_column},vs&&(Ee._$.range=[S[S.length-($||1)].range[0],S[S.length-1].range[1]]),Ct=this.performAction.apply(Ee,[ye,We,u,oe.yy,V[1],p,S].concat(As)),typeof Ct<"u")return Ct;$&&(m=m.slice(0,-1*$*2),p=p.slice(0,-1*$),S=S.slice(0,-1*$)),m.push(this.productions_[V[1]][0]),p.push(Ee.$),S.push(Ee._$),Nr=c[m[m.length-2]][m[m.length-1]],m.push(Nr);break;case 3:return!0}}return!0}},Ps=(function(){var Z={EOF:1,parseError:function(b,m){if(this.yy.parser)this.yy.parser.parseError(b,m);else throw new Error(b)},setInput:function(f,b){return this.yy=b||this.yy||{},this._input=f,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 f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var b=f.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},unput:function(f){var b=f.length,m=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var p=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),m.length-1&&(this.yylineno-=m.length-1);var S=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:m?(m.length===p.length?this.yylloc.first_column:0)+p[p.length-m.length].length-m[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-b]),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(f){this.unput(this.match.slice(f))},pastInput:function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var f=this.pastInput(),b=new Array(f.length+1).join("-");return f+this.upcomingInput()+`
`+b+"^"},test_match:function(f,b){var m,p,S;if(this.options.backtrack_lexer&&(S={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&&(S.yylloc.range=this.yylloc.range.slice(0))),p=f[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,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(f[0].length),this.matched+=f[0],m=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var c in S)this[c]=S[c];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,b,m,p;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),c=0;c<S.length;c++)if(m=this._input.match(this.rules[S[c]]),m&&(!b||m[0].length>b[0].length)){if(b=m,p=c,this.options.backtrack_lexer){if(f=this.test_match(m,S[c]),f!==!1)return f;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(f=this.test_match(b,S[p]),f!==!1?f:!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 b=this.next();return b||this.lex()},begin:function(b){this.conditionStack.push(b)},popState:function(){var b=this.conditionStack.length-1;return b>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(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},pushState:function(b){this.begin(b)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(b,m,p,S){function c(ye,u){return m.yytext=m.yytext.substring(ye,m.yyleng-u+ye)}switch(p){case 0:if(m.yytext.slice(-2)==="\\\\"?(c(0,1),this.begin("mu")):m.yytext.slice(-1)==="\\"?(c(0,1),this.begin("emu")):this.begin("mu"),m.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(c(5,9),18);case 5:return 15;case 6:return this.popState(),14;case 7:return 67;case 8:return 68;case 9:if(b.syntax.square==="string")this.unput(m.yytext),this.begin("escl");else return 75;break;case 10:return 77;case 11:return 19;case 12:return this.popState(),this.begin("raw"),23;case 13:return 57;case 14:return 61;case 15:return 29;case 16:return 47;case 17:return this.popState(),44;case 18:return this.popState(),44;case 19:return 34;case 20:return 39;case 21:return 53;case 22:return 48;case 23:this.unput(m.yytext),this.popState(),this.begin("com");break;case 24:return this.popState(),14;case 25:return 48;case 26:return 74;case 27:return 73;case 28:return 73;case 29:return 93;case 30:return 92;case 31:break;case 32:return this.popState(),56;case 33:return this.popState(),33;case 34:return m.yytext=c(1,2).replace(/\\"/g,'"'),84;case 35:return m.yytext=c(1,2).replace(/\\'/g,"'"),84;case 36:return 89;case 37:return 86;case 38:return 86;case 39:return 87;case 40:return 88;case 41:return 85;case 42:return 79;case 43:return 81;case 44:return 73;case 45:return m.yytext=m.yytext.replace(/\\([\\\]])/g,"$1"),this.popState(),73;case 46:return"INVALID";case 47: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,46,47],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},escl:{rules:[45],inclusive:!1},INITIAL:{rules:[0,1,47],inclusive:!0}}};return Z})();xt.lexer=Ps;function Pt(){this.yy={}}return Pt.prototype=xt,xt.Parser=Pt,new Pt})();function k(){this.padding=0}k.prototype=new Re;k.prototype.pad=function(t){let e="";for(let r=0,s=this.padding;r<s;r++)e+=" ";return e+=t+`
`,e};k.prototype.Program=function(t){let e="",r=t.body,s,n;if(t.blockParams){let i="BLOCK PARAMS: [";for(s=0,n=t.blockParams.length;s<n;s++)i+=" "+t.blockParams[s];i+=" ]",e+=this.pad(i)}for(s=0,n=r.length;s<n;s++)e+=this.accept(r[s]);return this.padding--,e};k.prototype.MustacheStatement=function(t){return t.params.length>0||t.hash?this.pad("{{ "+this.callBody(t)+" }}"):this.pad("{{ "+this.accept(t.path)+" }}")};k.prototype.Decorator=function(t){return this.pad("{{ DIRECTIVE "+this.callBody(t)+" }}")};k.prototype.BlockStatement=k.prototype.DecoratorBlock=function(t){let e="";return e+=this.pad((t.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,e+=this.pad(this.callBody(t)),t.program&&(e+=this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--),t.inverse&&(t.program&&this.padding++,e+=this.pad("{{^}}"),this.padding++,e+=this.accept(t.inverse),this.padding--,t.program&&this.padding--),this.padding--,e};k.prototype.PartialStatement=function(t){let e="PARTIAL:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),this.pad("{{> "+e+" }}")};k.prototype.PartialBlockStatement=function(t){let e="PARTIAL BLOCK:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),e+=" "+this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--,this.pad("{{> "+e+" }}")};k.prototype.ContentStatement=function(t){return this.pad("CONTENT[ '"+t.value+"' ]")};k.prototype.CommentStatement=function(t){return this.pad("{{! '"+t.value+"' }}")};k.prototype.SubExpression=function(t){return`(${this.callBody(t)})`};k.prototype.callBody=function(t){let e=t.params,r=[],s;for(let n=0,i=e.length;n<i;n++)r.push(this.accept(e[n]));return e=r.length===0?"":" ["+r.join(", ")+"]",s=t.hash?" "+this.accept(t.hash):"",this.accept(t.path)+e+s};k.prototype.PathExpression=function(t){let r=[typeof t.head=="string"?t.head:`[${this.accept(t.head)}]`,...t.tail].join("/");return"p%"+Js(t)+r};function Js(t){return t.data?"@":t.this?"this.":""}k.prototype.StringLiteral=function(t){return'"'+t.value+'"'};k.prototype.NumberLiteral=function(t){return"n%"+t.value};k.prototype.BooleanLiteral=function(t){return"b%"+t.value};k.prototype.UndefinedLiteral=function(){return"UNDEFINED"};k.prototype.NullLiteral=function(){return"NULL"};k.prototype.ArrayLiteral=function(t){return`Array[${t.items.map(e=>this.accept(e)).join(", ")}]`};k.prototype.HashLiteral=function(t){return`Hash{${this.hashPairs(t)}}`};k.prototype.Hash=function(t){return`HASH{${this.hashPairs(t)}}`};k.prototype.hashPairs=function(t){let e=t.pairs,r=[];for(let s=0,n=e.length;s<n;s++)r.push(this.HashPair(e[s]));return r.join(" ")};k.prototype.HashPair=function(t){return t.key+"="+this.accept(t.value)};function ir(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){let r={loc:t.path.loc};throw new re(t.path.original+" doesn't match "+e,r)}}function Kr(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}}function Xs(t){return/^\[.*\]$/.test(t)?t.substring(1,t.length-1):t}function Zs(t,e){return{open:t.charAt(2)==="~",close:e.charAt(e.length-3)==="~"}}function en(t){return t.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function tn(t,e,r,s){s=this.locInfo(s);let n;t?n="@":e?n=e.original+".":n="";let i=[],a=0;for(let l=0,h=r.length;l<h;l++){let g=r[l].part,E=r[l].original!==g,d=r[l].separator,w=d===".#"?"#":"";if(n+=(d||"")+g,!E&&(g===".."||g==="."||g==="this")){if(i.length>0)throw new re("Invalid path: "+n,{loc:s});g===".."&&a++}else i.push(`${w}${g}`)}let o=e||i.shift();return{type:"PathExpression",this:n.startsWith("this."),data:t,depth:a,head:o,tail:i,parts:o?[o,...i]:i,original:n,loc:s}}function rn(t,e,r,s,n,i){let a=s.charAt(3)||s.charAt(2),o=a!=="{"&&a!=="&";return{type:/\*/.test(s)?"Decorator":"MustacheStatement",path:t,params:e,hash:r,escaped:o,strip:n,loc:this.locInfo(i)}}function sn(t,e,r,s){ir(t,r),s=this.locInfo(s);let n={type:"Program",body:e,strip:{},loc:s};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:n,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}}function nn(t,e,r,s,n,i){s&&s.path&&ir(t,s);let a=/\*/.test(t.open);e.blockParams=t.blockParams;let o,l;if(r){if(a)throw new re("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=s.strip),l=r.strip,o=r.program}return n&&(n=o,o=e,e=n),{type:a?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:o,openStrip:t.strip,inverseStrip:l,closeStrip:s&&s.strip,loc:this.locInfo(i)}}function an(t,e){if(!e&&t.length){let r=t[0].loc,s=t[t.length-1].loc;r&&s&&(e={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:t,strip:{},loc:e}}function on(t,e,r,s){return ir(t,r),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:r&&r.strip,loc:this.locInfo(s)}}var Ht=Object.freeze({__proto__:null,SourceLocation:Kr,id:Xs,prepareBlock:nn,prepareMustache:rn,preparePartialBlock:on,preparePath:tn,prepareProgram:an,prepareRawBlock:sn,stripComment:en,stripFlags:Zs}),Wr={};for(let t in Ht)Object.prototype.hasOwnProperty.call(Ht,t)&&(Wr[t]=Ht[t]);function Kt(t,e){if(t.type==="Program")return t;ct.yy=Wr,ct.yy.locInfo=function(n){return new Kr(e&&e.srcName,n)};let r;typeof e?.syntax?.square=="function"?r=e.syntax.square:e?.syntax?.square==="node"?r=ln:r="string";let s;return typeof e?.syntax?.hash=="function"?s=e.syntax.hash:s=cn,ct.yy.syntax={square:r,hash:s},ct.parse(t)}function ln(t,e){return{type:"ArrayLiteral",items:t,loc:e}}function cn(t,e){return{type:"HashLiteral",pairs:t.pairs,loc:e}}function qr(t,e){let r=Kt(t,e);return new W(e).accept(r)}var un={},hn=/^#[xX]([A-Fa-f0-9]+)$/,pn=/^#([0-9]+)$/,fn=/^([A-Za-z0-9]+)$/,dn={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},jr=class{named;constructor(t){this.named=t}parse(t){if(!t)return;let e=t.match(hn);if(e)return Vr(parseInt(e[1],16));if(e=t.match(pn),e)return Vr(parseInt(e[1],10));if(e=t.match(fn),e)return this.named[e[1]]}};function Vr(t){return t===0||t>1114111||t>=55296&&t<=57343?"\uFFFD":String.fromCodePoint(dn[t]||t)}var mn=/[\t\n\f ]/,gn=/\r\n?/g;function P(t){return mn.test(t)}function bn(t){return t.replace(gn,`
`)}var yn=class{delegate;entityParser;mode;state="beforeData";line=-1;column=-1;input="";index=-1;tagNameBuffer="";constructor(t,e,r="precompile"){this.delegate=t,this.entityParser=e,this.mode=r,this.reset()}reset(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()}transitionTo(t){this.state=t}tokenize(t){this.reset(),this.tokenizePart(t),this.tokenizeEOF()}tokenizePart(t){for(this.input+=bn(t);this.index<this.input.length;){let e=this.states[this.state];if(e!==void 0)e.call(this);else throw new Error(`unhandled state ${this.state}`)}}tokenizeEOF(){this.flushData()}flushData(){this.state==="data"&&(this.delegate.finishData(),this.transitionTo("beforeData"))}peek(){return this.input.charAt(this.index)}consume(){let t=this.peek();return this.index++,t===`
`?(this.line++,this.column=0):this.column++,t}consumeCharRef(){let t=this.input.indexOf(";",this.index);if(t===-1)return;let e=this.input.slice(this.index,t),r=this.entityParser.parse(e);if(r){let s=e.length;for(;s;)this.consume(),s--;return this.consume(),r}}markTagStart(){this.delegate.tagOpen()}appendToTagName(t){this.tagNameBuffer+=t,this.delegate.appendToTagName(t)}isIgnoredEndTag(){let 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>"}states={beforeData(){let t=this.peek();if(t==="<"&&!this.isIgnoredEndTag())this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(this.mode==="precompile"&&t===`
`){let e=this.tagNameBuffer.toLowerCase();(e==="pre"||e==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data(){let t=this.peek(),e=this.tagNameBuffer;t==="<"&&!this.isIgnoredEndTag()?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):t==="&"&&e!=="script"&&e!=="style"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(t))},tagOpen(){let t=this.consume();t==="!"?this.transitionTo("markupDeclarationOpen"):t==="/"?this.transitionTo("endTagOpen"):P(t)||(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(t))},markupDeclarationOpen(){let t=this.consume();t==="-"&&this.peek()==="-"?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):t.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()==="DOCTYPE"&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype(){P(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName(){let t=this.consume();P(t)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(t.toLowerCase()))},doctypeName(){let t=this.consume();P(t)?this.transitionTo("afterDoctypeName"):t===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(t.toLowerCase())},afterDoctypeName(){let t=this.consume();if(!P(t))if(t===">")this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{let e=t.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),r=e.toUpperCase()==="PUBLIC",s=e.toUpperCase()==="SYSTEM";(r||s)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),r?this.transitionTo("afterDoctypePublicKeyword"):s&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword(){let t=this.peek();P(t)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):t==='"'?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):t==="'"?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):t===">"&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted(){let t=this.consume();t==='"'?this.transitionTo("afterDoctypePublicIdentifier"):t===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(t)},doctypePublicIdentifierSingleQuoted(){let t=this.consume();t==="'"?this.transitionTo("afterDoctypePublicIdentifier"):t===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(t)},afterDoctypePublicIdentifier(){let t=this.consume();P(t)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):t===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):t==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):t==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers(){let t=this.consume();P(t)||(t===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):t==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):t==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted(){let t=this.consume();t==='"'?this.transitionTo("afterDoctypeSystemIdentifier"):t===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(t)},doctypeSystemIdentifierSingleQuoted(){let t=this.consume();t==="'"?this.transitionTo("afterDoctypeSystemIdentifier"):t===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(t)},afterDoctypeSystemIdentifier(){let t=this.consume();P(t)||t===">"&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart(){let t=this.consume();t==="-"?this.transitionTo("commentStartDash"):t===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(t),this.transitionTo("comment"))},commentStartDash(){let t=this.consume();t==="-"?this.transitionTo("commentEnd"):t===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment(){let t=this.consume();t==="-"?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(t)},commentEndDash(){let t=this.consume();t==="-"?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+t),this.transitionTo("comment"))},commentEnd(){let t=this.consume();t===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+t),this.transitionTo("comment"))},tagName(){let t=this.consume();P(t)?this.transitionTo("beforeAttributeName"):t==="/"?this.transitionTo("selfClosingStartTag"):t===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(t)},endTagName(){let t=this.consume();P(t)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):t==="/"?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):t===">"?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(t)},beforeAttributeName(){let t=this.peek();if(P(t)){this.consume();return}else t==="/"?(this.transitionTo("selfClosingStartTag"),this.consume()):t===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):t==="="?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(t)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName(){let t=this.peek();P(t)?(this.transitionTo("afterAttributeName"),this.consume()):t==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):t==="="?(this.transitionTo("beforeAttributeValue"),this.consume()):t===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):t==='"'||t==="'"||t==="<"?(this.delegate.reportSyntaxError(t+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(t)):(this.consume(),this.delegate.appendToAttributeName(t))},afterAttributeName(){let t=this.peek();if(P(t)){this.consume();return}else t==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):t==="="?(this.consume(),this.transitionTo("beforeAttributeValue")):t===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(t))},beforeAttributeValue(){let t=this.peek();P(t)?this.consume():t==='"'?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):t==="'"?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):t===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(t))},attributeValueDoubleQuoted(){let t=this.consume();t==='"'?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):t==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(t)},attributeValueSingleQuoted(){let t=this.consume();t==="'"?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):t==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(t)},attributeValueUnquoted(){let t=this.peek();P(t)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):t==="/"?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):t==="&"?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):t===">"?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(t))},afterAttributeValueQuoted(){let t=this.peek();P(t)?(this.consume(),this.transitionTo("beforeAttributeName")):t==="/"?(this.consume(),this.transitionTo("selfClosingStartTag")):t===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag(){this.peek()===">"?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen(){let t=this.consume();P(t)||(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(t))}}},se=Object.freeze({line:1,column:0}),to=Object.freeze({source:"(synthetic)",start:se,end:se}),Wt=Object.freeze({source:"(nonexistent)",start:se,end:se}),te=Object.freeze({source:"(broken)",start:se,end:se}),G="CharPosition",z="HbsPosition",ar="InternalsSynthetic",ft="NonExistent",ne="Broken";function En(t){return t!==G&&t!==z}var Ve="MATCH_ANY",jt="IS_INVISIBLE",$t=class{_whens;constructor(e){this._whens=e}first(e){for(let r of this._whens){let s=r.match(e);if(mt(s))return s[0]}return null}},dt=class{_map=new Map;get(e,r){let s=this._map.get(e);return s||(s=r(),this._map.set(e,s),s)}add(e,r){this._map.set(e,r)}match(e){let r=Sn(e),s=[],n=this._map.get(r),i=this._map.get(Ve);return n&&s.push(n),i&&s.push(i),s}};function $r(t){return t(new Qt).validate()}var Qt=class{_whens=new dt;validate(){return(e,r)=>this.matchFor(e.kind,r.kind)(e,r)}matchFor(e,r){let s=this._whens.match(e);return mt(s),new $t(s).first(r)}when(e,r,s){return this._whens.get(e,()=>new dt).add(r,s),this}};function Sn(t){switch(t){case ne:case ar:case ft:return jt;default:return t}}var Fr=console;function Tn(t,e){return t}function wn(t,e="unexpected unreachable branch"){throw Fr.log("unreachable",t),Fr.log(`${e} :: ${JSON.stringify(t)} (${t})`),new Error("code reached unreachable")}var Jt=class t{static synthetic(e){let r=R.synthetic(e);return new t({loc:r,chars:e})}static load(e,r){return new t({loc:R.load(e,r[1]),chars:r[0]})}chars;loc;constructor(e){this.loc=e.loc,this.chars=e.chars}getString(){return this.chars}serialize(){return[this.chars,this.loc.serialize()]}},R=class t{static get NON_EXISTENT(){return new J(ft,Wt).wrap()}static load(e,r){if(typeof r=="number")return t.forCharPositions(e,r,r);if(typeof r=="string")return t.synthetic(r);if(Array.isArray(r))return t.forCharPositions(e,r[0],r[1]);if(r===ft)return t.NON_EXISTENT;if(r===ne)return t.broken(te);wn(r)}static forHbsLoc(e,r){let s=new ae(e,r.start),n=new ae(e,r.end);return new He(e,{start:s,end:n},r).wrap()}static forCharPositions(e,r,s){let n=new fe(e,r),i=new fe(e,s);return new Fe(e,{start:n,end:i}).wrap()}static synthetic(e){return new J(ar,Wt,e).wrap()}static broken(e=te){return new J(ne,e).wrap()}isInvisible;constructor(e){this.data=e,this.isInvisible=En(e.kind)}getStart(){return this.data.getStart().wrap()}getEnd(){return this.data.getEnd().wrap()}get loc(){let e=this.data.toHbsSpan();return e===null?te:e.toHbsLoc()}get module(){return this.data.getModule()}get startPosition(){return this.loc.start}get endPosition(){return this.loc.end}toJSON(){return this.loc}withStart(e){return K(e.data,this.data.getEnd())}withEnd(e){return K(this.data.getStart(),e.data)}asString(){return this.data.asString()}toSlice(e){let r=this.data.asString();return`${JSON.stringify(r)}${JSON.stringify(e)}`,new Jt({loc:this,chars:e||r})}get start(){return this.loc.start}set start(e){this.data.locDidUpdate({start:e})}get end(){return this.loc.end}set end(e){this.data.locDidUpdate({end:e})}get source(){return this.module}collapse(e){switch(e){case"start":return this.getStart().collapsed();case"end":return this.getEnd().collapsed()}}extend(e){return K(this.data.getStart(),e.data.getEnd())}serialize(){return this.data.serialize()}slice({skipStart:e=0,skipEnd:r=0}){return K(this.getStart().move(e).data,this.getEnd().move(-r).data)}sliceStartChars({skipStart:e=0,chars:r}){return K(this.getStart().move(e).data,this.getStart().move(e+r).data)}sliceEndChars({skipEnd:e=0,chars:r}){return K(this.getEnd().move(e-r).data,this.getStart().move(-e).data)}},Fe=class{kind=G;#e=null;constructor(e,r){this.source=e,this.charPositions=r}wrap(){return new R(this)}asString(){return this.source.slice(this.charPositions.start.charPos,this.charPositions.end.charPos)}getModule(){return this.source.module}getStart(){return this.charPositions.start}getEnd(){return this.charPositions.end}locDidUpdate(){}toHbsSpan(){let e=this.#e;if(e===null){let r=this.charPositions.start.toHbsPos(),s=this.charPositions.end.toHbsPos();r===null||s===null?e=this.#e=ie:e=this.#e=new He(this.source,{start:r,end:s})}return e===ie?null:e}serialize(){let{start:{charPos:e},end:{charPos:r}}=this.charPositions;return e===r?e:[e,r]}toCharPosSpan(){return this}},He=class{kind=z;#e=null;#t;constructor(e,r,s=null){this.source=e,this.hbsPositions=r,this.#t=s}serialize(){let e=this.toCharPosSpan();return e===null?ne:e.wrap().serialize()}wrap(){return new R(this)}updateProvided(e,r){this.#t&&(this.#t[r]=e),this.#e=null,this.#t={start:e,end:e}}locDidUpdate({start:e,end:r}){e!==void 0&&(this.updateProvided(e,"start"),this.hbsPositions.start=new ae(this.source,e,null)),r!==void 0&&(this.updateProvided(r,"end"),this.hbsPositions.end=new ae(this.source,r,null))}asString(){let e=this.toCharPosSpan();return e===null?"":e.asString()}getModule(){return this.source.module}getStart(){return this.hbsPositions.start}getEnd(){return this.hbsPositions.end}toHbsLoc(){return{start:this.hbsPositions.start.hbsPos,end:this.hbsPositions.end.hbsPos}}toHbsSpan(){return this}toCharPosSpan(){let e=this.#e;if(e===null){let r=this.hbsPositions.start.toCharPos(),s=this.hbsPositions.end.toCharPos();if(r&&s)e=this.#e=new Fe(this.source,{start:r,end:s});else return e=this.#e=ie,null}return e===ie?null:e}},J=class{constructor(e,r,s=null){this.kind=e,this.loc=r,this.string=s}serialize(){switch(this.kind){case ne:case ft:return this.kind;case ar:return this.string||""}}wrap(){return new R(this)}asString(){return this.string||""}locDidUpdate({start:e,end:r}){e!==void 0&&(this.loc.start=e),r!==void 0&&(this.loc.end=r)}getModule(){return"an unknown module"}getStart(){return new Ue(this.kind,this.loc.start)}getEnd(){return new Ue(this.kind,this.loc.end)}toCharPosSpan(){return this}toHbsSpan(){return null}toHbsLoc(){return te}},K=$r(t=>t.when(z,z,(e,r)=>new He(e.source,{start:e,end:r}).wrap()).when(G,G,(e,r)=>new Fe(e.source,{start:e,end:r}).wrap()).when(G,z,(e,r)=>{let s=r.toCharPos();return s===null?new J(ne,te).wrap():K(e,s)}).when(z,G,(e,r)=>{let s=e.toCharPos();return s===null?new J(ne,te).wrap():K(s,r)}).when(jt,Ve,e=>new J(e.kind,te).wrap()).when(Ve,jt,(e,r)=>new J(r.kind,te).wrap())),ie="BROKEN",Ce=class t{static forHbsPos(e,r){return new ae(e,r,null).wrap()}static broken(e=se){return new Ue(ne,e).wrap()}constructor(e){this.data=e}get offset(){let e=this.data.toCharPos();return e===null?null:e.offset}eql(e){return kn(this.data,e.data)}until(e){return K(this.data,e.data)}move(e){let r=this.data.toCharPos();if(r===null)return t.broken();{let s=r.offset+e;return r.source.validate(s)?new fe(r.source,s).wrap():t.broken()}}collapsed(){return K(this.data,this.data)}toJSON(){return this.data.toJSON()}},fe=class{kind=G;_locPos=null;constructor(e,r){this.source=e,this.charPos=r}toCharPos(){return this}toJSON(){let e=this.toHbsPos();return e===null?se:e.toJSON()}wrap(){return new Ce(this)}get offset(){return this.charPos}toHbsPos(){let e=this._locPos;if(e===null){let r=this.source.hbsPosFor(this.charPos);r===null?this._locPos=e=ie:this._locPos=e=new ae(this.source,r,this.charPos)}return e===ie?null:e}},ae=class{kind=z;_charPos;constructor(e,r,s=null){this.source=e,this.hbsPos=r,this._charPos=s===null?null:new fe(e,s)}toCharPos(){let e=this._charPos;if(e===null){let r=this.source.charPosFor(this.hbsPos);r===null?this._charPos=e=ie:this._charPos=e=new fe(this.source,r)}return e===ie?null:e}toJSON(){return this.hbsPos}wrap(){return new Ce(this)}toHbsPos(){return this}},Ue=class{constructor(e,r){this.kind=e,this.pos=r}toCharPos(){return null}toJSON(){return this.pos}wrap(){return new Ce(this)}get offset(){return null}},kn=$r(t=>t.when(z,z,({hbsPos:e},{hbsPos:r})=>e.column===r.column&&e.line===r.line).when(G,G,({charPos:e},{charPos:r})=>e===r).when(G,z,({offset:e},r)=>e===r.toCharPos()?.offset).when(z,G,(e,{offset:r})=>e.toCharPos()?.offset===r).when(Ve,Ve,()=>!1));function Nn(t,...e){}var qe=class t{static from(e,r={}){return new t(e,r.meta?.moduleName)}#e;constructor(e,r="an unknown module"){this.source=e,this.module=r,Nn("syntax:source",this),this.#e=xn(e)}validate(e){return e>=0&&e<=this.source.length}slice(e,r){return this.source.slice(e,r)}offsetFor(e,r){return Ce.forHbsPos(this,{line:e,column:r})}spanFor({start:e,end:r}){return R.forHbsLoc(this,{start:{line:e.line,column:e.column},end:{line:r.line,column:r.column}})}hbsPosFor(e){if(e<0||e>this.source.length)return null;let r=Pn(this.#e,e);return{line:r+1,column:e-this.#t(r)}}charPosFor({line:e,column:r}){let s=e-1;if(s<0||s>this.#e.length||r<0)return null;let n=s===0?0:this.#e[s-1]+1,i=this.#e[s]??this.source.length,a=n+r;return a<=i?a:i}#t(e){if(e===0)return 0;let r=this.#e[e-1];return r===void 0?0:r+1}};function xn(t){let e=[];for(let r=t.indexOf(`
`);r!==-1;r=t.indexOf(`
`,r+1))e.push(r);return e}function Pn(t,e){let r=0,s=t.length;for(;r<s;){let n=r+s>>>1;t[n]<e?r=n+1:s=n}return r}function y(t,e){let{module:r,loc:s}=e,{line:n,column:i}=s.start,a=e.asString(),o=a?`
|
| ${a.split(`
`).join(`
| `)}
|
`:"",l=new Error(`${t}: ${o}(error occurred in '${r}' @ line ${n} : column ${i})`);return l.name="SyntaxError",l.location=e,l.code=a,l}var gt={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"]},or=(function(){t.prototype=Object.create(Error.prototype),t.prototype.constructor=t;function t(e,r,s,n){let i=Error.call(this,e);this.key=n,this.message=e,this.node=r,this.parent=s,i.stack&&(this.stack=i.stack)}return t})();function Hr(t,e,r){return new or("Cannot remove a node unless it is part of an array",t,e,r)}function An(t,e,r){return new or("Cannot replace a node with multiple nodes unless it is part of an array",t,e,r)}function Ur(t,e){return new or("Replacing and removing in key handlers is not yet supported.",t,null,e)}var _e=class{node;parent;parentKey;constructor(e,r=null,s=null){this.node=e,this.parent=r,this.parentKey=s}get parentNode(){return this.parent?this.parent.node:null}parents(){return{[Symbol.iterator]:()=>new Xt(this)}}},Xt=class{path;constructor(e){this.path=e}next(){return this.path.parent?(this.path=this.path.parent,{done:!1,value:this.path}):{done:!0,value:null}}};function Qr(t){return typeof t=="function"?t:t.enter}function Jr(t){if(typeof t!="function")return t.exit}function vn(t,e){let r=typeof t!="function"?t.keys:void 0;if(r===void 0)return;let s=r[e];return s!==void 0?s:r.All}function Cn(t,e){if(t.Program&&(e==="Template"&&!t.Template||e==="Block"&&!t.Block))return t.Program;let r=t[e];return r!==void 0?r:t.All}function bt(t,e){let{node:r,parent:s,parentKey:n}=e,i=Cn(t,r.type),a,o;i!==void 0&&(a=Qr(i),o=Jr(i));let l;if(a!==void 0&&(l=a(r,e)),l!=null)if(JSON.stringify(r)===JSON.stringify(l))l=void 0;else{if(Array.isArray(l))return Xr(t,l,s,n),l;{let h=new _e(l,s,n);return bt(t,h)||l}}if(l===void 0){let h=gt[r.type];for(let g=0;g<h.length;g++){let E=h[g];Ln(t,i,e,E)}o!==void 0&&(l=o(r,e))}return l}function _n(t,e){return t[e]}function Mr(t,e,r){t[e]=r}function Ln(t,e,r,s){let{node:n}=r,i=_n(n,s);if(!i)return;let a,o;if(e!==void 0){let l=vn(e,s);l!==void 0&&(a=Qr(l),o=Jr(l))}if(a!==void 0&&a(n,s)!==void 0)throw Ur(n,s);if(Array.isArray(i))Xr(t,i,r,s);else{let l=new _e(i,r,s),h=bt(t,l);h!==void 0&&On(n,s,i,h)}if(o!==void 0&&o(n,s)!==void 0)throw Ur(n,s)}function Xr(t,e,r,s){for(let n=0;n<e.length;n++){let i=e[n],a=new _e(i,r,s),o=bt(t,a);o!==void 0&&(n+=Dn(e,n,o)-1)}}function On(t,e,r,s){if(s===null)throw Hr(r,t,e);if(Array.isArray(s))if(s.length===1)Mr(t,e,s[0]);else throw s.length===0?Hr(r,t,e):An(r,t,e);else Mr(t,e,s)}function Dn(t,e,r){return r===null?(t.splice(e,1),0):Array.isArray(r)?(t.splice(e,1,...r),r.length):(t.splice(e,1,r),1)}function In(t,e){let r=new _e(t);bt(e,r)}function Bn(t){switch(t.type){case"Block":case"Template":return t.body;case"ElementNode":return t.children}}function ve(t,e){Bn(t).push(e)}function Zr(t){return t.type==="StringLiteral"||t.type==="BooleanLiteral"||t.type==="NumberLiteral"||t.type==="NullLiteral"||t.type==="UndefinedLiteral"}function Rn(t){return t.type==="UndefinedLiteral"?"undefined":JSON.stringify(t.value)}var qn={};function Vn({path:t,params:e,hash:r,trusting:s,strip:n,loc:i}){let a={type:"MustacheStatement",path:t,params:e,hash:r,trusting:s,strip:n,loc:i};return Object.defineProperty(a,"escaped",{enumerable:!1,get(){return!this.trusting},set(o){this.trusting=!o}}),a}function Fn({head:t,tail:e,loc:r}){let s={type:"PathExpression",head:t,tail:e,get original(){let n=this.head.original;return this.tail.length===0?n:`${n}.${this.tail.join(".")}`},set original(n){let[i,...a]=pt(n.split("."));this.head=qn.head(i,this.head.loc),this.tail=a},loc:r};return Object.defineProperty(s,"parts",{enumerable:!1,get(){let n=pt(this.original.split("."));return n[0]==="this"?n.shift():n[0].startsWith("@")&&(n[0]=n[0].slice(1)),Object.freeze(n)},set(n){let i=[...n];i[0]!=="this"&&!i[0]?.startsWith("@")&&(this.head.type==="ThisHead"?i.unshift("this"):this.head.type==="AtHead"&&(i[0]=`@${i[0]}`)),this.original=i.join(".")}}),Object.defineProperty(s,"this",{enumerable:!1,get(){return this.head.type==="ThisHead"}}),Object.defineProperty(s,"data",{enumerable:!1,get(){return this.head.type==="AtHead"}}),s}function Hn({type:t,value:e,loc:r}){let s={type:t,value:e,loc:r};return Object.defineProperty(s,"original",{enumerable:!1,get(){return this.value},set(n){this.value=n}}),s}var ut={close:!1,open:!1},Zt=class{pos({line:e,column:r}){return{line:e,column:r}}blockItself({body:e,params:r,chained:s=!1,loc:n}){return{type:"Block",body:e,params:r,get blockParams(){return this.params.map(i=>i.name)},set blockParams(i){this.params=i.map(a=>T.var({name:a,loc:R.synthetic(a)}))},chained:s,loc:n}}template({body:e,blockParams:r,loc:s}){return{type:"Template",body:e,blockParams:r,loc:s}}mustache({path:e,params:r,hash:s,trusting:n,loc:i,strip:a=ut}){return Vn({path:e,params:r,hash:s,trusting:n,strip:a,loc:i})}block({path:e,params:r,hash:s,defaultBlock:n,elseBlock:i=null,loc:a,openStrip:o=ut,inverseStrip:l=ut,closeStrip:h=ut}){return{type:"BlockStatement",path:e,params:r,hash:s,program:n,inverse:i,loc:a,openStrip:o,inverseStrip:l,closeStrip:h}}comment({value:e,loc:r}){return{type:"CommentStatement",value:e,loc:r}}mustacheComment({value:e,loc:r}){return{type:"MustacheCommentStatement",value:e,loc:r}}concat({parts:e,loc:r}){return{type:"ConcatStatement",parts:e,loc:r}}element({path:e,selfClosing:r,attributes:s,modifiers:n,params:i,comments:a,children:o,openTag:l,closeTag:h,loc:g}){let E=r;return{type:"ElementNode",path:e,attributes:s,modifiers:n,params:i,comments:a,children:o,openTag:l,closeTag:h,loc:g,get tag(){return this.path.original},set tag(d){this.path.original=d},get blockParams(){return this.params.map(d=>d.name)},set blockParams(d){this.params=d.map(w=>T.var({name:w,loc:R.synthetic(w)}))},get selfClosing(){return E},set selfClosing(d){E=d,d?this.closeTag=null:this.closeTag=R.synthetic(`</${this.tag}>`)}}}elementModifier({path:e,params:r,hash:s,loc:n}){return{type:"ElementModifierStatement",path:e,params:r,hash:s,loc:n}}attr({name:e,value:r,loc:s}){return{type:"AttrNode",name:e,value:r,loc:s}}text({chars:e,loc:r}){return{type:"TextNode",chars:e,loc:r}}sexpr({path:e,params:r,hash:s,loc:n}){return{type:"SubExpression",path:e,params:r,hash:s,loc:n}}path({head:e,tail:r,loc:s}){return Fn({head:e,tail:r,loc:s})}head({original:e,loc:r}){return e==="this"?this.this({loc:r}):e[0]==="@"?this.atName({name:e,loc:r}):this.var({name:e,loc:r})}this({loc:e}){return{type:"ThisHead",get original(){return"this"},loc:e}}atName({name:e,loc:r}){let s="",n={type:"AtHead",get name(){return s},set name(i){i[0],i.indexOf("."),s=i},get original(){return this.name},set original(i){this.name=i},loc:r};return n.name=e,n}var({name:e,loc:r}){let s="",n={type:"VarHead",get name(){return s},set name(i){i[0],i.indexOf("."),s=i},get original(){return this.name},set original(i){this.name=i},loc:r};return n.name=e,n}hash({pairs:e,loc:r}){return{type:"Hash",pairs:e,loc:r}}pair({key:e,value:r,loc:s}){return{type:"HashPair",key:e,value:r,loc:s}}literal({type:e,value:r,loc:s}){return Hn({type:e,value:r,loc:s})}},T=new Zt,er=class{elementStack=[];lines;source;currentAttribute=null;currentNode=null;tokenizer;constructor(e,r=new jr(un),s="precompile"){this.source=e,this.lines=e.source.split(/\r\n?|\n/u),this.tokenizer=new yn(this,r,s)}offset(){let{line:e,column:r}=this.tokenizer;return this.source.offsetFor(e,r)}pos({line:e,column:r}){return this.source.offsetFor(e,r)}finish(e){return zr({},e,{loc:e.start.until(this.offset())})}get currentAttr(){return Tn(this.currentAttribute)}get currentTag(){let e=this.currentNode;return e&&(e.type==="StartTag"||e.type),e}get currentStartTag(){let e=this.currentNode;return e&&e.type,e}get currentEndTag(){let e=this.currentNode;return e&&e.type,e}get currentComment(){let e=this.currentNode;return e&&e.type,e}get currentData(){let e=this.currentNode;return e&&e.type,e}acceptNode(e){return this[e.type](e)}currentElement(){return nr(pt(this.elementStack))}sourceForNode(e,r){let s=e.loc.start.line-1,n=s-1,i=e.loc.start.column,a=[],o,l,h;for(r?(l=r.loc.end.line-1,h=r.loc.end.column):(l=e.loc.end.line-1,h=e.loc.end.column);n<l;)n++,o=this.lines[n],n===s?s===l?a.push(o.slice(i,h)):a.push(o.slice(i)):n===l?a.push(o.slice(0,h)):a.push(o);return a.join(`
`)}},tr=class extends er{pendingError=null;parse(e,r){e.loc;let s=T.template({body:[],blockParams:r,loc:this.source.spanFor(e.loc)}),n=this.parseProgram(s,e);return this.pendingError?.eof(n.loc.getEnd()),n}Program(e,r){e.loc;let s=T.blockItself({body:[],params:r,chained:e.chained,loc:this.source.spanFor(e.loc)});return this.parseProgram(s,e)}parseProgram(e,r){if(r.body.length===0)return e;let s;try{this.elementStack.push(e);for(let n of r.body)this.acceptNode(n)}finally{s=this.elementStack.pop()}if(e!==s){if(s?.type==="ElementNode")throw y(`Unclosed element \`${s.tag}\``,s.loc);`${e.type}`}return e}BlockStatement(e){if(e.loc,this.appendToHtmlComment(e))return;if(this.tokenizer.state!=="data"&&this.tokenizer.state!=="beforeData")throw y("A block may only be used inside an HTML element or another block.",this.source.spanFor(e.loc));if(e.program===void 0)throw y("Inverse sections (`{{^foo}}...{{/foo}}`) are not supported. Use `{{#unless foo}}...{{/unless}}` instead",this.source.spanFor(e.loc));let{path:r,params:s,hash:n}=Ut(this,e),i=this.source.spanFor(e.loc),a=[],o;if(e.program.blockParams?.length){let d=n.loc.collapse("end");e.program.loc?d=d.withEnd(this.source.spanFor(e.program.loc).getStart()):e.program.body[0]?d=d.withEnd(this.source.spanFor(e.program.body[0].loc).getStart()):d=d.withEnd(i.getEnd()),o=Yr(this.source,e,d);let w=d.asString(),N=w.indexOf("|")+1,q=w.indexOf("|",N);for(let L of e.program.blockParams){let v,O;N>=q?v=-1:v=w.indexOf(L,N),v===-1||v+L.length>q?(N=q,O=this.source.spanFor(Wt)):(N=v,O=d.sliceStartChars({skipStart:N,chars:L.length}),N+=L.length),a.push(T.var({name:L,loc:O}))}}else o=Yr(this.source,e,i);let l=this.Program(o.program,a),h=o.inverse?this.Program(o.inverse,[]):null,g=T.block({path:r,params:s,hash:n,defaultBlock:l,elseBlock:h,loc:this.source.spanFor(e.loc),openStrip:e.openStrip,inverseStrip:e.inverseStrip,closeStrip:e.closeStrip}),E=this.currentElement();ve(E,g)}MustacheStatement(e){this.pendingError?.mustache(this.source.spanFor(e.loc));let{tokenizer:r}=this;if(this.appendToHtmlComment(e))return;let s,{escaped:n,loc:i,strip:a}=e;if("original"in e.path&&e.path.original==="...attributes")throw y("Illegal use of ...attributes",this.source.spanFor(e.loc));if(Zr(e.path))s=T.mustache({path:this.acceptNode(e.path),params:[],hash:T.hash({pairs:[],loc:this.source.spanFor(e.path.loc).collapse("end")}),trusting:!n,loc:this.source.spanFor(i),strip:a});else{let{path:o,params:l,hash:h}=Ut(this,e);s=T.mustache({path:o,params:l,hash:h,trusting:!n,loc:this.source.spanFor(i),strip:a})}switch(r.state){case"tagOpen":case"tagName":case"endTagOpen":case"endTagName":throw y("Cannot use mustaches in an elements tagname",s.loc);case"beforeAttributeName":case"selfClosingStartTag":this.assertNotInEndTag("mustaches",s.loc),Mt(this.currentStartTag,s),r.transitionTo("beforeAttributeName");break;case"attributeName":case"afterAttributeName":this.assertNotInEndTag("mustaches",s.loc),this.beginAttributeValue(!1),this.finishAttributeValue(),Mt(this.currentStartTag,s),r.transitionTo("beforeAttributeName");break;case"afterAttributeValueQuoted":Mt(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;case"beforeData":case"data":ve(this.currentElement(),s);break;default:throw y(`Using a Handlebars mustache when in the \`${r.state}\` state is not supported`,s.loc)}return s}appendToHtmlComment(e){let r;switch(this.tokenizer.state){case"comment":case"commentStart":r="";break;case"commentStartDash":case"commentEndDash":r="-";break;case"commentEnd":r="--";break;default:return!1}return this.appendToCommentData(r+this.sourceForNode(e)),this.tokenizer.transitionTo("comment"),!0}assertNotInEndTag(e,r){if(this.currentTag.type==="EndTag")throw y(`Invalid end tag: closing tag must not contain ${e}`,r)}appendDynamicAttributeValuePart(e){this.finalizeTextPart();let r=this.currentAttr;r.isDynamic=!0,r.parts.push(e)}finalizeTextPart(){let r=this.currentAttr.currentPart;r!==null&&(this.currentAttr.parts.push(r),this.startTextPart())}startTextPart(){this.currentAttr.currentPart=null}ContentStatement(e){Mn(this.tokenizer,e),this.tokenizer.tokenizePart(e.value),this.tokenizer.flushData()}CommentStatement(e){let{tokenizer:r}=this;if(this.appendToHtmlComment(e))return null;let{value:s,loc:n}=e,i=T.mustacheComment({value:s,loc:this.source.spanFor(n)});switch(r.state){case"beforeAttributeName":case"afterAttributeName":this.assertNotInEndTag("Handlebars comments",i.loc),this.currentStartTag.comments.push(i);break;case"beforeData":case"data":ve(this.currentElement(),i);break;default:throw y(`Using a Handlebars comment when in the \`${r.state}\` state is not supported`,this.source.spanFor(e.loc))}return i}PartialStatement(e){throw y("Handlebars partials are not supported",this.source.spanFor(e.loc))}PartialBlockStatement(e){throw y("Handlebars partial blocks are not supported",this.source.spanFor(e.loc))}Decorator(e){throw y("Handlebars decorators are not supported",this.source.spanFor(e.loc))}DecoratorBlock(e){throw y("Handlebars decorator blocks are not supported",this.source.spanFor(e.loc))}SubExpression(e){let{path:r,params:s,hash:n}=Ut(this,e);return T.sexpr({path:r,params:s,hash:n,loc:this.source.spanFor(e.loc)})}HashLiteral(e){throw y("Hash literals are not supported. Use named arguments (`{{helper foo=bar}}`) or the `hash` helper (`(hash foo=bar)`) instead",this.source.spanFor(e.loc))}PathExpression(e){let{original:r}=e,s;if(typeof e.head=="object")throw y('A path cannot start with a sub-expression. Use the `get` helper (`(get (foo) "bar")`) instead',this.source.spanFor(e.loc));if(r.indexOf("/")!==-1){if(r.slice(0,2)==="./")throw y('Using "./" is not supported in Glimmer and unnecessary',this.source.spanFor(e.loc));if(r.slice(0,3)==="../")throw y('Changing context using "../" is not supported in Glimmer',this.source.spanFor(e.loc));if(r.indexOf(".")!==-1)throw y("Mixing '.' and '/' in paths is not supported in Glimmer; use only '.' to separate property paths",this.source.spanFor(e.loc));s=[e.parts.join("/")]}else{if(r===".")throw y("'.' is not a supported path in Glimmer; check for a path with a trailing '.'",this.source.spanFor(e.loc));s=e.parts}let n=!1;/^this(?:\..+)?$/u.test(r)&&(n=!0);let i;if(n)i=T.this({loc:this.source.spanFor({start:e.loc.start,end:{line:e.loc.start.line,column:e.loc.start.column+4}})});else if(e.data){let a=s.shift();if(a===void 0)throw y("Attempted to parse a path expression, but it was not valid. Paths beginning with @ must start with a-z.",this.source.spanFor(e.loc));i=T.atName({name:`@${a}`,loc:this.source.spanFor({start:e.loc.start,end:{line:e.loc.start.line,column:e.loc.start.column+a.length+1}})})}else{let a=s.shift();if(a===void 0)throw y("Attempted to parse a path expression, but it was not valid. Paths must start with a-z or A-Z.",this.source.spanFor(e.loc));i=T.var({name:a,loc:this.source.spanFor({start:e.loc.start,end:{line:e.loc.start.line,column:e.loc.start.column+a.length}})})}return T.path({head:i,tail:s,loc:this.source.spanFor(e.loc)})}Hash(e){let r=e.pairs.map(s=>T.pair({key:s.key,value:this.acceptNode(s.value),loc:this.source.spanFor(s.loc)}));return T.hash({pairs:r,loc:this.source.spanFor(e.loc)})}StringLiteral(e){return T.literal({type:"StringLiteral",value:e.value,loc:this.source.spanFor(e.loc)})}BooleanLiteral(e){return T.literal({type:"BooleanLiteral",value:e.value,loc:this.source.spanFor(e.loc)})}NumberLiteral(e){return T.literal({type:"NumberLiteral",value:e.value,loc:this.source.spanFor(e.loc)})}UndefinedLiteral(e){return T.literal({type:"UndefinedLiteral",value:void 0,loc:this.source.spanFor(e.loc)})}NullLiteral(e){return T.literal({type:"NullLiteral",value:null,loc:this.source.spanFor(e.loc)})}};function Un(t,e){if(e==="")return{lines:t.split(`
`).length-1,columns:0};let[r]=t.split(e),s=r.split(/\n/u),n=s.length-1;return{lines:n,columns:s[n].length}}function Mn(t,e){let r=e.loc.start.line,s=e.loc.start.column,n=Un(e.original,e.value);r=r+n.lines,n.lines?s=n.columns:s=s+n.columns,t.line=r,t.column=s}function Ut(t,e){let r;switch(e.path.type){case"PathExpression":r=t.PathExpression(e.path);break;case"SubExpression":r=t.SubExpression(e.path);break;case"HashLiteral":return t.HashLiteral(e.path);case"StringLiteral":case"UndefinedLiteral":case"NullLiteral":case"NumberLiteral":case"BooleanLiteral":{let a;throw e.path.type==="BooleanLiteral"?a=e.path.original.toString():e.path.type==="StringLiteral"?a=`"${e.path.original}"`:e.path.type==="NullLiteral"?a="null":e.path.type==="NumberLiteral"?a=e.path.value.toString():a="undefined",y(`${e.path.type} "${e.path.type==="StringLiteral"?e.path.original:a}" cannot be called as a sub-expression, replace (${a}) with ${a}`,t.source.spanFor(e.path.loc))}}let s=e.params.map(a=>t.acceptNode(a)),n=mt(s)?nr(s).loc:r.loc,i=e.hash?t.Hash(e.hash):T.hash({pairs:[],loc:t.source.spanFor(n).collapse("end")});return{path:r,params:s,hash:i}}function Mt(t,e){let{path:r,params:s,hash:n,loc:i}=e;if(Zr(r)){let o=`{{${Rn(r)}}}`,l=`<${t.name} ... ${o} ...`;throw y(`In ${l}, ${o} is not a valid modifier`,e.loc)}let a=T.elementModifier({path:r,params:s,hash:n,loc:i});t.modifiers.push(a)}function Yr(t,e,r){if(!e.program.loc){let n=F(0,e.program.body,0),i=F(0,e.program.body,-1);if(n&&i)e.program.loc={...n.loc,end:i.loc.end};else{let a=t.spanFor(e.loc);e.program.loc=r.withEnd(a.getEnd())}}let s=t.spanFor(e.program.loc).getEnd();return e.inverse&&!e.inverse.loc&&(e.inverse.loc=s.collapsed()),e}function Ae(t){return/[\t\n\f ]/u.test(t)}var rr=class extends tr{tagOpenLine=0;tagOpenColumn=0;reset(){this.currentNode=null}beginComment(){this.currentNode={type:"CommentStatement",value:"",start:this.source.offsetFor(this.tagOpenLine,this.tagOpenColumn)}}appendToCommentData(e){this.currentComment.value+=e}finishComment(){ve(this.currentElement(),T.comment(this.finish(this.currentComment)))}beginData(){this.currentNode={type:"TextNode",chars:"",start:this.offset()}}appendToData(e){this.currentData.chars+=e}finishData(){ve(this.currentElement(),T.text(this.finish(this.currentData)))}tagOpen(){this.tagOpenLine=this.tokenizer.line,this.tagOpenColumn=this.tokenizer.column}beginStartTag(){this.currentNode={type:"StartTag",name:"",nameStart:null,nameEnd:null,attributes:[],modifiers:[],comments:[],params:[],selfClosing:!1,start:this.source.offsetFor(this.tagOpenLine,this.tagOpenColumn)}}beginEndTag(){this.currentNode={type:"EndTag",name:"",start:this.source.offsetFor(this.tagOpenLine,this.tagOpenColumn)}}finishTag(){let e=this.finish(this.currentTag);if(e.type==="StartTag"){if(this.finishStartTag(),e.name===":")throw y("Invalid named block named detected, you may have created a named block without a name, or you may have began your name with a number. Named blocks must have names that are at least one character long, and begin with a lower case letter",this.source.spanFor({start:this.currentTag.start.toJSON(),end:this.offset().toJSON()}));(Yt.has(e.name)||e.selfClosing)&&this.finishEndTag(!0)}else e.type,`${e.type}`,this.finishEndTag(!1)}finishStartTag(){let{name:e,nameStart:r,nameEnd:s}=this.currentStartTag,n=r.until(s),[i,...a]=pt(e.split(".")),o=T.path({head:T.head({original:i,loc:n.sliceStartChars({chars:i.length})}),tail:a,loc:n}),{attributes:l,modifiers:h,comments:g,params:E,selfClosing:d,loc:w}=this.finish(this.currentStartTag),N=T.element({path:o,selfClosing:d,attributes:l,modifiers:h,comments:g,params:E,children:[],openTag:w,closeTag:d?null:R.broken(),loc:w});this.elementStack.push(N)}finishEndTag(e){let{start:r}=this.currentTag,s=this.finish(this.currentTag),n=this.elementStack.pop();this.validateEndTag(s,n,e);let i=this.currentElement();e?n.closeTag=null:n.selfClosing?(n.closeTag,void 0):n.closeTag=r.until(this.offset()),n.loc=n.loc.withEnd(this.offset()),ve(i,T.element(n))}markTagAsSelfClosing(){let e=this.currentTag;if(e.type==="StartTag")e.selfClosing=!0;else throw y("Invalid end tag: closing tag must not be self-closing",this.source.spanFor({start:e.start.toJSON(),end:this.offset().toJSON()}))}appendToTagName(e){let r=this.currentTag;if(r.name+=e,r.type==="StartTag"){let s=this.offset();r.nameStart===null&&(r.nameEnd,r.nameStart=s.move(-1)),r.nameEnd=s}}beginAttribute(){let e=this.offset();this.currentAttribute={name:"",parts:[],currentPart:null,isQuoted:!1,isDynamic:!1,start:e,valueSpan:e.collapsed()}}appendToAttributeName(e){this.currentAttr.name+=e,this.currentAttr.name==="as"&&this.parsePossibleBlockParams()}beginAttributeValue(e){this.currentAttr.isQuoted=e,this.startTextPart(),this.currentAttr.valueSpan=this.offset().collapsed()}appendToAttributeValue(e){let r=this.currentAttr.parts,s=r[r.length-1],n=this.currentAttr.currentPart;if(n)n.chars+=e,n.loc=n.loc.withEnd(this.offset());else{let i=this.offset();e===`
`?i=s?s.loc.getEnd():this.currentAttr.valueSpan.getStart():i=i.move(-1),this.currentAttr.currentPart=T.text({chars:e,loc:i.collapsed()})}}finishAttributeValue(){this.finalizeTextPart();let e=this.currentTag,r=this.offset();if(e.type==="EndTag")throw y("Invalid end tag: closing tag must not have attributes",this.source.spanFor({start:e.start.toJSON(),end:r.toJSON()}));let{name:s,parts:n,start:i,isQuoted:a,isDynamic:o,valueSpan:l}=this.currentAttr;if(s.startsWith("|")&&n.length===0&&!a&&!o)throw y("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=l.withEnd(r);let g=T.attr({name:s,value:h,loc:i.until(r)});this.currentStartTag.attributes.push(g)}parsePossibleBlockParams(){let e=/[!"#%&'()*+./;<=>@[\\\]^`{|}~]/u;this.tokenizer.state;let r=this.currentStartTag,s=this.currentAttr,n={state:"PossibleAs"},i={PossibleAs:o=>{if(n.state,Ae(o))n={state:"BeforeStartPipe"},this.tokenizer.transitionTo("afterAttributeName"),this.tokenizer.consume();else{if(o==="|")throw y('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,Ae(o)?this.tokenizer.consume():o==="|"?(n={state:"BeforeBlockParamName"},this.tokenizer.transitionTo("beforeAttributeName"),this.tokenizer.consume()):n={state:"Done"}},BeforeBlockParamName:o=>{if(n.state,Ae(o))this.tokenizer.consume();else if(o==="")n={state:"Done"},this.pendingError={mustache(l){throw y("Invalid block parameters syntax: mustaches cannot be used inside parameters list",l)},eof(l){throw y('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(l))}};else if(o==="|"){if(r.params.length===0)throw y("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 y('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(l){throw y("Invalid block parameters syntax: mustaches cannot be used inside parameters list",l)},eof(l){throw y('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(l))}};else if(o==="|"||Ae(o)){let l=n.start.until(this.offset());if(n.name==="this"||e.test(n.name))throw y(`Invalid block parameters syntax: invalid identifier name \`${n.name}\``,l);r.params.push(T.var({name:n.name,loc:l})),n=o==="|"?{state:"AfterEndPipe"}:{state:"BeforeBlockParamName"},this.tokenizer.consume()}else{if(o===">"||o==="/")throw y('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,Ae(o)?this.tokenizer.consume():o===""?(n={state:"Done"},this.pendingError={mustache(l){throw y("Invalid block parameters syntax: modifiers cannot follow parameters list",l)},eof(l){throw y('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',s.start.until(l))}}):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===">"||Ae(o))throw y(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(e){throw y(e,this.offset().collapsed())}assembleConcatenatedValue(e){let r=Qs(e),s=nr(e);return T.concat({parts:e,loc:this.source.spanFor(r.loc).extend(this.source.spanFor(s.loc))})}validateEndTag(e,r,s){if(Yt.has(e.name)&&!s)throw y(`<${e.name}> elements do not need end tags. You should remove it`,e.loc);if(r.type!=="ElementNode")throw y(`Closing tag </${e.name}> without an open tag`,e.loc);if(r.tag!==e.name)throw y(`Closing tag </${e.name}> did not match last open tag <${r.tag}> (on line ${r.loc.startPosition.line})`,e.loc)}assembleAttributeValue(e,r,s,n){if(s){if(r)return this.assembleConcatenatedValue(e);{let[i,a]=e;if(a===void 0||a.type==="TextNode"&&a.chars==="/")return i;throw y("An unquoted attribute value must be a string or a mustache, preceded by whitespace or a '=' character, and followed by whitespace, a '>' character, or '/>'",n)}}else return mt(e)?e[0]:T.text({chars:"",loc:n})}},Yn={},sr=class extends jr{constructor(){super({})}parse(){}};function es(t,e={}){let r=e.mode||"precompile",s,n;typeof t=="string"?(s=new qe(t,e.meta?.moduleName),r==="codemod"?n=Kt(t,e.parseOptions):n=qr(t,e.parseOptions)):t instanceof qe?(s=t,r==="codemod"?n=Kt(t.source,e.parseOptions):n=qr(t.source,e.parseOptions)):(s=new qe("",e.meta?.moduleName),n=t);let i;r==="codemod"&&(i=new sr);let a=R.forCharPositions(s,0,s.source.length);n.loc={source:"(program)",start:a.startPosition,end:a.endPosition};let o=new rr(s,i,r).parse(n,e.locals??[]);if(e.plugins?.ast)for(let l of e.plugins.ast){let h=zr({},e,{syntax:Yn},{plugins:void 0}),g=l(h);In(o,g.visitor)}return o}var Gn=new Set(Gr());function rs(t){return t.toUpperCase()===t}function zn(t){return t.type==="ElementNode"&&typeof t.tag=="string"&&!t.tag.startsWith(":")&&(rs(t.tag[0])||t.tag.includes("."))}function Kn(t){return Gn.has(t.toLowerCase())&&!rs(t[0])}function lr(t){return t.selfClosing===!0||Kn(t.tag)||zn(t)&&t.children.every(e=>yt(e))}function yt(t){return t.type==="TextNode"&&!/\S/.test(t.chars)}function Wn(t){return t.type==="ElementNode"&&t.children.length===1&&t.children[0].type==="TextNode"}function de(t){return Wn(t)&&(t.tag==="style"||t.tag==="script")}function ts(t){return t?.type==="MustacheCommentStatement"&&typeof t.value=="string"&&t.value.trim()==="prettier-ignore"}function ss(t){return ts(t.node)||t.isInArray&&(t.key==="children"||t.key==="body"||t.key==="parts")&&ts(t.siblings[t.index-2])}function cr(t,e){return t.attributes.find(r=>r.type==="AttrNode"&&r.name===e)}function ns(t){return t.value.type==="TextNode"?t.value.chars:void 0}function jn(t){if(cr(t,"src"))return;let e=cr(t,"type"),r=e?ns(e):void 0;if(!e||r==="module"||r==="text/javascript")return{parser:"babel",__embeddedInHtml:!0,__babelSourceType:r==="module"?"module":"script"}}function $n(t){let e=cr(t,"lang");if(!e||ns(e)==="css")return{parser:"css"}}function Qn(t){let{node:e}=t;if(e.type!=="TextNode")return;let{parent:r}=t;if(!(de(r)&&r.children[0]===e))return;let s=r.tag==="style"?$n(r):jn(r);if(s)return async n=>{let i=e.chars;return i.trim()?await n(i,s):""}}var is=Qn;var Me=null;function Ye(t){if(Me!==null&&typeof Me.property){let e=Me;return Me=Ye.prototype=null,e}return Me=Ye.prototype=t??Object.create(null),new Ye}var Jn=10;for(let t=0;t<=Jn;t++)Ye();function ur(t){return Ye(t)}function Xn(t,e="type"){ur(t);function r(s){let n=s[e],i=t[n];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${n}'.`),{node:s});return i}return r}var as=Xn;var Zn=as(gt),os=Zn;var me=t=>t.loc.start.offset,Ge=t=>t.loc.end.offset;function hr(t,e,r){if(t.type==="TextNode"){let s=t.chars.trim();if(!s)return null;de(r)&&r.children[0]===t?e.chars="":e.chars=B.split(s).join(" ")}t.type==="ElementNode"&&(delete e.startTag,delete e.openTag,delete e.parts,delete e.endTag,delete e.closeTag,delete e.nameNode,delete e.body,delete e.blockParamNodes,delete e.params,delete e.path),t.type==="Block"&&(delete e.blockParamNodes,delete e.params),t.type==="AttrNode"&&t.name.toLowerCase()==="class"&&delete e.value,t.type==="PathExpression"&&(e.head=t.head.original)}hr.ignoredProperties=new Set(["loc","selfClosing"]);var ds=2;function ei(t,e,r){let{node:s}=t;switch(s.type){case"Block":case"Program":case"Template":return I(t.map(r,"body"));case"ElementNode":{let n=e.htmlWhitespaceSensitivity!=="ignore",i=[!n&&t.previous?.type==="ElementNode"?U:"",I([ri(t,r)])];if(lr(s))return[i];let a=["</",s.tag,">"],o=de(s);if(s.children.length===0||(!n||o)&&s.children.every(h=>yt(h)))return[i,a];let l=t.map(r,"children");return!n||o?[i,H([U,...l]),U,a]:[i,H(I(l)),a]}case"BlockStatement":return bs(t)?[ci(t,r),us(t,e,r),hs(t,e,r)]:[ai(t,r),I([us(t,e,r),hs(t,e,r),ui(t,e,r)])];case"ElementModifierStatement":return I(["{{",fs(t,r),"}}"]);case"MustacheStatement":return I([Et(s),fs(t,r),St(s)]);case"SubExpression":return I(["(",gi(t,r),U,")"]);case"AttrNode":{let{name:n,value:i}=s,a=i.type==="TextNode";if(a&&i.chars===""&&me(i)===Ge(i))return n;let l=a?lt(i.chars,e.singleQuote):i.type==="ConcatStatement"?lt(i.parts.map(g=>g.type==="TextNode"?g.chars:"").join(""),e.singleQuote):"",h=r("value");return[n,"=",l,n==="class"&&l?I(H(h)):h,l]}case"ConcatStatement":return t.map(r,"parts");case"Hash":return ue(A,t.map(r,"pairs"));case"HashPair":return[s.key,"=",r("value")];case"TextNode":{let n=s.chars,{parent:i}=t;if(i.type==="ElementNode"){if(i.tag==="pre")return at(n);if(de(i)&&i.children[0]===s)return n=ce(0,n,/^\n+/g,""),n=B.trimEnd(n),n=B.dedentString(n),at(n,he)}n=ce(0,n,"{{","\\{{");let a=hi(t);if(a){if(a==="class"){let q=ce(0,n.trim(),/\s+/g," "),L=!1,v=!1;return t.parent.type==="ConcatStatement"&&(t.previous?.type==="MustacheStatement"&&/^\s/.test(n)&&(L=!0),t.next?.type==="MustacheStatement"&&/\s$/.test(n)&&q!==""&&(v=!0)),[L?A:"",q,v?A:""]}return at(n)}let o=B.isWhitespaceOnly(n),{isFirst:l,isLast:h}=t;if(e.htmlWhitespaceSensitivity!=="ignore"){let q=h&&t.parent.type==="Template",L=l&&t.parent.type==="Template";if(o){if(L||q)return"";let _=[A],X=Le(n);return X&&(_=ze(X)),h&&(_=_.map(j=>Ot(j))),_}let v=B.getLeadingWhitespace(n),O=[];if(v){O=[A];let _=Le(v);_&&(O=ze(_)),n=n.slice(v.length)}let C=B.getTrailingWhitespace(n),M=[];if(C){if(!q){M=[A];let _=Le(C);_&&(M=ze(_)),h&&(M=M.map(X=>Ot(X)))}n=n.slice(0,-C.length)}return[...O,It(ps(n)),...M]}if((l||h)&&o&&(t.parent.type==="Block"||t.parent.type==="ElementNode"||t.parent.type==="Template"))return"";let g=Le(n),E=pi(n),d=fi(n);o&&g?(E=Math.min(g,ds),d=0):((t.next?.type==="BlockStatement"||t.next?.type==="ElementNode")&&(d=Math.max(d,1)),(t.previous?.type==="BlockStatement"||t.previous?.type==="ElementNode")&&(E=Math.max(E,1)));let w="",N="";return d===0&&t.next?.type==="MustacheStatement"&&(N=" "),E===0&&t.previous?.type==="MustacheStatement"&&(w=" "),l&&(E=0,w=""),h&&(d=0,N=""),B.hasLeadingWhitespace(n)&&(n=w+B.trimStart(n)),B.hasTrailingWhitespace(n)&&(n=B.trimEnd(n)+N),[...ze(E),It(ps(n)),...ze(d)]}case"MustacheCommentStatement":{let n=me(s),i=Ge(s),a=e.originalText.charAt(n+2)==="~",o=e.originalText.charAt(i-3)==="~",l=s.value.includes("}}")?"--":"";return["{{",a?"~":"","!",l,s.value,l,o?"~":"","}}"]}case"PathExpression":return Si(s);case"BooleanLiteral":return String(s.value);case"CommentStatement":return["<!--",s.value,"-->"];case"StringLiteral":return di(t,e);case"NumberLiteral":return String(s.value);case"UndefinedLiteral":return"undefined";case"NullLiteral":return"null";default:throw new Ir(s,"Handlebars")}}function ti(t,e){return me(t)-me(e)}function ri(t,e){let{node:r}=t,s=["attributes","modifiers","comments"].filter(i=>Be(r[i])),n=s.flatMap(i=>r[i]).sort(ti);for(let i of s)t.each(({node:a})=>{let o=n.indexOf(a);n[o]=[A,e()]},i);return Be(r.blockParams)&&n.push(A,fr(r)),["<",r.tag,H(n),si(r)]}function si(t){return lr(t)?Bt([U,"/>"],[" />",U]):Bt([U,">"],">")}function Et(t){let e=t.trusting?"{{{":"{{",r=t.strip?.open?"~":"";return[e,r]}function St(t){let e=t.trusting?"}}}":"}}";return[t.strip?.close?"~":"",e]}function ni(t){let e=Et(t),r=t.openStrip.open?"~":"";return[e,r,"#"]}function ii(t){let e=St(t);return[t.openStrip.close?"~":"",e]}function ls(t){let e=Et(t),r=t.closeStrip.open?"~":"";return[e,r,"/"]}function cs(t){let e=St(t);return[t.closeStrip.close?"~":"",e]}function ms(t){let e=Et(t),r=t.inverseStrip.open?"~":"";return[e,r]}function gs(t){let e=St(t);return[t.inverseStrip.close?"~":"",e]}function ai(t,e){let{node:r}=t,s=[],n=Tt(t,e);return n&&s.push(I(n)),Be(r.program.blockParams)&&s.push(fr(r.program)),I([ni(r),pr(t,e),s.length>0?H([A,ue(A,s)]):"",U,ii(r)])}function oi(t,e){return[e.htmlWhitespaceSensitivity==="ignore"?he:"",ms(t),"else",gs(t)]}var li=({path:t},{path:e})=>[t,e].every(r=>r.type==="PathExpression"&&r.head.type==="VarHead")&&t.head.name===e.head.name;function bs(t){if(!t.match(r=>r.type==="BlockStatement",(r,s)=>s==="body"&&r.type==="Block"&&r.body.length===1,(r,s)=>s==="inverse"&&r.type==="BlockStatement"))return!1;let{node:e}=t;return e.path.type==="PathExpression"&&e.path.head.type==="VarHead"&&e.path.head.name==="if"||li(e,t.grandparent)}function ci(t,e){let{node:r,grandparent:s}=t;return I([ms(s),["else"," ",s.inverse.body[0].path.head.name],H([A,I(Tt(t,e)),...Be(r.program.blockParams)?[A,fr(r.program)]:[]]),U,gs(s)])}function ui(t,e,r){let{node:s}=t;return e.htmlWhitespaceSensitivity==="ignore"?[ys(s)?U:he,ls(s),r("path"),cs(s)]:[ls(s),r("path"),cs(s)]}function ys(t){return t.type==="BlockStatement"&&t.program.body.every(e=>yt(e))}function us(t,e,r){let{node:s}=t;if(ys(s))return"";let n=r("program");return e.htmlWhitespaceSensitivity==="ignore"?H([he,n]):H(n)}function hs(t,e,r){let{node:s}=t;if(!s.inverse)return"";let n=r("inverse"),i=e.htmlWhitespaceSensitivity==="ignore"?[he,n]:n;return t.call(bs,"inverse","body",0)?i:[oi(s,e),H(i)]}function ps(t){return ue(A,B.split(t))}function hi(t){for(let e=0;e<2;e++){let r=t.getParentNode(e);if(r?.type==="AttrNode")return r.name.toLowerCase()}}function Le(t){return t=typeof t=="string"?t:"",t.split(`
`).length-1}function pi(t){t=typeof t=="string"?t:"";let e=(t.match(/^([^\S\n\r]*[\n\r])+/g)||[])[0]||"";return Le(e)}function fi(t){t=typeof t=="string"?t:"";let e=(t.match(/([\n\r][^\S\n\r]*)+$/g)||[])[0]||"";return Le(e)}function ze(t=0){return Array.from({length:Math.min(t,ds)},()=>he)}function di(t,e){let{node:{value:r}}=t,s=lt(r,mi(t)?!e.singleQuote:e.singleQuote);return[s,ce(0,r,s,`\\${s}`),s]}function mi(t){let{ancestors:e}=t,r=e.findIndex(s=>s.type!=="SubExpression");return r!==-1&&e[r+1].type==="ConcatStatement"&&e[r+2].type==="AttrNode"}function gi(t,e){let r=pr(t,e),s=Tt(t,e);return s?H([r,A,I(s)]):r}function fs(t,e){let r=pr(t,e),s=Tt(t,e);return s?[H([r,A,s]),U]:r}function pr(t,e){return e("path")}function Tt(t,e){let{node:r}=t,s=[];return r.params.length>0&&s.push(...t.map(e,"params")),r.hash?.pairs.length>0&&s.push(e("hash")),s.length===0?"":ue(A,s)}function fr(t){return["as |",t.blockParams.join(" "),"|"]}var bi=new Set("!\"#%&'()*+,./;<=>@[\\]^`{|}~"),yi=new Set(["true","false","null","undefined"]),Ei=(t,e)=>e===0&&t.startsWith("@")?!1:e!==0&&yi.has(t)||/\s/.test(t)||/^\d/.test(t)||Array.prototype.some.call(t,r=>bi.has(r));function Si(t){return t.tail.length===0&&t.original.includes("/")?t.original:[t.head.original,...t.tail].map((r,s)=>Ei(r,s)?`[${r}]`:r).join(".")}var Ti={features:{experimental_frontMatterSupport:{massageAstNode:!0,embed:!0,print:!0}},print:ei,massageAstNode:hr,hasPrettierIgnore:ss,getVisitorKeys:os,embed:is},Es=Ti;var Ss=[{name:"Handlebars",type:"markup",aceMode:"handlebars",extensions:[".handlebars",".hbs"],tmScope:"text.html.handlebars",aliases:["hbs","htmlbars"],parsers:["glimmer"],vscodeLanguageIds:["handlebars"],linguistLanguageId:155}];var dr={};xr(dr,{glimmer:()=>Di});function wi(t,e){let r=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(r,e)}var Ts=wi;function ki(t){return ce(0,t,/[^\n]/g," ")}var ws=ki;var ks=Symbol.for("PRETTIER_IS_FRONT_MATTER");var Ke=3;function Ni(t){let e=t.slice(0,Ke);if(e!=="---"&&e!=="+++")return;let r=t.indexOf(`
`,Ke);if(r===-1)return;let s=t.slice(Ke,r).trim(),n=t.indexOf(`
${e}`,r),i=s;if(i||(i=e==="+++"?"toml":"yaml"),n===-1&&e==="---"&&i==="yaml"&&(n=t.indexOf(`
...`,r)),n===-1)return;let a=n+1+Ke,o=t.charAt(a+1);if(!/\s?/.test(o))return;let l=t.slice(0,a),h;return{language:i,explicitLanguage:s||null,value:t.slice(r+1,n),startDelimiter:e,endDelimiter:l.slice(-Ke),raw:l,start:{line:1,column:0,index:0},end:{index:l.length,get line(){return h??(h=l.split(`
`)),h.length},get column(){return h??(h=l.split(`
`)),F(0,h,-1).length}},[ks]:!0}}function xi(t){let e=Ni(t);return e?{frontMatter:e,get content(){let{raw:r}=e;return ws(r)+t.slice(r.length)}}:{content:t}}var Ns=xi;function Pi(t){let e=t.children??t.body;if(e)for(let r=0;r<e.length-1;r++)e[r].type==="TextNode"&&e[r+1].type==="MustacheStatement"&&(e[r].chars=e[r].chars.replace(/\\$/,"\\\\"))}var Ai=t=>{let{start:e,end:r}=t.loc;e.offset=t.loc.getStart().offset,r.offset=t.loc.getEnd().offset},vi=()=>({name:"glimmerPrettierParsePlugin",visitor:{All(t){Ai(t),Pi(t)}}}),Ci={mode:"codemod",plugins:{ast:[vi]}};function _i(t){let{frontMatter:e,content:r}=Ns(t),s;try{s=es(r,Ci)}catch(n){let i=Oi(n);if(i){let a=Li(n);throw Ts(a,{loc:i,cause:n})}throw n}if(e){let n={...e,type:"FrontMatter",loc:{start:{...e.start,offset:e.start.index},end:{...e.end,offset:e.end.index}}};s.body.unshift(n)}return s}function Li(t){let{message:e}=t,r=e.split(`
`);return r.length>=4&&/^Parse error on line \d+:$/.test(r[0])&&/^-*\^$/.test(F(0,r,-2))?F(0,r,-1):r.length>=4&&/:\s?$/.test(r[0])&&/^\(error occurred in '.*?' @ line \d+ : column \d+\)$/.test(F(0,r,-1))&&r[1]===""&&F(0,r,-2)===""&&r.slice(2,-2).every(s=>s.startsWith("|"))?r[0].trim().slice(0,-1):e}function Oi(t){let{location:e,hash:r}=t;if(e){let{start:s,end:n}=e;return{start:{line:s.line,column:s.column+1},end:typeof n.line=="number"?{line:n.line,column:n.column+1}:void 0}}if(r){let{loc:{last_line:s,last_column:n}}=r;return{start:{line:s,column:n+1}}}}var Di={parse:_i,astFormat:"glimmer",locStart:me,locEnd:Ge};var Ii={glimmer:Es};export{xs as default,Ss as languages,dr as parsers,Ii as printers};