UNPKG

chrome-inject-eval

Version:
1 lines 2.77 MB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).evalCore=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){var t=e.default;if("function"==typeof t){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})})),r}var r={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},a="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",n={5:a,"5module":a+" export import",6:a+" const class extends export import super"},s=/^in(stanceof)?$/,i="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",o="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",d=new RegExp("["+i+"]"),u=new RegExp("["+i+o+"]");i=o=null;var c=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],l=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function p(e,t){for(var r=65536,a=0;a<t.length;a+=2){if((r+=t[a])>e)return!1;if((r+=t[a+1])>=e)return!0}}function f(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&d.test(String.fromCharCode(e)):!1!==t&&p(e,c)))}function g(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&u.test(String.fromCharCode(e)):!1!==t&&(p(e,c)||p(e,l)))))}var h=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function m(e,t){return new h(e,{beforeExpr:!0,binop:t})}var y={beforeExpr:!0},v={startsExpr:!0},b={};function R(e,t){return void 0===t&&(t={}),t.keyword=e,b[e]=new h(e,t)}var x={num:new h("num",v),regexp:new h("regexp",v),string:new h("string",v),name:new h("name",v),eof:new h("eof"),bracketL:new h("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new h("]"),braceL:new h("{",{beforeExpr:!0,startsExpr:!0}),braceR:new h("}"),parenL:new h("(",{beforeExpr:!0,startsExpr:!0}),parenR:new h(")"),comma:new h(",",y),semi:new h(";",y),colon:new h(":",y),dot:new h("."),question:new h("?",y),questionDot:new h("?."),arrow:new h("=>",y),template:new h("template"),invalidTemplate:new h("invalidTemplate"),ellipsis:new h("...",y),backQuote:new h("`",v),dollarBraceL:new h("${",{beforeExpr:!0,startsExpr:!0}),eq:new h("=",{beforeExpr:!0,isAssign:!0}),assign:new h("_=",{beforeExpr:!0,isAssign:!0}),incDec:new h("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new h("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:m("||",1),logicalAND:m("&&",2),bitwiseOR:m("|",3),bitwiseXOR:m("^",4),bitwiseAND:m("&",5),equality:m("==/!=/===/!==",6),relational:m("</>/<=/>=",7),bitShift:m("<</>>/>>>",8),plusMin:new h("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:m("%",10),star:m("*",10),slash:m("/",10),starstar:new h("**",{beforeExpr:!0}),coalesce:m("??",1),_break:R("break"),_case:R("case",y),_catch:R("catch"),_continue:R("continue"),_debugger:R("debugger"),_default:R("default",y),_do:R("do",{isLoop:!0,beforeExpr:!0}),_else:R("else",y),_finally:R("finally"),_for:R("for",{isLoop:!0}),_function:R("function",v),_if:R("if"),_return:R("return",y),_switch:R("switch"),_throw:R("throw",y),_try:R("try"),_var:R("var"),_const:R("const"),_while:R("while",{isLoop:!0}),_with:R("with"),_new:R("new",{beforeExpr:!0,startsExpr:!0}),_this:R("this",v),_super:R("super",v),_class:R("class",v),_extends:R("extends",y),_export:R("export"),_import:R("import",v),_null:R("null",v),_true:R("true",v),_false:R("false",v),_in:R("in",{beforeExpr:!0,binop:7}),_instanceof:R("instanceof",{beforeExpr:!0,binop:7}),_typeof:R("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:R("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:R("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},E=/\r\n?|\n|\u2028|\u2029/,D=new RegExp(E.source,"g");function w(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var j=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,C=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,S=Object.prototype,A=S.hasOwnProperty,T=S.toString;function P(e,t){return A.call(e,t)}var k=Array.isArray||function(e){return"[object Array]"===T.call(e)};function I(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var F=function(e,t){this.line=e,this.column=t};F.prototype.offset=function(e){return new F(this.line,this.column+e)};var _=function(e,t,r){this.start=t,this.end=r,null!==e.sourceFile&&(this.source=e.sourceFile)};function B(e,t){for(var r=1,a=0;;){D.lastIndex=a;var n=D.exec(e);if(!(n&&n.index<t))return new F(r,t-a);++r,a=n.index+n[0].length}}var O={ecmaVersion:10,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function N(e){var t={};for(var r in O)t[r]=e&&P(e,r)?e[r]:O[r];if(t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),k(t.onToken)){var a=t.onToken;t.onToken=function(e){return a.push(e)}}return k(t.onComment)&&(t.onComment=function(e,t){return function(r,a,n,s,i,o){var d={type:r?"Block":"Line",value:a,start:n,end:s};e.locations&&(d.loc=new _(this,i,o)),e.ranges&&(d.range=[n,s]),t.push(d)}}(t,t.onComment)),t}function L(e,t){return 2|(e?4:0)|(t?8:0)}var M=function(e,t,a){this.options=e=N(e),this.sourceFile=e.sourceFile,this.keywords=I(n[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var s="";if(!0!==e.allowReserved){for(var i=e.ecmaVersion;!(s=r[i]);i--);"module"===e.sourceType&&(s+=" await")}this.reservedWords=I(s);var o=(s?s+" ":"")+r.strict;this.reservedWordsStrict=I(o),this.reservedWordsStrictBind=I(o+" "+r.strictBind),this.input=String(t),this.containsEsc=!1,a?(this.pos=a,this.lineStart=this.input.lastIndexOf("\n",a-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(E).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=x.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},U={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};M.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},U.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},U.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},U.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},U.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},U.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},U.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},M.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},M.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=this,a=0;a<e.length;a++)r=e[a](r);return r},M.parse=function(e,t){return new this(t,e).parse()},M.parseExpressionAt=function(e,t,r){var a=new this(r,e,t);return a.nextToken(),a.parseExpression()},M.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(M.prototype,U);var V=M.prototype,G=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function W(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}V.strictDirective=function(e){for(;;){C.lastIndex=e,e+=C.exec(this.input)[0].length;var t=G.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){C.lastIndex=e+t[0].length;var r=C.exec(this.input),a=r.index+r[0].length,n=this.input.charAt(a);return";"===n||"}"===n||E.test(r[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||"!"===n&&"="===this.input.charAt(a+1))}e+=t[0].length,C.lastIndex=e,e+=C.exec(this.input)[0].length,";"===this.input[e]&&e++}},V.eat=function(e){return this.type===e&&(this.next(),!0)},V.isContextual=function(e){return this.type===x.name&&this.value===e&&!this.containsEsc},V.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},V.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},V.canInsertSemicolon=function(){return this.type===x.eof||this.type===x.braceR||E.test(this.input.slice(this.lastTokEnd,this.start))},V.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},V.semicolon=function(){this.eat(x.semi)||this.insertSemicolon()||this.unexpected()},V.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},V.expect=function(e){this.eat(e)||this.unexpected()},V.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},V.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var r=t?e.parenthesizedAssign:e.parenthesizedBind;r>-1&&this.raiseRecoverable(r,"Parenthesized pattern")}},V.checkExpressionErrors=function(e,t){if(!e)return!1;var r=e.shorthandAssign,a=e.doubleProto;if(!t)return r>=0||a>=0;r>=0&&this.raise(r,"Shorthand property assignments are valid only in destructuring patterns"),a>=0&&this.raiseRecoverable(a,"Redefinition of __proto__ property")},V.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},V.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var H=M.prototype;H.parseTopLevel=function(e){var t={};for(e.body||(e.body=[]);this.type!==x.eof;){var r=this.parseStatement(null,!0,t);e.body.push(r)}if(this.inModule)for(var a=0,n=Object.keys(this.undefinedExports);a<n.length;a+=1){var s=n[a];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var K={kind:"loop"},q={kind:"switch"};H.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;C.lastIndex=this.pos;var t=C.exec(this.input),r=this.pos+t[0].length,a=this.input.charCodeAt(r);if(91===a)return!0;if(e)return!1;if(123===a)return!0;if(f(a,!0)){for(var n=r+1;g(this.input.charCodeAt(n),!0);)++n;var i=this.input.slice(r,n);if(!s.test(i))return!0}return!1},H.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;C.lastIndex=this.pos;var e=C.exec(this.input),t=this.pos+e[0].length;return!(E.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!==this.input.length&&g(this.input.charAt(t+8)))},H.parseStatement=function(e,t,r){var a,n=this.type,s=this.startNode();switch(this.isLet(e)&&(n=x._var,a="let"),n){case x._break:case x._continue:return this.parseBreakContinueStatement(s,n.keyword);case x._debugger:return this.parseDebuggerStatement(s);case x._do:return this.parseDoStatement(s);case x._for:return this.parseForStatement(s);case x._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case x._class:return e&&this.unexpected(),this.parseClass(s,!0);case x._if:return this.parseIfStatement(s);case x._return:return this.parseReturnStatement(s);case x._switch:return this.parseSwitchStatement(s);case x._throw:return this.parseThrowStatement(s);case x._try:return this.parseTryStatement(s);case x._const:case x._var:return a=a||this.value,e&&"var"!==a&&this.unexpected(),this.parseVarStatement(s,a);case x._while:return this.parseWhileStatement(s);case x._with:return this.parseWithStatement(s);case x.braceL:return this.parseBlock(!0,s);case x.semi:return this.parseEmptyStatement(s);case x._export:case x._import:if(this.options.ecmaVersion>10&&n===x._import){C.lastIndex=this.pos;var i=C.exec(this.input),o=this.pos+i[0].length,d=this.input.charCodeAt(o);if(40===d||46===d)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===x._import?this.parseImport(s):this.parseExport(s,r);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var u=this.value,c=this.parseExpression();return n===x.name&&"Identifier"===c.type&&this.eat(x.colon)?this.parseLabeledStatement(s,u,c,e):this.parseExpressionStatement(s,c)}},H.parseBreakContinueStatement=function(e,t){var r="break"===t;this.next(),this.eat(x.semi)||this.insertSemicolon()?e.label=null:this.type!==x.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var a=0;a<this.labels.length;++a){var n=this.labels[a];if(null==e.label||n.name===e.label.name){if(null!=n.kind&&(r||"loop"===n.kind))break;if(e.label&&r)break}}return a===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,r?"BreakStatement":"ContinueStatement")},H.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},H.parseDoStatement=function(e){return this.next(),this.labels.push(K),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(x._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(x.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},H.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(K),this.enterScope(0),this.expect(x.parenL),this.type===x.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var r=this.isLet();if(this.type===x._var||this.type===x._const||r){var a=this.startNode(),n=r?"let":this.value;return this.next(),this.parseVar(a,!0,n),this.finishNode(a,"VariableDeclaration"),(this.type===x._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===a.declarations.length?(this.options.ecmaVersion>=9&&(this.type===x._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,a)):(t>-1&&this.unexpected(t),this.parseFor(e,a))}var s=new W,i=this.parseExpression(!0,s);return this.type===x._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===x._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(i,!1,s),this.checkLVal(i),this.parseForIn(e,i)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,i))},H.parseFunctionStatement=function(e,t,r){return this.next(),this.parseFunction(e,X|(r?0:Y),!1,t)},H.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(x._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},H.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(x.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},H.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(x.braceL),this.labels.push(q),this.enterScope(0);for(var r=!1;this.type!==x.braceR;)if(this.type===x._case||this.type===x._default){var a=this.type===x._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),a?t.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,t.test=null),this.expect(x.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},H.parseThrowStatement=function(e){return this.next(),E.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var z=[];H.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===x._catch){var t=this.startNode();if(this.next(),this.eat(x.parenL)){t.param=this.parseBindingAtom();var r="Identifier"===t.param.type;this.enterScope(r?32:0),this.checkLVal(t.param,r?4:2),this.expect(x.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(x._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},H.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},H.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(K),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},H.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},H.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},H.parseLabeledStatement=function(e,t,r,a){for(var n=0,s=this.labels;n<s.length;n+=1){s[n].name===t&&this.raise(r.start,"Label '"+t+"' is already declared")}for(var i=this.type.isLoop?"loop":this.type===x._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var d=this.labels[o];if(d.statementStart!==e.start)break;d.statementStart=this.start,d.kind=i}return this.labels.push({name:t,kind:i,statementStart:this.start}),e.body=this.parseStatement(a?-1===a.indexOf("label")?a+"label":a:"label"),this.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},H.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},H.parseBlock=function(e,t,r){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(x.braceL),e&&this.enterScope(0);this.type!==x.braceR;){var a=this.parseStatement(null);t.body.push(a)}return r&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},H.parseFor=function(e,t){return e.init=t,this.expect(x.semi),e.test=this.type===x.semi?null:this.parseExpression(),this.expect(x.semi),e.update=this.type===x.parenR?null:this.parseExpression(),this.expect(x.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},H.parseForIn=function(e,t){var r=this.type===x._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!r||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(r?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssign(),this.expect(x.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,r?"ForInStatement":"ForOfStatement")},H.parseVar=function(e,t,r){for(e.declarations=[],e.kind=r;;){var a=this.startNode();if(this.parseVarId(a,r),this.eat(x.eq)?a.init=this.parseMaybeAssign(t):"const"!==r||this.type===x._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===a.id.type||t&&(this.type===x._in||this.isContextual("of"))?a.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(a,"VariableDeclarator")),!this.eat(x.comma))break}return e},H.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var X=1,Y=2;H.parseFunction=function(e,t,r,a){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!a)&&(this.type===x.star&&t&Y&&this.unexpected(),e.generator=this.eat(x.star)),this.options.ecmaVersion>=8&&(e.async=!!a),t&X&&(e.id=4&t&&this.type!==x.name?null:this.parseIdent(),!e.id||t&Y||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var n=this.yieldPos,s=this.awaitPos,i=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(L(e.async,e.generator)),t&X||(e.id=this.type===x.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,r,!1),this.yieldPos=n,this.awaitPos=s,this.awaitIdentPos=i,this.finishNode(e,t&X?"FunctionDeclaration":"FunctionExpression")},H.parseFunctionParams=function(e){this.expect(x.parenL),e.params=this.parseBindingList(x.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},H.parseClass=function(e,t){this.next();var r=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var a=this.startNode(),n=!1;for(a.body=[],this.expect(x.braceL);this.type!==x.braceR;){var s=this.parseClassElement(null!==e.superClass);s&&(a.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(n&&this.raise(s.start,"Duplicate constructor in the same class"),n=!0))}return this.strict=r,this.next(),e.body=this.finishNode(a,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},H.parseClassElement=function(e){var t=this;if(this.eat(x.semi))return null;var r=this.startNode(),a=function(e,a){void 0===a&&(a=!1);var n=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===x.parenL||a&&t.canInsertSemicolon())||(r.key&&t.unexpected(),r.computed=!1,r.key=t.startNodeAt(n,s),r.key.name=e,t.finishNode(r.key,"Identifier"),!1))};r.kind="method",r.static=a("static");var n=this.eat(x.star),s=!1;n||(this.options.ecmaVersion>=8&&a("async",!0)?(s=!0,n=this.options.ecmaVersion>=9&&this.eat(x.star)):a("get")?r.kind="get":a("set")&&(r.kind="set")),r.key||this.parsePropertyName(r);var i=r.key,o=!1;return r.computed||r.static||!("Identifier"===i.type&&"constructor"===i.name||"Literal"===i.type&&"constructor"===i.value)?r.static&&"Identifier"===i.type&&"prototype"===i.name&&this.raise(i.start,"Classes may not have a static property named prototype"):("method"!==r.kind&&this.raise(i.start,"Constructor can't have get/set modifier"),n&&this.raise(i.start,"Constructor can't be a generator"),s&&this.raise(i.start,"Constructor can't be an async method"),r.kind="constructor",o=e),this.parseClassMethod(r,n,s,o),"get"===r.kind&&0!==r.value.params.length&&this.raiseRecoverable(r.value.start,"getter should have no params"),"set"===r.kind&&1!==r.value.params.length&&this.raiseRecoverable(r.value.start,"setter should have exactly one param"),"set"===r.kind&&"RestElement"===r.value.params[0].type&&this.raiseRecoverable(r.value.params[0].start,"Setter cannot use rest params"),r},H.parseClassMethod=function(e,t,r,a){return e.value=this.parseMethod(t,r,a),this.finishNode(e,"MethodDefinition")},H.parseClassId=function(e,t){this.type===x.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},H.parseClassSuper=function(e){e.superClass=this.eat(x._extends)?this.parseExprSubscripts():null},H.parseExport=function(e,t){if(this.next(),this.eat(x.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==x.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(x._default)){var r;if(this.checkExport(t,"default",this.lastTokStart),this.type===x._function||(r=this.isAsyncFunction())){var a=this.startNode();this.next(),r&&this.next(),e.declaration=this.parseFunction(a,4|X,!1,r)}else if(this.type===x._class){var n=this.startNode();e.declaration=this.parseClass(n,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==x.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,i=e.specifiers;s<i.length;s+=1){var o=i[s];this.checkUnreserved(o.local),this.checkLocalExport(o.local)}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},H.checkExport=function(e,t,r){e&&(P(e,t)&&this.raiseRecoverable(r,"Duplicate export '"+t+"'"),e[t]=!0)},H.checkPatternExport=function(e,t){var r=t.type;if("Identifier"===r)this.checkExport(e,t.name,t.start);else if("ObjectPattern"===r)for(var a=0,n=t.properties;a<n.length;a+=1){var s=n[a];this.checkPatternExport(e,s)}else if("ArrayPattern"===r)for(var i=0,o=t.elements;i<o.length;i+=1){var d=o[i];d&&this.checkPatternExport(e,d)}else"Property"===r?this.checkPatternExport(e,t.value):"AssignmentPattern"===r?this.checkPatternExport(e,t.left):"RestElement"===r?this.checkPatternExport(e,t.argument):"ParenthesizedExpression"===r&&this.checkPatternExport(e,t.expression)},H.checkVariableExport=function(e,t){if(e)for(var r=0,a=t;r<a.length;r+=1){var n=a[r];this.checkPatternExport(e,n.id)}},H.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},H.parseExportSpecifiers=function(e){var t=[],r=!0;for(this.expect(x.braceL);!this.eat(x.braceR);){if(r)r=!1;else if(this.expect(x.comma),this.afterTrailingComma(x.braceR))break;var a=this.startNode();a.local=this.parseIdent(!0),a.exported=this.eatContextual("as")?this.parseIdent(!0):a.local,this.checkExport(e,a.exported.name,a.exported.start),t.push(this.finishNode(a,"ExportSpecifier"))}return t},H.parseImport=function(e){return this.next(),this.type===x.string?(e.specifiers=z,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===x.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},H.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===x.name){var r=this.startNode();if(r.local=this.parseIdent(),this.checkLVal(r.local,2),e.push(this.finishNode(r,"ImportDefaultSpecifier")),!this.eat(x.comma))return e}if(this.type===x.star){var a=this.startNode();return this.next(),this.expectContextual("as"),a.local=this.parseIdent(),this.checkLVal(a.local,2),e.push(this.finishNode(a,"ImportNamespaceSpecifier")),e}for(this.expect(x.braceL);!this.eat(x.braceR);){if(t)t=!1;else if(this.expect(x.comma),this.afterTrailingComma(x.braceR))break;var n=this.startNode();n.imported=this.parseIdent(!0),this.eatContextual("as")?n.local=this.parseIdent():(this.checkUnreserved(n.imported),n.local=n.imported),this.checkLVal(n.local,2),e.push(this.finishNode(n,"ImportSpecifier"))}return e},H.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},H.isDirectiveCandidate=function(e){return"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var J=M.prototype;J.toAssignable=function(e,t,r){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var a=0,n=e.properties;a<n.length;a+=1){var s=n[a];this.toAssignable(s,t),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",r&&this.checkPatternErrors(r,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,r);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else r&&this.checkPatternErrors(r,!0);return e},J.toAssignableList=function(e,t){for(var r=e.length,a=0;a<r;a++){var n=e[a];n&&this.toAssignable(n,t)}if(r){var s=e[r-1];6===this.options.ecmaVersion&&t&&s&&"RestElement"===s.type&&"Identifier"!==s.argument.type&&this.unexpected(s.argument.start)}return e},J.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},J.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==x.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},J.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case x.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(x.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case x.braceL:return this.parseObj(!0)}return this.parseIdent()},J.parseBindingList=function(e,t,r){for(var a=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(x.comma),t&&this.type===x.comma)a.push(null);else{if(r&&this.afterTrailingComma(e))break;if(this.type===x.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),a.push(s),this.type===x.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}var i=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(i),a.push(i)}return a},J.parseBindingListItem=function(e){return e},J.parseMaybeDefault=function(e,t,r){if(r=r||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(x.eq))return r;var a=this.startNodeAt(e,t);return a.left=r,a.right=this.parseMaybeAssign(),this.finishNode(a,"AssignmentPattern")},J.checkLVal=function(e,t,r){switch(void 0===t&&(t=0),e.type){case"Identifier":2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(t?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(P(r,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),r[e.name]=!0),0!==t&&5!==t&&this.declareName(e.name,t,e.start);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":t&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ObjectPattern":for(var a=0,n=e.properties;a<n.length;a+=1){var s=n[a];this.checkLVal(s,t,r)}break;case"Property":this.checkLVal(e.value,t,r);break;case"ArrayPattern":for(var i=0,o=e.elements;i<o.length;i+=1){var d=o[i];d&&this.checkLVal(d,t,r)}break;case"AssignmentPattern":this.checkLVal(e.left,t,r);break;case"RestElement":this.checkLVal(e.argument,t,r);break;case"ParenthesizedExpression":this.checkLVal(e.expression,t,r);break;default:this.raise(e.start,(t?"Binding":"Assigning to")+" rvalue")}};var $=M.prototype;$.checkPropClash=function(e,t,r){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var a,n=e.key;switch(n.type){case"Identifier":a=n.name;break;case"Literal":a=String(n.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===a&&"init"===s&&(t.proto&&(r?r.doubleProto<0&&(r.doubleProto=n.start):this.raiseRecoverable(n.start,"Redefinition of __proto__ property")),t.proto=!0);else{var i=t[a="$"+a];if(i)("init"===s?this.strict&&i.init||i.get||i.set:i.init||i[s])&&this.raiseRecoverable(n.start,"Redefinition of property");else i=t[a]={init:!1,get:!1,set:!1};i[s]=!0}}},$.parseExpression=function(e,t){var r=this.start,a=this.startLoc,n=this.parseMaybeAssign(e,t);if(this.type===x.comma){var s=this.startNodeAt(r,a);for(s.expressions=[n];this.eat(x.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return n},$.parseMaybeAssign=function(e,t,r){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var a=!1,n=-1,s=-1;t?(n=t.parenthesizedAssign,s=t.trailingComma,t.parenthesizedAssign=t.trailingComma=-1):(t=new W,a=!0);var i=this.start,o=this.startLoc;this.type!==x.parenL&&this.type!==x.name||(this.potentialArrowAt=this.start);var d=this.parseMaybeConditional(e,t);if(r&&(d=r.call(this,d,i,o)),this.type.isAssign){var u=this.startNodeAt(i,o);return u.operator=this.value,u.left=this.type===x.eq?this.toAssignable(d,!1,t):d,a||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=u.left.start&&(t.shorthandAssign=-1),this.checkLVal(d),this.next(),u.right=this.parseMaybeAssign(e),this.finishNode(u,"AssignmentExpression")}return a&&this.checkExpressionErrors(t,!0),n>-1&&(t.parenthesizedAssign=n),s>-1&&(t.trailingComma=s),d},$.parseMaybeConditional=function(e,t){var r=this.start,a=this.startLoc,n=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return n;if(this.eat(x.question)){var s=this.startNodeAt(r,a);return s.test=n,s.consequent=this.parseMaybeAssign(),this.expect(x.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return n},$.parseExprOps=function(e,t){var r=this.start,a=this.startLoc,n=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)||n.start===r&&"ArrowFunctionExpression"===n.type?n:this.parseExprOp(n,r,a,-1,e)},$.parseExprOp=function(e,t,r,a,n){var s=this.type.binop;if(null!=s&&(!n||this.type!==x._in)&&s>a){var i=this.type===x.logicalOR||this.type===x.logicalAND,o=this.type===x.coalesce;o&&(s=x.logicalAND.binop);var d=this.value;this.next();var u=this.start,c=this.startLoc,l=this.parseExprOp(this.parseMaybeUnary(null,!1),u,c,s,n),p=this.buildBinary(t,r,e,l,d,i||o);return(i&&this.type===x.coalesce||o&&(this.type===x.logicalOR||this.type===x.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(p,t,r,a,n)}return e},$.buildBinary=function(e,t,r,a,n,s){var i=this.startNodeAt(e,t);return i.left=r,i.operator=n,i.right=a,this.finishNode(i,s?"LogicalExpression":"BinaryExpression")},$.parseMaybeUnary=function(e,t){var r,a=this.start,n=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))r=this.parseAwait(),t=!0;else if(this.type.prefix){var s=this.startNode(),i=this.type===x.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),i?this.checkLVal(s.argument):this.strict&&"delete"===s.operator&&"Identifier"===s.argument.type?this.raiseRecoverable(s.start,"Deleting local variable in strict mode"):t=!0,r=this.finishNode(s,i?"UpdateExpression":"UnaryExpression")}else{if(r=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return r;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(a,n);o.operator=this.value,o.prefix=!1,o.argument=r,this.checkLVal(r),this.next(),r=this.finishNode(o,"UpdateExpression")}}return!t&&this.eat(x.starstar)?this.buildBinary(a,n,r,this.parseMaybeUnary(null,!1),"**",!1):r},$.parseExprSubscripts=function(e){var t=this.start,r=this.startLoc,a=this.parseExprAtom(e);if("ArrowFunctionExpression"===a.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return a;var n=this.parseSubscripts(a,t,r);return e&&"MemberExpression"===n.type&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1)),n},$.parseSubscripts=function(e,t,r,a){for(var n=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&this.potentialArrowAt===e.start,s=!1;;){var i=this.parseSubscript(e,t,r,a,n,s);if(i.optional&&(s=!0),i===e||"ArrowFunctionExpression"===i.type){if(s){var o=this.startNodeAt(t,r);o.expression=i,i=this.finishNode(o,"ChainExpression")}return i}e=i}},$.parseSubscript=function(e,t,r,a,n,s){var i=this.options.ecmaVersion>=11,o=i&&this.eat(x.questionDot);a&&o&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var d=this.eat(x.bracketL);if(d||o&&this.type!==x.parenL&&this.type!==x.backQuote||this.eat(x.dot)){var u=this.startNodeAt(t,r);u.object=e,u.property=d?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),u.computed=!!d,d&&this.expect(x.bracketR),i&&(u.optional=o),e=this.finishNode(u,"MemberExpression")}else if(!a&&this.eat(x.parenL)){var c=new W,l=this.yieldPos,p=this.awaitPos,f=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var g=this.parseExprList(x.parenR,this.options.ecmaVersion>=8,!1,c);if(n&&!o&&!this.canInsertSemicolon()&&this.eat(x.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=l,this.awaitPos=p,this.awaitIdentPos=f,this.parseArrowExpression(this.startNodeAt(t,r),g,!0);this.checkExpressionErrors(c,!0),this.yieldPos=l||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=f||this.awaitIdentPos;var h=this.startNodeAt(t,r);h.callee=e,h.arguments=g,i&&(h.optional=o),e=this.finishNode(h,"CallExpression")}else if(this.type===x.backQuote){(o||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var m=this.startNodeAt(t,r);m.tag=e,m.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(m,"TaggedTemplateExpression")}return e},$.parseExprAtom=function(e){this.type===x.slash&&this.readRegexp();var t,r=this.potentialArrowAt===this.start;switch(this.type){case x._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),t=this.startNode(),this.next(),this.type!==x.parenL||this.allowDirectSuper||this.raise(t.start,"super() call outside constructor of a subclass"),this.type!==x.dot&&this.type!==x.bracketL&&this.type!==x.parenL&&this.unexpected(),this.finishNode(t,"Super");case x._this:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case x.name:var a=this.start,n=this.startLoc,s=this.containsEsc,i=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&"async"===i.name&&!this.canInsertSemicolon()&&this.eat(x._function))return this.parseFunction(this.startNodeAt(a,n),0,!1,!0);if(r&&!this.canInsertSemicolon()){if(this.eat(x.arrow))return this.parseArrowExpression(this.startNodeAt(a,n),[i],!1);if(this.options.ecmaVersion>=8&&"async"===i.name&&this.type===x.name&&!s)return i=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(x.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,n),[i],!0)}return i;case x.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case x.num:case x.string:return this.parseLiteral(this.value);case x._null:case x._true:case x._false:return(t=this.startNode()).value=this.type===x._null?null:this.type===x._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case x.parenL:var d=this.start,u=this.parseParenAndDistinguishExpression(r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=d),e.parenthesizedBind<0&&(e.parenthesizedBind=d)),u;case x.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(x.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case x.braceL:return this.parseObj(!1,e);case x._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case x._class:return this.parseClass(this.startNode(),!1);case x._new:return this.parseNew();case x.backQuote:return this.parseTemplate();case x._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},$.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case x.parenL:return this.parseDynamicImport(e);case x.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},$.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(x.parenR)){var t=this.start;this.eat(x.comma)&&this.eat(x.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},$.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},$.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},$.parseParenExpression=function(){this.expect(x.parenL);var e=this.parseExpression();return this.expect(x.parenR),e},$.parseParenAndDistinguishExpression=function(e){var t,r=this.start,a=this.startLoc,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,i=this.start,o=this.startLoc,d=[],u=!0,c=!1,l=new W,p=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==x.parenR;){if(u?u=!1:this.expect(x.comma),n&&this.afterTrailingComma(x.parenR,!0)){c=!0;break}if(this.type===x.ellipsis){s=this.start,d.push(this.parseParenItem(this.parseRestBinding())),this.type===x.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}d.push(this.parseMaybeAssign(!1,l,this.parseParenItem))}var g=this.start,h=this.startLoc;if(this.expect(x.parenR),e&&!this.canInsertSemicolon()&&this.eat(x.arrow))return this.checkPatternErrors(l,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=f,this.parseParenArrowList(r,a,d);d.length&&!c||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(l,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=f||this.awaitPos,d.length>1?((t=this.startNodeAt(i,o)).expressions=d,this.finishNodeAt(t,"SequenceExpression",g,h)):t=d[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var m=this.startNodeAt(r,a);return m.expression=t,this.finishNode(m,"ParenthesizedExpression")}return t},$.parseParenItem=function(e){return e},$.parseParenArrowList=function(e,t,r){return this.parseArrowExpression(this.startNodeAt(e,t),r)};var Q=[];$.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(x.dot)){e.meta=t;var r=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),r&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var a=this.start,n=this.startLoc,s=this.type===x._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),a,n,!0),s&&"ImportExpression"===e.callee.type&&this.raise(a,"Cannot use new with import()"),this.eat(x.parenL)?e.arguments=this.parseExprList(x.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Q,this.finishNode(e,"NewExpression")},$.parseTemplateElement=function(e){var t=e.isTagged,r=thi