(function(n){function e(){var i=n();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.angular=e()}})(function(){"use strict";var Re=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var Ze=(r,e)=>{for(var t in e)Re(r,t,{get:e[t],enumerable:!0})},Mt=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Tt(e))!_t.call(r,n)&&n!==t&&Re(r,n,{get:()=>e[n],enumerable:!(s=Kt(e,n))||s.enumerable});return r};var Ft=r=>Mt(Re({},"__esModule",{value:!0}),r);var _r={};Ze(_r,{parsers:()=>ze});var ze={};Ze(ze,{__ng_action:()=>br,__ng_binding:()=>Br,__ng_directive:()=>Tr,__ng_interpolation:()=>Kr});var me=` `,Je="\r",Ye=function(){function r(e){this.length=e.length;for(var t=[0],s=0;sthis.length)return null;for(var t=0,s=this.offsets;s[t+1]<=e;)t++;var n=e-s[t];return{line:t,column:n}},r.prototype.indexForLocation=function(e){var t=e.line,s=e.column;return t<0||t>=this.offsets.length||s<0||s>this.lengthOfLine(t)?null:this.offsets[t]+s},r.prototype.lengthOfLine=function(e){var t=this.offsets[e],s=e===this.offsets.length-1?this.length:this.offsets[e+1];return s-t},r}();var le=class{text;locator;constructor(e){this.text=e,this.locator=new Pe(this.text)}},Pe=class{_linesAndColumns;constructor(e){this._linesAndColumns=new Ye(e)}locationForIndex(e){let{line:t,column:s}=this._linesAndColumns.locationForIndex(e);return{line:t+1,column:s,index:e}}};var G=class{constructor(e,t,s,n){this.input=t,this.errLocation=s,this.ctxLocation=n,this.message=`Parser Error: ${e} ${s} [${t}] in ${n}`}},P=class{constructor(e,t){this.start=e,this.end=t}toAbsolute(e){return new I(e+this.start,e+this.end)}},S=class{constructor(e,t){this.span=e,this.sourceSpan=t}toString(){return"AST"}},D=class extends S{constructor(e,t,s){super(e,t),this.nameSpan=s}},E=class extends S{visit(e,t=null){}},L=class extends S{visit(e,t=null){return e.visitImplicitReceiver(this,t)}},Se=class extends L{visit(e,t=null){var s;return(s=e.visitThisReceiver)==null?void 0:s.call(e,this,t)}},V=class extends S{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitChain(this,t)}},W=class extends S{constructor(e,t,s,n,i){super(e,t),this.condition=s,this.trueExp=n,this.falseExp=i}visit(e,t=null){return e.visitConditional(this,t)}},B=class extends D{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitPropertyRead(this,t)}},Q=class extends D{constructor(e,t,s,n,i,a){super(e,t,s),this.receiver=n,this.name=i,this.value=a}visit(e,t=null){return e.visitPropertyWrite(this,t)}},H=class extends D{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitSafePropertyRead(this,t)}},j=class extends S{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitKeyedRead(this,t)}},z=class extends S{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitSafeKeyedRead(this,t)}},q=class extends S{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.key=n,this.value=i}visit(e,t=null){return e.visitKeyedWrite(this,t)}},X=class extends D{constructor(e,t,s,n,i,a){super(e,t,a),this.exp=s,this.name=n,this.args=i}visit(e,t=null){return e.visitPipe(this,t)}},A=class extends S{constructor(e,t,s){super(e,t),this.value=s}visit(e,t=null){return e.visitLiteralPrimitive(this,t)}},Z=class extends S{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitLiteralArray(this,t)}},J=class extends S{constructor(e,t,s,n){super(e,t),this.keys=s,this.values=n}visit(e,t=null){return e.visitLiteralMap(this,t)}},we=class extends S{constructor(e,t,s,n){super(e,t),this.strings=s,this.expressions=n}visit(e,t=null){return e.visitInterpolation(this,t)}},$=class extends S{constructor(e,t,s,n,i){super(e,t),this.operation=s,this.left=n,this.right=i}visit(e,t=null){return e.visitBinary(this,t)}},K=class r extends ${static createMinus(e,t,s){return new r(e,t,"-",s,"-",new A(e,t,0),s)}static createPlus(e,t,s){return new r(e,t,"+",s,"-",s,new A(e,t,0))}constructor(e,t,s,n,i,a,h){super(e,t,i,a,h),this.operator=s,this.expr=n,this.left=null,this.right=null,this.operation=null}visit(e,t=null){return e.visitUnary!==void 0?e.visitUnary(this,t):e.visitBinary(this,t)}},Y=class extends S{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitPrefixNot(this,t)}},ee=class extends S{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitNonNullAssert(this,t)}},te=class extends S{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitCall(this,t)}},re=class extends S{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitSafeCall(this,t)}},I=class{constructor(e,t){this.start=e,this.end=t}},R=class extends S{constructor(e,t,s,n,i){super(new P(0,t===null?0:t.length),new I(n,t===null?n:n+t.length)),this.ast=e,this.source=t,this.location=s,this.errors=i}visit(e,t=null){return e.visitASTWithSource?e.visitASTWithSource(this,t):this.ast.visit(e,t)}toString(){return`${this.source} in ${this.location}`}},T=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},se=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},ye=class{visit(e,t){e.visit(this,t)}visitUnary(e,t){this.visit(e.expr,t)}visitBinary(e,t){this.visit(e.left,t),this.visit(e.right,t)}visitChain(e,t){this.visitAll(e.expressions,t)}visitConditional(e,t){this.visit(e.condition,t),this.visit(e.trueExp,t),this.visit(e.falseExp,t)}visitPipe(e,t){this.visit(e.exp,t),this.visitAll(e.args,t)}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){this.visitAll(e.expressions,t)}visitKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitKeyedWrite(e,t){this.visit(e.receiver,t),this.visit(e.key,t),this.visit(e.value,t)}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitLiteralPrimitive(e,t){}visitPrefixNot(e,t){this.visit(e.expression,t)}visitNonNullAssert(e,t){this.visit(e.expression,t)}visitPropertyRead(e,t){this.visit(e.receiver,t)}visitPropertyWrite(e,t){this.visit(e.receiver,t),this.visit(e.value,t)}visitSafePropertyRead(e,t){this.visit(e.receiver,t)}visitSafeKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitSafeCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitAll(e,t){for(let s of e)this.visit(s,t)}};var et;(function(r){r[r.DEFAULT=0]="DEFAULT",r[r.LITERAL_ATTR=1]="LITERAL_ATTR",r[r.ANIMATION=2]="ANIMATION"})(et||(et={}));function tt(r){return r>=9&&r<=32||r==160}function b(r){return 48<=r&&r<=57}function rt(r){return r>=97&&r<=122||r>=65&&r<=90}function Le(r){return r===39||r===34||r===96}var d;(function(r){r[r.Character=0]="Character",r[r.Identifier=1]="Identifier",r[r.PrivateIdentifier=2]="PrivateIdentifier",r[r.Keyword=3]="Keyword",r[r.String=4]="String",r[r.Operator=5]="Operator",r[r.Number=6]="Number",r[r.Error=7]="Error"})(d||(d={}));var dr=["var","let","as","null","undefined","true","false","if","else","this"],xe=class{tokenize(e){let t=new Ke(e),s=[],n=t.scanToken();for(;n!=null;)s.push(n),n=t.scanToken();return s}},N=class{constructor(e,t,s,n,i){this.index=e,this.end=t,this.type=s,this.numValue=n,this.strValue=i}isCharacter(e){return this.type==d.Character&&this.numValue==e}isNumber(){return this.type==d.Number}isString(){return this.type==d.String}isOperator(e){return this.type==d.Operator&&this.strValue==e}isIdentifier(){return this.type==d.Identifier}isPrivateIdentifier(){return this.type==d.PrivateIdentifier}isKeyword(){return this.type==d.Keyword}isKeywordLet(){return this.type==d.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==d.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==d.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==d.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==d.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==d.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==d.Keyword&&this.strValue=="this"}isError(){return this.type==d.Error}toNumber(){return this.type==d.Number?this.numValue:-1}toString(){switch(this.type){case d.Character:case d.Identifier:case d.Keyword:case d.Operator:case d.PrivateIdentifier:case d.String:case d.Error:return this.strValue;case d.Number:return this.numValue.toString();default:return null}}};function ot(r,e,t){return new N(r,e,d.Character,t,String.fromCharCode(t))}function vr(r,e,t){return new N(r,e,d.Identifier,0,t)}function gr(r,e,t){return new N(r,e,d.PrivateIdentifier,0,t)}function mr(r,e,t){return new N(r,e,d.Keyword,0,t)}function Be(r,e,t){return new N(r,e,d.Operator,0,t)}function Sr(r,e,t){return new N(r,e,d.String,0,t)}function wr(r,e,t){return new N(r,e,d.Number,t,"")}function yr(r,e,t){return new N(r,e,d.Error,0,t)}var Ce=new N(-1,-1,d.Character,0,""),Ke=class{constructor(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?0:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,t=this.length,s=this.peek,n=this.index;for(;s<=32;)if(++n>=t){s=0;break}else s=e.charCodeAt(n);if(this.peek=s,this.index=n,n>=t)return null;if(ct(s))return this.scanIdentifier();if(b(s))return this.scanNumber(n);let i=n;switch(s){case 46:return this.advance(),b(this.peek)?this.scanNumber(i):ot(i,this.index,46);case 40:case 41:case 123:case 125:case 91:case 93:case 44:case 58:case 59:return this.scanCharacter(i,s);case 39:case 34:return this.scanString();case 35:return this.scanPrivateIdentifier();case 43:case 45:case 42:case 47:case 37:case 94:return this.scanOperator(i,String.fromCharCode(s));case 63:return this.scanQuestion(i);case 60:case 62:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=");case 33:case 61:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=",61,"=");case 38:return this.scanComplexOperator(i,"&",38,"&");case 124:return this.scanComplexOperator(i,"|",124,"|");case 160:for(;tt(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,t){return this.advance(),ot(e,this.index,t)}scanOperator(e,t){return this.advance(),Be(e,this.index,t)}scanComplexOperator(e,t,s,n,i,a){this.advance();let h=t;return this.peek==s&&(this.advance(),h+=n),i!=null&&this.peek==i&&(this.advance(),h+=a),Be(e,this.index,h)}scanIdentifier(){let e=this.index;for(this.advance();ht(this.peek);)this.advance();let t=this.input.substring(e,this.index);return dr.indexOf(t)>-1?mr(e,this.index,t):vr(e,this.index,t)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!ct(this.peek))return this.error("Invalid character [#]",-1);for(;ht(this.peek);)this.advance();let t=this.input.substring(e,this.index);return gr(e,this.index,t)}scanNumber(e){let t=this.index===e,s=!1;for(this.advance();;){if(!b(this.peek))if(this.peek===95){if(!b(this.input.charCodeAt(this.index-1))||!b(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);s=!0}else if(this.peek===46)t=!1;else if(Er(this.peek)){if(this.advance(),Ar(this.peek)&&this.advance(),!b(this.peek))return this.error("Invalid exponent",-1);t=!1}else break;this.advance()}let n=this.input.substring(e,this.index);s&&(n=n.replace(/_/g,""));let i=t?Cr(n):parseFloat(n);return wr(e,this.index,i)}scanString(){let e=this.index,t=this.peek;this.advance();let s="",n=this.index,i=this.input;for(;this.peek!=t;)if(this.peek==92){s+=i.substring(n,this.index);let h;if(this.advance(),this.peek==117){let v=i.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(v))h=parseInt(v,16);else return this.error(`Invalid unicode escape [\\u${v}]`,0);for(let f=0;f<5;f++)this.advance()}else h=$r(this.peek),this.advance();s+=String.fromCharCode(h),n=this.index}else{if(this.peek==0)return this.error("Unterminated quote",0);this.advance()}let a=i.substring(n,this.index);return this.advance(),Sr(e,this.index,s+a)}scanQuestion(e){this.advance();let t="?";return(this.peek===63||this.peek===46)&&(t+=this.peek===46?".":"?",this.advance()),Be(e,this.index,t)}error(e,t){let s=this.index+t;return yr(s,this.index,`Lexer Error: ${e} at column ${s} in expression [${this.input}]`)}};function ct(r){return 97<=r&&r<=122||65<=r&&r<=90||r==95||r==36}function ht(r){return rt(r)||b(r)||r==95||r==36}function Er(r){return r==101||r==69}function Ar(r){return r==45||r==43}function $r(r){switch(r){case 110:return 10;case 102:return 12;case 114:return 13;case 116:return 9;case 118:return 11;default:return r}}function Cr(r){let e=parseInt(r);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+r);return e}var Or=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function xt(r,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${r}' to be an array, [start, end].`);if(e!=null){let t=e[0],s=e[1];Or.forEach(n=>{if(n.test(t)||n.test(s))throw new Error(`['${t}', '${s}'] contains unusable interpolation symbol.`)})}}var _e=class r{static fromArray(e){return e?(xt("interpolation",e),new r(e[0],e[1])):F}constructor(e,t){this.start=e,this.end=t}},F=new _e("{{","}}");var Me=class{constructor(e,t,s){this.strings=e,this.expressions=t,this.offsets=s}},Fe=class{constructor(e,t,s){this.templateBindings=e,this.warnings=t,this.errors=s}},ve=class{constructor(e){this._lexer=e,this.errors=[]}parseAction(e,t,s,n,i=F){this._checkNoInterpolation(e,s,i);let a=this._stripComments(e),h=this._lexer.tokenize(a),v=1;t&&(v|=2);let f=new U(e,s,n,h,v,this.errors,0).parseChain();return new R(f,e,s,n,this.errors)}parseBinding(e,t,s,n=F){let i=this._parseBindingAst(e,t,s,n);return new R(i,e,t,s,this.errors)}checkSimpleExpression(e){let t=new Ue;return e.visit(t),t.errors}parseSimpleBinding(e,t,s,n=F){let i=this._parseBindingAst(e,t,s,n),a=this.checkSimpleExpression(i);return a.length>0&&this._reportError(`Host binding expression cannot contain ${a.join(" ")}`,e,t),new R(i,e,t,s,this.errors)}_reportError(e,t,s,n){this.errors.push(new G(e,t,s,n))}_parseBindingAst(e,t,s,n){this._checkNoInterpolation(e,t,n);let i=this._stripComments(e),a=this._lexer.tokenize(i);return new U(e,t,s,a,0,this.errors,0).parseChain()}parseTemplateBindings(e,t,s,n,i){let a=this._lexer.tokenize(t);return new U(t,s,i,a,0,this.errors,0).parseTemplateBindings({source:e,span:new I(n,n+e.length)})}parseInterpolation(e,t,s,n,i=F){let{strings:a,expressions:h,offsets:v}=this.splitInterpolation(e,t,n,i);if(h.length===0)return null;let f=[];for(let w=0;ww.text),f,e,t,s)}parseInterpolationExpression(e,t,s){let n=this._stripComments(e),i=this._lexer.tokenize(n),a=new U(e,t,s,i,0,this.errors,0).parseChain(),h=["",""];return this.createInterpolationAst(h,[a],e,t,s)}createInterpolationAst(e,t,s,n,i){let a=new P(0,s.length),h=new we(a,a.toAbsolute(i),e,t);return new R(h,s,n,i,this.errors)}splitInterpolation(e,t,s,n=F){let i=[],a=[],h=[],v=s?Nr(s):null,f=0,w=!1,k=!1,{start:C,end:y}=n;for(;f-1)break;i>-1&&a>-1&&this._reportError(`Got interpolation (${s}${n}) where expression was expected`,e,`at column ${i} in`,t)}_getInterpolationEndIndex(e,t,s){for(let n of this._forEachUnquotedChar(e,s)){if(e.startsWith(t,n))return n;if(e.startsWith("//",n))return e.indexOf(t,n)}return-1}*_forEachUnquotedChar(e,t){let s=null,n=0;for(let i=t;i=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,t){let s=this.currentEndIndex;if(t!==void 0&&t>this.currentEndIndex&&(s=t),e>s){let n=s;s=e,e=n}return new P(e,s)}sourceSpan(e,t){let s=`${e}@${this.inputIndex}:${t}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,t){this.context|=e;let s=t();return this.context^=e,s}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===Ce?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],t=this.inputIndex;for(;this.index":case"<=":case">=":this.advance();let n=this.parseAdditive();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseAdditive(){let e=this.inputIndex,t=this.parseMultiplicative();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"+":case"-":this.advance();let n=this.parseMultiplicative();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseMultiplicative(){let e=this.inputIndex,t=this.parsePrefix();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"*":case"%":case"/":this.advance();let n=this.parsePrefix();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parsePrefix(){if(this.next.type==d.Operator){let e=this.inputIndex,t=this.next.strValue,s;switch(t){case"+":return this.advance(),s=this.parsePrefix(),K.createPlus(this.span(e),this.sourceSpan(e),s);case"-":return this.advance(),s=this.parsePrefix(),K.createMinus(this.span(e),this.sourceSpan(e),s);case"!":return this.advance(),s=this.parsePrefix(),new Y(this.span(e),this.sourceSpan(e),s)}}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,t=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(46))t=this.parseAccessMember(t,e,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(40)?t=this.parseCall(t,e,!0):t=this.consumeOptionalCharacter(91)?this.parseKeyedReadOrWrite(t,e,!0):this.parseAccessMember(t,e,!0);else if(this.consumeOptionalCharacter(91))t=this.parseKeyedReadOrWrite(t,e,!1);else if(this.consumeOptionalCharacter(40))t=this.parseCall(t,e,!1);else if(this.consumeOptionalOperator("!"))t=new ee(this.span(e),this.sourceSpan(e),t);else return t}parsePrimary(){let e=this.inputIndex;if(this.consumeOptionalCharacter(40)){this.rparensExpected++;let t=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),t}else{if(this.next.isKeywordNull())return this.advance(),new A(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new A(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new A(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new A(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new Se(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;let t=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new Z(this.span(e),this.sourceSpan(e),t)}else{if(this.next.isCharacter(123))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new L(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let t=this.next.toNumber();return this.advance(),new A(this.span(e),this.sourceSpan(e),t)}else if(this.next.isString()){let t=this.next.toString();return this.advance(),new A(this.span(e),this.sourceSpan(e),t)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new E(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new E(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new E(this.span(e),this.sourceSpan(e)))}}}parseExpressionList(e){let t=[];do if(!this.next.isCharacter(e))t.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(44));return t}parseLiteralMap(){let e=[],t=[],s=this.inputIndex;if(this.expectCharacter(123),!this.consumeOptionalCharacter(125)){this.rbracesExpected++;do{let n=this.inputIndex,i=this.next.isString(),a=this.expectIdentifierOrKeywordOrString();if(e.push({key:a,quoted:i}),i)this.expectCharacter(58),t.push(this.parsePipe());else if(this.consumeOptionalCharacter(58))t.push(this.parsePipe());else{let h=this.span(n),v=this.sourceSpan(n);t.push(new B(h,v,v,new L(h,v),a))}}while(this.consumeOptionalCharacter(44)&&!this.next.isCharacter(125));this.rbracesExpected--,this.expectCharacter(125)}return new J(this.span(s),this.sourceSpan(s),e,t)}parseAccessMember(e,t,s){let n=this.inputIndex,i=this.withContext(he.Writable,()=>{let v=this.expectIdentifierOrKeyword()??"";return v.length===0&&this.error("Expected identifier for property access",e.span.end),v}),a=this.sourceSpan(n),h;if(s)this.consumeOptionalAssignment()?(this.error("The '?.' operator cannot be used in the assignment"),h=new E(this.span(t),this.sourceSpan(t))):h=new H(this.span(t),this.sourceSpan(t),a,e,i);else if(this.consumeOptionalAssignment()){if(!(this.parseFlags&1))return this.error("Bindings cannot contain assignments"),new E(this.span(t),this.sourceSpan(t));let v=this.parseConditional();h=new Q(this.span(t),this.sourceSpan(t),a,e,i,v)}else h=new B(this.span(t),this.sourceSpan(t),a,e,i);return h}parseCall(e,t,s){let n=this.inputIndex;this.rparensExpected++;let i=this.parseCallArguments(),a=this.span(n,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(41),this.rparensExpected--;let h=this.span(t),v=this.sourceSpan(t);return s?new re(h,v,e,i,a):new te(h,v,e,i,a)}consumeOptionalAssignment(){return this.parseFlags&2&&this.next.isOperator("!")&&this.peek(1).isOperator("=")?(this.advance(),this.advance(),!0):this.consumeOptionalOperator("=")}parseCallArguments(){if(this.next.isCharacter(41))return[];let e=[];do e.push(this.parsePipe());while(this.consumeOptionalCharacter(44));return e}expectTemplateBindingKey(){let e="",t=!1,s=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),t=this.consumeOptionalOperator("-"),t&&(e+="-");while(t);return{source:e,span:new I(s,s+e.length)}}parseTemplateBindings(e){let t=[];for(t.push(...this.parseDirectiveKeywordBindings(e));this.index{this.rbracketsExpected++;let n=this.parsePipe();if(n instanceof E&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(93),this.consumeOptionalOperator("="))if(s)this.error("The '?.' operator cannot be used in the assignment");else{let i=this.parseConditional();return new q(this.span(t),this.sourceSpan(t),e,n,i)}else return s?new z(this.span(t),this.sourceSpan(t),e,n):new j(this.span(t),this.sourceSpan(t),e,n);return new E(this.span(t),this.sourceSpan(t))})}parseDirectiveKeywordBindings(e){let t=[];this.consumeOptionalCharacter(58);let s=this.getDirectiveBoundTarget(),n=this.currentAbsoluteOffset,i=this.parseAsBinding(e);i||(this.consumeStatementTerminator(),n=this.currentAbsoluteOffset);let a=new I(e.span.start,n);return t.push(new se(a,e,s)),i&&t.push(i),t}getDirectiveBoundTarget(){if(this.next===Ce||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:t,end:s}=e.span,n=this.input.substring(t,s);return new R(e,n,this.location,this.absoluteOffset+t,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let t=this.expectTemplateBindingKey();this.consumeStatementTerminator();let s=new I(e.span.start,this.currentAbsoluteOffset);return new T(s,t,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let t=this.expectTemplateBindingKey(),s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let n=new I(e,this.currentAbsoluteOffset);return new T(n,t,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(59)||this.consumeOptionalCharacter(44)}error(e,t=null){this.errors.push(new G(e,this.input,this.locationText(t),this.location)),this.skip()}locationText(e=null){return e==null&&(e=this.index),eh+v.length,0);s+=a,t+=a}e.set(s,t),n++}return e}var dt="angular-estree-parser",De="NgEstreeParser",Ge=0,Ve=[dt,Ge];function vt(){return new ve(new xe)}function We(r,e){let t=vt(),{astInput:s,comments:n}=Ir(r,t),{ast:i,errors:a}=e(s,t);return yt(a),{ast:i,comments:n}}function gt(r){return We(r,(e,t)=>t.parseBinding(e,...Ve))}function mt(r){return We(r,(e,t)=>t.parseAction(e,!1,...Ve))}function St(r){return We(r,(e,t)=>{let s=t.parseInterpolationExpression(e,...Ve);return s.ast=s.ast.expressions[0],s})}function wt(r){let e=vt(),{templateBindings:t,errors:s}=e.parseTemplateBindings(De,r,dt,Ge,Ge);return yt(s),t}function yt(r){if(r.length!==0){let[{message:e}]=r;throw new SyntaxError(e.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}}function Ir(r,e){let t=e._commentStart(r);return t===null?{astInput:r,comments:[]}:{astInput:r.slice(0,t),comments:[{type:"Comment",value:r.slice(t+2),sourceSpan:{start:t,end:r.length}}]}}function Et(r){return r instanceof K?"Unary":r instanceof $?"Binary":r instanceof X?"BindingPipe":r instanceof te?"Call":r instanceof V?"Chain":r instanceof W?"Conditional":r instanceof E?"EmptyExpr":r instanceof L?"ImplicitReceiver":r instanceof j?"KeyedRead":r instanceof z?"SafeKeyedRead":r instanceof q?"KeyedWrite":r instanceof Z?"LiteralArray":r instanceof J?"LiteralMap":r instanceof A?"LiteralPrimitive":r instanceof ee?"NonNullAssert":r instanceof Y?"PrefixNot":r instanceof B?"PropertyRead":r instanceof Q?"PropertyWrite":r instanceof re?"SafeCall":r instanceof H?"SafePropertyRead":r.type}function ft({start:r,end:e},t){let s=r,n=e;for(;n!==s&&/\s/.test(t[n-1]);)n--;for(;s!==n&&/\s/.test(t[s]);)s++;return{start:s,end:n}}function Rr({start:r,end:e},t){let s=r,n=e;for(;n!==t.length&&/\s/.test(t[n]);)n++;for(;s!==0&&/\s/.test(t[s-1]);)s--;return{start:s,end:n}}function Pr(r,e){return e[r.start-1]==="("&&e[r.end]===")"?{start:r.start-1,end:r.end+1}:r}function At(r,e,t){let s=0,n={start:r.start,end:r.end};for(;;){let i=Rr(n,e),a=Pr(i,e);if(i.start===a.start&&i.end===a.end)break;n.start=a.start,n.end=a.end,s++}return{hasParens:(t?s-1:s)!==0,outerSpan:ft(t?{start:n.start+1,end:n.end-1}:n,e),innerSpan:ft(r,e)}}function $t(r,e,t){let s=e;for(;!r.test(t[s]);)if(--s<0)throw new Error(`Cannot find front char ${r} from index ${e} in ${JSON.stringify(t)}`);return s}function Oe(r,e,t){let s=e;for(;!r.test(t[s]);)if(++s>=t.length)throw new Error(`Cannot find back char ${r} from index ${e} in ${JSON.stringify(t)}`);return s}function Ct(r){return r.slice(0,1).toLowerCase()+r.slice(1)}function Ot(r){return r.length===0?void 0:r[r.length-1]}var pe=(r,e,t=!1)=>{let s=Et(r);switch(s){case"Unary":{let{operator:c,expr:o}=r,x=n(o);return a("UnaryExpression",{prefix:!0,argument:x,operator:c},r.sourceSpan,{hasParentParens:t})}case"Binary":{let{left:c,operation:o,right:x}=r,p=n(c),u=n(x);return a(o==="&&"||o==="||"||o==="??"?"LogicalExpression":"BinaryExpression",{left:p,right:u,operator:o},{start:y(p),end:m(u)},{hasParentParens:t})}case"BindingPipe":{let{exp:c,name:o,args:x}=r,p=n(c),u=f(/\S/,f(/\|/,m(p))+1),g=a("Identifier",{name:o},{start:u,end:u+o.length}),l=x.map(n);return a("NGPipeExpression",{left:p,right:g,arguments:l},{start:y(p),end:m(l.length===0?g:Ot(l))},{hasParentParens:t})}case"Chain":{let{expressions:c}=r;return a("NGChainedExpression",{expressions:c.map(n)},r.sourceSpan,{hasParentParens:t})}case"Comment":{let{value:c}=r;return a("CommentLine",{value:c},r.sourceSpan,{processSpan:!1})}case"Conditional":{let{condition:c,trueExp:o,falseExp:x}=r,p=n(c),u=n(o),g=n(x);return a("ConditionalExpression",{test:p,consequent:u,alternate:g},{start:y(p),end:m(g)},{hasParentParens:t})}case"EmptyExpr":return a("NGEmptyExpression",{},r.sourceSpan,{hasParentParens:t});case"ImplicitReceiver":return a("ThisExpression",{},r.sourceSpan,{hasParentParens:t});case"KeyedRead":case"SafeKeyedRead":{let c=s==="SafeKeyedRead",{key:o}=r,x=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,p=n(o);return h(x,p,{computed:!0,optional:c},{end:r.sourceSpan.end,hasParentParens:t})}case"LiteralArray":{let{expressions:c}=r;return a("ArrayExpression",{elements:c.map(n)},r.sourceSpan,{hasParentParens:t})}case"LiteralMap":{let{keys:c,values:o}=r,x=o.map(u=>n(u)),p=c.map(({key:u,quoted:g},l)=>{let O=x[l],ue=y(O),qe=m(O),Ie=f(/\S/,l===0?r.sourceSpan.start+1:f(/,/,m(x[l-1]))+1),bt=ue===Ie?qe:v(/\S/,v(/:/,ue-1)-1)+1,Xe={start:Ie,end:bt},ge=g?a("StringLiteral",{value:u},Xe):a("Identifier",{name:u},Xe),Bt=ge.end=c.sourceSpan.end||/^\s+$/.test(e.text.slice(c.sourceSpan.start,c.sourceSpan.end))}function k(c){return(c.type==="OptionalCallExpression"||c.type==="OptionalMemberExpression")&&!C(c)}function C(c){return c.extra&&c.extra.parenthesized}function y(c){return C(c)?c.extra.parenStart:c.start}function m(c){return C(c)?c.extra.parenEnd:c.end}};function Ne(r,e,t=!1,s=!1){if(!t){let{start:h,end:v}=r;return{start:h,end:v,loc:{start:e.locator.locationForIndex(h),end:e.locator.locationForIndex(v)}}}let{outerSpan:n,innerSpan:i,hasParens:a}=At(r,e.text,s);return{start:i.start,end:i.end,loc:{start:e.locator.locationForIndex(i.start),end:e.locator.locationForIndex(i.end)},...a&&{extra:{parenthesized:!0,parenStart:n.start,parenEnd:n.end}}}}function Nt(r,e){r.forEach(y);let[t]=r,{key:s}=t,n=e.text.slice(t.sourceSpan.start,t.sourceSpan.end).trim().length===0?r.slice(1):r,i=[],a=null;for(let o=0;o({...O,...Ne({start:O.start,end:ue},e)}),g=O=>({...u(O,p.end),alias:p}),l=i.pop();if(l.type==="NGMicrosyntaxExpression")i.push(g(l));else if(l.type==="NGMicrosyntaxKeyedExpression"){let O=g(l.expression);i.push(u({...l,expression:O},O.end))}else throw new Error(`Unexpected type ${l.type}`)}else i.push(h(x,o));a=x}return f("NGMicrosyntax",{body:i},i.length===0?r[0].sourceSpan:{start:i[0].start,end:i[i.length-1].end});function h(o,x){if(k(o)){let{key:p,value:u}=o;return u?x===0?f("NGMicrosyntaxExpression",{expression:v(u.ast),alias:null},u.sourceSpan):f("NGMicrosyntaxKeyedExpression",{key:f("NGMicrosyntaxKey",{name:w(p.source)},p.span),expression:f("NGMicrosyntaxExpression",{expression:v(u.ast),alias:null},u.sourceSpan)},{start:p.span.start,end:u.sourceSpan.end}):f("NGMicrosyntaxKey",{name:w(p.source)},p.span)}else{let{key:p,sourceSpan:u}=o;if(/^let\s$/.test(e.text.slice(u.start,u.start+4))){let{value:l}=o;return f("NGMicrosyntaxLet",{key:f("NGMicrosyntaxKey",{name:p.source},p.span),value:l?f("NGMicrosyntaxKey",{name:l.source},l.span):null},{start:u.start,end:l?l.span.end:p.span.end})}else{let l=c(o);return f("NGMicrosyntaxAs",{key:f("NGMicrosyntaxKey",{name:l.source},l.span),alias:f("NGMicrosyntaxKey",{name:p.source},p.span)},{start:l.span.start,end:p.span.end})}}}function v(o){return pe(o,e)}function f(o,x,p,u=!0){return{type:o,...Ne(p,e,u),...x}}function w(o){return Ct(o.slice(s.source.length))}function k(o){return o instanceof se}function C(o){return o instanceof T}function y(o){m(o.key.span),C(o)&&o.value&&m(o.value.span)}function m(o){if(e.text[o.start]!=='"'&&e.text[o.start]!=="'")return;let x=e.text[o.start],p=!1;for(let u=o.start+1;upe(h,n),a=i(t);return a.comments=s.map(h=>i(h)),a}function kt(r){return Qe(r,gt)}function It(r){return Qe(r,St)}function He(r){return Qe(r,mt)}function Rt(r){return Nt(wt(r),new le(r))}function Lr(r){return Array.isArray(r)&&r.length>0}var Pt=Lr;function je(r){var s;let e=r.range?r.range[0]:r.start,t=((s=r.declaration)==null?void 0:s.decorators)??r.decorators;return Pt(t)?Math.min(je(t[0]),e):e}function Lt(r){return r.range?r.range[1]:r.end}function ke(r){return{astFormat:"estree",parse(e){let t=r(e);return{type:"NGRoot",node:r===He&&t.type!=="NGChainedExpression"?{...t,type:"NGChainedExpression",expressions:[t]}:t}},locStart:je,locEnd:Lt}}var br=ke(He),Br=ke(kt),Kr=ke(It),Tr=ke(Rt);return Ft(_r);});