webhook/node_modules/prettier/esm/parser-babel.mjs

28 lines
309 KiB
JavaScript
Raw Normal View History

2022-11-10 11:43:16 +01:00
"use strict";var b=(h,u)=>()=>(u||h((u={exports:{}}).exports,u),u.exports);var J=b((pf,Gr)=>{var vt=function(h){return h&&h.Math==Math&&h};Gr.exports=vt(typeof globalThis=="object"&&globalThis)||vt(typeof window=="object"&&window)||vt(typeof self=="object"&&self)||vt(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var be=b((ff,Xr)=>{Xr.exports=function(h){try{return!!h()}catch{return!0}}});var Me=b((df,Jr)=>{var Yh=be();Jr.exports=!Yh(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var St=b((mf,Yr)=>{var $h=be();Yr.exports=!$h(function(){var h=function(){}.bind();return typeof h!="function"||h.hasOwnProperty("prototype")})});var Nt=b((yf,$r)=>{var Qh=St(),wt=Function.prototype.call;$r.exports=Qh?wt.bind(wt):function(){return wt.apply(wt,arguments)}});var ti=b(ei=>{"use strict";var Qr={}.propertyIsEnumerable,Zr=Object.getOwnPropertyDescriptor,Zh=Zr&&!Qr.call({1:2},1);ei.f=Zh?function(u){var p=Zr(this,u);return!!p&&p.enumerable}:Qr});var ds=b((gf,si)=>{si.exports=function(h,u){return{enumerable:!(h&1),configurable:!(h&2),writable:!(h&4),value:u}}});var le=b((Af,ai)=>{var ri=St(),ii=Function.prototype,el=ii.bind,ms=ii.call,tl=ri&&el.bind(ms,ms);ai.exports=ri?function(h){return h&&tl(h)}:function(h){return h&&function(){return ms.apply(h,arguments)}}});var It=b((Pf,oi)=>{var ni=le(),sl=ni({}.toString),rl=ni("".slice);oi.exports=function(h){return rl(sl(h),8,-1)}});var li=b((Tf,hi)=>{var il=J(),al=le(),nl=be(),ol=It(),ys=il.Object,hl=al("".split);hi.exports=nl(function(){return!ys("z").propertyIsEnumerable(0)})?function(h){return ol(h)=="String"?hl(h,""):ys(h)}:ys});var xs=b((Ef,ui)=>{var ll=J(),ul=ll.TypeError;ui.exports=function(h){if(h==null)throw ul("Can't call method on "+h);return h}});var kt=b((bf,ci)=>{var cl=li(),pl=xs();ci.exports=function(h){return cl(pl(h))}});var ue=b((Cf,pi)=>{pi.exports=function(h){return typeof h=="function"}});var Re=b((vf,fi)=>{var fl=ue();fi.exports=function(h){return typeof h=="object"?h!==null:fl(h)}});var rt=b((Sf,di)=>{var gs=J(),dl=ue(),ml=function(h){return dl(h)?h:void 0};di.exports=function(h,u){return arguments.length<2?ml(gs[h]):gs[h]&&gs[h][u]}});var yi=b((wf,mi)=>{var yl=le();mi.exports=yl({}.isPrototypeOf)});var gi=b((Nf,xi)=>{var xl=rt();xi.exports=xl("navigator","userAgent")||""});var vi=b((If,Ci)=>{var bi=J(),As=gi(),Ai=bi.process,Pi=bi.Deno,Ti=Ai&&Ai.versions||Pi&&Pi.version,Ei=Ti&&Ti.v8,fe,Dt;Ei&&(fe=Ei.split("."),Dt=fe[0]>0&&fe[0]<4?1:+(fe[0]+fe[1]));!Dt&&As&&(fe=As.match(/Edge\/(\d+)/),(!fe||fe[1]>=74)&&(fe=As.match(/Chrome\/(\d+)/),fe&&(Dt=+fe[1])));Ci.exports=Dt});var Ps=b((kf,wi)=>{var Si=vi(),gl=be();wi.exports=!!Object.getOwnPropertySymbols&&!gl(function(){var h=Symbol();return!String(h)||!(Object(h)instanceof Symbol)||!Symbol.sham&&Si&&Si<41})});var Ts=b((Df,Ni)=>{var Al=Ps();Ni.exports=Al&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Es=b((Ff,Ii)=>{var Pl=J(),Tl=rt(),El=ue(),bl=yi(),Cl=Ts(),vl=Pl.Object;Ii.exports=Cl?function(h){return typeof h=="symbol"}:function(h){var u=Tl("Symbol");return El(u)&&bl(u.prototype,vl(h))}});var Di=b((Lf,ki)=>{var Sl=J(),wl=Sl.String;ki.exports=function(h){try{return wl(h)}catch{return"Object"}}});var Ft=b((Of,Fi)=>{var Nl=J(),Il=ue(),kl=Di(),Dl=Nl.TypeError;Fi.exports=function(h){if(Il(h))return h;throw Dl(kl(h)+" is not a function")}});var Oi=b((Bf,Li)=>{var Fl=Ft();Li.exports=function(h,u){var p=h[u];return p==null?void 0:Fl(p)}});var Mi=b((Mf,Bi)=>{var Ll=J(),bs=Nt(),Cs=ue(),vs=Re(),Ol=Ll.TypeError;Bi.exports=function(h,u){var p,d;if(u==="string"&&Cs(p=h.toString)&&!vs(d=bs(p,h))||Cs(p=h.valueOf)&&!vs(d=bs(p,h))||u!=="string"&&Cs(p=h.toString)&&!vs(d=bs(p,h)))return d;throw Ol("Can't convert object to primitive value")}});var ji=b((Rf,Ri)=>{Ri.exports=!1});var Lt=b((jf,Ui)=>{var qi=J(),Bl=Object.defineProperty;Ui.exports=function(h,u){try{Bl(qi,h,{value:u,configurable:!0,writable:!0})}catch{qi[h]=u}return u}});var Ot=b((qf,zi)=>{var Ml=J(),Rl=Lt(),_i="__core-js_shared__",jl=Ml[_i]||Rl(_i,{});zi.exports=jl});var Ss=b((Uf,Vi)=>{var ql=ji(),Ki=Ot(
`);return m===-1?d:d.slice(0,m)}u.exports=p}}),Kp=W({"src/utils/text/skip-inline-comment.js"(h,u){"use strict";H();function p(d,m){if(m===!1)return!1;if(d.charAt(m)==="/"&&d.charAt(m+1)==="*"){for(let x=m+2;x<d.length;++x)if(d.charAt(x)==="*"&&d.charAt(x+1)==="/")return x+2}return m}u.exports=p}}),Vp=W({"src/utils/text/skip-newline.js"(h,u){"use strict";H();function p(d,m,x){let A=x&&x.backwards;if(m===!1)return!1;let g=d.charAt(m);if(A){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}u.exports=p}}),Vn=W({"src/utils/text/skip.js"(h,u){"use strict";H();function p(g){return(E,F,D)=>{let C=D&&D.backwards;if(F===!1)return!1;let{length:M}=E,L=F;for(;L>=0&&L<M;){let k=E.charAt(L);if(g instanceof RegExp){if(!g.test(k))return L}else if(!g.includes(k))return L;C?L--:L++}return L===-1||L===M?L:!1}}var d=p(/\s/),m=p(" "),x=p(",; "),A=p(/[^\n\r]/);u.exports={skipWhitespace:d,skipSpaces:m,skipToLineEnd:x,skipEverythingButNewLine:A}}}),Hp=W({"src/utils/text/skip-trailing-comment.js"(h,u){"use strict";H();var{skipEverythingButNewLine:p}=Vn();function d(m,x){return x===!1?!1:m.charAt(x)==="/"&&m.charAt(x+1)==="/"?p(m,x):x}u.exports=d}}),Wp=W({"src/utils/text/get-next-non-space-non-comment-character-index-with-start-index.js"(h,u){"use strict";H();var p=Kp(),d=Vp(),m=Hp(),{skipSpaces:x}=Vn();function A(g,E){let F=null,D=E;for(;D!==F;)F=D,D=x(g,D),D=p(g,D),D=m(g,D),D=d(g,D);return D}u.exports=A}}),Hn={};qp(Hn,{EOL:()=>sr,arch:()=>Gp,cpus:()=>Qn,default:()=>ro,endianness:()=>Wn,freemem:()=>Yn,getNetworkInterfaces:()=>so,hostname:()=>Gn,loadavg:()=>Xn,networkInterfaces:()=>to,platform:()=>Xp,release:()=>eo,tmpDir:()=>er,tmpdir:()=>tr,totalmem:()=>$n,type:()=>Zn,uptime:()=>Jn});function Wn(){if(typeof zt>"u"){var h=new ArrayBuffer(2),u=new Uint8Array(h),p=new Uint16Array(h);if(u[0]=1,u[1]=2,p[0]===258)zt="BE";else if(p[0]===513)zt="LE";else throw new Error("unable to figure out endianess")}return zt}function Gn(){return typeof globalThis.location<"u"?globalThis.location.hostname:""}function Xn(){return[]}function Jn(){return 0}function Yn(){return Number.MAX_VALUE}function $n(){return Number.MAX_VALUE}function Qn(){return[]}function Zn(){return"Browser"}function eo(){return typeof globalThis.navigator<"u"?globalThis.navigator.appVersion:""}function to(){}function so(){}function Gp(){return"javascript"}function Xp(){return"browser"}function er(){return"/tmp"}var zt,tr,sr,ro,Jp=zn({"node-modules-polyfills:os"(){H(),tr=er,sr=`
`,ro={EOL:sr,tmpdir:tr,tmpDir:er,networkInterfaces:to,getNetworkInterfaces:so,release:eo,type:Zn,cpus:Qn,totalmem:$n,freemem:Yn,uptime:Jn,loadavg:Xn,hostname:Gn,endianness:Wn}}}),Yp=W({"node-modules-polyfills-commonjs:os"(h,u){H();var p=(Jp(),_p(Hn));if(p&&p.default){u.exports=p.default;for(let d in p)u.exports[d]=p[d]}else p&&(u.exports=p)}}),$p=W({"node_modules/detect-newline/index.js"(h,u){"use strict";H();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 x=m.filter(g=>g===`\r
`).length,A=m.length-x;return x>A?`\r
`:`
`};u.exports=p,u.exports.graceful=d=>typeof d=="string"&&p(d)||`
`}}),Qp=W({"node_modules/jest-docblock/build/index.js"(h){"use strict";H(),Object.defineProperty(h,"__esModule",{value:!0}),h.extract=L,h.parse=G,h.parseWithComments=Z,h.print=B,h.strip=k;function u(){let l=Yp();return u=function(){return l},l}function p(){let l=d($p());return p=function(){return l},l}function d(l){return l&&l.__esModule?l:{default:l}}var m=/\*\/$/,x=/^\/\*\*/,A=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,g=/(^|\s+)\/\/([^\r\n]*)/g,E=/^(\r?\n)+/,F=/(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g,D=/(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g,C=/(\r?\n|^) *\* ?/g,M=[];function L(l){let Y=l.match(A);return Y?Y[0].trimLeft():""}function k(l){let Y=l.match(A);return Y&&Y[0]?l.substring(Y[0].length):l}function G(l){return Z(l).pragmas}function Z(l){let Y=(0,p().default)(l)||u().EOL;l=l.replace(x,"").replace(m,"").replace(C,"$1");let ie="";for(;ie!==l;)ie=l,l=l.replace(F,"".concat(Y,"$1 $2").concat(Y));l=l.replace(E,"").trimRight();let Q=Object.create(null),Ce=l.replace(D,"").replace(E,"").trimRight(),ee;for(;ee=D.exec(l);){let U=ee[2].replace(g,"");typeof Q[ee[1]]=="string"||Array.isArray(Q[ee[1]])?Q[ee[1]]=M.concat(Q[ee[1]],U):Q[ee[1]]=U}return{comments:Ce,pragmas:Q}}function B(l){let{comments:Y="",pragmas:ie={}}=l,Q=(0,p().default)(Y)||u().EOL,Ce="/**",ee=" *",U=" */",O=Object.keys(ie),P=O.map(V=>j(V,ie[V])).reduce((V,$)=>V.concat($),[]).map(V=>ee+" "+V+Q).join("");if(!Y){if(O.length===0)return"";if(O.length===1&&!Array.isArray(ie[O[0]])){let V=ie[O[0]];return"".concat(Ce," ").concat(j(O[0],V)[0]).concat(U)}}let De=Y.split(Q).map(V=>"".concat(ee," ").concat(V)).join(Q)+Q;return Ce+Q+(Y?De:"")+(Y&&O.length?ee+Q:"")+P+U}function j(l,Y){return M.concat(Y).map(ie=>"@".concat(l," ").concat(ie).trim())}}}),Zp=W({"src/common/end-of-line.js"(h,u){"use strict";H();function p(A){let g=A.indexOf("\r");return g>=0?A.charAt(g+1)===`
`?"crlf":"cr":"lf"}function d(A){switch(A){case"cr":return"\r";case"crlf":return`\r
`;default:return`
`}}function m(A,g){let E;switch(g){case`
`:E=/\n/g;break;case"\r":E=/\r/g;break;case`\r
`:E=/\r\n/g;break;default:throw new Error('Unexpected "eol" '.concat(JSON.stringify(g),"."))}let F=A.match(E);return F?F.length:0}function x(A){return A.replace(/\r\n?/g,`
`)}u.exports={guessEndOfLine:p,convertEndOfLineToChars:d,countEndOfLineChars:m,normalizeEndOfLine:x}}}),ef=W({"src/language-js/pragma.js"(h,u){"use strict";H();var{parseWithComments:p,strip:d,extract:m,print:x}=Qp(),{normalizeEndOfLine:A}=Zp(),g=Kn();function E(C){let M=g(C);M&&(C=C.slice(M.length+1));let L=m(C),{pragmas:k,comments:G}=p(L);return{shebang:M,text:C,pragmas:k,comments:G}}function F(C){let M=Object.keys(E(C).pragmas);return M.includes("prettier")||M.includes("format")}function D(C){let{shebang:M,text:L,pragmas:k,comments:G}=E(C),Z=d(L),B=x({pragmas:Object.assign({format:""},k),comments:G.trimStart()});return(M?"".concat(M,`
`):"")+A(B)+(Z.startsWith(`
`)?`
`:`
`)+Z}u.exports={hasPragma:F,insertPragma:D}}}),io=W({"src/utils/is-non-empty-array.js"(h,u){"use strict";H();function p(d){return Array.isArray(d)&&d.length>0}u.exports=p}}),ao=W({"src/language-js/loc.js"(h,u){"use strict";H();var p=io();function d(E,F){let{ignoreDecorators:D}=F||{};if(!D){let C=E.declaration&&E.declaration.decorators||E.decorators;if(p(C))return d(C[0])}return E.range?E.range[0]:E.start}function m(E){return E.range?E.range[1]:E.end}function x(E,F){let D=d(E);return Number.isInteger(D)&&D===d(F)}function A(E,F){let D=m(E);return Number.isInteger(D)&&D===m(F)}function g(E,F){return x(E,F)&&A(E,F)}u.exports={locStart:d,locEnd:m,hasSameLocStart:x,hasSameLoc:g}}}),no=W({"src/language-js/parse/utils/create-parser.js"(h,u){"use strict";H();var{hasPragma:p}=ef(),{locStart:d,locEnd:m}=ao();function x(A){return A=typeof A=="function"?{parse:A}:A,Object.assign({astFormat:"estree",hasPragma:p,locStart:d,locEnd:m},A)}u.exports=x}}),ar=W({"src/common/parser-create-error.js"(h,u){"use strict";H();function p(d,m){let x=new SyntaxError(d+" ("+m.start.line+":"+m.start.column+")");return x.loc=m,x}u.exports=p}}),oo=W({"src/language-js/parse/utils/create-babel-parse-error.js"(h,u){"use strict";H();var p=ar();function d(m){let{message:x,loc:A}=m;return p(x.replace(/ \(.*\)/,""),{start:{line:A?A.line:0,column:A?A.column+1:0}})}u.exports=d}}),tf=W({"src/language-js/utils/is-ts-keyword-type.js"(h,u){"use strict";H();function p(d){let{type:m}=d;return m.startsWith("TS")&&m.endsWith("Keyword")}u.exports=p}}),sf=W({"src/language-js/utils/is-block-comment.js"(h,u){"use strict";H();var p=new Set(["Block","CommentBlock","MultiLine"]),d=m=>p.has(m==null?void 0:m.type);u.exports=d}}),rf=W({"src/language-js/utils/is-type-cast-comment.js"(h,u){"use strict";H();var p=sf();function d(m){return p(m)&&m.value[0]==="*"&&/@type\b/.test(m.value)}u.exports=d}}),af=W({"src/utils/get-last.js"(h,u){"use strict";H();var p=d=>d[d.length-1];u.exports=p}}),ho=W({"src/language-js/parse/postprocess/visit-node.js"(h,u){"use strict";H();function p(d,m){if(Array.isArray(d)){for(let x=0;x<d.length;x++)d[x]=p(d[x],m);return d}if(d&&typeof d=="object"&&typeof d.type=="string"){let x=Object.keys(d);for(let A=0;A<x.length;A++)d[x[A]]=p(d[x[A]],m);return m(d)||d}return d}u.exports=p}}),lo=W({"src/language-js/parse/postprocess/throw-syntax-error.js"(h,u){"use strict";H();var p=ar();function d(m,x){let{start:A,end:g}=m.loc;throw p(x,{start:{line:A.line,column:A.column+1},end:{line:g.line,column:g.column+1}})}u.exports=d}}),nf=W({"src/language-js/parse/postprocess/typescript.js"(h,u){"use strict";H();var p=ho(),d=lo();function m(g,E,F){let D=g.decorators;if(!Array.isArray(D))return;let C=E.decorators;(!Array.isArray(C)||C.length!==D.length||D.some(M=>{let L=F.get(M);return!L||!C.includes(L)}))&&d(E,"Leading decorators must be attached to a class declaration")}function x(g,E){g.kind!==167||g.modifiers&&!g.modifiers.some(C=>C.kind===126)||g.initializer&&E.value===null&&d(E,"Abstract property cannot have an initializer")}function A(g,E){let{esTreeNodeToTSNodeMap:F,tsNodeToESTreeNodeMap:D}=E.tsParseResult;p(g,C=>{let M=F.get(C);if(!M)return;let L=D.get(M);L===C&&(m(M,L,D),x(M,L))})}u.exports={throwErrorForInvalidNodes:A}}}),of=W({"src/language-js/parse/postprocess/index.js"(h,u){"use strict";H();var{locStart:p,locEnd:d}=ao(),m=tf(),x=rf(),A=af(),g=ho(),{throwErrorForInvalidNodes:E}=nf(),F=lo();function D(k,G){if(G.parser==="typescript"&&/@|abstract/.test(G.originalText)&&E(k,G),G.parser!=="typescript"&&G.parser!=="flow"&&G.parser!=="acorn"&&G.parser!=="espree"&&G.parser!=="meriyah"){let B=new Set;k=g(k,j=>{j.leadingComments&&j.leadingComments.some(x)&&B.add(p(j))}),k=g(k,j=>{if(j.type==="ParenthesizedExpression"){let{expression:l}=j;if(l.type==="TypeCastExpression")return l.range=j.range,l;let Y=p(j);if(!B.has(Y))return l.extra=Object.assign(Object.assign({},l.extra),{},{parenthesized:!0}),l}})}return k=g(k,B=>{switch(B.type){case"ChainExpression":return C(B.expression);case"LogicalExpression":{if(M(B))return L(B);break}case"VariableDeclaration":{let j=A(B.declaration
`;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(l.StrictNumericEscape,{at:m(this.state.curPosition(),-1)});default:if(s>=48&&s<=55){let r=m(this.state.curPosition(),-1),a=this.input.slice(this.state.pos-1,this.state.pos+2).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(l.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(l.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(ze(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?ge:ze;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(l.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(l.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=ae.get(e);s!==void 0?this.finishToken(s,ve(s)):this.finishToken(128,e)}checkKeywordEscapes(){let{type:t}=this.state;Vt(t)&&this.state.containsEsc&&this.raise(l.InvalidEscapedReservedWord,{at:this.state.startLoc,reservedWord:ve(t)})}raise(t,e){let{at:s}=e,r=u(e,Jo),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=u(e,Yo),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(l.UnexpectedToken,{expected:e?ve(e):null,at:t!=null?t:this.state.startLoc})}expectPlugin(t,e){if(this.hasPlugin(t))return!0;throw this.raise(l.MissingPlugin,{at:e!=null?e:this.state.startLoc,missingPlugin:[t]})}expectOnePlugin(t){if(!t.some(e=>this.hasPlugin(e)))throw this.raise(l.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()&Ae)>0}get allowSuper(){return(this.currentThisScopeFlags()&ct)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&mr)>0}get inClass(){return(this.currentThisScopeFlags()&Fe)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&Fe)>0&&(t&Ae)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&Jt)return!0;if(e&(ft|Fe))return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&Ae)>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&(Ae|Jt)||!this.parser.inModule&&t.flags&$e)}declareName(t,e,s){let r=this.currentScope();if(e&Se||e&dt
`:`\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(l.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):Oe(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=Ph[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(ze(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=ve(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(U.brace),this.next(),e=this.jsxParseExpressionContainer(e,U.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(Be.AttributeIsEmpty,{at:e}),e;case 138:case 129:return this.parseExprAtom();default:throw this.raise(Be.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(U.j_oTag),this.state.canStartJSXElement=!0,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.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext(U.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(U.j_oTag),this.state.canStartJSXElement=!0,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.eat(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.eat(139)?this.finishNode(r,"JSXClosingFragment"):(r.name=this.jsxParseElementName(),this.expect(139),this.finishNode(r,"JSXClosingElement"))}jsxParseElementAt(e,s){let r=this.startNodeAt(
`),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(l.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(l.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(l.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"?l.BadGetterArity:l.BadSetterArity,{at:t}),t.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(l.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,Ee(t.key));else if(this.match(29)){let a=this.state.startLoc;i!=null?i.shorthandAssignLoc===null&&(i.shorthandAssignLoc=a):this.raise(l.InvalidCoverInitializedName,{at:a}),t.value=this.parseMaybeDefault(e,s,Ee(t.key))}else t.value=Ee(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