hugo-batsite/node_modules/prettier/parser-babel.js

27 lines
307 KiB
JavaScript
Raw Normal View History

2022-05-27 15:11:53 +00:00
(function(e){if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var i=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};i.prettierPlugins=i.prettierPlugins||{},i.prettierPlugins.babel=e()}})(function(){"use strict";var v=(h,l)=>()=>(l||h((l={exports:{}}).exports,l),l.exports);var W=v((Bf,Jr)=>{var Pt=function(h){return h&&h.Math==Math&&h};Jr.exports=Pt(typeof globalThis=="object"&&globalThis)||Pt(typeof window=="object"&&window)||Pt(typeof self=="object"&&self)||Pt(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var Ae=v((Mf,Yr)=>{Yr.exports=function(h){try{return!!h()}catch{return!0}}});var De=v((Rf,$r)=>{var rl=Ae();$r.exports=!rl(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var Tt=v((jf,Qr)=>{var il=Ae();Qr.exports=!il(function(){var h=function(){}.bind();return typeof h!="function"||h.hasOwnProperty("prototype")})});var bt=v((qf,Zr)=>{var al=Tt(),Et=Function.prototype.call;Zr.exports=al?Et.bind(Et):function(){return Et.apply(Et,arguments)}});var ri=v(si=>{"use strict";var ei={}.propertyIsEnumerable,ti=Object.getOwnPropertyDescriptor,nl=ti&&!ei.call({1:2},1);si.f=nl?function(l){var p=ti(this,l);return!!p&&p.enumerable}:ei});var ms=v((_f,ii)=>{ii.exports=function(h,l){return{enumerable:!(h&1),configurable:!(h&2),writable:!(h&4),value:l}}});var ie=v((zf,oi)=>{var ai=Tt(),ni=Function.prototype,ol=ni.bind,ys=ni.call,hl=ai&&ol.bind(ys,ys);oi.exports=ai?function(h){return h&&hl(h)}:function(h){return h&&function(){return ys.apply(h,arguments)}}});var vt=v((Kf,li)=>{var hi=ie(),ll=hi({}.toString),ul=hi("".slice);li.exports=function(h){return ul(ll(h),8,-1)}});var ci=v((Vf,ui)=>{var cl=W(),pl=ie(),fl=Ae(),dl=vt(),xs=cl.Object,ml=pl("".split);ui.exports=fl(function(){return!xs("z").propertyIsEnumerable(0)})?function(h){return dl(h)=="String"?ml(h,""):xs(h)}:xs});var gs=v((Hf,pi)=>{var yl=W(),xl=yl.TypeError;pi.exports=function(h){if(h==null)throw xl("Can't call method on "+h);return h}});var Ct=v((Wf,fi)=>{var gl=ci(),Al=gs();fi.exports=function(h){return gl(Al(h))}});var ae=v((Gf,di)=>{di.exports=function(h){return typeof h=="function"}});var Fe=v((Xf,mi)=>{var Pl=ae();mi.exports=function(h){return typeof h=="object"?h!==null:Pl(h)}});var $e=v((Jf,yi)=>{var As=W(),Tl=ae(),El=function(h){return Tl(h)?h:void 0};yi.exports=function(h,l){return arguments.length<2?El(As[h]):As[h]&&As[h][l]}});var gi=v((Yf,xi)=>{var bl=ie();xi.exports=bl({}.isPrototypeOf)});var Pi=v(($f,Ai)=>{var vl=$e();Ai.exports=vl("navigator","userAgent")||""});var wi=v((Qf,Si)=>{var Ci=W(),Ps=Pi(),Ti=Ci.process,Ei=Ci.Deno,bi=Ti&&Ti.versions||Ei&&Ei.version,vi=bi&&bi.v8,he,St;vi&&(he=vi.split("."),St=he[0]>0&&he[0]<4?1:+(he[0]+he[1]));!St&&Ps&&(he=Ps.match(/Edge\/(\d+)/),(!he||he[1]>=74)&&(he=Ps.match(/Chrome\/(\d+)/),he&&(St=+he[1])));Si.exports=St});var Ts=v((Zf,Ii)=>{var Ni=wi(),Cl=Ae();Ii.exports=!!Object.getOwnPropertySymbols&&!Cl(function(){var h=Symbol();return!String(h)||!(Object(h)instanceof Symbol)||!Symbol.sham&&Ni&&Ni<41})});var Es=v((ed,ki)=>{var Sl=Ts();ki.exports=Sl&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var bs=v((td,Di)=>{var wl=W(),Nl=$e(),Il=ae(),kl=gi(),Dl=Es(),Fl=wl.Object;Di.exports=Dl?function(h){return typeof h=="symbol"}:function(h){var l=Nl("Symbol");return Il(l)&&kl(l.prototype,Fl(h))}});var Li=v((sd,Fi)=>{var Ll=W(),Ol=Ll.String;Fi.exports=function(h){try{return Ol(h)}catch{return"Object"}}});var wt=v((rd,Oi)=>{var Bl=W(),Ml=ae(),Rl=Li(),jl=Bl.TypeError;Oi.exports=function(h){if(Ml(h))return h;throw jl(Rl(h)+" is not a function")}});var Mi=v((id,Bi)=>{var ql=wt();Bi.exports=function(h,l){var p=h[l];return p==null?void 0:ql(p)}});var ji=v((ad,Ri)=>{var Ul=W(),vs=bt(),Cs=ae(),Ss=Fe(),_l=Ul.TypeError;Ri.exports=function(h,l){var p,d;if(l==="string"&&Cs(p=h.toString)&&!Ss(d=vs(p,h))||Cs(p=h.valueOf)&&!Ss(d=vs(p,h))||l!=="string"&&Cs(p=h.toString)&&!Ss(d=vs(p,h)))return d;throw _l("Can't convert object to primitive value")}});var Ui
`);return m===-1?d:d.slice(0,m)}l.exports=p}}),Yp=H({"src/utils/text/skip-inline-comment.js"(h,l){"use strict";V();function p(d,m){if(m===!1)return!1;if(d.charAt(m)==="/"&&d.charAt(m+1)==="*"){for(let A=m+2;A<d.length;++A)if(d.charAt(A)==="*"&&d.charAt(A+1)==="/")return A+2}return m}l.exports=p}}),$p=H({"src/utils/text/skip-newline.js"(h,l){"use strict";V();function p(d,m,A){let x=A&&A.backwards;if(m===!1)return!1;let g=d.charAt(m);if(x){if(d.charAt(m-1)==="\r"&&g===`
`)return m-2;if(g===`
`||g==="\r"||g==="\u2028"||g==="\u2029")return m-1}else{if(g==="\r"&&d.charAt(m+1)===`
`)return m+2;if(g===`
`||g==="\r"||g==="\u2028"||g==="\u2029")return m+1}return m}l.exports=p}}),Qn=H({"src/utils/text/skip.js"(h,l){"use strict";V();function p(g){return(P,N,D)=>{let T=D&&D.backwards;if(N===!1)return!1;let{length:L}=P,b=N;for(;b>=0&&b<L;){let _=P.charAt(b);if(g instanceof RegExp){if(!g.test(_))return b}else if(!g.includes(_))return b;T?b--:b++}return b===-1||b===L?b:!1}}var d=p(/\s/),m=p(" "),A=p(",; "),x=p(/[^\n\r]/);l.exports={skipWhitespace:d,skipSpaces:m,skipToLineEnd:A,skipEverythingButNewLine:x}}}),Qp=H({"src/utils/text/skip-trailing-comment.js"(h,l){"use strict";V();var{skipEverythingButNewLine:p}=Qn();function d(m,A){return A===!1?!1:m.charAt(A)==="/"&&m.charAt(A+1)==="/"?p(m,A):A}l.exports=d}}),Zp=H({"src/utils/text/get-next-non-space-non-comment-character-index-with-start-index.js"(h,l){"use strict";V();var p=Yp(),d=$p(),m=Qp(),{skipSpaces:A}=Qn();function x(g,P){let N=null,D=P;for(;D!==N;)N=D,D=A(g,D),D=p(g,D),D=m(g,D),D=d(g,D);return D}l.exports=x}}),Zn={};Wp(Zn,{EOL:()=>rr,arch:()=>ef,cpus:()=>no,default:()=>co,endianness:()=>eo,freemem:()=>io,getNetworkInterfaces:()=>uo,hostname:()=>to,loadavg:()=>so,networkInterfaces:()=>lo,platform:()=>tf,release:()=>ho,tmpDir:()=>tr,tmpdir:()=>sr,totalmem:()=>ao,type:()=>oo,uptime:()=>ro});function eo(){if(typeof Rt>"u"){var h=new ArrayBuffer(2),l=new Uint8Array(h),p=new Uint16Array(h);if(l[0]=1,l[1]=2,p[0]===258)Rt="BE";else if(p[0]===513)Rt="LE";else throw new Error("unable to figure out endianess")}return Rt}function to(){return typeof globalThis.location<"u"?globalThis.location.hostname:""}function so(){return[]}function ro(){return 0}function io(){return Number.MAX_VALUE}function ao(){return Number.MAX_VALUE}function no(){return[]}function oo(){return"Browser"}function ho(){return typeof globalThis.navigator<"u"?globalThis.navigator.appVersion:""}function lo(){}function uo(){}function ef(){return"javascript"}function tf(){return"browser"}function tr(){return"/tmp"}var Rt,sr,rr,co,sf=Yn({"node-modules-polyfills:os"(){V(),sr=tr,rr=`
`,co={EOL:rr,tmpdir:sr,tmpDir:tr,networkInterfaces:lo,getNetworkInterfaces:uo,release:ho,type:oo,cpus:no,totalmem:ao,freemem:io,uptime:ro,loadavg:so,hostname:to,endianness:eo}}}),rf=H({"node-modules-polyfills-commonjs:os"(h,l){V();var p=(sf(),Xp(Zn));if(p&&p.default){l.exports=p.default;for(let d in p)l.exports[d]=p[d]}else p&&(l.exports=p)}}),af=H({"node_modules/detect-newline/index.js"(h,l){"use strict";V();var p=d=>{if(typeof d!="string")throw new TypeError("Expected a string");let m=d.match(/(?:\r?\n)/g)||[];if(m.length===0)return;let A=m.filter(g=>g===`\r
`).length,x=m.length-A;return A>x?`\r
`:`
`};l.exports=p,l.exports.graceful=d=>typeof d=="string"&&p(d)||`
`}}),nf=H({"node_modules/jest-docblock/build/index.js"(h){"use strict";V(),Object.defineProperty(h,"__esModule",{value:!0}),h.extract=b,h.parse=se,h.parseWithComments=B,h.print=j,h.strip=_;function l(){let u=rf();return l=function(){return u},u}function p(){let u=d(af());return p=function(){return u},u}function d(u){return u&&u.__esModule?u:{default:u}}var m=/\*\/$/,A=/^\/\*\*/,x=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,g=/(^|\s+)\/\/([^\r\n]*)/g,P=/^(\r?\n)+/,N=/(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g,D=/(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g,T=/(\r?\n|^) *\* ?/g,L=[];function b(u){let X=u.match(x);return X?X[0].trimLeft():""}function _(u){let X=u.match(x);return X&&X[0]?u.substring(X[0].length):u}function se(u){return B(u).pragmas}function B(u){let X=(0,p().default)(u)||l().EOL;u=u.replace(A,"").replace(m,"").replace(T,"$1");let re="";for(;re!==u;)re=u,u=u.replace(N,"".concat(X,"$1 $2").concat(X));u=u.replace(P,"").trimRight();let J=Object.create(null),Be=u.replace(D,"").replace(P,"").trimRight(),Y;for(;Y=D.exec(u);){let z=Y[2].replace(g,"");typeof J[Y[1]]=="string"||Array.isArray(J[Y[1]])?J[Y[1]]=L.concat(J[Y[1]],z):J[Y[1]]=z}return{comments:Be,pragmas:J}}function j(u){let{comments:X="",pragmas:re={}}=u,J=(0,p().default)(X)||l().EOL,Be="/**",Y=" *",z=" */",O=Object.keys(re),E=O.map(Q=>G(Q,re[Q])).reduce((Q,le)=>Q.concat(le),[]).map(Q=>Y+" "+Q+J).join("");if(!X){if(O.length===0)return"";if(O.length===1&&!Array.isArray(re[O[0]])){let Q=re[O[0]];return"".concat(Be," ").concat(G(O[0],Q)[0]).concat(z)}}let Ke=X.split(J).map(Q=>"".concat(Y," ").concat(Q)).join(J)+J;return Be+J+(X?Ke:"")+(X&&O.length?Y+J:"")+E+z}function G(u,X){return L.concat(X).map(re=>"@".concat(u," ").concat(re).trim())}}}),of=H({"src/common/end-of-line.js"(h,l){"use strict";V();function p(x){let g=x.indexOf("\r");return g>=0?x.charAt(g+1)===`
`?"crlf":"cr":"lf"}function d(x){switch(x){case"cr":return"\r";case"crlf":return`\r
`;default:return`
`}}function m(x,g){let P;switch(g){case`
`:P=/\n/g;break;case"\r":P=/\r/g;break;case`\r
`:P=/\r\n/g;break;default:throw new Error('Unexpected "eol" '.concat(JSON.stringify(g),"."))}let N=x.match(P);return N?N.length:0}function A(x){return x.replace(/\r\n?/g,`
`)}l.exports={guessEndOfLine:p,convertEndOfLineToChars:d,countEndOfLineChars:m,normalizeEndOfLine:A}}}),hf=H({"src/language-js/pragma.js"(h,l){"use strict";V();var{parseWithComments:p,strip:d,extract:m,print:A}=nf(),{normalizeEndOfLine:x}=of(),g=$n();function P(T){let L=g(T);L&&(T=T.slice(L.length+1));let b=m(T),{pragmas:_,comments:se}=p(b);return{shebang:L,text:T,pragmas:_,comments:se}}function N(T){let L=Object.keys(P(T).pragmas);return L.includes("prettier")||L.includes("format")}function D(T){let{shebang:L,text:b,pragmas:_,comments:se}=P(T),B=d(b),j=A({pragmas:Object.assign({format:""},_),comments:se.trimStart()});return(L?"".concat(L,`
`):"")+x(j)+(B.startsWith(`
`)?`
`:`
`)+B}l.exports={hasPragma:N,insertPragma:D}}}),po=H({"src/utils/is-non-empty-array.js"(h,l){"use strict";V();function p(d){return Array.isArray(d)&&d.length>0}l.exports=p}}),fo=H({"src/language-js/loc.js"(h,l){"use strict";V();var p=po();function d(P,N){let{ignoreDecorators:D}=N||{};if(!D){let T=P.declaration&&P.declaration.decorators||P.decorators;if(p(T))return d(T[0])}return P.range?P.range[0]:P.start}function m(P){return P.range?P.range[1]:P.end}function A(P,N){let D=d(P);return Number.isInteger(D)&&D===d(N)}function x(P,N){let D=m(P);return Number.isInteger(D)&&D===m(N)}function g(P,N){return A(P,N)&&x(P,N)}l.exports={locStart:d,locEnd:m,hasSameLocStart:A,hasSameLoc:g}}}),mo=H({"src/language-js/parse/utils/create-parser.js"(h,l){"use strict";V();var{hasPragma:p}=hf(),{locStart:d,locEnd:m}=fo();function A(x){return x=typeof x=="function"?{parse:x}:x,Object.assign({astFormat:"estree",hasPragma:p,locStart:d,locEnd:m},x)}l.exports=A}}),nr=H({"src/common/parser-create-error.js"(h,l){"use strict";V();function p(d,m){let A=new SyntaxError(d+" ("+m.start.line+":"+m.start.column+")");return A.loc=m,A}l.exports=p}}),yo=H({"src/language-js/parse/utils/create-babel-parse-error.js"(h,l){"use strict";V();var p=nr();function d(m){let{message:A,loc:x}=m;return p(A.replace(/ \(.*\)/,""),{start:{line:x?x.line:0,column:x?x.column+1:0}})}l.exports=d}}),lf=H({"src/language-js/utils/is-ts-keyword-type.js"(h,l){"use strict";V();function p(d){let{type:m}=d;return m.startsWith("TS")&&m.endsWith("Keyword")}l.exports=p}}),uf=H({"src/language-js/utils/is-block-comment.js"(h,l){"use strict";V();function p(d){return d.type==="Block"||d.type==="CommentBlock"||d.type==="MultiLine"}l.exports=p}}),cf=H({"src/language-js/utils/is-type-cast-comment.js"(h,l){"use strict";V();var p=uf();function d(m){return p(m)&&m.value[0]==="*"&&/@type\b/.test(m.value)}l.exports=d}}),pf=H({"src/utils/get-last.js"(h,l){"use strict";V();var p=d=>d[d.length-1];l.exports=p}}),xo=H({"src/language-js/parse/postprocess/visit-node.js"(h,l){"use strict";V();function p(d,m){if(Array.isArray(d)){for(let A=0;A<d.length;A++)d[A]=p(d[A],m);return d}if(d&&typeof d=="object"&&typeof d.type=="string"){let A=Object.keys(d);for(let x=0;x<A.length;x++)d[A[x]]=p(d[A[x]],m);return m(d)||d}return d}l.exports=p}}),ff=H({"src/language-js/parse/postprocess/typescript.js"(h,l){"use strict";V();var p=nr(),d=xo();function m(P,N){let{start:D,end:T}=P.loc;throw p(N,{start:{line:D.line,column:D.column+1},end:{line:T.line,column:T.column+1}})}function A(P,N,D){let T=P.decorators;if(!Array.isArray(T))return;let L=N.decorators;(!Array.isArray(L)||L.length!==T.length||T.some(b=>{let _=D.get(b);return!_||!L.includes(_)}))&&m(N,"Leading decorators must be attached to a class declaration")}function x(P,N){P.kind!==166||P.modifiers&&!P.modifiers.some(L=>L.kind===126)||P.initializer&&N.value===null&&m(N,"Abstract property cannot have an initializer")}function g(P,N){let{esTreeNodeToTSNodeMap:D,tsNodeToESTreeNodeMap:T}=N.tsParseResult;d(P,L=>{let b=D.get(L);if(!b)return;let _=T.get(b);_===L&&(A(b,_,T),x(b,_))})}l.exports={throwErrorForInvalidNodes:g}}}),df=H({"src/language-js/parse/postprocess/index.js"(h,l){"use strict";V();var{locStart:p,locEnd:d}=fo(),m=lf(),A=cf(),x=pf(),g=xo(),{throwErrorForInvalidNodes:P}=ff();function N(b,_){if(_.parser==="typescript"&&/@|abstract/.test(_.originalText)&&P(b,_),_.parser!=="typescript"&&_.parser!=="flow"&&_.parser!=="acorn"&&_.parser!=="espree"&&_.parser!=="meriyah"){let B=new Set;b=g(b,j=>{j.leadingComments&&j.leadingComments.some(A)&&B.add(p(j))}),b=g(b,j=>{if(j.type==="ParenthesizedExpression"){let{expression:G}=j;if(G.type==="TypeCastExpression")return G.range=j.range,G;let u=p(j);if(!B.has(u))return G.extra=Object.assign(Object.assign({},G.extra),{},{parenthesized:!0}),G}})}return b=g(b,B=>{switch(B.type){case"ChainExpression":return D(B.expression);case"LogicalExpression":{if(T(B))return L(B);break}case"VariableDeclaration":{let j=x(B.declarations);j&&j.init&&se(B,j);break}case"TSParenthesizedType":return m(B.typeAnnotation)||B.typeAnnotation.type==="TSThisType"||
`;break;default:t+=String.fromCharCode(r);break}++this.state.curLine,this.state.lineStart=this.state.pos,e=this.state.pos}else++this.state.pos}}recordStrictModeErrors(t,e){let{at:s}=e,r=s.index;this.state.strict&&!this.state.strictErrors.has(r)?this.raise(t,{at:s}):this.state.strictErrors.set(r,[t,s])}readEscapedChar(t){let e=!t,s=this.input.charCodeAt(++this.state.pos);switch(++this.state.pos,s){case 110:return`
`;case 114:return"\r";case 120:{let r=this.readHexChar(2,!1,e);return r===null?null:String.fromCharCode(r)}case 117:{let r=this.readCodePoint(e);return r===null?null:String.fromCodePoint(r)}case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.state.pos)===10&&++this.state.pos;case 10:this.state.lineStart=this.state.pos,++this.state.curLine;case 8232:case 8233:return"";case 56:case 57:if(t)return null;this.recordStrictModeErrors(u.StrictNumericEscape,{at:m(this.state.curPosition(),-1)});default:if(s>=48&&s<=55){let r=m(this.state.curPosition(),-1),a=this.input.substr(this.state.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(a,8);n>255&&(a=a.slice(0,-1),n=parseInt(a,8)),this.state.pos+=a.length-1;let o=this.input.charCodeAt(this.state.pos);if(a!=="0"||o===56||o===57){if(t)return null;this.recordStrictModeErrors(u.StrictNumericEscape,{at:r})}return String.fromCharCode(n)}return String.fromCharCode(s)}}readHexChar(t,e,s){let r=this.state.curPosition(),i=this.readInt(16,t,e,!1);return i===null&&(s?this.raise(u.InvalidEscapeSequence,{at:r}):this.state.pos=r.index-1),i}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,r=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos<this.length;){let i=this.codePointAtPos(this.state.pos);if(Me(i))this.state.pos+=i<=65535?1:2;else if(i===92){this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);let a=this.state.curPosition(),n=this.state.pos===s?de:Me;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(u.MissingUnicodeEscape,{at:this.state.curPosition()}),r=this.state.pos-1;continue}++this.state.pos;let o=this.readCodePoint(!0);o!==null&&(n(o)||this.raise(u.EscapedCharNotAnIdentifier,{at:a}),e+=String.fromCodePoint(o)),r=this.state.pos}else break}return e+this.input.slice(r,this.state.pos)}readWord(t){let e=this.readWord1(t),s=jt.get(e);s!==void 0?this.finishToken(s,Te(s)):this.finishToken(128,e)}checkKeywordEscapes(){let{type:t}=this.state;Vt(t)&&this.state.containsEsc&&this.raise(u.InvalidEscapedReservedWord,{at:this.state.startLoc,reservedWord:Te(t)})}raise(t,e){let{at:s}=e,r=l(e,ih),i=s instanceof p?s:s.loc.start,a=t({loc:i,details:r});if(!this.options.errorRecovery)throw a;return this.isLookahead||this.state.errors.push(a),a}raiseOverwrite(t,e){let{at:s}=e,r=l(e,ah),i=s instanceof p?s:s.loc.start,a=i.index,n=this.state.errors;for(let o=n.length-1;o>=0;o--){let c=n[o];if(c.loc.index===a)return n[o]=t({loc:i,details:r});if(c.loc.index<a)break}return this.raise(t,e)}updateContext(t){}unexpected(t,e){throw this.raise(u.UnexpectedToken,{expected:e?Te(e):null,at:t!=null?t:this.state.startLoc})}expectPlugin(t,e){if(this.hasPlugin(t))return!0;throw this.raise(u.MissingPlugin,{at:e!=null?e:this.state.startLoc,missingPlugin:[t]})}expectOnePlugin(t){if(!t.some(e=>this.hasPlugin(e)))throw this.raise(u.MissingOneOfPlugins,{at:this.state.startLoc,missingPlugin:t})}},ns=class{constructor(t){this.var=new Set,this.lexical=new Set,this.functions=new Set,this.flags=t}},os=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inFunction(){return(this.currentVarScopeFlags()&me)>0}get allowSuper(){return(this.currentThisScopeFlags()&ot)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&gr)>0}get inClass(){return(this.currentThisScopeFlags()&we)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&we)>0&&(t&me)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&Jt)return!0;if(e&(lt|we))return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&me)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new ns(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){this.scopeStack.pop()}treatFunctionsAsVarInScope(t){return!!(t.flags&(me|Jt)||!this.parser.inModule&&t.flags&He)}declareName(t,e,s){let r=this.currentScope();if(e&Ee||e&ut)this.checkRed
`:`\r
`):r=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let s="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(u.UnterminatedString,{at:this.state.startLoc});let i=this.input.charCodeAt(this.state.pos);if(i===e)break;i===38?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadEntity(),r=this.state.pos):Ie(i)?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}return s+=this.input.slice(r,this.state.pos++),this.finishToken(129,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let r=this.readInt(s,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let s=0,r=!1;for(;s++<10&&this.state.pos<this.length&&!(r=this.codePointAtPos(this.state.pos)==59);)++this.state.pos;if(r){let i=this.input.slice(e,this.state.pos),a=Ih[i];if(++this.state.pos,a)return a}}return this.state.pos=e,"&"}jsxReadWord(){let e,s=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(Me(e)||e===45);return this.finishToken(136,this.input.slice(s,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(136)?e.name=this.state.value:Vt(this.state.type)?e.name=Te(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.start,s=this.state.startLoc,r=this.jsxParseIdentifier();if(!this.eat(14))return r;let i=this.startNodeAt(e,s);return i.namespace=r,i.name=this.jsxParseIdentifier(),this.finishNode(i,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.start,s=this.state.startLoc,r=this.jsxParseNamespacedName();if(r.type==="JSXNamespacedName")return r;for(;this.eat(16);){let i=this.startNodeAt(e,s);i.object=r,i.property=this.jsxParseIdentifier(),r=this.finishNode(i,"JSXMemberExpression")}return r}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext(z.brace),this.next(),e=this.jsxParseExpressionContainer(e,z.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(ke.AttributeIsEmpty,{at:e}),e;case 138:case 129:return this.parseExprAtom();default:throw this.raise(ke.UnsupportedJsxValue,{at:this.state.startLoc})}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc.index,this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(z.j_oTag),this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,s){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let r=this.parseExpression();e.expression=r}return this.setContext(s),this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext(z.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(z.j_oTag),this.expect(8),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsxParseOpeningElementAt(e,s){let r=this.startNodeAt(e,s);return this.match(139)?(this.expect(139),this.finishNode(r,"JSXOpeningFragment")):(r.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(r))}jsxParseOpeningElementAfterName(e){let s=[];for(;!this.match(56)&&!this.match(139);)s.push(this.jsxParseAttribute());return e.attributes=s,e.selfClosing=this.eat(56),this.expect(139),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e,s){let r=this.startNodeAt(e,s);return this.match(139)?(this.expect(139),this.finishNode(r,"JSXClosingFragment")):(r.name=this.jsxParseElementName(),this.expect(139),this.finishNode(r,"JSXClosingElement"))}jsxParseElementAt(e,s){let r=this.startNodeAt(e,s),i=[],a=this.jsxParseOpeningElementAt(e,s),n=null;if(
`),cooked:i===null?null:i.slice(1,c)},n.tail=o,this.next(),this.finishNode(n,"TemplateElement"),this.resetEndLocation(n,m(this.state.lastTokEndLoc,c)),n}parseTemplate(t){let e=this.startNode();e.expressions=[];let s=this.parseTemplateElement(t);for(e.quasis=[s];!s.tail;)e.expressions.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),e.quasis.push(s=this.parseTemplateElement(t));return this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,r){s&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=Object.create(null),n=!0,o=this.startNode();for(o.properties=[],this.next();!this.match(t);){if(n)n=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(o);break}let f;e?f=this.parseBindingProperty():(f=this.parsePropertyDefinition(r),this.checkProto(f,s,a,r)),s&&!this.isObjectProperty(f)&&f.type!=="SpreadElement"&&this.raise(u.InvalidRecordProperty,{at:f}),f.shorthand&&this.addExtra(f,"shorthand",!0),o.properties.push(f)}this.next(),this.state.inFSharpPipelineDirectBody=i;let c="ObjectExpression";return e?c="ObjectPattern":s&&(c="RecordExpression"),this.finishNode(o,c)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStart),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(u.UnsupportedPropertyDecorator,{at:this.state.startLoc});this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),r=!1,i=!1,a,n;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(a=this.state.start,n=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let c=this.state.containsEsc,f=this.parsePropertyName(s,t);if(!o&&!c&&this.maybeAsyncOrAccessorProp(s)){let y=f.name;y==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(f),o=this.eat(55),this.parsePropertyName(s)),(y==="get"||y==="set")&&(i=!0,this.resetPreviousNodeTrailingComments(f),s.kind=y,this.match(55)&&(o=!0,this.raise(u.AccessorIsGenerator,{at:this.state.curPosition(),kind:y}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,a,n,o,r,!1,i,t),s}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),r=this.getObjectOrClassMethodParams(t);r.length!==s&&this.raise(t.kind==="get"?u.BadGetterArity:u.BadSetterArity,{at:t}),t.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(u.BadSetterRestParameter,{at:t})}parseObjectMethod(t,e,s,r,i){if(i)return this.parseMethod(t,e,!1,!1,!1,"ObjectMethod"),this.checkGetterSetterParams(t),t;if(s||e||this.match(10))return r&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,r,i){if(t.shorthand=!1,this.eat(14))return t.value=r?this.parseMaybeDefault(this.state.start,this.state.startLoc):this.parseMaybeAssignAllowIn(i),this.finishNode(t,"ObjectProperty");if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),r)t.value=this.parseMaybeDefault(e,s,ge(t.key));else if(this.match(29)){let a=this.state.startLoc;i!=null?i.shorthandAssignLoc===null&&(i.shorthandAssignLoc=a):this.raise(u.InvalidCoverInitializedName,{at:a}),t.value=this.parseMaybeDefault(e,s,ge(t.key))}else t.value=ge(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,s,r,i,a,n,o){let c=this.parseObjectMethod(t,r,i,a,n)||this.parseObjectProperty(t,e,s,a,o);return c||this.unexpected(),c}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);el