Files
form_metacase/node_modules/prettier/plugins/angular.js
T

4 lines
96 KiB
JavaScript
Raw Normal View History

2026-03-14 20:41:55 +00:00
(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 nt=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var _i=Object.getOwnPropertyNames;var Ti=Object.getPrototypeOf,ki=Object.prototype.hasOwnProperty;var bi=Reflect.get;var ln=t=>{throw TypeError(t)};var cn=(t,e)=>{for(var n in e)nt(t,n,{get:e[n],enumerable:!0})},Ai=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _i(e))!ki.call(t,i)&&i!==n&&nt(t,i,{get:()=>e[i],enumerable:!(s=Ci(e,i))||s.enumerable});return t};var Ii=t=>Ai(nt({},"__esModule",{value:!0}),t);var st=(t,e,n)=>e.has(t)||ln("Cannot "+n);var U=(t,e,n)=>(st(t,e,"read from private field"),n?n.call(t):e.get(t)),ke=(t,e,n)=>e.has(t)?ln("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),it=(t,e,n,s)=>(st(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),v=(t,e,n)=>(st(t,e,"access private method"),n);var un=(t,e,n)=>bi(Ti(t),n,e);var Gr={};cn(Gr,{parsers:()=>rn});var rn={};cn(rn,{__ng_action:()=>Wr,__ng_binding:()=>qr,__ng_directive:()=>zr,__ng_interpolation:()=>jr});function Ni(t){return typeof t=="string"?e=>e===t:e=>t.test(e)}function hn(t,e,n){let s=Ni(e);for(let i=n;i<t.length;i++){let r=t[i];if(s(r))return i}throw new Error(`Cannot find character ${e} from index ${n} in ${JSON.stringify(t)}`)}function fn(t){return t.slice(0,1).toLowerCase()+t.slice(1)}function be(t){let{start:e,end:n}=t;return{start:e,end:n,range:[e,n]}}function pn(t){return!!t.extra?.parenthesized}function ue(t){return t.type==="TSNonNullExpression"&&!pn(t)?ue(t.expression):(t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression")&&!pn(t)}var Qr=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g");var dn;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom"})(dn||(dn={}));var mn;(function(t){t[t.OnPush=0]="OnPush",t[t.Default=1]="Default"})(mn||(mn={}));var gn;(function(t){t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(gn||(gn={}));var N;(function(t){t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t[t.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING"})(N||(N={}));var vn;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Ignore=2]="Ignore"})(vn||(vn={}));var xn;(function(t){t[t.Directive=0]="Directive",t[t.Component=1]="Component",t[t.Injectable=2]="Injectable",t[t.Pipe=3]="Pipe",t[t.NgModule=4]="NgModule"})(xn||(xn={}));var wn;(function(t){t[t.Directive=0]="Directive",t[t.Pipe=1]="Pipe",t[t.NgModule=2]="NgModule"})(wn||(wn={}));var Sn;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom"})(Sn||(Sn={}));var En;(function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"})(En||(En={}));var yn;(function(t){t[t.None=0]="None",t[t.Const=1]="Const"})(yn||(yn={}));var Cn;(function(t){t[t.Dynamic=0]="Dynamic",t[t.Bool=1]="Bool",t[t.String=2]="String",t[t.Int=3]="Int",t[t.Number=4]="Number",t[t.Function=5]="Function",t[t.Inferred=6]="Inferred",t[t.None=7]="None"})(Cn||(Cn={}));var _n;(function(t){t[t.Minus=0]="Minus",t[t.Plus=1]="Plus"})(_n||(_n={}));var c;(function(t){t[t.Equals=0]="Equals",t[t.NotEquals=1]="NotEquals",t[t.Assign=2]="Assign",t[t.Identical=3]="Identical",t[t.NotIdentical=4]="NotIdentical",t[t.Minus=5]="Minus",t[t.Plus=6]="Plus",t[t.Divide=7]="Divide",t[t.Multiply=8]="Multiply",t[t.Modulo=9]="Modulo",t[t.And=10]="And",t[t.Or=11]="Or",t[t.BitwiseOr=12]="BitwiseOr",t[t.BitwiseAnd=13]="B
`&&++u==n)););for(a=0,u=0;a<e&&r<s.length-1&&(r++,a++,!(s[r]==`
`&&++u==n)););return{before:s.substring(i,this.offset),after:s.substring(this.offset,r+1)}}return null}},He=class{content;url;constructor(e,n){this.content=e,this.url=n}},We=class{start;end;fullStart;details;constructor(e,n,s=e,i=null){this.start=e,this.end=n,this.fullStart=s,this.details=i}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},qe;(function(t){t[t.WARNING=0]="WARNING",t[t.ERROR=1]="ERROR"})(qe||(qe={}));var Ce=class extends Error{span;msg;level;relatedError;constructor(e,n,s=qe.ERROR,i){super(n),this.span=e,this.msg=n,this.level=s,this.relatedError=i,Object.setPrototypeOf(this,new.target.prototype)}contextualMessage(){let e=this.span.start.getContext(100,3);return e?`${this.msg} ("${e.before}[${qe[this.level]} ->]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};var $n;(function(t){t[t.Inline=0]="Inline",t[t.SideEffect=1]="SideEffect",t[t.Omit=2]="Omit"})($n||($n={}));var Dn;(function(t){t[t.Global=0]="Global",t[t.Local=1]="Local"})(Dn||(Dn={}));var Bn;(function(t){t[t.Directive=0]="Directive",t[t.Pipe=1]="Pipe",t[t.NgModule=2]="NgModule"})(Bn||(Bn={}));var er="(:(where|is)\\()?";var gs="-shadowcsshost",tr="-shadowcsscontext",Ot="[^)(]*",nr=`(?:\\(${Ot}\\)|${Ot})+?`,sr=`(?:\\(${nr}\\)|${Ot})+?`,Gt=`(?:\\((${sr})\\))`,to=new RegExp("(:nth-[-\\w]+)"+Gt,"g"),no=new RegExp(gs+Gt+"?([^,{]*)","gim"),ir=tr+Gt+"?([^{]*)",so=new RegExp(`${er}(${ir})`,"gim"),rr=gs+"-no-combinator",io=new RegExp(`${rr}(?![^(]*\\))`,"g");var vs="%COMMENT%",ro=new RegExp(vs,"g");var oo=new RegExp(`(\\s*(?:${vs}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g");var or="%COMMA_IN_PLACEHOLDER%",ar="%SEMI_IN_PLACEHOLDER%",lr="%COLON_IN_PLACEHOLDER%",ao=new RegExp(or,"g"),lo=new RegExp(ar,"g"),co=new RegExp(lr,"g");var f;(function(t){t[t.ListEnd=0]="ListEnd",t[t.Statement=1]="Statement",t[t.Variable=2]="Variable",t[t.ElementStart=3]="ElementStart",t[t.Element=4]="Element",t[t.Template=5]="Template",t[t.ElementEnd=6]="ElementEnd",t[t.ContainerStart=7]="ContainerStart",t[t.Container=8]="Container",t[t.ContainerEnd=9]="ContainerEnd",t[t.DisableBindings=10]="DisableBindings",t[t.ConditionalCreate=11]="ConditionalCreate",t[t.ConditionalBranchCreate=12]="ConditionalBranchCreate",t[t.Conditional=13]="Conditional",t[t.EnableBindings=14]="EnableBindings",t[t.Text=15]="Text",t[t.Listener=16]="Listener",t[t.InterpolateText=17]="InterpolateText",t[t.Binding=18]="Binding",t[t.Property=19]="Property",t[t.StyleProp=20]="StyleProp",t[t.ClassProp=21]="ClassProp",t[t.StyleMap=22]="StyleMap",t[t.ClassMap=23]="ClassMap",t[t.Advance=24]="Advance",t[t.Pipe=25]="Pipe",t[t.Attribute=26]="Attribute",t[t.ExtractedAttribute=27]="ExtractedAttribute",t[t.Defer=28]="Defer",t[t.DeferOn=29]="DeferOn",t[t.DeferWhen=30]="DeferWhen",t[t.I18nMessage=31]="I18nMessage",t[t.DomProperty=32]="DomProperty",t[t.Namespace=33]="Namespace",t[t.ProjectionDef=34]="ProjectionDef",t[t.Projection=35]="Projection",t[t.RepeaterCreate=36]="RepeaterCreate",t[t.Repeater=37]="Repeater",t[t.TwoWayProperty=38]="TwoWayProperty",t[t.TwoWayListener=39]="TwoWayListener",t[t.DeclareLet=40]="DeclareLet",t[t.StoreLet=41]="StoreLet",t[t.I18nStart=42]="I18nStart",t[t.I18n=43]="I18n",t[t.I18nEnd=44]="I18nEnd",t[t.I18nExpression=45]="I18nExpression",t[t.I18nApply=46]="I18nApply",t[t.IcuStart=47]="IcuStart",t[t.IcuEnd=48]="IcuEnd",t[t.IcuPlaceholder=49]="IcuPlaceholder",t[t.I18nContext=50]="I18nContext",t[t.I18nAttributes=51]="I18nAttributes",t[t.SourceLocation=52]="SourceLocation",t[t.Animation=53]="Animation",t[t.AnimationString=54]="AnimationString",t[t.AnimationBinding=55]="AnimationBinding",t[t.AnimationListener=56]="AnimationListener",t[t.Control=57]="Control",t[t.ControlCreate=58]="ControlCreate"})(f||(f={}));var ie;(function(t){t[t.LexicalRead=0]="LexicalRead",t[t.Context=1]="Context",t[t.TrackContext=2]="TrackContext",t[t.ReadVariable=3]="ReadVariable",t[t.NextContext=4]="NextContext",t[t.Reference=5]="Reference",t[t.StoreLet=6]="StoreLet",t[t.ContextLet
\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,So=new RegExp(`[^${ws}]`),Eo=new RegExp(`[${ws}]{2,}`,"g");var h;(function(t){t[t.Character=0]="Character",t[t.Identifier=1]="Identifier",t[t.PrivateIdentifier=2]="PrivateIdentifier",t[t.Keyword=3]="Keyword",t[t.String=4]="String",t[t.Operator=5]="Operator",t[t.Number=6]="Number",t[t.RegExpBody=7]="RegExpBody",t[t.RegExpFlags=8]="RegExpFlags",t[t.Error=9]="Error"})(h||(h={}));var F;(function(t){t[t.Plain=0]="Plain",t[t.TemplateLiteralPart=1]="TemplateLiteralPart",t[t.TemplateLiteralEnd=2]="TemplateLiteralEnd"})(F||(F={}));var hr=["var","let","as","null","undefined","true","false","if","else","this","typeof","void","in"],_e=class{tokenize(e){return new Vt(e).scan()}},A=class{index;end;type;numValue;strValue;constructor(e,n,s,i,r){this.index=e,this.end=n,this.type=s,this.numValue=i,this.strValue=r}isCharacter(e){return this.type===h.Character&&this.numValue===e}isNumber(){return this.type===h.Number}isString(){return this.type===h.String}isOperator(e){return this.type===h.Operator&&this.strValue===e}isIdentifier(){return this.type===h.Identifier}isPrivateIdentifier(){return this.type===h.PrivateIdentifier}isKeyword(){return this.type===h.Keyword}isKeywordLet(){return this.type===h.Keyword&&this.strValue==="let"}isKeywordAs(){return this.type===h.Keyword&&this.strValue==="as"}isKeywordNull(){return this.type===h.Keyword&&this.strValue==="null"}isKeywordUndefined(){return this.type===h.Keyword&&this.strValue==="undefined"}isKeywordTrue(){return this.type===h.Keyword&&this.strValue==="true"}isKeywordFalse(){return this.type===h.Keyword&&this.strValue==="false"}isKeywordThis(){return this.type===h.Keyword&&this.strValue==="this"}isKeywordTypeof(){return this.type===h.Keyword&&this.strValue==="typeof"}isKeywordVoid(){return this.type===h.Keyword&&this.strValue==="void"}isKeywordIn(){return this.type===h.Keyword&&this.strValue==="in"}isError(){return this.type===h.Error}isRegExpBody(){return this.type===h.RegExpBody}isRegExpFlags(){return this.type===h.RegExpFlags}toNumber(){return this.type===h.Number?this.numValue:-1}isTemplateLiteralPart(){return this.isString()&&this.kind===F.TemplateLiteralPart}isTemplateLiteralEnd(){return this.isString()&&this.kind===F.TemplateLiteralEnd}isTemplateLiteralInterpolationStart(){return this.isOperator("${")}toString(){switch(this.type){case h.Character:case h.Identifier:case h.Keyword:case h.Operator:case h.PrivateIdentifier:case h.String:case h.Error:case h.RegExpBody:case h.RegExpFlags:return this.strValue;case h.Number:return this.numValue.toString();default:return null}}},xe=class extends A{kind;constructor(e,n,s,i){super(e,n,h.String,0,s),this.kind=i}};function he(t,e,n){return new A(t,e,h.Character,n,String.fromCharCode(n))}function fr(t,e,n){return new A(t,e,h.Identifier,0,n)}function dr(t,e,n){return new A(t,e,h.PrivateIdentifier,0,n)}function mr(t,e,n){return new A(t,e,h.Keyword,0,n)}function Y(t,e,n){return new A(t,e,h.Operator,0,n)}function gr(t,e,n){return new A(t,e,h.Number,n,"")}function vr(t,e,n){return new A(t,e,h.Error,0,n)}function xr(t,e,n){return new A(t,e,h.RegExpBody,0,n)}function wr(t,e,n){return new A(t,e,h.RegExpFlags,0,n)}var Ae=new A(-1,-1,h.Character,0,""),Vt=class{input;tokens=[];length;peek=0;index=-1;braceStack=[];constructor(e){this.input=e,this.length=e.length,this.advance()}scan(){let e=this.scanToken();for(;e!==null;)this.tokens.push(e),e=this.scanToken();return this.tokens}advance(){this.peek=++this.index>=this.length?pe:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,n=this.length,s=this.peek,i=this.index;for(;s<=ls;)if(++i>=n){s=pe;break}else s=e.charCodeAt(i);if(this.peek=s,this.index=i,i>=n)return null;if(es(s))return this.scanIdentifier();if(W(s))return this.scanNumber(i);let r=i;switch(s){case H:return this.advance(),W(this.peek)?this.scanNumber(r):this.peek!==H?he(r,this.index,H):(this.advance(),this.peek===H?(this.advance(),Y(r,this.index,"...")):this.error(`Unexpected character [${String.fromCharCode(s)}]`,0));case ve:case q:case te:case G:case Q:case j:case fe:retu