UNPKG

@vtj/renderer

Version:

VTJ 是一款基于 Vue3 + Typescript 的低代码页面可视化设计器。内置低代码引擎、渲染器和代码生成器,面向前端开发者,开箱即用。 无缝嵌入本地开发工程,不改变前端开发流程和编码习惯。

1,090 lines 236 kB
import { Base as ui, BUILT_IN_COMPONENTS as ci, ProjectModel as qe, HistoryModel as fs } from "@vtj/core"; import { url as pe, isUrl as xt, dedupArray as li, isFunction as K, isString as te, logger as ve, storage as ot, cookie as ut, toArray as Yt, unRSA as Xt, delay as Pe, createRequest as ds, jsonp as ms, merge as hi, pathToRegexp as pi, pathToRegexpMatch as fi, formDataToJson as di, isEqual as ct, Queue as mi, cloneDeep as Zt, camelCase as Z, upperFirstCamelCase as gi, pick as xi, request as vt, loadScript as es, debounce as vi, Storage as bi, mapToObject as Pt } from "@vtj/utils"; import * as be from "vue"; import { inject as Tt, defineComponent as gs, h as bt, ref as yt, watchEffect as yi, defineAsyncComponent as ts } from "vue"; import { useRoute as xs } from "vue-router"; /**! * Copyright (c) 2026, VTJ.PRO All rights reserved. * @name @vtj/renderer * @author CHC chenhuachun1549@dingtalk.com * @version 0.18.22 * @license <a href="https://vtj.pro/license.html">MIT License</a> */ const ke = "0.18.22"; var T = /* @__PURE__ */ ((t) => (t.Runtime = "Runtime", t.Design = "Design", t.Raw = "Raw", t.VNode = "VNode", t))(T || {}); const ss = [ "$el", "$emit", "$nextTick", "$parent", "$root", "$attrs", "$slots", "$watch", "$props", "$options", "$forceUpdate" ], Pn = [ "beforeCreate", "created", "beforeMount", "mounted", "beforeUpdate", "updated", "beforeUnmount", "unmounted", "errorCaptured", "renderTracked", "renderTriggered", "activated", "deactivated" ], Tn = [ "onBeforeMount", "onMounted", "onBeforeUpdate", "onUpdated", "onBeforeUnmount", "onUnmounted", "onErrorCaptured", "onRenderTracked", "onRenderTriggered", "onActivated", "onDeactivated" ], _i = [ "vIf", "vElseIf", "vElse", "vShow", "vModel", "vFor", "vBind", "vHtml" ], Si = { String, Number, Boolean, Array, Object, Function, Date }, Ie = "VtjPage", Ge = "VtjHomepage", vs = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split( "," ), Ci = "component,slot".split(","), Nn = [ "h", "t", "t", "p", "s", ":", "/", "/", "a", "p", "p", ".", "v", "t", "j", ".", "p", "r", "o" ].join(""), Rn = { auth: [ "h", "t", "t", "p", "s", ":", "/", "/", "a", "p", "p", ".", "v", "t", "j", ".", "p", "r", "o", "/", "a", "u", "t", "h", ".", "h", "t", "m", "l" ].join(""), storageKey: [ "R", "R", "O", "_", "I", "D", "E", "_", "A", "C", "C", "E", "S", "S", "_", "S", "T", "O", "R", "A", "G", "E", "_", "_" ].join(""), privateKey: "MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd" }; function He(t, e) { return t.map((s) => xt(s) || s.startsWith("/") ? s : `${e}${s}`); } function Qe(t) { return /\.css$/.test(t); } function Ye(t) { return /\.js$/.test(t); } function wi(t) { return /\.json$/.test(t); } function Vn(t) { return t.map( (e) => `<script src="${pe.append(e, { v: ke })}"><\/script>` ).join(""); } function On(t = []) { return t.map( (e) => `<link rel="stylesheet" href="${pe.append(e, { v: ke })}" />` ).join(""); } function Ei(t, e = !1) { return e && t.endsWith(".prod.js") ? t.replace(".prod.js", ".js") : t; } function ki(t, e, s = !1) { const i = t.filter((d) => !!d.enabled), r = [], n = [], a = [], u = [], c = {}, l = {}, h = [], p = {}; return i.forEach( ({ urls: d, assetsUrl: f, library: m, assetsLibrary: v, localeLibrary: g }) => { d?.forEach((x) => { Ye(x) && r.push(Ei(x, s)), Qe(x) && n.push(x); }), m && (u.push(m), c[m] = He(d || [], e), g && (l[m] = g)), f && a.push(f), v && h.push(v), m && v && (p[v] = m); } ), { scripts: He(r, e), css: He(n, e), materials: He(a, e), libraryExports: u, materialExports: li(h), materialMapLibrary: p, libraryMap: c, libraryLocaleMap: l }; } function Ii(t, e) { const { name: s, parent: i, alias: r } = t; return i ? e[i]?.[r || s] : e[r || s]; } function Ai(t = []) { const e = t.filter((i) => Qe(i)), s = t.filter((i) => Ye(i)); return { css: e, js: s }; } function Pi(t, e) { const s = (l) => { const h = []; let p = 0; for (; p < l.length; ) { if (/\s/.test(l[p])) { p++; continue; } if (l.substring(p, p + 2) === "/*") { const x = l.indexOf("*/", p + 2); if (x !== -1) { p = x + 2; continue; } } if (l[p] === "@") { const x = p; for (; p < l.length && l[p] !== "{" && l[p] !== ";"; ) p++; const k = l.substring(x, p).trim(), N = k.includes("@keyframes"); if (l[p] === ";") h.push({ type: "simple-at-rule", content: l.substring(x, p + 1) }), p++; else if (l[p] === "{") { const C = p + 1; let D = 1; for (p++; p < l.length && D > 0; ) l[p] === "{" ? D++ : l[p] === "}" && D--, p++; const de = l.substring(x, p), Se = l.substring(C, p - 1); h.push({ type: N ? "keyframes" : "at-rule", rule: k, content: de, inner: Se }); } continue; } const d = p; for (; p < l.length && l[p] !== "{"; ) p++; if (p >= l.length) break; const f = l.substring(d, p).trim(); if (!f) { p++; continue; } const m = p + 1; let v = 1; for (p++; p < l.length && v > 0; ) l[p] === "{" ? v++ : l[p] === "}" && v--, p++; const g = l.substring(m, p - 1); h.push({ type: "rule", selector: f, content: g.trim() }); } return h; }, i = (l) => { const h = l.trim(); return /^(from|to|\d+(\.\d+)?%)$/.test(h); }, r = (l) => l.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (h, p, d) => { const f = p.trim(), m = d.trim(); return f ? `${f}[${e}] ${m}` : m; }), n = (l) => { const h = l.trim(); if (!h || h.includes(`[${e}]`) || /^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(h) || i(h)) return h; const p = h.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/); if (p) { const [, d, f = ""] = p, m = d.trim(); return m ? `${m}[${e}]${f}` : h; } return `${h}[${e}]`; }, a = (l) => r(l).split(",").map((p) => n(p)).filter((p) => p.trim()).join(", "), u = (l) => l.map((h) => { switch (h.type) { case "simple-at-rule": return h.content; case "keyframes": return h.content; case "at-rule": try { const d = s(h.inner), f = u(d); return `${h.rule} { ${f} }`; } catch { return h.content; } case "rule": if (!h.selector || !h.content) return ""; const p = a(h.selector); return p.trim() ? `${p} { ${h.content} }` : ""; default: return ""; } }).filter((h) => h.trim()).join(" "), c = (l) => l.replace(/\s*{\s*/g, " { ").replace(/\s*}\s*/g, " } ").replace(/\s*;\s*/g, "; ").replace(/\s*,\s*/g, ", ").replace(/\s+/g, " ").replace(/^\s+|\s+$/g, "").replace(/\s*}\s*}/g, " } }").trim(); try { const l = t.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g, "").replace(/^\s+|\s+$/gm, "").replace(/\n\s*\n/g, ` `), h = s(l), p = u(h); return c(p); } catch (l) { return console.error("CSS scoping failed:", l), console.error("Input CSS:", t), t.replace(/\/\*[\s\S]*?\*\//g, "").replace( /(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g, (h) => h ).replace(/([^{}@]+)(?=\s*{)/g, (h) => { const p = h.trim(); return !p || p.startsWith("@") || p.includes(`[${e}]`) || i(p) ? h : `${p}[${e}]`; }); } } const Ti = 750; function Ni(t, e, s) { let i; typeof t < "u" ? i = t.innerWidth || t.document.documentElement.clientWidth : (console.warn("无法获取屏幕宽度,使用默认值375"), i = 375); const r = s || Ti; return e * i / r; } function Ri(t, e) { let s = !1, i = !1, r = !1, n = ""; for (let a = 0; a < e.length; a++) { const u = e[a]; if (u === "'" && !i && !r ? s = !s : u === '"' && !s && !r ? i = !i : e.substr(a, 4).toLowerCase() === "url(" && !s && !i ? r = !0 : u === ")" && r && (r = !1), !s && !i && !r) { const c = e.substr(a).match(/^(-?\d+(?:\.\d+)?)\s*rpx/); if (c) { const l = c[1], h = parseFloat(l), d = `${Ni(t, h).toFixed(6).replace(/\.?0+$/, "")}px`; n += d, a += c[0].length - 1; continue; } } n += u; } return n; } function bs(t) { return te(t) ? t : JSON.stringify(t); } function Nt(t, e, s, i = !1) { const r = t.CSSStyleSheet, n = i ? `data-v-${e}` : e, a = t.__uniConfig ? Ri(t, s) : s, u = i ? Pi(a, n) : a, c = !!t.__uniConfig; if (r.prototype.replaceSync && !c) { const l = new r(); l.id = e, l.replaceSync(u); const h = t.document, p = h.adoptedStyleSheets, d = Array.from(p).filter( (f) => f.id !== e ); h.adoptedStyleSheets = [...d, l]; } else { const l = t.document; let h = l.getElementById(e); h ? h.innerHTML = u : (h = l.createElement("style"), h.id = e, h.innerHTML = u, l.head.appendChild(h)); } } function Fn(t) { const e = t.adoptedStyleSheets || []; let s = ""; if (e.forEach((i) => { try { for (const r of i.cssRules) s += r.cssText + ` `; } catch (r) { console.error("Failed to read cssRules from adopted stylesheet:", r); } }), s) { const i = t.createElement("style"); i.textContent = s, t.head.appendChild(i); } } async function Vi(t, e) { const s = await globalThis.fetch(e).then((i) => i.text()).catch(() => ""); s && Nt(globalThis, t, s); } function ys(t, e = globalThis) { const s = e.document, i = e.document.head; for (const r of t) if (!s.getElementById(r)) { const a = s.createElement("link"); a.rel = "stylesheet", a.id = r, a.href = r, i.appendChild(a); } } async function _s(t, e, s = globalThis) { const i = s.document, r = s.document.head; let n = s[e]; return n ? n.default || n : new Promise((a, u) => { for (const c of t) { const l = i.createElement("script"); l.src = c, l.onload = () => { n = s[e], n ? a(n.default || n) : u(null); }, l.onerror = (h) => { u(h); }, r.appendChild(l); } }); } function Oi(t) { return K(t) && Object.getOwnPropertyNames(t.prototype || {}).length === 0 || K(t?.install); } function Fi(t) { return Ci.includes(t); } function Li(t) { return vs.includes(t); } function Te(t = globalThis) { const e = globalThis?.Mock; if (e) return e; const s = t?.Mock; if (s && globalThis) return globalThis.Mock = s, s; } function Ln(t, e, s) { Object.assign(e.meta, s.meta); const i = t?._container; s?.type === "page" && i.classList.add("is-page"), s?.pure && i.classList.add("is-pure"); } function ji(t) { return /^\([\s\S]*\)/.test(t.trim()); } function Mi(t) { return /\w+\([\s\S]*\)$/.test(t.trim()); } function Di(t) { return t.includes("="); } var lt = { 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" }, ht = "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", Bi = { 5: ht, "5module": ht + " export import", 6: ht + " const class extends export import super" }, Hi = /^in(stanceof)?$/, Rt = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", Ss = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_", $i = new RegExp("[" + Rt + "]"), Ui = new RegExp("[" + Rt + Ss + "]"); Rt = Ss = null; var Cs = [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], Gi = [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 _t(t, e) { for (var s = 65536, i = 0; i < e.length; i += 2) { if (s += e[i], s > t) return !1; if (s += e[i + 1], s >= t) return !0; } } function ae(t, e) { return t < 65 ? t === 36 : t < 91 ? !0 : t < 97 ? t === 95 : t < 123 ? !0 : t <= 65535 ? t >= 170 && $i.test(String.fromCharCode(t)) : e === !1 ? !1 : _t(t, Cs); } function ye(t, e) { return t < 48 ? t === 36 : t < 58 ? !0 : t < 65 ? !1 : t < 91 ? !0 : t < 97 ? t === 95 : t < 123 ? !0 : t <= 65535 ? t >= 170 && Ui.test(String.fromCharCode(t)) : e === !1 ? !1 : _t(t, Cs) || _t(t, Gi); } var E = function(e, s) { s === void 0 && (s = {}), this.label = e, this.keyword = s.keyword, this.beforeExpr = !!s.beforeExpr, this.startsExpr = !!s.startsExpr, this.isLoop = !!s.isLoop, this.isAssign = !!s.isAssign, this.prefix = !!s.prefix, this.postfix = !!s.postfix, this.binop = s.binop || null, this.updateContext = null; }; function H(t, e) { return new E(t, { beforeExpr: !0, binop: e }); } var $ = { beforeExpr: !0 }, B = { startsExpr: !0 }, Vt = {}; function w(t, e) { return e === void 0 && (e = {}), e.keyword = t, Vt[t] = new E(t, e); } var o = { num: new E("num", B), regexp: new E("regexp", B), string: new E("string", B), name: new E("name", B), 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(",", $), semi: new E(";", $), colon: new E(":", $), dot: new E("."), question: new E("?", $), questionDot: new E("?."), arrow: new E("=>", $), template: new E("template"), invalidTemplate: new E("invalidTemplate"), ellipsis: new E("...", $), backQuote: new E("`", B), 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: H("||", 1), logicalAND: H("&&", 2), bitwiseOR: H("|", 3), bitwiseXOR: H("^", 4), bitwiseAND: H("&", 5), equality: H("==/!=/===/!==", 6), relational: H("</>/<=/>=", 7), bitShift: H("<</>>/>>>", 8), plusMin: new E("+/-", { beforeExpr: !0, binop: 9, prefix: !0, startsExpr: !0 }), modulo: H("%", 10), star: H("*", 10), slash: H("/", 10), starstar: new E("**", { beforeExpr: !0 }), coalesce: H("??", 1), // Keyword token types. _break: w("break"), _case: w("case", $), _catch: w("catch"), _continue: w("continue"), _debugger: w("debugger"), _default: w("default", $), _do: w("do", { isLoop: !0, beforeExpr: !0 }), _else: w("else", $), _finally: w("finally"), _for: w("for", { isLoop: !0 }), _function: w("function", B), _if: w("if"), _return: w("return", $), _switch: w("switch"), _throw: w("throw", $), _try: w("try"), _var: w("var"), _const: w("const"), _while: w("while", { isLoop: !0 }), _with: w("with"), _new: w("new", { beforeExpr: !0, startsExpr: !0 }), _this: w("this", B), _super: w("super", B), _class: w("class", B), _extends: w("extends", $), _export: w("export"), _import: w("import", B), _null: w("null", B), _true: w("true", B), _false: w("false", B), _in: w("in", { beforeExpr: !0, binop: 7 }), _instanceof: w("instanceof", { beforeExpr: !0, binop: 7 }), _typeof: w("typeof", { beforeExpr: !0, prefix: !0, startsExpr: !0 }), _void: w("void", { beforeExpr: !0, prefix: !0, startsExpr: !0 }), _delete: w("delete", { beforeExpr: !0, prefix: !0, startsExpr: !0 }) }, G = /\r\n?|\n|\u2028|\u2029/, Ne = new RegExp(G.source, "g"); function Fe(t, e) { return t === 10 || t === 13 || !e && (t === 8232 || t === 8233); } var ws = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, U = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, Es = Object.prototype, qi = Es.hasOwnProperty, Wi = Es.toString; function Xe(t, e) { return qi.call(t, e); } var is = Array.isArray || (function(t) { return Wi.call(t) === "[object Array]"; }); function he(t) { return new RegExp("^(?:" + t.replace(/ /g, "|") + ")$"); } var Re = function(e, s) { this.line = e, this.column = s; }; Re.prototype.offset = function(e) { return new Re(this.line, this.column + e); }; var Ze = function(e, s, i) { this.start = s, this.end = i, e.sourceFile !== null && (this.source = e.sourceFile); }; function ks(t, e) { for (var s = 1, i = 0; ; ) { Ne.lastIndex = i; var r = Ne.exec(t); if (r && r.index < e) ++s, i = r.index + r[0].length; else return new Re(s, e - i); } } var St = { // `ecmaVersion` indicates the ECMAScript version to parse. Must be // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 // (2019). This influences support for strict mode, the set of // reserved words, and support for new syntax features. The default // is 10. ecmaVersion: 10, // `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 comma 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. allowImportExportEverywhere: !1, // When enabled, await identifiers are allowed to appear at the top-level scope, // but they are still not allowed in non-async functions. allowAwaitOutsideFunction: !1, // When enabled, hashbang directive in the beginning of file // is allowed and treated as a line comment. allowHashBang: !1, // 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. 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 }; function Ki(t) { var e = {}; for (var s in St) e[s] = t && Xe(t, s) ? t[s] : St[s]; if (e.ecmaVersion >= 2015 && (e.ecmaVersion -= 2009), e.allowReserved == null && (e.allowReserved = e.ecmaVersion < 5), is(e.onToken)) { var i = e.onToken; e.onToken = function(r) { return i.push(r); }; } return is(e.onComment) && (e.onComment = zi(e, e.onComment)), e; } function zi(t, e) { return function(s, i, r, n, a, u) { var c = { type: s ? "Block" : "Line", value: i, start: r, end: n }; t.locations && (c.loc = new Ze(this, a, u)), t.ranges && (c.range = [r, n]), e.push(c); }; } var Ve = 1, Le = 2, Ot = Ve | Le, Is = 4, As = 8, Ps = 16, Ts = 32, Ns = 64, Rs = 128; function Ft(t, e) { return Le | (t ? Is : 0) | (e ? As : 0); } var rs = 0, Lt = 1, ee = 2, Vs = 3, Os = 4, Fs = 5, A = function(e, s, i) { this.options = e = Ki(e), this.sourceFile = e.sourceFile, this.keywords = he(Bi[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]); var r = ""; if (e.allowReserved !== !0) { for (var n = e.ecmaVersion; !(r = lt[n]); n--) ; e.sourceType === "module" && (r += " await"); } this.reservedWords = he(r); var a = (r ? r + " " : "") + lt.strict; this.reservedWordsStrict = he(a), this.reservedWordsStrictBind = he(a + " " + lt.strictBind), this.input = String(s), this.containsEsc = !1, i ? (this.pos = i, this.lineStart = this.input.lastIndexOf(` `, i - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(G).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 = e.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = {}, this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(Ve), this.regexpState = null; }, fe = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 } }; A.prototype.parse = function() { var e = this.options.program || this.startNode(); return this.nextToken(), this.parseTopLevel(e); }; fe.inFunction.get = function() { return (this.currentVarScope().flags & Le) > 0; }; fe.inGenerator.get = function() { return (this.currentVarScope().flags & As) > 0; }; fe.inAsync.get = function() { return (this.currentVarScope().flags & Is) > 0; }; fe.allowSuper.get = function() { return (this.currentThisScope().flags & Ns) > 0; }; fe.allowDirectSuper.get = function() { return (this.currentThisScope().flags & Rs) > 0; }; fe.treatFunctionsAsVar.get = function() { return this.treatFunctionsAsVarInScope(this.currentScope()); }; A.prototype.inNonArrowFunction = function() { return (this.currentThisScope().flags & Le) > 0; }; A.extend = function() { for (var e = [], s = arguments.length; s--; ) e[s] = arguments[s]; for (var i = this, r = 0; r < e.length; r++) i = e[r](i); return i; }; A.parse = function(e, s) { return new this(s, e).parse(); }; A.parseExpressionAt = function(e, s, i) { var r = new this(i, e, s); return r.nextToken(), r.parseExpression(); }; A.tokenizer = function(e, s) { return new this(s, e); }; Object.defineProperties(A.prototype, fe); var L = A.prototype, Ji = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; L.strictDirective = function(t) { for (; ; ) { U.lastIndex = t, t += U.exec(this.input)[0].length; var e = Ji.exec(this.input.slice(t)); if (!e) return !1; if ((e[1] || e[2]) === "use strict") { U.lastIndex = t + e[0].length; var s = U.exec(this.input), i = s.index + s[0].length, r = this.input.charAt(i); return r === ";" || r === "}" || G.test(s[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(r) || r === "!" && this.input.charAt(i + 1) === "="); } t += e[0].length, U.lastIndex = t, t += U.exec(this.input)[0].length, this.input[t] === ";" && t++; } }; L.eat = function(t) { return this.type === t ? (this.next(), !0) : !1; }; L.isContextual = function(t) { return this.type === o.name && this.value === t && !this.containsEsc; }; L.eatContextual = function(t) { return this.isContextual(t) ? (this.next(), !0) : !1; }; L.expectContextual = function(t) { this.eatContextual(t) || this.unexpected(); }; L.canInsertSemicolon = function() { return this.type === o.eof || this.type === o.braceR || G.test(this.input.slice(this.lastTokEnd, this.start)); }; L.insertSemicolon = function() { if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0; }; L.semicolon = function() { !this.eat(o.semi) && !this.insertSemicolon() && this.unexpected(); }; L.afterTrailingComma = function(t, e) { if (this.type === t) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), e || this.next(), !0; }; L.expect = function(t) { this.eat(t) || this.unexpected(); }; L.unexpected = function(t) { this.raise(t ?? this.start, "Unexpected token"); }; function et() { this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; } L.checkPatternErrors = function(t, e) { if (t) { t.trailingComma > -1 && this.raiseRecoverable(t.trailingComma, "Comma is not permitted after the rest element"); var s = e ? t.parenthesizedAssign : t.parenthesizedBind; s > -1 && this.raiseRecoverable(s, "Parenthesized pattern"); } }; L.checkExpressionErrors = function(t, e) { if (!t) return !1; var s = t.shorthandAssign, i = t.doubleProto; if (!e) return s >= 0 || i >= 0; s >= 0 && this.raise(s, "Shorthand property assignments are valid only in destructuring patterns"), i >= 0 && this.raiseRecoverable(i, "Redefinition of __proto__ property"); }; L.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"); }; L.isSimpleAssignTarget = function(t) { return t.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(t.expression) : t.type === "Identifier" || t.type === "MemberExpression"; }; var y = A.prototype; y.parseTopLevel = function(t) { var e = {}; for (t.body || (t.body = []); this.type !== o.eof; ) { var s = this.parseStatement(null, !0, e); t.body.push(s); } if (this.inModule) for (var i = 0, r = Object.keys(this.undefinedExports); i < r.length; i += 1) { var n = r[i]; this.raiseRecoverable(this.undefinedExports[n].start, "Export '" + n + "' is not defined"); } return this.adaptDirectivePrologue(t.body), this.next(), t.sourceType = this.options.sourceType, this.finishNode(t, "Program"); }; var jt = { kind: "loop" }, Qi = { kind: "switch" }; y.isLet = function(t) { if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1; U.lastIndex = this.pos; var e = U.exec(this.input), s = this.pos + e[0].length, i = this.input.charCodeAt(s); if (i === 91) return !0; if (t) return !1; if (i === 123) return !0; if (ae(i, !0)) { for (var r = s + 1; ye(this.input.charCodeAt(r), !0); ) ++r; var n = this.input.slice(s, r); if (!Hi.test(n)) return !0; } return !1; }; y.isAsyncFunction = function() { if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1; U.lastIndex = this.pos; var t = U.exec(this.input), e = this.pos + t[0].length; return !G.test(this.input.slice(this.pos, e)) && this.input.slice(e, e + 8) === "function" && (e + 8 === this.input.length || !ye(this.input.charAt(e + 8))); }; y.parseStatement = function(t, e, s) { var i = this.type, r = this.startNode(), n; switch (this.isLet(t) && (i = o._var, n = "let"), i) { case o._break: case o._continue: return this.parseBreakContinueStatement(r, i.keyword); case o._debugger: return this.parseDebuggerStatement(r); case o._do: return this.parseDoStatement(r); case o._for: return this.parseForStatement(r); case o._function: return t && (this.strict || t !== "if" && t !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(r, !1, !t); case o._class: return t && this.unexpected(), this.parseClass(r, !0); case o._if: return this.parseIfStatement(r); case o._return: return this.parseReturnStatement(r); case o._switch: return this.parseSwitchStatement(r); case o._throw: return this.parseThrowStatement(r); case o._try: return this.parseTryStatement(r); case o._const: case o._var: return n = n || this.value, t && n !== "var" && this.unexpected(), this.parseVarStatement(r, n); case o._while: return this.parseWhileStatement(r); case o._with: return this.parseWithStatement(r); case o.braceL: return this.parseBlock(!0, r); case o.semi: return this.parseEmptyStatement(r); case o._export: case o._import: if (this.options.ecmaVersion > 10 && i === o._import) { U.lastIndex = this.pos; var a = U.exec(this.input), u = this.pos + a[0].length, c = this.input.charCodeAt(u); if (c === 40 || c === 46) return this.parseExpressionStatement(r, this.parseExpression()); } return this.options.allowImportExportEverywhere || (e || 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(r) : this.parseExport(r, s); // 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 t && this.unexpected(), this.next(), this.parseFunctionStatement(r, !0, !t); var l = this.value, h = this.parseExpression(); return i === o.name && h.type === "Identifier" && this.eat(o.colon) ? this.parseLabeledStatement(r, l, h, t) : this.parseExpressionStatement(r, h); } }; y.parseBreakContinueStatement = function(t, e) { var s = e === "break"; this.next(), this.eat(o.semi) || this.insertSemicolon() ? t.label = null : this.type !== o.name ? this.unexpected() : (t.label = this.parseIdent(), this.semicolon()); for (var i = 0; i < this.labels.length; ++i) { var r = this.labels[i]; if ((t.label == null || r.name === t.label.name) && (r.kind != null && (s || r.kind === "loop") || t.label && s)) break; } return i === this.labels.length && this.raise(t.start, "Unsyntactic " + e), this.finishNode(t, s ? "BreakStatement" : "ContinueStatement"); }; y.parseDebuggerStatement = function(t) { return this.next(), this.semicolon(), this.finishNode(t, "DebuggerStatement"); }; y.parseDoStatement = function(t) { return this.next(), this.labels.push(jt), t.body = this.parseStatement("do"), this.labels.pop(), this.expect(o._while), t.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(o.semi) : this.semicolon(), this.finishNode(t, "DoWhileStatement"); }; y.parseForStatement = function(t) { this.next(); var e = this.options.ecmaVersion >= 9 && (this.inAsync || !this.inFunction && this.options.allowAwaitOutsideFunction) && this.eatContextual("await") ? this.lastTokStart : -1; if (this.labels.push(jt), this.enterScope(0), this.expect(o.parenL), this.type === o.semi) return e > -1 && this.unexpected(e), this.parseFor(t, null); var s = this.isLet(); if (this.type === o._var || this.type === o._const || s) { var i = this.startNode(), r = s ? "let" : this.value; return this.next(), this.parseVar(i, !0, r), 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 ? e > -1 && this.unexpected(e) : t.await = e > -1), this.parseForIn(t, i)) : (e > -1 && this.unexpected(e), this.parseFor(t, i)); } var n = new et(), a = this.parseExpression(!0, n); return this.type === o._in || this.options.ecmaVersion >= 6 && this.isContextual("of") ? (this.options.ecmaVersion >= 9 && (this.type === o._in ? e > -1 && this.unexpected(e) : t.await = e > -1), this.toAssignable(a, !1, n), this.checkLVal(a), this.parseForIn(t, a)) : (this.checkExpressionErrors(n, !0), e > -1 && this.unexpected(e), this.parseFor(t, a)); }; y.parseFunctionStatement = function(t, e, s) { return this.next(), this.parseFunction(t, Ae | (s ? 0 : Ct), !1, e); }; y.parseIfStatement = function(t) { return this.next(), t.test = this.parseParenExpression(), t.consequent = this.parseStatement("if"), t.alternate = this.eat(o._else) ? this.parseStatement("if") : null, this.finishNode(t, "IfStatement"); }; y.parseReturnStatement = function(t) { return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(o.semi) || this.insertSemicolon() ? t.argument = null : (t.argument = this.parseExpression(), this.semicolon()), this.finishNode(t, "ReturnStatement"); }; y.parseSwitchStatement = function(t) { this.next(), t.discriminant = this.parseParenExpression(), t.cases = [], this.expect(o.braceL), this.labels.push(Qi), this.enterScope(0); for (var e, s = !1; this.type !== o.braceR; ) if (this.type === o._case || this.type === o._default) { var i = this.type === o._case; e && this.finishNode(e, "SwitchCase"), t.cases.push(e = this.startNode()), e.consequent = [], this.next(), i ? e.test = this.parseExpression() : (s && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), s = !0, e.test = null), this.expect(o.colon); } else e || this.unexpected(), e.consequent.push(this.parseStatement(null)); return this.exitScope(), e && this.finishNode(e, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(t, "SwitchStatement"); }; y.parseThrowStatement = function(t) { return this.next(), G.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), t.argument = this.parseExpression(), this.semicolon(), this.finishNode(t, "ThrowStatement"); }; var Yi = []; y.parseTryStatement = function(t) { if (this.next(), t.block = this.parseBlock(), t.handler = null, this.type === o._catch) { var e = this.startNode(); if (this.next(), this.eat(o.parenL)) { e.param = this.parseBindingAtom(); var s = e.param.type === "Identifier"; this.enterScope(s ? Ts : 0), this.checkLVal(e.param, s ? Os : ee), this.expect(o.parenR); } else this.options.ecmaVersion < 10 && this.unexpected(), e.param = null, this.enterScope(0); e.body = this.parseBlock(!1), this.exitScope(), t.handler = this.finishNode(e, "CatchClause"); } return t.finalizer = this.eat(o._finally) ? this.parseBlock() : null, !t.handler && !t.finalizer && this.raise(t.start, "Missing catch or finally clause"), this.finishNode(t, "TryStatement"); }; y.parseVarStatement = function(t, e) { return this.next(), this.parseVar(t, !1, e), this.semicolon(), this.finishNode(t, "VariableDeclaration"); }; y.parseWhileStatement = function(t) { return this.next(), t.test = this.parseParenExpression(), this.labels.push(jt), t.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(t, "WhileStatement"); }; y.parseWithStatement = function(t) { return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), t.object = this.parseParenExpression(), t.body = this.parseStatement("with"), this.finishNode(t, "WithStatement"); }; y.parseEmptyStatement = function(t) { return this.next(), this.finishNode(t, "EmptyStatement"); }; y.parseLabeledStatement = function(t, e, s, i) { for (var r = 0, n = this.labels; r < n.length; r += 1) { var a = n[r]; a.name === e && this.raise(s.start, "Label '" + e + "' is already declared"); } for (var u = this.type.isLoop ? "loop" : this.type === o._switch ? "switch" : null, c = this.labels.length - 1; c >= 0; c--) { var l = this.labels[c]; if (l.statementStart === t.start) l.statementStart = this.start, l.kind = u; else break; } return this.labels.push({ name: e, kind: u, statementStart: this.start }), t.body = this.parseStatement(i ? i.indexOf("label") === -1 ? i + "label" : i : "label"), this.labels.pop(), t.label = s, this.finishNode(t, "LabeledStatement"); }; y.parseExpressionStatement = function(t, e) { return t.expression = e, this.semicolon(), this.finishNode(t, "ExpressionStatement"); }; y.parseBlock = function(t, e, s) { for (t === void 0 && (t = !0), e === void 0 && (e = this.startNode()), e.body = [], this.expect(o.braceL), t && this.enterScope(0); this.type !== o.braceR; ) { var i = this.parseStatement(null); e.body.push(i); } return s && (this.strict = !1), this.next(), t && this.exitScope(), this.finishNode(e, "BlockStatement"); }; y.parseFor = function(t, e) { return t.init = e, this.expect(o.semi), t.test = this.type === o.semi ? null : this.parseExpression(), this.expect(o.semi), t.update = this.type === o.parenR ? null : this.parseExpression(), this.expect(o.parenR), t.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(t, "ForStatement"); }; y.parseForIn = function(t, e) { var s = this.type === o._in; return this.next(), e.type === "VariableDeclaration" && e.declarations[0].init != null && (!s || this.options.ecmaVersion < 8 || this.strict || e.kind !== "var" || e.declarations[0].id.type !== "Identifier") ? this.raise( e.start, (s ? "for-in" : "for-of") + " loop variable declaration may not have an initializer" ) : e.type === "AssignmentPattern" && this.raise(e.start, "Invalid left-hand side in for-loop"), t.left = e, t.right = s ? this.parseExpression() : this.parseMaybeAssign(), this.expect(o.parenR), t.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(t, s ? "ForInStatement" : "ForOfStatement"); }; y.parseVar = function(t, e, s) { for (t.declarations = [], t.kind = s; ; ) { var i = this.startNode(); if (this.parseVarId(i, s), this.eat(o.eq) ? i.init = this.parseMaybeAssign(e) : s === "const" && !(this.type === o._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : i.id.type !== "Identifier" && !(e && (this.type === o._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : i.init = null, t.declarations.push(this.finishNode(i, "VariableDeclarator")), !this.eat(o.comma)) break; } return t; }; y.parseVarId = function(t, e) { t.id = this.parseBindingAtom(), this.checkLVal(t.id, e === "var" ? Lt : ee, !1); }; var Ae = 1, Ct = 2, Ls = 4; y.parseFunction = function(t, e, s, i) { this.initFunction(t), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !i) && (this.type === o.star && e & Ct && this.unexpected(), t.generator = this.eat(o.star)), this.options.ecmaVersion >= 8 && (t.async = !!i), e & Ae && (t.id = e & Ls && this.type !== o.name ? null : this.parseIdent(), t.id && !(e & Ct) && this.checkLVal(t.id, this.strict || t.generator || t.async ? this.treatFunctionsAsVar ? Lt : ee : Vs)); var r = this.yieldPos, n = this.awaitPos, a = this.awaitIdentPos; return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ft(t.async, t.generator)), e & Ae || (t.id = this.type === o.name ? this.parseIdent() : null), this.parseFunctionParams(t), this.parseFunctionBody(t, s, !1), this.yieldPos = r, this.awaitPos = n, this.awaitIdentPos = a, this.finishNode(t, e & Ae ? "FunctionDeclaration" : "FunctionExpression"); }; y.parseFunctionParams = function(t) { this.expect(o.parenL), t.params = this.parseBindingList(o.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(); }; y.parseClass = function(t, e) { this.next(); var s = this.strict; this.strict = !0, this.parseClassId(t, e), this.parseClassSuper(t); var i = this.startNode(), r = !1; for (i.body = [], this.expect(o.braceL); this.type !== o.braceR; ) { var n = this.parseClassElement(t.superClass !== null); n && (i.body.push(n), n.type === "MethodDefinition" && n.kind === "constructor" && (r && this.raise(n.start, "Duplicate constructor in the same class"), r = !0)); } return this.strict = s, this.next(), t.body = this.finishNode(i, "ClassBody"), this.finishNode(t, e ? "ClassDeclaration" : "ClassExpression"); }; y.parseClassElement = function(t) { var e = this; if (this.eat(o.semi)) return null; var s = this.startNode(), i = function(c, l) { l === void 0 && (l = !1); var h = e.start, p = e.startLoc; return e.eatContextual(c) ? e.type !== o.parenL && (!l || !e.canInsertSemicolon()) ? !0 : (s.key && e.unexpected(), s.computed = !1, s.key = e.startNodeAt(h, p), s.key.name = c, e.finishNode(s.key, "Identifier"), !1) : !1; }; s.kind = "method", s.static = i("static"); var r = this.eat(o.star), n = !1; r || (this.options.ecmaVersion >= 8 && i("async", !0) ? (n = !0, r = this.options.ecmaVersion >= 9 && this.eat(o.star)) : i("get") ? s.kind = "get" : i("set") && (s.kind = "set")), s.key || this.parsePropertyName(s); var a = s.key, u = !1; return !s.computed && !s.static && (a.type === "Identifier" && a.name === "constructor" || a.type === "Literal" && a.value === "constructor") ? (s.kind !== "method" && this.raise(a.start, "Constructor can't have get/set modifier"), r && this.raise(a.start, "Constructor can't be a generator"), n && this.raise(a.start, "Constructor can't be an async method"), s.kind = "constructor", u = t) : s.static && a.type === "Identifier" && a.name === "prototype" && this.raise(a.start, "Classes may not have a static property named prototype"), this.parseClassMethod(s, r, n, u), s.kind === "get" && s.value.params.length !== 0 && this.raiseRecoverable(s.value.start, "getter should have no params"), s.kind === "set" && s.value.params.length !== 1 && this.raiseRecoverable(s.value.start, "setter should have exactly one param"), s.kind === "set" && s.value.params[0].type === "RestElement" && this.raiseRecoverable(s.value.params[0].start, "Setter cannot use rest params"), s; }; y.parseClassMethod