UNPKG

sval

Version:

A javascript interpreter written in javascript

1,231 lines 231 kB
const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, get BlockStatement() { return ce; }, get BreakStatement() { return ea; }, get CatchClause() { return Gi; }, get ContinueStatement() { return ta; }, get DebuggerStatement() { return Ys; }, get DoWhileStatement() { return Ki; }, get EmptyStatement() { return Xs; }, get ExpressionStatement() { return Zs; }, get ForInStatement() { return Zi; }, get ForOfStatement() { return Xi; }, get ForStatement() { return Qi; }, get IfStatement() { return qi; }, get LabeledStatement() { return ia; }, get ReturnStatement() { return Js; }, get SwitchCase() { return kt; }, get SwitchStatement() { return Wi; }, get ThrowStatement() { return ra; }, get TryStatement() { return zi; }, get WhileStatement() { return Hi; }, get WithStatement() { return $i; } }, Symbol.toStringTag, { value: "Module" })), Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, get ClassBody() { return Ji; }, get ClassDeclaration() { return aa; }, get ExportAllDeclaration() { return la; }, get ExportDefaultDeclaration() { return oa; }, get ExportNamedDeclaration() { return ua; }, get FunctionDeclaration() { return sa; }, get ImportDeclaration() { return na; }, get MethodDefinition() { return er; }, get PropertyDefinition() { return Ot; }, get StaticBlock() { return tr; }, get VariableDeclaration() { return Se; }, get VariableDeclarator() { return Yi; } }, Symbol.toStringTag, { value: "Module" })), _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, get BlockStatement() { return fe; }, get BreakStatement() { return ja; }, get CatchClause() { return hr; }, get ContinueStatement() { return Ua; }, get DebuggerStatement() { return Fa; }, get DoWhileStatement() { return dr; }, get EmptyStatement() { return Da; }, get ExpressionStatement() { return Oa; }, get ForInStatement() { return mr; }, get ForOfStatement() { return gr; }, get ForStatement() { return yr; }, get IfStatement() { return lr; }, get LabeledStatement() { return $a; }, get ReturnStatement() { return Ma; }, get SwitchCase() { return Ct; }, get SwitchStatement() { return cr; }, get ThrowStatement() { return qa; }, get TryStatement() { return fr; }, get WhileStatement() { return pr; }, get WithStatement() { return ur; } }, Symbol.toStringTag, { value: "Module" })), Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, get ClassBody() { return br; }, get ClassDeclaration() { return za; }, get ExportAllDeclaration() { return Qa; }, get ExportDefaultDeclaration() { return Ha; }, get ExportNamedDeclaration() { return Ka; }, get FunctionDeclaration() { return Wa; }, get ImportDeclaration() { return Ga; }, get MethodDefinition() { return vr; }, get PropertyDefinition() { return Dt; }, get StaticBlock() { return Sr; }, get VariableDeclaration() { return we; }, get VariableDeclarator() { return xr; } }, Symbol.toStringTag, { value: "Module" })), Qe = Object.freeze, w = Object.defineProperty, de = Object.getOwnPropertyDescriptor, Ar = Object.prototype.hasOwnProperty; function It(e, t) { return Ar.call(e, t); } const At = Object.getOwnPropertyNames, Ut = Object.setPrototypeOf; function Pr(e, t) { Ut ? Ut(e, t) : e.__proto__ = t; } const $t = Object.getPrototypeOf; function Qt(e) { return $t ? $t(e) : e.__proto__; } const Lr = Object.getOwnPropertyDescriptor; function Zt(e, t, r) { for (; t; ) { const i = Lr(t, r), s = typeof i < "u" && typeof i.writable > "u" && typeof i[e] == "function" && i[e]; if (s) return s; t = Qt(t); } } function Xt(e, t) { return Zt("get", e, t); } function Yt(e, t) { return Zt("set", e, t); } const Ce = Object.create; function Jt(e, t) { Pr(e, t), e.prototype = Ce(t.prototype, { constructor: { value: e, writable: !0 } }); } function tt(e, t, r = []) { let i = !1; try { i = !Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function() { }) ); } catch { } return i ? Reflect.construct(t, r, Qt(e).constructor) : t.apply(e, r); } function Tr(e) { for (let t = 1; t < arguments.length; ++t) { const r = arguments[t]; for (const i in r) It(r, i) && (e[i] = r[i]); } return e; } const z = Object.assign || Tr; let Ze = [], h = Ce(null); const He = (e) => { if (!e.Object) throw 0; Ze = At(h = e).filter((t) => ["webkitStorageInfo", "GLOBAL", "root"].indexOf(t) === -1); }; try { He(window); } catch { try { He(self); } catch { try { He(global); } catch { try { He(globalThis); } catch { try { h.Object = Object; } catch { } try { h.Function = Function; } catch { } try { h.Array = Array; } catch { } try { h.Number = Number; } catch { } try { h.parseFloat = parseFloat; } catch { } try { h.parseInt = parseInt; } catch { } try { h.Infinity = 1 / 0; } catch { } try { h.NaN = NaN; } catch { } try { h.undefined = void 0; } catch { } try { h.Boolean = Boolean; } catch { } try { h.String = String; } catch { } try { h.Symbol = Symbol; } catch { } try { h.Date = Date; } catch { } try { h.Promise = Promise; } catch { } try { h.RegExp = RegExp; } catch { } try { h.Error = Error; } catch { } try { h.EvalError = EvalError; } catch { } try { h.RangeError = RangeError; } catch { } try { h.ReferenceError = ReferenceError; } catch { } try { h.SyntaxError = SyntaxError; } catch { } try { h.TypeError = TypeError; } catch { } try { h.URIError = URIError; } catch { } try { h.JSON = JSON; } catch { } try { h.Math = Math; } catch { } try { h.console = console; } catch { } try { h.Intl = Intl; } catch { } try { h.ArrayBuffer = ArrayBuffer; } catch { } try { h.Uint8Array = Uint8Array; } catch { } try { h.Int8Array = Int8Array; } catch { } try { h.Uint16Array = Uint16Array; } catch { } try { h.Int16Array = Int16Array; } catch { } try { h.Uint32Array = Uint32Array; } catch { } try { h.Int32Array = Int32Array; } catch { } try { h.Float32Array = Float32Array; } catch { } try { h.Float64Array = Float64Array; } catch { } try { h.Uint8ClampedArray = Uint8ClampedArray; } catch { } try { h.DataView = DataView; } catch { } try { h.Map = Map; } catch { } try { h.Set = Set; } catch { } try { h.WeakMap = WeakMap; } catch { } try { h.WeakSet = WeakSet; } catch { } try { h.Proxy = Proxy; } catch { } try { h.Reflect = Reflect; } catch { } try { h.BigInt = BigInt; } catch { } try { h.decodeURI = decodeURI; } catch { } try { h.decodeURIComponent = decodeURIComponent; } catch { } try { h.encodeURI = encodeURI; } catch { } try { h.encodeURIComponent = encodeURIComponent; } catch { } try { h.escape = escape; } catch { } try { h.unescape = unescape; } catch { } try { h.eval = eval; } catch { } try { h.isFinite = isFinite; } catch { } try { h.isNaN = isNaN; } catch { } try { h.SharedArrayBuffer = SharedArrayBuffer; } catch { } try { h.Atomics = Atomics; } catch { } try { h.WebAssembly = WebAssembly; } catch { } try { h.clearInterval = clearInterval; } catch { } try { h.clearTimeout = clearTimeout; } catch { } try { h.setInterval = setInterval; } catch { } try { h.setTimeout = setTimeout; } catch { } try { h.crypto = crypto; } catch { } try { h.URL = URL; } catch { } Ze = At(h); } } } } h.Symbol && (!h.Symbol.iterator && (h.Symbol.iterator = B("iterator")), !h.Symbol.asyncIterator && (h.Symbol.asyncIterator = B("asynciterator"))); const ei = Ce({}); for (let e = 0; e < Ze.length; e++) { const t = Ze[e]; try { ei[t] = h[t]; } catch { } } const Oe = B("window"); function Vr() { return z(Ce({ [Oe]: h }), ei); } function B(e) { return e + Math.random().toString(36).substring(2); } function Nr(e) { let t; if (typeof Symbol == "function" && (t = e[Symbol.asyncIterator], !t && (t = e[Symbol.iterator])), t) return t.call(e); if (typeof e.next == "function") return e; { let r = 0; return { next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } } var Rr = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 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, 343, 9, 54, 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, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 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, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239], ti = [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, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 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, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 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, 20, 1, 64, 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, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 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, 38, 6, 186, 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, 19, 72, 200, 32, 32, 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, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 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, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 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, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191], Br = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", ii = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", ht = { 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" }, pt = "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", Or = { 5: pt, "5module": pt + " export import", 6: pt + " const class extends export import super" }, Dr = /^in(stanceof)?$/, Fr = new RegExp("[" + ii + "]"), Mr = new RegExp("[" + ii + Br + "]"); function gt(e, t) { for (var r = 65536, i = 0; i < t.length; i += 2) { if (r += t[i], r > e) return !1; if (r += t[i + 1], r >= e) return !0; } return !1; } function oe(e, t) { return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Fr.test(String.fromCharCode(e)) : t === !1 ? !1 : gt(e, ti); } function _e(e, t) { return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Mr.test(String.fromCharCode(e)) : t === !1 ? !1 : gt(e, ti) || gt(e, Rr); } var E = function(t, r) { r === void 0 && (r = {}), this.label = t, this.keyword = r.keyword, this.beforeExpr = !!r.beforeExpr, this.startsExpr = !!r.startsExpr, this.isLoop = !!r.isLoop, this.isAssign = !!r.isAssign, this.prefix = !!r.prefix, this.postfix = !!r.postfix, this.binop = r.binop || null, this.updateContext = null; }; function K(e, t) { return new E(e, { beforeExpr: !0, binop: t }); } var Q = { beforeExpr: !0 }, U = { startsExpr: !0 }, Pt = {}; function S(e, t) { return t === void 0 && (t = {}), t.keyword = e, Pt[e] = new E(e, t); } var o = { num: new E("num", U), regexp: new E("regexp", U), string: new E("string", U), name: new E("name", U), privateId: new E("privateId", U), eof: new E("eof"), // Punctuation token types. bracketL: new E("[", { beforeExpr: !0, startsExpr: !0 }), bracketR: new E("]"), braceL: new E("{", { beforeExpr: !0, startsExpr: !0 }), braceR: new E("}"), parenL: new E("(", { beforeExpr: !0, startsExpr: !0 }), parenR: new E(")"), comma: new E(",", Q), semi: new E(";", Q), colon: new E(":", Q), dot: new E("."), question: new E("?", Q), questionDot: new E("?."), arrow: new E("=>", Q), template: new E("template"), invalidTemplate: new E("invalidTemplate"), ellipsis: new E("...", Q), backQuote: new E("`", U), dollarBraceL: new E("${", { beforeExpr: !0, startsExpr: !0 }), // Operators. These carry several kinds of properties to help the // parser use them properly (the presence of these properties is // what categorizes them as operators). // // `binop`, when present, specifies that this operator is a binary // operator, and will refer to its precedence. // // `prefix` and `postfix` mark the operator as a prefix or postfix // unary operator. // // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as // binary operators with a very low precedence, that should result // in AssignmentExpression nodes. eq: new E("=", { beforeExpr: !0, isAssign: !0 }), assign: new E("_=", { beforeExpr: !0, isAssign: !0 }), incDec: new E("++/--", { prefix: !0, postfix: !0, startsExpr: !0 }), prefix: new E("!/~", { beforeExpr: !0, prefix: !0, startsExpr: !0 }), logicalOR: K("||", 1), logicalAND: K("&&", 2), bitwiseOR: K("|", 3), bitwiseXOR: K("^", 4), bitwiseAND: K("&", 5), equality: K("==/!=/===/!==", 6), relational: K("</>/<=/>=", 7), bitShift: K("<</>>/>>>", 8), plusMin: new E("+/-", { beforeExpr: !0, binop: 9, prefix: !0, startsExpr: !0 }), modulo: K("%", 10), star: K("*", 10), slash: K("/", 10), starstar: new E("**", { beforeExpr: !0 }), coalesce: K("??", 1), // Keyword token types. _break: S("break"), _case: S("case", Q), _catch: S("catch"), _continue: S("continue"), _debugger: S("debugger"), _default: S("default", Q), _do: S("do", { isLoop: !0, beforeExpr: !0 }), _else: S("else", Q), _finally: S("finally"), _for: S("for", { isLoop: !0 }), _function: S("function", U), _if: S("if"), _return: S("return", Q), _switch: S("switch"), _throw: S("throw", Q), _try: S("try"), _var: S("var"), _const: S("const"), _while: S("while", { isLoop: !0 }), _with: S("with"), _new: S("new", { beforeExpr: !0, startsExpr: !0 }), _this: S("this", U), _super: S("super", U), _class: S("class", U), _extends: S("extends", Q), _export: S("export"), _import: S("import", U), _null: S("null", U), _true: S("true", U), _false: S("false", U), _in: S("in", { beforeExpr: !0, binop: 7 }), _instanceof: S("instanceof", { beforeExpr: !0, binop: 7 }), _typeof: S("typeof", { beforeExpr: !0, prefix: !0, startsExpr: !0 }), _void: S("void", { beforeExpr: !0, prefix: !0, startsExpr: !0 }), _delete: S("delete", { beforeExpr: !0, prefix: !0, startsExpr: !0 }) }, Y = /\r\n?|\n|\u2028|\u2029/, jr = new RegExp(Y.source, "g"); function Le(e) { return e === 10 || e === 13 || e === 8232 || e === 8233; } function ri(e, t, r) { r === void 0 && (r = e.length); for (var i = t; i < r; i++) { var s = e.charCodeAt(i); if (Le(s)) return i < r - 1 && s === 13 && e.charCodeAt(i + 1) === 10 ? i + 2 : i + 1; } return -1; } var si = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, Z = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ai = Object.prototype, Ur = ai.hasOwnProperty, $r = ai.toString, Te = Object.hasOwn || function(e, t) { return Ur.call(e, t); }, qt = Array.isArray || function(e) { return $r.call(e) === "[object Array]"; }, Wt = /* @__PURE__ */ Object.create(null); function pe(e) { return Wt[e] || (Wt[e] = new RegExp("^(?:" + e.replace(/ /g, "|") + ")$")); } function ue(e) { return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320)); } var qr = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, De = function(t, r) { this.line = t, this.column = r; }; De.prototype.offset = function(t) { return new De(this.line, this.column + t); }; var it = function(t, r, i) { this.start = r, this.end = i, t.sourceFile !== null && (this.source = t.sourceFile); }; function ni(e, t) { for (var r = 1, i = 0; ; ) { var s = ri(e, i, t); if (s < 0) return new De(r, t - i); ++r, i = s; } } var xt = { // `ecmaVersion` indicates the ECMAScript version to parse. Must be // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` // (the latest version the library supports). This influences // support for strict mode, the set of reserved words, and support // for new syntax features. ecmaVersion: null, // `sourceType` indicates the mode the code should be parsed in. // Can be either `"script"` or `"module"`. This influences global // strict mode and parsing of `import` and `export` declarations. sourceType: "script", // `onInsertedSemicolon` can be a callback that will be called when // a semicolon is automatically inserted. It will be passed the // position of the inserted semicolon as an offset, and if // `locations` is enabled, it is given the location as a `{line, // column}` object as second argument. onInsertedSemicolon: null, // `onTrailingComma` is similar to `onInsertedSemicolon`, but for // trailing commas. onTrailingComma: null, // By default, reserved words are only enforced if ecmaVersion >= 5. // Set `allowReserved` to a boolean value to explicitly turn this on // an off. When this option has the value "never", reserved words // and keywords can also not be used as property names. allowReserved: null, // When enabled, a return at the top level is not considered an // error. allowReturnOutsideFunction: !1, // When enabled, import/export statements are not constrained to // appearing at the top of the program, and an import.meta expression // in a script isn't considered an error. allowImportExportEverywhere: !1, // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022. // When enabled, await identifiers are allowed to appear at the top-level scope, // but they are still not allowed in non-async functions. allowAwaitOutsideFunction: null, // When enabled, super identifiers are not constrained to // appearing in methods and do not raise an error when they appear elsewhere. allowSuperOutsideMethod: null, // When enabled, hashbang directive in the beginning of file is // allowed and treated as a line comment. Enabled by default when // `ecmaVersion` >= 2023. allowHashBang: !1, // By default, the parser will verify that private properties are // only used in places where they are valid and have been declared. // Set this to false to turn such checks off. checkPrivateFields: !0, // When `locations` is on, `loc` properties holding objects with // `start` and `end` properties in `{line, column}` form (with // line being 1-based and column 0-based) will be attached to the // nodes. locations: !1, // A function can be passed as `onToken` option, which will // cause Acorn to call that function with object in the same // format as tokens returned from `tokenizer().getToken()`. Note // that you are not allowed to call the parser from the // callback—that will corrupt its internal state. onToken: null, // A function can be passed as `onComment` option, which will // cause Acorn to call that function with `(block, text, start, // end)` parameters whenever a comment is skipped. `block` is a // boolean indicating whether this is a block (`/* */`) comment, // `text` is the content of the comment, and `start` and `end` are // character offsets that denote the start and end of the comment. // When the `locations` option is on, two more parameters are // passed, the full `{line, column}` locations of the start and // end of the comments. Note that you are not allowed to call the // parser from the callback—that will corrupt its internal state. // When this option has an array as value, objects representing the // comments are pushed to it. onComment: null, // Nodes have their start and end characters offsets recorded in // `start` and `end` properties (directly on the node, rather than // the `loc` object, which holds line/column data. To also add a // [semi-standardized][range] `range` property holding a `[start, // end]` array with the same numbers, set the `ranges` option to // `true`. // // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 ranges: !1, // It is possible to parse multiple files into a single AST by // passing the tree produced by parsing the first file as // `program` option in subsequent parses. This will add the // toplevel forms of the parsed file to the `Program` (top) node // of an existing parse tree. program: null, // When `locations` is on, you can pass this to record the source // file in every node's `loc` object. sourceFile: null, // This value, if given, is stored in every node, whether // `locations` is on or off. directSourceFile: null, // When enabled, parenthesized expressions are represented by // (non-standard) ParenthesizedExpression nodes preserveParens: !1 }, zt = !1; function Wr(e) { var t = {}; for (var r in xt) t[r] = e && Te(e, r) ? e[r] : xt[r]; if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!zt && typeof console == "object" && console.warn && (zt = !0, console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. Defaulting to 2020, but this will stop working in the future.`)), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved == null && (t.allowReserved = t.ecmaVersion < 5), (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), qt(t.onToken)) { var i = t.onToken; t.onToken = function(s) { return i.push(s); }; } return qt(t.onComment) && (t.onComment = zr(t, t.onComment)), t; } function zr(e, t) { return function(r, i, s, a, n, u) { var l = { type: r ? "Block" : "Line", value: i, start: s, end: a }; e.locations && (l.loc = new it(this, n, u)), e.ranges && (l.range = [s, a]), t.push(l); }; } var Fe = 1, Ve = 2, Lt = 4, oi = 8, Tt = 16, ui = 32, rt = 64, li = 128, ke = 256, Ue = 512, st = Fe | Ve | ke; function Vt(e, t) { return Ve | (e ? Lt : 0) | (t ? oi : 0); } var Xe = 0, Nt = 1, he = 2, ci = 3, fi = 4, hi = 5, N = function(t, r, i) { this.options = t = Wr(t), this.sourceFile = t.sourceFile, this.keywords = pe(Or[t.ecmaVersion >= 6 ? 6 : t.sourceType === "module" ? "5module" : 5]); var s = ""; t.allowReserved !== !0 && (s = ht[t.ecmaVersion >= 6 ? 6 : t.ecmaVersion === 5 ? 5 : 3], t.sourceType === "module" && (s += " await")), this.reservedWords = pe(s); var a = (s ? s + " " : "") + ht.strict; this.reservedWordsStrict = pe(a), this.reservedWordsStrictBind = pe(a + " " + ht.strictBind), this.input = String(r), this.containsEsc = !1, i ? (this.pos = i, this.lineStart = this.input.lastIndexOf(` `, i - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(Y).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = o.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 = t.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && t.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(Fe), this.regexpState = null, this.privateNameStack = []; }, re = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, canAwait: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 }, allowNewDotTarget: { configurable: !0 }, inClassStaticBlock: { configurable: !0 } }; N.prototype.parse = function() { var t = this.options.program || this.startNode(); return this.nextToken(), this.parseTopLevel(t); }; re.inFunction.get = function() { return (this.currentVarScope().flags & Ve) > 0; }; re.inGenerator.get = function() { return (this.currentVarScope().flags & oi) > 0; }; re.inAsync.get = function() { return (this.currentVarScope().flags & Lt) > 0; }; re.canAwait.get = function() { for (var e = this.scopeStack.length - 1; e >= 0; e--) { var t = this.scopeStack[e], r = t.flags; if (r & (ke | Ue)) return !1; if (r & Ve) return (r & Lt) > 0; } return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction; }; re.allowSuper.get = function() { var e = this.currentThisScope(), t = e.flags; return (t & rt) > 0 || this.options.allowSuperOutsideMethod; }; re.allowDirectSuper.get = function() { return (this.currentThisScope().flags & li) > 0; }; re.treatFunctionsAsVar.get = function() { return this.treatFunctionsAsVarInScope(this.currentScope()); }; re.allowNewDotTarget.get = function() { for (var e = this.scopeStack.length - 1; e >= 0; e--) { var t = this.scopeStack[e], r = t.flags; if (r & (ke | Ue) || r & Ve && !(r & Tt)) return !0; } return !1; }; re.inClassStaticBlock.get = function() { return (this.currentVarScope().flags & ke) > 0; }; N.extend = function() { for (var t = [], r = arguments.length; r--; ) t[r] = arguments[r]; for (var i = this, s = 0; s < t.length; s++) i = t[s](i); return i; }; N.parse = function(t, r) { return new this(r, t).parse(); }; N.parseExpressionAt = function(t, r, i) { var s = new this(i, t, r); return s.nextToken(), s.parseExpression(); }; N.tokenizer = function(t, r) { return new this(r, t); }; Object.defineProperties(N.prototype, re); var M = N.prototype, Gr = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/; M.strictDirective = function(e) { if (this.options.ecmaVersion < 5) return !1; for (; ; ) { Z.lastIndex = e, e += Z.exec(this.input)[0].length; var t = Gr.exec(this.input.slice(e)); if (!t) return !1; if ((t[1] || t[2]) === "use strict") { Z.lastIndex = e + t[0].length; var r = Z.exec(this.input), i = r.index + r[0].length, s = this.input.charAt(i); return s === ";" || s === "}" || Y.test(r[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(s) || s === "!" && this.input.charAt(i + 1) === "="); } e += t[0].length, Z.lastIndex = e, e += Z.exec(this.input)[0].length, this.input[e] === ";" && e++; } }; M.eat = function(e) { return this.type === e ? (this.next(), !0) : !1; }; M.isContextual = function(e) { return this.type === o.name && this.value === e && !this.containsEsc; }; M.eatContextual = function(e) { return this.isContextual(e) ? (this.next(), !0) : !1; }; M.expectContextual = function(e) { this.eatContextual(e) || this.unexpected(); }; M.canInsertSemicolon = function() { return this.type === o.eof || this.type === o.braceR || Y.test(this.input.slice(this.lastTokEnd, this.start)); }; M.insertSemicolon = function() { if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0; }; M.semicolon = function() { !this.eat(o.semi) && !this.insertSemicolon() && this.unexpected(); }; M.afterTrailingComma = function(e, t) { if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0; }; M.expect = function(e) { this.eat(e) || this.unexpected(); }; M.unexpected = function(e) { this.raise(e ?? this.start, "Unexpected token"); }; var at = function() { this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; }; M.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, t ? "Assigning to rvalue" : "Parenthesized pattern"); } }; M.checkExpressionErrors = function(e, t) { if (!e) return !1; var r = e.shorthandAssign, i = e.doubleProto; if (!t) return r >= 0 || i >= 0; r >= 0 && this.raise(r, "Shorthand property assignments are valid only in destructuring patterns"), i >= 0 && this.raiseRecoverable(i, "Redefinition of __proto__ property"); }; M.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"); }; M.isSimpleAssignTarget = function(e) { return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression"; }; var m = N.prototype; m.parseTopLevel = function(e) { var t = /* @__PURE__ */ Object.create(null); for (e.body || (e.body = []); this.type !== o.eof; ) { var r = this.parseStatement(null, !0, t); e.body.push(r); } if (this.inModule) for (var i = 0, s = Object.keys(this.undefinedExports); i < s.length; i += 1) { var a = s[i]; this.raiseRecoverable(this.undefinedExports[a].start, "Export '" + a + "' is not defined"); } return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType, this.finishNode(e, "Program"); }; var Rt = { kind: "loop" }, Hr = { kind: "switch" }; m.isLet = function(e) { if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1; Z.lastIndex = this.pos; var t = Z.exec(this.input), r = this.pos + t[0].length, i = this.input.charCodeAt(r); if (i === 91 || i === 92) return !0; if (e) return !1; if (i === 123 || i > 55295 && i < 56320) return !0; if (oe(i, !0)) { for (var s = r + 1; _e(i = this.input.charCodeAt(s), !0); ) ++s; if (i === 92 || i > 55295 && i < 56320) return !0; var a = this.input.slice(r, s); if (!Dr.test(a)) return !0; } return !1; }; m.isAsyncFunction = function() { if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1; Z.lastIndex = this.pos; var e = Z.exec(this.input), t = this.pos + e[0].length, r; return !Y.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(_e(r = this.input.charCodeAt(t + 8)) || r > 55295 && r < 56320)); }; m.parseStatement = function(e, t, r) { var i = this.type, s = this.startNode(), a; switch (this.isLet(e) && (i = o._var, a = "let"), i) { case o._break: case o._continue: return this.parseBreakContinueStatement(s, i.keyword); case o._debugger: return this.parseDebuggerStatement(s); case o._do: return this.parseDoStatement(s); case o._for: return this.parseForStatement(s); case o._function: return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(s, !1, !e); case o._class: return e && this.unexpected(), this.parseClass(s, !0); case o._if: return this.parseIfStatement(s); case o._return: return this.parseReturnStatement(s); case o._switch: return this.parseSwitchStatement(s); case o._throw: return this.parseThrowStatement(s); case o._try: return this.parseTryStatement(s); case o._const: case o._var: return a = a || this.value, e && a !== "var" && this.unexpected(), this.parseVarStatement(s, a); case o._while: return this.parseWhileStatement(s); case o._with: return this.parseWithStatement(s); case o.braceL: return this.parseBlock(!0, s); case o.semi: return this.parseEmptyStatement(s); case o._export: case o._import: if (this.options.ecmaVersion > 10 && i === o._import) { Z.lastIndex = this.pos; var n = Z.exec(this.input), u = this.pos + n[0].length, l = this.input.charCodeAt(u); if (l === 40 || l === 46) 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'")), i === o._import ? this.parseImport(s) : this.parseExport(s, r); // If the statement does not start with a statement keyword or a // brace, it's an ExpressionStatement or LabeledStatement. We // simply start parsing an expression, and afterwards, if the // next token is a colon and the expression was a simple // Identifier node, we switch to interpreting it as a label. default: if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(s, !0, !e); var c = this.value, f = this.parseExpression(); return i === o.name && f.type === "Identifier" && this.eat(o.colon) ? this.parseLabeledStatement(s, c, f, e) : this.parseExpressionStatement(s, f); } }; m.parseBreakContinueStatement = function(e, t) { var r = t === "break"; this.next(), this.eat(o.semi) || this.insertSemicolon() ? e.label = null : this.type !== o.name ? this.unexpected() : (e.label = this.parseIdent(), this.semicolon()); for (var i = 0; i < this.labels.length; ++i) { var s = this.labels[i]; if ((e.label == null || s.name === e.label.name) && (s.kind != null && (r || s.kind === "loop") || e.label && r)) break; } return i === this.labels.length && this.raise(e.start, "Unsyntactic " + t), this.finishNode(e, r ? "BreakStatement" : "ContinueStatement"); }; m.parseDebuggerStatement = function(e) { return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement"); }; m.parseDoStatement = function(e) { return this.next(), this.labels.push(Rt), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(o._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(o.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement"); }; m.parseForStatement = function(e) { this.next(); var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1; if (this.labels.push(Rt), this.enterScope(0), this.expect(o.parenL), this.type === o.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null); var r = this.isLet(); if (this.type === o._var || this.type === o._const || r) { var i = this.startNode(), s = r ? "let" : this.value; return this.next(), this.parseVar(i, !0, s), this.finishNode(i, "VariableDeclaration"), (this.type === o._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && i.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === o._in ? t > -1 && this.unexpected(t) : e.await = t > -1), this.parseForIn(e, i)) : (t > -1 && this.unexpected(t), this.parseFor(e, i)); } var a = this.isContextual("let"), n = !1, u = this.containsEsc, l = new at(), c = this.start, f = t > -1 ? this.parseExprSubscripts(l, "await") : this.parseExpression(!0, l); return this.type === o._in || (n = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === o._in && this.unexpected(t), e.await = !0) : n && this.options.ecmaVersion >= 8 && (f.start === c && !u && f.type === "Identifier" && f.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), a && n && this.raise(f.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(f, !1, l), this.checkLValPattern(f), this.parseForIn(e, f)) : (this.checkExpressionErrors(l, !0), t > -1 && this.unexpected(t), this.parseFor(e, f)); }; m.parseFunctionStatement = function(e, t, r) { return this.next(), this.parseFunction(e, Be | (r ? 0 : bt), !1, t); }; m.parseIfStatement = function(e) { return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(o._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement"); }; m.parseReturnStatement = function(e) { return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(o.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement"); }; m.parseSwitchStatement = function(e) { this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(o.braceL), this.labels.push(Hr), this.enterScope(0); for (var t, r = !1; this.type !== o.braceR; ) if (this.type === o._case || this.type === o._default) { var i = this.type === o._case; t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), i ? t.test = this.parseExpression() : (r && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), r = !0, t.test = null), this.expect(o.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"); }; m.parseThrowStatement = function(e) { return this.next(), Y.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 Kr = []; m.parseCatchClauseParam = function() { var e = this.parseBindingAtom(), t = e.type === "Identifier"; return this.enterScope(t ? ui : 0), this.checkLValPattern(e, t ? fi : he), this.expect(o.parenR), e; }; m.parseTryStatement = function(e) { if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === o._catch) { var t = this.startNode(); this.next(), this.eat(o.parenL) ? t.param = this.parseCatchClauseParam() : (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(o._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement"); }; m.parseVarStatement = function(e, t, r) { return this.next(), this.parseVar(e, !1, t, r), this.semicolon(), this.finishNode(e, "VariableDeclaration"); }; m.parseWhileStatement = function(e) { return this.next(), e.test = this.parseParenExpression(), this.labels.push(Rt), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement"); }; m.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"); }; m.parseEmptyStatement = function(e) { return this.next(), this.finishNode(e, "EmptyStatement"); }; m.parseLabeledStatement = function(e, t, r, i) { for (var s = 0, a = this.labels; s < a.length; s += 1) { var n = a[s]; n.name === t && this.raise(r.start, "Label '" + t + "' is already declared"); } for (var u = this.type.isLoop ? "loop" : this.type === o._switch ? "switch" : null, l = this.labels.length - 1; l >= 0; l--) { var c = this.labels[l]; if (c.statementStart === e.start) c.statementStart = this.start, c.kind = u; else break; } return this.labels.push({ name: t, kind: u, statementStart: this.start }), e.body = this.parseStatement(i ? i.indexOf("label") === -1 ? i + "label" : i : "label"), this.labels.pop(), e.label = r, this.finishNode(e, "LabeledStatement"); }; m.parseExpressionStatement = function(e, t) { return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement"); }; m.parseBlock = function(e, t, r) { for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(o.braceL), e && this.enterScope(0); this.type !== o.braceR; ) { var i = this.parseStatement(null); t.body.push(i); } return r && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement"); }; m.parseFor = function(e, t) { return e.init = t, this.expect(o.semi), e.test = this.type === o.semi ? null : this.parseExpression(), this.expect(o.semi), e.update = this.type === o.parenR ? null : this.parseExpression(), this.expect(o.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement"); }; m.parseForIn = function(e, t) { var r = this.type === o._in; return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!r || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise( t.start, (r ? "for-in" : "for-of") + " loop variable declaration may not have an initializer" ), e.left = t, e.right = r ? this.parseExpression() : this.parseMaybeAssign(), this.expect(o.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, r ? "ForInStatement" : "ForOfStatement"); }; m.parseVar = function(e, t, r, i) { for (e.declarations = [], e.kind = r; ; ) { var s = this.startNode(); if (this.parseVarId(s, r), this.eat(o.eq) ? s.init = this.parseMaybeAssign(t) : !i && r === "const" && !(this.type === o._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !i && s.id.type !== "Identifier" && !(t && (this.type === o._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : s.init = null, e.declarations.push(this.finishNode(s, "VariableDeclarator")), !this.eat(o.comma)) break; } return e; }; m.parseVarId = function(e, t) { e.id = this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? Nt : he, !1); }; var Be = 1, bt = 2, pi = 4; m.parseFunction = function(e, t, r, i, s) { this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !i) && (this.type === o.star && t & bt && this.unexpected(), e.generator = this.eat(o.star)), this.options.ecmaVersion >= 8 && (e.async = !!i), t & Be && (e.id = t & pi && this.type !== o.name ? null : this.parseIdent(), e.id && !(t & bt) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Nt : he : ci)); var a = this.yieldPos, n = this.awaitPos, u = this.awaitIdentPos; return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Vt(e.async, e.generator)), t & Be || (e.id = this.type === o.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, r, !1, s), this.yieldPos = a, this.awaitPos = n, this.awaitIdentPos = u, this.finishNode(e, t & Be ? "FunctionDeclaration" : "FunctionExpression"); }; m.parseFunctionParams = function(e) { this.expect(o.parenL), e.params = this.parseBindingList(o.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(); }; m.parseClass = function(e, t) { this.next(); var r = this.strict; this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e); var i = this.enterClassBody(), s = this.startNode(), a = !1; for (s.body =