From e92093631de30e62ed1ab2bb11ecd9495427ecac Mon Sep 17 00:00:00 2001
From: 15578532015 <15578532015@qq.com>
Date: Mon, 8 Aug 2022 08:12:35 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=8E=88=E6=9D=83=E7=99=BB?=
=?UTF-8?q?=E5=BD=95=EF=BC=8C=E6=B3=A8=E5=86=8C=EF=BC=8C=E7=99=BB=E5=BD=95?=
=?UTF-8?q?=EF=BC=8C=E6=9C=AC=E5=9C=B0=E7=BC=93=E5=AD=98=E5=A4=B4=E5=83=8F?=
=?UTF-8?q?=E6=98=B5=E7=A7=B0=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Fronts/manifest.json | 11 +-
Fronts/node_modules/.bin/nanoid | 12 +
Fronts/node_modules/.bin/nanoid.cmd | 17 +
Fronts/node_modules/.bin/nanoid.ps1 | 28 +
Fronts/node_modules/.bin/parser | 12 +
Fronts/node_modules/.bin/parser.cmd | 17 +
Fronts/node_modules/.bin/parser.ps1 | 28 +
Fronts/node_modules/.package-lock.json | 312 +
Fronts/node_modules/.yarn-integrity | 17 +
.../node_modules/@babel/parser/CHANGELOG.md | 1073 +
Fronts/node_modules/@babel/parser/LICENSE | 19 +
Fronts/node_modules/@babel/parser/README.md | 19 +
.../@babel/parser/bin/babel-parser.js | 15 +
Fronts/node_modules/@babel/parser/index.cjs | 5 +
.../node_modules/@babel/parser/lib/index.js | 16800 ++++++
.../@babel/parser/lib/index.js.map | 1 +
.../node_modules/@babel/parser/package.json | 46 +
.../@babel/parser/typings/babel-parser.d.ts | 214 +
.../node_modules/@vue/compiler-core/LICENSE | 21 +
.../node_modules/@vue/compiler-core/README.md | 1 +
.../compiler-core/dist/compiler-core.cjs.js | 5801 ++
.../dist/compiler-core.cjs.prod.js | 5672 ++
.../compiler-core/dist/compiler-core.d.ts | 1191 +
.../dist/compiler-core.esm-bundler.js | 4858 ++
.../node_modules/@vue/compiler-core/index.js | 7 +
.../@vue/compiler-core/package.json | 43 +
Fronts/node_modules/@vue/compiler-dom/LICENSE | 21 +
.../node_modules/@vue/compiler-dom/README.md | 1 +
.../compiler-dom/dist/compiler-dom.cjs.js | 3099 +
.../dist/compiler-dom.cjs.prod.js | 3056 +
.../@vue/compiler-dom/dist/compiler-dom.d.ts | 66 +
.../dist/compiler-dom.esm-browser.js | 5468 ++
.../dist/compiler-dom.esm-browser.prod.js | 1 +
.../dist/compiler-dom.esm-bundler.js | 462 +
.../compiler-dom/dist/compiler-dom.global.js | 5617 ++
.../dist/compiler-dom.global.prod.js | 1 +
.../node_modules/@vue/compiler-dom/index.js | 7 +
.../@vue/compiler-dom/package.json | 43 +
Fronts/node_modules/@vue/compiler-sfc/LICENSE | 21 +
.../node_modules/@vue/compiler-sfc/README.md | 80 +
.../compiler-sfc/dist/compiler-sfc.cjs.js | 17301 ++++++
.../@vue/compiler-sfc/dist/compiler-sfc.d.ts | 321 +
.../dist/compiler-sfc.esm-browser.js | 49039 ++++++++++++++++
.../@vue/compiler-sfc/package.json | 59 +
Fronts/node_modules/@vue/compiler-ssr/LICENSE | 21 +
.../node_modules/@vue/compiler-ssr/README.md | 1 +
.../compiler-ssr/dist/compiler-ssr.cjs.js | 1150 +
.../@vue/compiler-ssr/dist/compiler-ssr.d.ts | 6 +
.../@vue/compiler-ssr/package.json | 34 +
.../@vue/devtools-api/lib/cjs/api/api.js | 2 +
.../@vue/devtools-api/lib/cjs/api/app.js | 2 +
.../devtools-api/lib/cjs/api/component.js | 2 +
.../@vue/devtools-api/lib/cjs/api/context.js | 2 +
.../@vue/devtools-api/lib/cjs/api/hooks.js | 2 +
.../@vue/devtools-api/lib/cjs/api/index.js | 22 +
.../@vue/devtools-api/lib/cjs/api/util.js | 2 +
.../@vue/devtools-api/lib/cjs/const.js | 5 +
.../@vue/devtools-api/lib/cjs/env.js | 17 +
.../@vue/devtools-api/lib/cjs/index.js | 44 +
.../@vue/devtools-api/lib/cjs/plugin.js | 2 +
.../@vue/devtools-api/lib/cjs/proxy.js | 111 +
.../@vue/devtools-api/lib/cjs/time.js | 28 +
.../@vue/devtools-api/lib/esm/api/api.d.ts | 108 +
.../@vue/devtools-api/lib/esm/api/api.js | 1 +
.../@vue/devtools-api/lib/esm/api/app.d.ts | 1 +
.../@vue/devtools-api/lib/esm/api/app.js | 1 +
.../devtools-api/lib/esm/api/component.d.ts | 77 +
.../devtools-api/lib/esm/api/component.js | 1 +
.../devtools-api/lib/esm/api/context.d.ts | 5 +
.../@vue/devtools-api/lib/esm/api/context.js | 1 +
.../@vue/devtools-api/lib/esm/api/hooks.d.ts | 179 +
.../@vue/devtools-api/lib/esm/api/hooks.js | 1 +
.../@vue/devtools-api/lib/esm/api/index.d.ts | 6 +
.../@vue/devtools-api/lib/esm/api/index.js | 6 +
.../@vue/devtools-api/lib/esm/api/util.d.ts | 4 +
.../@vue/devtools-api/lib/esm/api/util.js | 1 +
.../@vue/devtools-api/lib/esm/const.d.ts | 2 +
.../@vue/devtools-api/lib/esm/const.js | 2 +
.../@vue/devtools-api/lib/esm/env.d.ts | 15 +
.../@vue/devtools-api/lib/esm/env.js | 12 +
.../@vue/devtools-api/lib/esm/index.d.ts | 18 +
.../@vue/devtools-api/lib/esm/index.js | 26 +
.../@vue/devtools-api/lib/esm/plugin.d.ts | 47 +
.../@vue/devtools-api/lib/esm/plugin.js | 1 +
.../@vue/devtools-api/lib/esm/proxy.d.ts | 20 +
.../@vue/devtools-api/lib/esm/proxy.js | 107 +
.../@vue/devtools-api/lib/esm/time.d.ts | 2 +
.../@vue/devtools-api/lib/esm/time.js | 23 +
.../@vue/devtools-api/package.json | 37 +
.../@vue/reactivity-transform/README.md | 121 +
.../dist/reactivity-transform.cjs.js | 525 +
.../dist/reactivity-transform.d.ts | 33 +
.../@vue/reactivity-transform/package.json | 41 +
Fronts/node_modules/@vue/reactivity/LICENSE | 21 +
Fronts/node_modules/@vue/reactivity/README.md | 19 +
.../@vue/reactivity/dist/reactivity.cjs.js | 1229 +
.../reactivity/dist/reactivity.cjs.prod.js | 1153 +
.../@vue/reactivity/dist/reactivity.d.ts | 344 +
.../reactivity/dist/reactivity.esm-browser.js | 1249 +
.../dist/reactivity.esm-browser.prod.js | 1 +
.../reactivity/dist/reactivity.esm-bundler.js | 1208 +
.../@vue/reactivity/dist/reactivity.global.js | 1291 +
.../reactivity/dist/reactivity.global.prod.js | 1 +
Fronts/node_modules/@vue/reactivity/index.js | 7 +
.../node_modules/@vue/reactivity/package.json | 41 +
Fronts/node_modules/@vue/runtime-core/LICENSE | 21 +
.../node_modules/@vue/runtime-core/README.md | 28 +
.../runtime-core/dist/runtime-core.cjs.js | 7765 +++
.../dist/runtime-core.cjs.prod.js | 6229 ++
.../@vue/runtime-core/dist/runtime-core.d.ts | 1998 +
.../dist/runtime-core.esm-bundler.js | 7739 +++
.../node_modules/@vue/runtime-core/index.js | 7 +
.../@vue/runtime-core/package.json | 38 +
Fronts/node_modules/@vue/runtime-dom/LICENSE | 21 +
.../node_modules/@vue/runtime-dom/README.md | 13 +
.../@vue/runtime-dom/dist/runtime-dom.cjs.js | 1653 +
.../runtime-dom/dist/runtime-dom.cjs.prod.js | 1548 +
.../@vue/runtime-dom/dist/runtime-dom.d.ts | 1523 +
.../dist/runtime-dom.esm-browser.js | 10688 ++++
.../dist/runtime-dom.esm-browser.prod.js | 1 +
.../dist/runtime-dom.esm-bundler.js | 1683 +
.../runtime-dom/dist/runtime-dom.global.js | 10821 ++++
.../dist/runtime-dom.global.prod.js | 1 +
Fronts/node_modules/@vue/runtime-dom/index.js | 7 +
.../@vue/runtime-dom/package.json | 42 +
.../node_modules/@vue/server-renderer/LICENSE | 21 +
.../@vue/server-renderer/README.md | 178 +
.../dist/server-renderer.cjs.js | 1040 +
.../dist/server-renderer.cjs.prod.js | 792 +
.../server-renderer/dist/server-renderer.d.ts | 98 +
.../dist/server-renderer.esm-bundler.js | 987 +
.../@vue/server-renderer/index.js | 7 +
.../@vue/server-renderer/package.json | 40 +
Fronts/node_modules/@vue/shared/LICENSE | 21 +
Fronts/node_modules/@vue/shared/README.md | 3 +
.../@vue/shared/dist/shared.cjs.js | 647 +
.../@vue/shared/dist/shared.cjs.prod.js | 646 +
.../node_modules/@vue/shared/dist/shared.d.ts | 354 +
.../@vue/shared/dist/shared.esm-bundler.js | 585 +
Fronts/node_modules/@vue/shared/index.js | 7 +
Fronts/node_modules/@vue/shared/package.json | 32 +
Fronts/node_modules/asynckit/LICENSE | 21 +
Fronts/node_modules/asynckit/README.md | 233 +
Fronts/node_modules/asynckit/bench.js | 76 +
Fronts/node_modules/asynckit/index.js | 6 +
Fronts/node_modules/asynckit/lib/abort.js | 29 +
Fronts/node_modules/asynckit/lib/async.js | 34 +
Fronts/node_modules/asynckit/lib/defer.js | 26 +
Fronts/node_modules/asynckit/lib/iterate.js | 75 +
.../asynckit/lib/readable_asynckit.js | 91 +
.../asynckit/lib/readable_parallel.js | 25 +
.../asynckit/lib/readable_serial.js | 25 +
.../asynckit/lib/readable_serial_ordered.js | 29 +
Fronts/node_modules/asynckit/lib/state.js | 37 +
Fronts/node_modules/asynckit/lib/streamify.js | 141 +
.../node_modules/asynckit/lib/terminator.js | 29 +
Fronts/node_modules/asynckit/package.json | 63 +
Fronts/node_modules/asynckit/parallel.js | 43 +
Fronts/node_modules/asynckit/serial.js | 17 +
Fronts/node_modules/asynckit/serialOrdered.js | 75 +
Fronts/node_modules/asynckit/stream.js | 21 +
Fronts/node_modules/axios/CHANGELOG.md | 943 +
Fronts/node_modules/axios/LICENSE | 19 +
Fronts/node_modules/axios/README.md | 991 +
Fronts/node_modules/axios/SECURITY.md | 5 +
Fronts/node_modules/axios/UPGRADE_GUIDE.md | 168 +
Fronts/node_modules/axios/dist/axios.js | 2595 +
Fronts/node_modules/axios/dist/axios.map | 1 +
Fronts/node_modules/axios/dist/axios.min.js | 3 +
Fronts/node_modules/axios/dist/axios.min.map | 1 +
Fronts/node_modules/axios/index.d.ts | 254 +
Fronts/node_modules/axios/index.js | 1 +
.../node_modules/axios/lib/adapters/README.md | 37 +
.../node_modules/axios/lib/adapters/http.js | 424 +
Fronts/node_modules/axios/lib/adapters/xhr.js | 222 +
Fronts/node_modules/axios/lib/axios.js | 64 +
.../axios/lib/cancel/CancelToken.js | 119 +
.../axios/lib/cancel/CanceledError.js | 22 +
.../node_modules/axios/lib/cancel/isCancel.js | 5 +
Fronts/node_modules/axios/lib/core/Axios.js | 160 +
.../node_modules/axios/lib/core/AxiosError.js | 86 +
.../axios/lib/core/InterceptorManager.js | 54 +
Fronts/node_modules/axios/lib/core/README.md | 8 +
.../axios/lib/core/buildFullPath.js | 20 +
.../axios/lib/core/dispatchRequest.js | 87 +
.../axios/lib/core/mergeConfig.js | 100 +
Fronts/node_modules/axios/lib/core/settle.js | 25 +
.../axios/lib/core/transformData.js | 22 +
.../axios/lib/defaults/env/FormData.js | 2 +
.../node_modules/axios/lib/defaults/index.js | 146 +
.../axios/lib/defaults/transitional.js | 7 +
Fronts/node_modules/axios/lib/env/README.md | 3 +
Fronts/node_modules/axios/lib/env/data.js | 3 +
.../node_modules/axios/lib/helpers/README.md | 7 +
Fronts/node_modules/axios/lib/helpers/bind.js | 11 +
.../axios/lib/helpers/buildURL.js | 70 +
.../axios/lib/helpers/combineURLs.js | 14 +
.../node_modules/axios/lib/helpers/cookies.js | 53 +
.../axios/lib/helpers/deprecatedMethod.js | 24 +
.../axios/lib/helpers/isAbsoluteURL.js | 14 +
.../axios/lib/helpers/isAxiosError.js | 13 +
.../axios/lib/helpers/isURLSameOrigin.js | 68 +
.../axios/lib/helpers/normalizeHeaderName.js | 12 +
Fronts/node_modules/axios/lib/helpers/null.js | 2 +
.../axios/lib/helpers/parseHeaders.js | 53 +
.../axios/lib/helpers/parseProtocol.js | 6 +
.../node_modules/axios/lib/helpers/spread.js | 27 +
.../axios/lib/helpers/toFormData.js | 72 +
.../axios/lib/helpers/validator.js | 86 +
Fronts/node_modules/axios/lib/utils.js | 470 +
Fronts/node_modules/axios/package.json | 87 +
Fronts/node_modules/axios/tsconfig.json | 14 +
Fronts/node_modules/axios/tslint.json | 6 +
Fronts/node_modules/combined-stream/License | 19 +
Fronts/node_modules/combined-stream/Readme.md | 138 +
.../combined-stream/lib/combined_stream.js | 208 +
.../node_modules/combined-stream/package.json | 25 +
Fronts/node_modules/combined-stream/yarn.lock | 17 +
Fronts/node_modules/csstype/LICENSE | 19 +
Fronts/node_modules/csstype/README.md | 220 +
Fronts/node_modules/csstype/index.d.ts | 38372 ++++++++++++
Fronts/node_modules/csstype/index.js.flow | 6220 ++
Fronts/node_modules/csstype/package.json | 57 +
Fronts/node_modules/delayed-stream/.npmignore | 1 +
Fronts/node_modules/delayed-stream/License | 19 +
Fronts/node_modules/delayed-stream/Makefile | 7 +
Fronts/node_modules/delayed-stream/Readme.md | 141 +
.../delayed-stream/lib/delayed_stream.js | 107 +
.../node_modules/delayed-stream/package.json | 27 +
.../node_modules/estree-walker/CHANGELOG.md | 92 +
Fronts/node_modules/estree-walker/LICENSE | 7 +
Fronts/node_modules/estree-walker/README.md | 48 +
.../estree-walker/dist/esm/estree-walker.js | 333 +
.../estree-walker/dist/esm/package.json | 1 +
.../estree-walker/dist/umd/estree-walker.js | 344 +
.../node_modules/estree-walker/package.json | 37 +
.../node_modules/estree-walker/src/async.js | 118 +
.../node_modules/estree-walker/src/index.js | 35 +
.../estree-walker/src/package.json | 1 +
Fronts/node_modules/estree-walker/src/sync.js | 118 +
.../node_modules/estree-walker/src/walker.js | 61 +
.../estree-walker/types/async.d.ts | 53 +
.../estree-walker/types/index.d.ts | 56 +
.../estree-walker/types/sync.d.ts | 53 +
.../estree-walker/types/tsconfig.tsbuildinfo | 345 +
.../estree-walker/types/walker.d.ts | 37 +
Fronts/node_modules/follow-redirects/LICENSE | 18 +
.../node_modules/follow-redirects/README.md | 155 +
Fronts/node_modules/follow-redirects/debug.js | 15 +
Fronts/node_modules/follow-redirects/http.js | 1 +
Fronts/node_modules/follow-redirects/https.js | 1 +
Fronts/node_modules/follow-redirects/index.js | 598 +
.../follow-redirects/package.json | 59 +
Fronts/node_modules/form-data/License | 19 +
Fronts/node_modules/form-data/README.md.bak | 358 +
Fronts/node_modules/form-data/Readme.md | 358 +
Fronts/node_modules/form-data/index.d.ts | 62 +
Fronts/node_modules/form-data/lib/browser.js | 2 +
.../node_modules/form-data/lib/form_data.js | 501 +
Fronts/node_modules/form-data/lib/populate.js | 10 +
Fronts/node_modules/form-data/package.json | 68 +
Fronts/node_modules/magic-string/LICENSE | 7 +
Fronts/node_modules/magic-string/README.md | 252 +
.../magic-string/dist/magic-string.cjs.js | 1311 +
.../magic-string/dist/magic-string.cjs.js.map | 1 +
.../magic-string/dist/magic-string.es.js | 1305 +
.../magic-string/dist/magic-string.es.js.map | 1 +
.../magic-string/dist/magic-string.umd.js | 1371 +
.../magic-string/dist/magic-string.umd.js.map | 1 +
Fronts/node_modules/magic-string/index.d.ts | 221 +
Fronts/node_modules/magic-string/package.json | 52 +
Fronts/node_modules/mime-db/HISTORY.md | 507 +
Fronts/node_modules/mime-db/LICENSE | 23 +
Fronts/node_modules/mime-db/README.md | 100 +
Fronts/node_modules/mime-db/db.json | 8519 +++
Fronts/node_modules/mime-db/index.js | 12 +
Fronts/node_modules/mime-db/package.json | 60 +
Fronts/node_modules/mime-types/HISTORY.md | 397 +
Fronts/node_modules/mime-types/LICENSE | 23 +
Fronts/node_modules/mime-types/README.md | 113 +
Fronts/node_modules/mime-types/index.js | 188 +
Fronts/node_modules/mime-types/package.json | 44 +
Fronts/node_modules/nanoid/LICENSE | 20 +
Fronts/node_modules/nanoid/README.md | 39 +
.../nanoid/async/index.browser.cjs | 34 +
.../nanoid/async/index.browser.js | 34 +
Fronts/node_modules/nanoid/async/index.cjs | 35 +
Fronts/node_modules/nanoid/async/index.d.ts | 56 +
Fronts/node_modules/nanoid/async/index.js | 35 +
.../node_modules/nanoid/async/index.native.js | 26 +
Fronts/node_modules/nanoid/async/package.json | 12 +
Fronts/node_modules/nanoid/bin/nanoid.cjs | 55 +
Fronts/node_modules/nanoid/index.browser.cjs | 34 +
Fronts/node_modules/nanoid/index.browser.js | 34 +
Fronts/node_modules/nanoid/index.cjs | 45 +
Fronts/node_modules/nanoid/index.d.ts | 91 +
Fronts/node_modules/nanoid/index.js | 45 +
Fronts/node_modules/nanoid/nanoid.js | 1 +
.../node_modules/nanoid/non-secure/index.cjs | 21 +
.../node_modules/nanoid/non-secure/index.d.ts | 33 +
.../node_modules/nanoid/non-secure/index.js | 21 +
.../nanoid/non-secure/package.json | 6 +
Fronts/node_modules/nanoid/package.json | 60 +
.../nanoid/url-alphabet/index.cjs | 3 +
.../node_modules/nanoid/url-alphabet/index.js | 3 +
.../nanoid/url-alphabet/package.json | 6 +
Fronts/node_modules/picocolors/LICENSE | 15 +
Fronts/node_modules/picocolors/README.md | 21 +
Fronts/node_modules/picocolors/package.json | 25 +
.../picocolors/picocolors.browser.js | 4 +
.../node_modules/picocolors/picocolors.d.ts | 5 +
Fronts/node_modules/picocolors/picocolors.js | 58 +
Fronts/node_modules/picocolors/types.ts | 30 +
Fronts/node_modules/postcss/LICENSE | 20 +
Fronts/node_modules/postcss/README.md | 44 +
Fronts/node_modules/postcss/lib/at-rule.d.ts | 106 +
Fronts/node_modules/postcss/lib/at-rule.js | 25 +
Fronts/node_modules/postcss/lib/comment.d.ts | 56 +
Fronts/node_modules/postcss/lib/comment.js | 13 +
.../node_modules/postcss/lib/container.d.ts | 442 +
Fronts/node_modules/postcss/lib/container.js | 433 +
.../postcss/lib/css-syntax-error.d.ts | 239 +
.../postcss/lib/css-syntax-error.js | 100 +
.../node_modules/postcss/lib/declaration.d.ts | 124 +
.../node_modules/postcss/lib/declaration.js | 24 +
Fronts/node_modules/postcss/lib/document.d.ts | 57 +
Fronts/node_modules/postcss/lib/document.js | 33 +
Fronts/node_modules/postcss/lib/fromJSON.d.ts | 5 +
Fronts/node_modules/postcss/lib/fromJSON.js | 54 +
Fronts/node_modules/postcss/lib/input.d.ts | 150 +
Fronts/node_modules/postcss/lib/input.js | 248 +
.../node_modules/postcss/lib/lazy-result.d.ts | 176 +
.../node_modules/postcss/lib/lazy-result.js | 550 +
Fronts/node_modules/postcss/lib/list.d.ts | 51 +
Fronts/node_modules/postcss/lib/list.js | 56 +
.../node_modules/postcss/lib/map-generator.js | 331 +
.../postcss/lib/no-work-result.d.ts | 37 +
.../postcss/lib/no-work-result.js | 135 +
Fronts/node_modules/postcss/lib/node.d.ts | 478 +
Fronts/node_modules/postcss/lib/node.js | 379 +
Fronts/node_modules/postcss/lib/parse.d.ts | 5 +
Fronts/node_modules/postcss/lib/parse.js | 42 +
Fronts/node_modules/postcss/lib/parser.js | 603 +
Fronts/node_modules/postcss/lib/postcss.d.ts | 473 +
Fronts/node_modules/postcss/lib/postcss.js | 101 +
Fronts/node_modules/postcss/lib/postcss.mjs | 30 +
.../postcss/lib/previous-map.d.ts | 72 +
.../node_modules/postcss/lib/previous-map.js | 142 +
.../node_modules/postcss/lib/processor.d.ts | 102 +
Fronts/node_modules/postcss/lib/processor.js | 67 +
Fronts/node_modules/postcss/lib/result.d.ts | 196 +
Fronts/node_modules/postcss/lib/result.js | 42 +
Fronts/node_modules/postcss/lib/root.d.ts | 73 +
Fronts/node_modules/postcss/lib/root.js | 59 +
Fronts/node_modules/postcss/lib/rule.d.ts | 104 +
Fronts/node_modules/postcss/lib/rule.js | 27 +
.../node_modules/postcss/lib/stringifier.d.ts | 37 +
.../node_modules/postcss/lib/stringifier.js | 353 +
.../node_modules/postcss/lib/stringify.d.ts | 5 +
Fronts/node_modules/postcss/lib/stringify.js | 11 +
Fronts/node_modules/postcss/lib/symbols.js | 5 +
.../postcss/lib/terminal-highlight.js | 70 +
Fronts/node_modules/postcss/lib/tokenize.js | 266 +
Fronts/node_modules/postcss/lib/warn-once.js | 13 +
Fronts/node_modules/postcss/lib/warning.d.ts | 138 +
Fronts/node_modules/postcss/lib/warning.js | 37 +
Fronts/node_modules/postcss/package.json | 85 +
.../node_modules/source-map-js/CHANGELOG.md | 320 +
Fronts/node_modules/source-map-js/LICENSE | 28 +
Fronts/node_modules/source-map-js/README.md | 758 +
.../source-map-js/lib/array-set.js | 121 +
.../source-map-js/lib/base64-vlq.js | 140 +
.../node_modules/source-map-js/lib/base64.js | 67 +
.../source-map-js/lib/binary-search.js | 111 +
.../source-map-js/lib/mapping-list.js | 79 +
.../source-map-js/lib/quick-sort.js | 132 +
.../source-map-js/lib/source-map-consumer.js | 1184 +
.../source-map-js/lib/source-map-generator.js | 425 +
.../source-map-js/lib/source-node.js | 413 +
Fronts/node_modules/source-map-js/lib/util.js | 594 +
.../node_modules/source-map-js/package.json | 71 +
.../source-map-js/source-map.d.ts | 115 +
.../node_modules/source-map-js/source-map.js | 8 +
Fronts/node_modules/source-map/CHANGELOG.md | 301 +
Fronts/node_modules/source-map/LICENSE | 28 +
Fronts/node_modules/source-map/README.md | 742 +
.../source-map/dist/source-map.debug.js | 3234 +
.../source-map/dist/source-map.js | 3233 +
.../source-map/dist/source-map.min.js | 2 +
.../source-map/dist/source-map.min.js.map | 1 +
.../node_modules/source-map/lib/array-set.js | 121 +
.../node_modules/source-map/lib/base64-vlq.js | 140 +
Fronts/node_modules/source-map/lib/base64.js | 67 +
.../source-map/lib/binary-search.js | 111 +
.../source-map/lib/mapping-list.js | 79 +
.../node_modules/source-map/lib/quick-sort.js | 114 +
.../source-map/lib/source-map-consumer.js | 1145 +
.../source-map/lib/source-map-generator.js | 425 +
.../source-map/lib/source-node.js | 413 +
Fronts/node_modules/source-map/lib/util.js | 488 +
Fronts/node_modules/source-map/package.json | 73 +
.../node_modules/source-map/source-map.d.ts | 98 +
Fronts/node_modules/source-map/source-map.js | 8 +
.../node_modules/sourcemap-codec/CHANGELOG.md | 64 +
Fronts/node_modules/sourcemap-codec/LICENSE | 21 +
Fronts/node_modules/sourcemap-codec/README.md | 63 +
.../dist/sourcemap-codec.es.js | 124 +
.../dist/sourcemap-codec.es.js.map | 1 +
.../dist/sourcemap-codec.umd.js | 135 +
.../dist/sourcemap-codec.umd.js.map | 1 +
.../dist/types/sourcemap-codec.d.ts | 5 +
.../node_modules/sourcemap-codec/package.json | 53 +
Fronts/node_modules/vue/LICENSE | 21 +
Fronts/node_modules/vue/README.md | 54 +
.../node_modules/vue/compiler-sfc/index.d.ts | 1 +
Fronts/node_modules/vue/compiler-sfc/index.js | 1 +
.../node_modules/vue/compiler-sfc/index.mjs | 1 +
.../vue/compiler-sfc/package.json | 5 +
Fronts/node_modules/vue/dist/vue.cjs.js | 77 +
Fronts/node_modules/vue/dist/vue.cjs.prod.js | 65 +
Fronts/node_modules/vue/dist/vue.d.ts | 9 +
.../node_modules/vue/dist/vue.esm-browser.js | 15768 +++++
.../vue/dist/vue.esm-browser.prod.js | 1 +
.../node_modules/vue/dist/vue.esm-bundler.js | 67 +
Fronts/node_modules/vue/dist/vue.global.js | 15754 +++++
.../node_modules/vue/dist/vue.global.prod.js | 1 +
.../vue/dist/vue.runtime.esm-browser.js | 10710 ++++
.../vue/dist/vue.runtime.esm-browser.prod.js | 1 +
.../vue/dist/vue.runtime.esm-bundler.js | 22 +
.../vue/dist/vue.runtime.global.js | 10844 ++++
.../vue/dist/vue.runtime.global.prod.js | 1 +
Fronts/node_modules/vue/index.js | 7 +
Fronts/node_modules/vue/index.mjs | 1 +
Fronts/node_modules/vue/macros-global.d.ts | 19 +
Fronts/node_modules/vue/macros.d.ts | 106 +
Fronts/node_modules/vue/package.json | 75 +
Fronts/node_modules/vue/ref-macros.d.ts | 2 +
.../vue/server-renderer/index.d.ts | 1 +
.../node_modules/vue/server-renderer/index.js | 1 +
.../vue/server-renderer/index.mjs | 1 +
.../vue/server-renderer/package.json | 5 +
Fronts/node_modules/vuex/CHANGELOG.md | 604 +
Fronts/node_modules/vuex/LICENSE | 21 +
Fronts/node_modules/vuex/README.md | 55 +
Fronts/node_modules/vuex/dist/vuex.cjs.js | 1463 +
.../vuex/dist/vuex.esm-browser.js | 1461 +
.../vuex/dist/vuex.esm-browser.prod.js | 1300 +
.../vuex/dist/vuex.esm-bundler.js | 1462 +
Fronts/node_modules/vuex/dist/vuex.global.js | 1491 +
.../vuex/dist/vuex.global.prod.js | 6 +
Fronts/node_modules/vuex/dist/vuex.mjs | 32 +
Fronts/node_modules/vuex/package.json | 99 +
Fronts/node_modules/vuex/types/helpers.d.ts | 86 +
Fronts/node_modules/vuex/types/index.d.ts | 167 +
Fronts/node_modules/vuex/types/logger.d.ts | 20 +
Fronts/node_modules/vuex/types/vue.d.ts | 12 +
Fronts/package-lock.json | 558 +
Fronts/package.json | 7 +
Fronts/pages.json | 18 +
Fronts/pages/Percenter/Percenter.vue | 3 +
Fronts/pages/TeLogin/AuLogin.vue | 116 +
Fronts/pages/TeLogin/Login.vue | 175 +
Fronts/pages/TeLogin/Register.vue | 113 +
Fronts/pages/index/TedentSon/Avatar.vue | 89 +
Fronts/pages/index/TedentSon/Logincancel.vue | 29 +
Fronts/pages/index/index.vue | 43 +-
Fronts/static/index/avatar1.jpeg | Bin 0 -> 87216 bytes
Fronts/static/index/img2.jpg | Bin 0 -> 45677 bytes
Fronts/static/index/img3.jpg | Bin 0 -> 218692 bytes
Fronts/unpackage/dist/dev/mp-weixin/app.js | 5 +-
Fronts/unpackage/dist/dev/mp-weixin/app.json | 8 +-
.../dist/dev/mp-weixin/common/vendor.js | 3085 +-
.../mp-weixin/pages/Percenter/Percenter.js | 2 +-
.../dev/mp-weixin/pages/Student/Student.js | 2 +-
.../dev/mp-weixin/pages/TeLogin/AuLogin.js | 70 +
.../dev/mp-weixin/pages/TeLogin/AuLogin.json | 4 +
.../dev/mp-weixin/pages/TeLogin/AuLogin.wxml | 1 +
.../dev/mp-weixin/pages/TeLogin/AuLogin.wxss | 23 +
.../dist/dev/mp-weixin/pages/TeLogin/Login.js | 67 +
.../dev/mp-weixin/pages/TeLogin/Login.json | 4 +
.../dev/mp-weixin/pages/TeLogin/Login.wxml | 1 +
.../dev/mp-weixin/pages/TeLogin/Login.wxss | 77 +
.../dev/mp-weixin/pages/TeLogin/Register.js | 22 +
.../dev/mp-weixin/pages/TeLogin/Register.json | 6 +
.../dev/mp-weixin/pages/TeLogin/Register.wxml | 1 +
.../dev/mp-weixin/pages/TeLogin/Register.wxss | 65 +
.../mp-weixin/pages/index/TedentSon/Avatar.js | 61 +
.../pages/index/TedentSon/Avatar.json | 4 +
.../pages/index/TedentSon/Avatar.wxml | 1 +
.../pages/index/TedentSon/Avatar.wxss | 25 +
.../pages/index/TedentSon/Logincancel.js | 8 +
.../pages/index/TedentSon/Logincancel.json | 4 +
.../pages/index/TedentSon/Logincancel.wxml | 1 +
.../pages/index/TedentSon/Logincancel.wxss | 18 +
.../dist/dev/mp-weixin/pages/index/index.js | 30 +-
.../dist/dev/mp-weixin/pages/index/index.json | 3 +-
.../dist/dev/mp-weixin/pages/index/index.wxml | 2 +-
.../dist/dev/mp-weixin/pages/index/index.wxss | 14 +-
.../dev/mp-weixin/pages/results/results.js | 2 +-
.../dist/dev/mp-weixin/project.config.json | 65 +-
.../dev/mp-weixin/project.private.config.json | 11 +-
.../unpackage/dist/dev/mp-weixin/sitemap.json | 10 +-
.../dev/mp-weixin/static/index/avatar1.jpeg | Bin 0 -> 87216 bytes
.../dist/dev/mp-weixin/static/index/img2.jpg | Bin 0 -> 45677 bytes
.../dist/dev/mp-weixin/static/index/img3.jpg | Bin 0 -> 218692 bytes
.../uni-file-picker/choose-and-upload-file.js | 200 +
.../uni-file-picker/uni-file-picker.js | 480 +
.../uni-file-picker/uni-file-picker.json | 7 +
.../uni-file-picker/uni-file-picker.wxml | 1 +
.../uni-file-picker/uni-file-picker.wxss | 42 +
.../components/uni-file-picker/upload-file.js | 169 +
.../uni-file-picker/upload-file.json | 4 +
.../uni-file-picker/upload-file.wxml | 1 +
.../uni-file-picker/upload-file.wxss | 98 +
.../uni-file-picker/upload-image.js | 182 +
.../uni-file-picker/upload-image.json | 4 +
.../uni-file-picker/upload-image.wxml | 1 +
.../uni-file-picker/upload-image.wxss | 89 +
.../components/uni-file-picker/utils.js | 89 +
Fronts/yarn.lock | 223 +
520 files changed, 352774 insertions(+), 355 deletions(-)
create mode 100644 Fronts/node_modules/.bin/nanoid
create mode 100644 Fronts/node_modules/.bin/nanoid.cmd
create mode 100644 Fronts/node_modules/.bin/nanoid.ps1
create mode 100644 Fronts/node_modules/.bin/parser
create mode 100644 Fronts/node_modules/.bin/parser.cmd
create mode 100644 Fronts/node_modules/.bin/parser.ps1
create mode 100644 Fronts/node_modules/.package-lock.json
create mode 100644 Fronts/node_modules/.yarn-integrity
create mode 100644 Fronts/node_modules/@babel/parser/CHANGELOG.md
create mode 100644 Fronts/node_modules/@babel/parser/LICENSE
create mode 100644 Fronts/node_modules/@babel/parser/README.md
create mode 100644 Fronts/node_modules/@babel/parser/bin/babel-parser.js
create mode 100644 Fronts/node_modules/@babel/parser/index.cjs
create mode 100644 Fronts/node_modules/@babel/parser/lib/index.js
create mode 100644 Fronts/node_modules/@babel/parser/lib/index.js.map
create mode 100644 Fronts/node_modules/@babel/parser/package.json
create mode 100644 Fronts/node_modules/@babel/parser/typings/babel-parser.d.ts
create mode 100644 Fronts/node_modules/@vue/compiler-core/LICENSE
create mode 100644 Fronts/node_modules/@vue/compiler-core/README.md
create mode 100644 Fronts/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js
create mode 100644 Fronts/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js
create mode 100644 Fronts/node_modules/@vue/compiler-core/dist/compiler-core.d.ts
create mode 100644 Fronts/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js
create mode 100644 Fronts/node_modules/@vue/compiler-core/index.js
create mode 100644 Fronts/node_modules/@vue/compiler-core/package.json
create mode 100644 Fronts/node_modules/@vue/compiler-dom/LICENSE
create mode 100644 Fronts/node_modules/@vue/compiler-dom/README.md
create mode 100644 Fronts/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js
create mode 100644 Fronts/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js
create mode 100644 Fronts/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts
create mode 100644 Fronts/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.js
create mode 100644 Fronts/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js
create mode 100644 Fronts/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js
create mode 100644 Fronts/node_modules/@vue/compiler-dom/dist/compiler-dom.global.js
create mode 100644 Fronts/node_modules/@vue/compiler-dom/dist/compiler-dom.global.prod.js
create mode 100644 Fronts/node_modules/@vue/compiler-dom/index.js
create mode 100644 Fronts/node_modules/@vue/compiler-dom/package.json
create mode 100644 Fronts/node_modules/@vue/compiler-sfc/LICENSE
create mode 100644 Fronts/node_modules/@vue/compiler-sfc/README.md
create mode 100644 Fronts/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js
create mode 100644 Fronts/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts
create mode 100644 Fronts/node_modules/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js
create mode 100644 Fronts/node_modules/@vue/compiler-sfc/package.json
create mode 100644 Fronts/node_modules/@vue/compiler-ssr/LICENSE
create mode 100644 Fronts/node_modules/@vue/compiler-ssr/README.md
create mode 100644 Fronts/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js
create mode 100644 Fronts/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts
create mode 100644 Fronts/node_modules/@vue/compiler-ssr/package.json
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/api/api.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/api/app.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/api/component.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/api/context.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/api/index.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/api/util.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/const.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/env.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/index.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/plugin.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/proxy.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/cjs/time.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/api.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/app.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/component.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/context.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/hooks.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/index.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/api/util.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/const.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/const.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/env.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/env.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/index.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/index.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/plugin.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/proxy.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/time.d.ts
create mode 100644 Fronts/node_modules/@vue/devtools-api/lib/esm/time.js
create mode 100644 Fronts/node_modules/@vue/devtools-api/package.json
create mode 100644 Fronts/node_modules/@vue/reactivity-transform/README.md
create mode 100644 Fronts/node_modules/@vue/reactivity-transform/dist/reactivity-transform.cjs.js
create mode 100644 Fronts/node_modules/@vue/reactivity-transform/dist/reactivity-transform.d.ts
create mode 100644 Fronts/node_modules/@vue/reactivity-transform/package.json
create mode 100644 Fronts/node_modules/@vue/reactivity/LICENSE
create mode 100644 Fronts/node_modules/@vue/reactivity/README.md
create mode 100644 Fronts/node_modules/@vue/reactivity/dist/reactivity.cjs.js
create mode 100644 Fronts/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js
create mode 100644 Fronts/node_modules/@vue/reactivity/dist/reactivity.d.ts
create mode 100644 Fronts/node_modules/@vue/reactivity/dist/reactivity.esm-browser.js
create mode 100644 Fronts/node_modules/@vue/reactivity/dist/reactivity.esm-browser.prod.js
create mode 100644 Fronts/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
create mode 100644 Fronts/node_modules/@vue/reactivity/dist/reactivity.global.js
create mode 100644 Fronts/node_modules/@vue/reactivity/dist/reactivity.global.prod.js
create mode 100644 Fronts/node_modules/@vue/reactivity/index.js
create mode 100644 Fronts/node_modules/@vue/reactivity/package.json
create mode 100644 Fronts/node_modules/@vue/runtime-core/LICENSE
create mode 100644 Fronts/node_modules/@vue/runtime-core/README.md
create mode 100644 Fronts/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js
create mode 100644 Fronts/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js
create mode 100644 Fronts/node_modules/@vue/runtime-core/dist/runtime-core.d.ts
create mode 100644 Fronts/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
create mode 100644 Fronts/node_modules/@vue/runtime-core/index.js
create mode 100644 Fronts/node_modules/@vue/runtime-core/package.json
create mode 100644 Fronts/node_modules/@vue/runtime-dom/LICENSE
create mode 100644 Fronts/node_modules/@vue/runtime-dom/README.md
create mode 100644 Fronts/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.js
create mode 100644 Fronts/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js
create mode 100644 Fronts/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts
create mode 100644 Fronts/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.js
create mode 100644 Fronts/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.prod.js
create mode 100644 Fronts/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
create mode 100644 Fronts/node_modules/@vue/runtime-dom/dist/runtime-dom.global.js
create mode 100644 Fronts/node_modules/@vue/runtime-dom/dist/runtime-dom.global.prod.js
create mode 100644 Fronts/node_modules/@vue/runtime-dom/index.js
create mode 100644 Fronts/node_modules/@vue/runtime-dom/package.json
create mode 100644 Fronts/node_modules/@vue/server-renderer/LICENSE
create mode 100644 Fronts/node_modules/@vue/server-renderer/README.md
create mode 100644 Fronts/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js
create mode 100644 Fronts/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js
create mode 100644 Fronts/node_modules/@vue/server-renderer/dist/server-renderer.d.ts
create mode 100644 Fronts/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js
create mode 100644 Fronts/node_modules/@vue/server-renderer/index.js
create mode 100644 Fronts/node_modules/@vue/server-renderer/package.json
create mode 100644 Fronts/node_modules/@vue/shared/LICENSE
create mode 100644 Fronts/node_modules/@vue/shared/README.md
create mode 100644 Fronts/node_modules/@vue/shared/dist/shared.cjs.js
create mode 100644 Fronts/node_modules/@vue/shared/dist/shared.cjs.prod.js
create mode 100644 Fronts/node_modules/@vue/shared/dist/shared.d.ts
create mode 100644 Fronts/node_modules/@vue/shared/dist/shared.esm-bundler.js
create mode 100644 Fronts/node_modules/@vue/shared/index.js
create mode 100644 Fronts/node_modules/@vue/shared/package.json
create mode 100644 Fronts/node_modules/asynckit/LICENSE
create mode 100644 Fronts/node_modules/asynckit/README.md
create mode 100644 Fronts/node_modules/asynckit/bench.js
create mode 100644 Fronts/node_modules/asynckit/index.js
create mode 100644 Fronts/node_modules/asynckit/lib/abort.js
create mode 100644 Fronts/node_modules/asynckit/lib/async.js
create mode 100644 Fronts/node_modules/asynckit/lib/defer.js
create mode 100644 Fronts/node_modules/asynckit/lib/iterate.js
create mode 100644 Fronts/node_modules/asynckit/lib/readable_asynckit.js
create mode 100644 Fronts/node_modules/asynckit/lib/readable_parallel.js
create mode 100644 Fronts/node_modules/asynckit/lib/readable_serial.js
create mode 100644 Fronts/node_modules/asynckit/lib/readable_serial_ordered.js
create mode 100644 Fronts/node_modules/asynckit/lib/state.js
create mode 100644 Fronts/node_modules/asynckit/lib/streamify.js
create mode 100644 Fronts/node_modules/asynckit/lib/terminator.js
create mode 100644 Fronts/node_modules/asynckit/package.json
create mode 100644 Fronts/node_modules/asynckit/parallel.js
create mode 100644 Fronts/node_modules/asynckit/serial.js
create mode 100644 Fronts/node_modules/asynckit/serialOrdered.js
create mode 100644 Fronts/node_modules/asynckit/stream.js
create mode 100644 Fronts/node_modules/axios/CHANGELOG.md
create mode 100644 Fronts/node_modules/axios/LICENSE
create mode 100644 Fronts/node_modules/axios/README.md
create mode 100644 Fronts/node_modules/axios/SECURITY.md
create mode 100644 Fronts/node_modules/axios/UPGRADE_GUIDE.md
create mode 100644 Fronts/node_modules/axios/dist/axios.js
create mode 100644 Fronts/node_modules/axios/dist/axios.map
create mode 100644 Fronts/node_modules/axios/dist/axios.min.js
create mode 100644 Fronts/node_modules/axios/dist/axios.min.map
create mode 100644 Fronts/node_modules/axios/index.d.ts
create mode 100644 Fronts/node_modules/axios/index.js
create mode 100644 Fronts/node_modules/axios/lib/adapters/README.md
create mode 100644 Fronts/node_modules/axios/lib/adapters/http.js
create mode 100644 Fronts/node_modules/axios/lib/adapters/xhr.js
create mode 100644 Fronts/node_modules/axios/lib/axios.js
create mode 100644 Fronts/node_modules/axios/lib/cancel/CancelToken.js
create mode 100644 Fronts/node_modules/axios/lib/cancel/CanceledError.js
create mode 100644 Fronts/node_modules/axios/lib/cancel/isCancel.js
create mode 100644 Fronts/node_modules/axios/lib/core/Axios.js
create mode 100644 Fronts/node_modules/axios/lib/core/AxiosError.js
create mode 100644 Fronts/node_modules/axios/lib/core/InterceptorManager.js
create mode 100644 Fronts/node_modules/axios/lib/core/README.md
create mode 100644 Fronts/node_modules/axios/lib/core/buildFullPath.js
create mode 100644 Fronts/node_modules/axios/lib/core/dispatchRequest.js
create mode 100644 Fronts/node_modules/axios/lib/core/mergeConfig.js
create mode 100644 Fronts/node_modules/axios/lib/core/settle.js
create mode 100644 Fronts/node_modules/axios/lib/core/transformData.js
create mode 100644 Fronts/node_modules/axios/lib/defaults/env/FormData.js
create mode 100644 Fronts/node_modules/axios/lib/defaults/index.js
create mode 100644 Fronts/node_modules/axios/lib/defaults/transitional.js
create mode 100644 Fronts/node_modules/axios/lib/env/README.md
create mode 100644 Fronts/node_modules/axios/lib/env/data.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/README.md
create mode 100644 Fronts/node_modules/axios/lib/helpers/bind.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/buildURL.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/combineURLs.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/cookies.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/deprecatedMethod.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/isAbsoluteURL.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/isAxiosError.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/isURLSameOrigin.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/normalizeHeaderName.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/null.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/parseHeaders.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/parseProtocol.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/spread.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/toFormData.js
create mode 100644 Fronts/node_modules/axios/lib/helpers/validator.js
create mode 100644 Fronts/node_modules/axios/lib/utils.js
create mode 100644 Fronts/node_modules/axios/package.json
create mode 100644 Fronts/node_modules/axios/tsconfig.json
create mode 100644 Fronts/node_modules/axios/tslint.json
create mode 100644 Fronts/node_modules/combined-stream/License
create mode 100644 Fronts/node_modules/combined-stream/Readme.md
create mode 100644 Fronts/node_modules/combined-stream/lib/combined_stream.js
create mode 100644 Fronts/node_modules/combined-stream/package.json
create mode 100644 Fronts/node_modules/combined-stream/yarn.lock
create mode 100644 Fronts/node_modules/csstype/LICENSE
create mode 100644 Fronts/node_modules/csstype/README.md
create mode 100644 Fronts/node_modules/csstype/index.d.ts
create mode 100644 Fronts/node_modules/csstype/index.js.flow
create mode 100644 Fronts/node_modules/csstype/package.json
create mode 100644 Fronts/node_modules/delayed-stream/.npmignore
create mode 100644 Fronts/node_modules/delayed-stream/License
create mode 100644 Fronts/node_modules/delayed-stream/Makefile
create mode 100644 Fronts/node_modules/delayed-stream/Readme.md
create mode 100644 Fronts/node_modules/delayed-stream/lib/delayed_stream.js
create mode 100644 Fronts/node_modules/delayed-stream/package.json
create mode 100644 Fronts/node_modules/estree-walker/CHANGELOG.md
create mode 100644 Fronts/node_modules/estree-walker/LICENSE
create mode 100644 Fronts/node_modules/estree-walker/README.md
create mode 100644 Fronts/node_modules/estree-walker/dist/esm/estree-walker.js
create mode 100644 Fronts/node_modules/estree-walker/dist/esm/package.json
create mode 100644 Fronts/node_modules/estree-walker/dist/umd/estree-walker.js
create mode 100644 Fronts/node_modules/estree-walker/package.json
create mode 100644 Fronts/node_modules/estree-walker/src/async.js
create mode 100644 Fronts/node_modules/estree-walker/src/index.js
create mode 100644 Fronts/node_modules/estree-walker/src/package.json
create mode 100644 Fronts/node_modules/estree-walker/src/sync.js
create mode 100644 Fronts/node_modules/estree-walker/src/walker.js
create mode 100644 Fronts/node_modules/estree-walker/types/async.d.ts
create mode 100644 Fronts/node_modules/estree-walker/types/index.d.ts
create mode 100644 Fronts/node_modules/estree-walker/types/sync.d.ts
create mode 100644 Fronts/node_modules/estree-walker/types/tsconfig.tsbuildinfo
create mode 100644 Fronts/node_modules/estree-walker/types/walker.d.ts
create mode 100644 Fronts/node_modules/follow-redirects/LICENSE
create mode 100644 Fronts/node_modules/follow-redirects/README.md
create mode 100644 Fronts/node_modules/follow-redirects/debug.js
create mode 100644 Fronts/node_modules/follow-redirects/http.js
create mode 100644 Fronts/node_modules/follow-redirects/https.js
create mode 100644 Fronts/node_modules/follow-redirects/index.js
create mode 100644 Fronts/node_modules/follow-redirects/package.json
create mode 100644 Fronts/node_modules/form-data/License
create mode 100644 Fronts/node_modules/form-data/README.md.bak
create mode 100644 Fronts/node_modules/form-data/Readme.md
create mode 100644 Fronts/node_modules/form-data/index.d.ts
create mode 100644 Fronts/node_modules/form-data/lib/browser.js
create mode 100644 Fronts/node_modules/form-data/lib/form_data.js
create mode 100644 Fronts/node_modules/form-data/lib/populate.js
create mode 100644 Fronts/node_modules/form-data/package.json
create mode 100644 Fronts/node_modules/magic-string/LICENSE
create mode 100644 Fronts/node_modules/magic-string/README.md
create mode 100644 Fronts/node_modules/magic-string/dist/magic-string.cjs.js
create mode 100644 Fronts/node_modules/magic-string/dist/magic-string.cjs.js.map
create mode 100644 Fronts/node_modules/magic-string/dist/magic-string.es.js
create mode 100644 Fronts/node_modules/magic-string/dist/magic-string.es.js.map
create mode 100644 Fronts/node_modules/magic-string/dist/magic-string.umd.js
create mode 100644 Fronts/node_modules/magic-string/dist/magic-string.umd.js.map
create mode 100644 Fronts/node_modules/magic-string/index.d.ts
create mode 100644 Fronts/node_modules/magic-string/package.json
create mode 100644 Fronts/node_modules/mime-db/HISTORY.md
create mode 100644 Fronts/node_modules/mime-db/LICENSE
create mode 100644 Fronts/node_modules/mime-db/README.md
create mode 100644 Fronts/node_modules/mime-db/db.json
create mode 100644 Fronts/node_modules/mime-db/index.js
create mode 100644 Fronts/node_modules/mime-db/package.json
create mode 100644 Fronts/node_modules/mime-types/HISTORY.md
create mode 100644 Fronts/node_modules/mime-types/LICENSE
create mode 100644 Fronts/node_modules/mime-types/README.md
create mode 100644 Fronts/node_modules/mime-types/index.js
create mode 100644 Fronts/node_modules/mime-types/package.json
create mode 100644 Fronts/node_modules/nanoid/LICENSE
create mode 100644 Fronts/node_modules/nanoid/README.md
create mode 100644 Fronts/node_modules/nanoid/async/index.browser.cjs
create mode 100644 Fronts/node_modules/nanoid/async/index.browser.js
create mode 100644 Fronts/node_modules/nanoid/async/index.cjs
create mode 100644 Fronts/node_modules/nanoid/async/index.d.ts
create mode 100644 Fronts/node_modules/nanoid/async/index.js
create mode 100644 Fronts/node_modules/nanoid/async/index.native.js
create mode 100644 Fronts/node_modules/nanoid/async/package.json
create mode 100644 Fronts/node_modules/nanoid/bin/nanoid.cjs
create mode 100644 Fronts/node_modules/nanoid/index.browser.cjs
create mode 100644 Fronts/node_modules/nanoid/index.browser.js
create mode 100644 Fronts/node_modules/nanoid/index.cjs
create mode 100644 Fronts/node_modules/nanoid/index.d.ts
create mode 100644 Fronts/node_modules/nanoid/index.js
create mode 100644 Fronts/node_modules/nanoid/nanoid.js
create mode 100644 Fronts/node_modules/nanoid/non-secure/index.cjs
create mode 100644 Fronts/node_modules/nanoid/non-secure/index.d.ts
create mode 100644 Fronts/node_modules/nanoid/non-secure/index.js
create mode 100644 Fronts/node_modules/nanoid/non-secure/package.json
create mode 100644 Fronts/node_modules/nanoid/package.json
create mode 100644 Fronts/node_modules/nanoid/url-alphabet/index.cjs
create mode 100644 Fronts/node_modules/nanoid/url-alphabet/index.js
create mode 100644 Fronts/node_modules/nanoid/url-alphabet/package.json
create mode 100644 Fronts/node_modules/picocolors/LICENSE
create mode 100644 Fronts/node_modules/picocolors/README.md
create mode 100644 Fronts/node_modules/picocolors/package.json
create mode 100644 Fronts/node_modules/picocolors/picocolors.browser.js
create mode 100644 Fronts/node_modules/picocolors/picocolors.d.ts
create mode 100644 Fronts/node_modules/picocolors/picocolors.js
create mode 100644 Fronts/node_modules/picocolors/types.ts
create mode 100644 Fronts/node_modules/postcss/LICENSE
create mode 100644 Fronts/node_modules/postcss/README.md
create mode 100644 Fronts/node_modules/postcss/lib/at-rule.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/at-rule.js
create mode 100644 Fronts/node_modules/postcss/lib/comment.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/comment.js
create mode 100644 Fronts/node_modules/postcss/lib/container.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/container.js
create mode 100644 Fronts/node_modules/postcss/lib/css-syntax-error.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/css-syntax-error.js
create mode 100644 Fronts/node_modules/postcss/lib/declaration.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/declaration.js
create mode 100644 Fronts/node_modules/postcss/lib/document.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/document.js
create mode 100644 Fronts/node_modules/postcss/lib/fromJSON.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/fromJSON.js
create mode 100644 Fronts/node_modules/postcss/lib/input.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/input.js
create mode 100644 Fronts/node_modules/postcss/lib/lazy-result.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/lazy-result.js
create mode 100644 Fronts/node_modules/postcss/lib/list.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/list.js
create mode 100644 Fronts/node_modules/postcss/lib/map-generator.js
create mode 100644 Fronts/node_modules/postcss/lib/no-work-result.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/no-work-result.js
create mode 100644 Fronts/node_modules/postcss/lib/node.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/node.js
create mode 100644 Fronts/node_modules/postcss/lib/parse.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/parse.js
create mode 100644 Fronts/node_modules/postcss/lib/parser.js
create mode 100644 Fronts/node_modules/postcss/lib/postcss.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/postcss.js
create mode 100644 Fronts/node_modules/postcss/lib/postcss.mjs
create mode 100644 Fronts/node_modules/postcss/lib/previous-map.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/previous-map.js
create mode 100644 Fronts/node_modules/postcss/lib/processor.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/processor.js
create mode 100644 Fronts/node_modules/postcss/lib/result.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/result.js
create mode 100644 Fronts/node_modules/postcss/lib/root.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/root.js
create mode 100644 Fronts/node_modules/postcss/lib/rule.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/rule.js
create mode 100644 Fronts/node_modules/postcss/lib/stringifier.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/stringifier.js
create mode 100644 Fronts/node_modules/postcss/lib/stringify.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/stringify.js
create mode 100644 Fronts/node_modules/postcss/lib/symbols.js
create mode 100644 Fronts/node_modules/postcss/lib/terminal-highlight.js
create mode 100644 Fronts/node_modules/postcss/lib/tokenize.js
create mode 100644 Fronts/node_modules/postcss/lib/warn-once.js
create mode 100644 Fronts/node_modules/postcss/lib/warning.d.ts
create mode 100644 Fronts/node_modules/postcss/lib/warning.js
create mode 100644 Fronts/node_modules/postcss/package.json
create mode 100644 Fronts/node_modules/source-map-js/CHANGELOG.md
create mode 100644 Fronts/node_modules/source-map-js/LICENSE
create mode 100644 Fronts/node_modules/source-map-js/README.md
create mode 100644 Fronts/node_modules/source-map-js/lib/array-set.js
create mode 100644 Fronts/node_modules/source-map-js/lib/base64-vlq.js
create mode 100644 Fronts/node_modules/source-map-js/lib/base64.js
create mode 100644 Fronts/node_modules/source-map-js/lib/binary-search.js
create mode 100644 Fronts/node_modules/source-map-js/lib/mapping-list.js
create mode 100644 Fronts/node_modules/source-map-js/lib/quick-sort.js
create mode 100644 Fronts/node_modules/source-map-js/lib/source-map-consumer.js
create mode 100644 Fronts/node_modules/source-map-js/lib/source-map-generator.js
create mode 100644 Fronts/node_modules/source-map-js/lib/source-node.js
create mode 100644 Fronts/node_modules/source-map-js/lib/util.js
create mode 100644 Fronts/node_modules/source-map-js/package.json
create mode 100644 Fronts/node_modules/source-map-js/source-map.d.ts
create mode 100644 Fronts/node_modules/source-map-js/source-map.js
create mode 100644 Fronts/node_modules/source-map/CHANGELOG.md
create mode 100644 Fronts/node_modules/source-map/LICENSE
create mode 100644 Fronts/node_modules/source-map/README.md
create mode 100644 Fronts/node_modules/source-map/dist/source-map.debug.js
create mode 100644 Fronts/node_modules/source-map/dist/source-map.js
create mode 100644 Fronts/node_modules/source-map/dist/source-map.min.js
create mode 100644 Fronts/node_modules/source-map/dist/source-map.min.js.map
create mode 100644 Fronts/node_modules/source-map/lib/array-set.js
create mode 100644 Fronts/node_modules/source-map/lib/base64-vlq.js
create mode 100644 Fronts/node_modules/source-map/lib/base64.js
create mode 100644 Fronts/node_modules/source-map/lib/binary-search.js
create mode 100644 Fronts/node_modules/source-map/lib/mapping-list.js
create mode 100644 Fronts/node_modules/source-map/lib/quick-sort.js
create mode 100644 Fronts/node_modules/source-map/lib/source-map-consumer.js
create mode 100644 Fronts/node_modules/source-map/lib/source-map-generator.js
create mode 100644 Fronts/node_modules/source-map/lib/source-node.js
create mode 100644 Fronts/node_modules/source-map/lib/util.js
create mode 100644 Fronts/node_modules/source-map/package.json
create mode 100644 Fronts/node_modules/source-map/source-map.d.ts
create mode 100644 Fronts/node_modules/source-map/source-map.js
create mode 100644 Fronts/node_modules/sourcemap-codec/CHANGELOG.md
create mode 100644 Fronts/node_modules/sourcemap-codec/LICENSE
create mode 100644 Fronts/node_modules/sourcemap-codec/README.md
create mode 100644 Fronts/node_modules/sourcemap-codec/dist/sourcemap-codec.es.js
create mode 100644 Fronts/node_modules/sourcemap-codec/dist/sourcemap-codec.es.js.map
create mode 100644 Fronts/node_modules/sourcemap-codec/dist/sourcemap-codec.umd.js
create mode 100644 Fronts/node_modules/sourcemap-codec/dist/sourcemap-codec.umd.js.map
create mode 100644 Fronts/node_modules/sourcemap-codec/dist/types/sourcemap-codec.d.ts
create mode 100644 Fronts/node_modules/sourcemap-codec/package.json
create mode 100644 Fronts/node_modules/vue/LICENSE
create mode 100644 Fronts/node_modules/vue/README.md
create mode 100644 Fronts/node_modules/vue/compiler-sfc/index.d.ts
create mode 100644 Fronts/node_modules/vue/compiler-sfc/index.js
create mode 100644 Fronts/node_modules/vue/compiler-sfc/index.mjs
create mode 100644 Fronts/node_modules/vue/compiler-sfc/package.json
create mode 100644 Fronts/node_modules/vue/dist/vue.cjs.js
create mode 100644 Fronts/node_modules/vue/dist/vue.cjs.prod.js
create mode 100644 Fronts/node_modules/vue/dist/vue.d.ts
create mode 100644 Fronts/node_modules/vue/dist/vue.esm-browser.js
create mode 100644 Fronts/node_modules/vue/dist/vue.esm-browser.prod.js
create mode 100644 Fronts/node_modules/vue/dist/vue.esm-bundler.js
create mode 100644 Fronts/node_modules/vue/dist/vue.global.js
create mode 100644 Fronts/node_modules/vue/dist/vue.global.prod.js
create mode 100644 Fronts/node_modules/vue/dist/vue.runtime.esm-browser.js
create mode 100644 Fronts/node_modules/vue/dist/vue.runtime.esm-browser.prod.js
create mode 100644 Fronts/node_modules/vue/dist/vue.runtime.esm-bundler.js
create mode 100644 Fronts/node_modules/vue/dist/vue.runtime.global.js
create mode 100644 Fronts/node_modules/vue/dist/vue.runtime.global.prod.js
create mode 100644 Fronts/node_modules/vue/index.js
create mode 100644 Fronts/node_modules/vue/index.mjs
create mode 100644 Fronts/node_modules/vue/macros-global.d.ts
create mode 100644 Fronts/node_modules/vue/macros.d.ts
create mode 100644 Fronts/node_modules/vue/package.json
create mode 100644 Fronts/node_modules/vue/ref-macros.d.ts
create mode 100644 Fronts/node_modules/vue/server-renderer/index.d.ts
create mode 100644 Fronts/node_modules/vue/server-renderer/index.js
create mode 100644 Fronts/node_modules/vue/server-renderer/index.mjs
create mode 100644 Fronts/node_modules/vue/server-renderer/package.json
create mode 100644 Fronts/node_modules/vuex/CHANGELOG.md
create mode 100644 Fronts/node_modules/vuex/LICENSE
create mode 100644 Fronts/node_modules/vuex/README.md
create mode 100644 Fronts/node_modules/vuex/dist/vuex.cjs.js
create mode 100644 Fronts/node_modules/vuex/dist/vuex.esm-browser.js
create mode 100644 Fronts/node_modules/vuex/dist/vuex.esm-browser.prod.js
create mode 100644 Fronts/node_modules/vuex/dist/vuex.esm-bundler.js
create mode 100644 Fronts/node_modules/vuex/dist/vuex.global.js
create mode 100644 Fronts/node_modules/vuex/dist/vuex.global.prod.js
create mode 100644 Fronts/node_modules/vuex/dist/vuex.mjs
create mode 100644 Fronts/node_modules/vuex/package.json
create mode 100644 Fronts/node_modules/vuex/types/helpers.d.ts
create mode 100644 Fronts/node_modules/vuex/types/index.d.ts
create mode 100644 Fronts/node_modules/vuex/types/logger.d.ts
create mode 100644 Fronts/node_modules/vuex/types/vue.d.ts
create mode 100644 Fronts/package-lock.json
create mode 100644 Fronts/package.json
create mode 100644 Fronts/pages/TeLogin/AuLogin.vue
create mode 100644 Fronts/pages/TeLogin/Login.vue
create mode 100644 Fronts/pages/TeLogin/Register.vue
create mode 100644 Fronts/pages/index/TedentSon/Avatar.vue
create mode 100644 Fronts/pages/index/TedentSon/Logincancel.vue
create mode 100644 Fronts/static/index/avatar1.jpeg
create mode 100644 Fronts/static/index/img2.jpg
create mode 100644 Fronts/static/index/img3.jpg
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/AuLogin.js
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/AuLogin.json
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/AuLogin.wxml
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/AuLogin.wxss
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/Login.js
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/Login.json
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/Login.wxml
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/Login.wxss
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/Register.js
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/Register.json
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/Register.wxml
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/TeLogin/Register.wxss
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/index/TedentSon/Avatar.js
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/index/TedentSon/Avatar.json
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/index/TedentSon/Avatar.wxml
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/index/TedentSon/Avatar.wxss
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/index/TedentSon/Logincancel.js
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/index/TedentSon/Logincancel.json
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/index/TedentSon/Logincancel.wxml
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/pages/index/TedentSon/Logincancel.wxss
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/static/index/avatar1.jpeg
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/static/index/img2.jpg
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/static/index/img3.jpg
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.json
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.wxml
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.wxss
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.js
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.json
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.wxml
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.wxss
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.js
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.json
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.wxml
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.wxss
create mode 100644 Fronts/unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/utils.js
create mode 100644 Fronts/yarn.lock
diff --git a/Fronts/manifest.json b/Fronts/manifest.json
index 636d7fb..2b55a05 100644
--- a/Fronts/manifest.json
+++ b/Fronts/manifest.json
@@ -52,9 +52,16 @@
/* 小程序特有相关 */
"appid" : "",
"setting" : {
- "urlCheck" : false
+ "urlCheck" : false,
+ "minified" : false,
+ "postcss" : false
},
"usingComponents" : true
},
- "vueVersion" : "3"
+ "vueVersion" : "3",
+ "h5" : {
+ "sdkConfigs" : {
+ "maps" : {}
+ }
+ }
}
diff --git a/Fronts/node_modules/.bin/nanoid b/Fronts/node_modules/.bin/nanoid
new file mode 100644
index 0000000..23254eb
--- /dev/null
+++ b/Fronts/node_modules/.bin/nanoid
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@"
+else
+ exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@"
+fi
diff --git a/Fronts/node_modules/.bin/nanoid.cmd b/Fronts/node_modules/.bin/nanoid.cmd
new file mode 100644
index 0000000..9c40107
--- /dev/null
+++ b/Fronts/node_modules/.bin/nanoid.cmd
@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+ SET "_prog=%dp0%\node.exe"
+) ELSE (
+ SET "_prog=node"
+ SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.cjs" %*
diff --git a/Fronts/node_modules/.bin/nanoid.ps1 b/Fronts/node_modules/.bin/nanoid.ps1
new file mode 100644
index 0000000..d8a4d7a
--- /dev/null
+++ b/Fronts/node_modules/.bin/nanoid.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
+ } else {
+ & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/Fronts/node_modules/.bin/parser b/Fronts/node_modules/.bin/parser
new file mode 100644
index 0000000..cb5b10d
--- /dev/null
+++ b/Fronts/node_modules/.bin/parser
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
+else
+ exec node "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
+fi
diff --git a/Fronts/node_modules/.bin/parser.cmd b/Fronts/node_modules/.bin/parser.cmd
new file mode 100644
index 0000000..1ad5c81
--- /dev/null
+++ b/Fronts/node_modules/.bin/parser.cmd
@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+ SET "_prog=%dp0%\node.exe"
+) ELSE (
+ SET "_prog=node"
+ SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@babel\parser\bin\babel-parser.js" %*
diff --git a/Fronts/node_modules/.bin/parser.ps1 b/Fronts/node_modules/.bin/parser.ps1
new file mode 100644
index 0000000..8926517
--- /dev/null
+++ b/Fronts/node_modules/.bin/parser.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
+ } else {
+ & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/Fronts/node_modules/.package-lock.json b/Fronts/node_modules/.package-lock.json
new file mode 100644
index 0000000..b6eb758
--- /dev/null
+++ b/Fronts/node_modules/.package-lock.json
@@ -0,0 +1,312 @@
+{
+ "name": "Fronts",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "node_modules/@babel/parser": {
+ "version": "7.18.11",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.11.tgz",
+ "integrity": "sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ==",
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@vue/compiler-core": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.31.tgz",
+ "integrity": "sha512-aKno00qoA4o+V/kR6i/pE+aP+esng5siNAVQ422TkBNM6qA4veXiZbSe8OTXHXquEi/f6Akc+nLfB4JGfe4/WQ==",
+ "dependencies": {
+ "@babel/parser": "^7.16.4",
+ "@vue/shared": "3.2.31",
+ "estree-walker": "^2.0.2",
+ "source-map": "^0.6.1"
+ }
+ },
+ "node_modules/@vue/compiler-dom": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.31.tgz",
+ "integrity": "sha512-60zIlFfzIDf3u91cqfqy9KhCKIJgPeqxgveH2L+87RcGU/alT6BRrk5JtUso0OibH3O7NXuNOQ0cDc9beT0wrg==",
+ "dependencies": {
+ "@vue/compiler-core": "3.2.31",
+ "@vue/shared": "3.2.31"
+ }
+ },
+ "node_modules/@vue/compiler-sfc": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.31.tgz",
+ "integrity": "sha512-748adc9msSPGzXgibHiO6T7RWgfnDcVQD+VVwYgSsyyY8Ans64tALHZANrKtOzvkwznV/F4H7OAod/jIlp/dkQ==",
+ "dependencies": {
+ "@babel/parser": "^7.16.4",
+ "@vue/compiler-core": "3.2.31",
+ "@vue/compiler-dom": "3.2.31",
+ "@vue/compiler-ssr": "3.2.31",
+ "@vue/reactivity-transform": "3.2.31",
+ "@vue/shared": "3.2.31",
+ "estree-walker": "^2.0.2",
+ "magic-string": "^0.25.7",
+ "postcss": "^8.1.10",
+ "source-map": "^0.6.1"
+ }
+ },
+ "node_modules/@vue/compiler-ssr": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.31.tgz",
+ "integrity": "sha512-mjN0rqig+A8TVDnsGPYJM5dpbjlXeHUm2oZHZwGyMYiGT/F4fhJf/cXy8QpjnLQK4Y9Et4GWzHn9PS8AHUnSkw==",
+ "dependencies": {
+ "@vue/compiler-dom": "3.2.31",
+ "@vue/shared": "3.2.31"
+ }
+ },
+ "node_modules/@vue/devtools-api": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.2.1.tgz",
+ "integrity": "sha512-OEgAMeQXvCoJ+1x8WyQuVZzFo0wcyCmUR3baRVLmKBo1LmYZWMlRiXlux5jd0fqVJu6PfDbOrZItVqUEzLobeQ==",
+ "license": "MIT"
+ },
+ "node_modules/@vue/reactivity": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.31.tgz",
+ "integrity": "sha512-HVr0l211gbhpEKYr2hYe7hRsV91uIVGFYNHj73njbARVGHQvIojkImKMaZNDdoDZOIkMsBc9a1sMqR+WZwfSCw==",
+ "dependencies": {
+ "@vue/shared": "3.2.31"
+ }
+ },
+ "node_modules/@vue/reactivity-transform": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.31.tgz",
+ "integrity": "sha512-uS4l4z/W7wXdI+Va5pgVxBJ345wyGFKvpPYtdSgvfJfX/x2Ymm6ophQlXXB6acqGHtXuBqNyyO3zVp9b1r0MOA==",
+ "dependencies": {
+ "@babel/parser": "^7.16.4",
+ "@vue/compiler-core": "3.2.31",
+ "@vue/shared": "3.2.31",
+ "estree-walker": "^2.0.2",
+ "magic-string": "^0.25.7"
+ }
+ },
+ "node_modules/@vue/runtime-core": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.31.tgz",
+ "integrity": "sha512-Kcog5XmSY7VHFEMuk4+Gap8gUssYMZ2+w+cmGI6OpZWYOEIcbE0TPzzPHi+8XTzAgx1w/ZxDFcXhZeXN5eKWsA==",
+ "dependencies": {
+ "@vue/reactivity": "3.2.31",
+ "@vue/shared": "3.2.31"
+ }
+ },
+ "node_modules/@vue/runtime-dom": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.31.tgz",
+ "integrity": "sha512-N+o0sICVLScUjfLG7u9u5XCjvmsexAiPt17GNnaWHJUfsKed5e85/A3SWgKxzlxx2SW/Hw7RQxzxbXez9PtY3g==",
+ "dependencies": {
+ "@vue/runtime-core": "3.2.31",
+ "@vue/shared": "3.2.31",
+ "csstype": "^2.6.8"
+ }
+ },
+ "node_modules/@vue/server-renderer": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.31.tgz",
+ "integrity": "sha512-8CN3Zj2HyR2LQQBHZ61HexF5NReqngLT3oahyiVRfSSvak+oAvVmu8iNLSu6XR77Ili2AOpnAt1y8ywjjqtmkg==",
+ "dependencies": {
+ "@vue/compiler-ssr": "3.2.31",
+ "@vue/shared": "3.2.31"
+ },
+ "peerDependencies": {
+ "vue": "3.2.31"
+ }
+ },
+ "node_modules/@vue/shared": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz",
+ "integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ=="
+ },
+ "node_modules/asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
+ },
+ "node_modules/axios": {
+ "version": "0.27.2",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
+ "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
+ "dependencies": {
+ "follow-redirects": "^1.14.9",
+ "form-data": "^4.0.0"
+ }
+ },
+ "node_modules/combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/csstype": {
+ "version": "2.6.20",
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.20.tgz",
+ "integrity": "sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA=="
+ },
+ "node_modules/delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/estree-walker": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
+ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
+ },
+ "node_modules/follow-redirects": {
+ "version": "1.15.1",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz",
+ "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/RubenVerborgh"
+ }
+ ],
+ "engines": {
+ "node": ">=4.0"
+ },
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/form-data": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
+ "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/magic-string": {
+ "version": "0.25.9",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz",
+ "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==",
+ "dependencies": {
+ "sourcemap-codec": "^1.4.8"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.4",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
+ "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
+ "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
+ },
+ "node_modules/postcss": {
+ "version": "8.4.14",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz",
+ "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ }
+ ],
+ "dependencies": {
+ "nanoid": "^3.3.4",
+ "picocolors": "^1.0.0",
+ "source-map-js": "^1.0.2"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
+ "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/sourcemap-codec": {
+ "version": "1.4.8",
+ "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
+ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA=="
+ },
+ "node_modules/vue": {
+ "version": "3.2.31",
+ "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.31.tgz",
+ "integrity": "sha512-odT3W2tcffTiQCy57nOT93INw1auq5lYLLYtWpPYQQYQOOdHiqFct9Xhna6GJ+pJQaF67yZABraH47oywkJgFw==",
+ "dependencies": {
+ "@vue/compiler-dom": "3.2.31",
+ "@vue/compiler-sfc": "3.2.31",
+ "@vue/runtime-dom": "3.2.31",
+ "@vue/server-renderer": "3.2.31",
+ "@vue/shared": "3.2.31"
+ }
+ },
+ "node_modules/vuex": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/vuex/-/vuex-4.0.2.tgz",
+ "integrity": "sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@vue/devtools-api": "^6.0.0-beta.11"
+ },
+ "peerDependencies": {
+ "vue": "^3.0.2"
+ }
+ }
+ }
+}
diff --git a/Fronts/node_modules/.yarn-integrity b/Fronts/node_modules/.yarn-integrity
new file mode 100644
index 0000000..d5abfb2
--- /dev/null
+++ b/Fronts/node_modules/.yarn-integrity
@@ -0,0 +1,17 @@
+{
+ "systemParams": "win32-x64-93",
+ "modulesFolders": [
+ "node_modules"
+ ],
+ "flags": [],
+ "linkedModules": [],
+ "topLevelPatterns": [
+ "vuex@^4.0.2"
+ ],
+ "lockfileEntries": {
+ "@vue/devtools-api@^6.0.0-beta.11": "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.2.1.tgz#6f2948ff002ec46df01420dfeff91de16c5b4092",
+ "vuex@^4.0.2": "https://registry.yarnpkg.com/vuex/-/vuex-4.0.2.tgz#f896dbd5bf2a0e963f00c67e9b610de749ccacc9"
+ },
+ "files": [],
+ "artifacts": {}
+}
\ No newline at end of file
diff --git a/Fronts/node_modules/@babel/parser/CHANGELOG.md b/Fronts/node_modules/@babel/parser/CHANGELOG.md
new file mode 100644
index 0000000..b3840ac
--- /dev/null
+++ b/Fronts/node_modules/@babel/parser/CHANGELOG.md
@@ -0,0 +1,1073 @@
+# Changelog
+
+> **Tags:**
+> - :boom: [Breaking Change]
+> - :eyeglasses: [Spec Compliance]
+> - :rocket: [New Feature]
+> - :bug: [Bug Fix]
+> - :memo: [Documentation]
+> - :house: [Internal]
+> - :nail_care: [Polish]
+
+> Semver Policy: https://github.com/babel/babel/tree/main/packages/babel-parser#semver
+
+_Note: Gaps between patch versions are faulty, broken or test releases._
+
+See the [Babel Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) for the pre-6.8.0 version Changelog.
+
+## 6.17.1 (2017-05-10)
+
+### :bug: Bug Fix
+ * Fix typo in flow spread operator error (Brian Ng)
+ * Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko)
+ * Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko)
+ * Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng)
+ * Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng)
+ * Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng)
+ * Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng)
+
+## 6.17.0 (2017-04-20)
+
+### :bug: Bug Fix
+ * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie)
+ * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons)
+ * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng)
+ * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons)
+ * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng)
+ * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng)
+
+## 7.0.0-beta.8 (2017-04-04)
+
+### New Feature
+* Add support for flow type spread (#418) (Conrad Buck)
+* Allow statics in flow interfaces (#427) (Brian Ng)
+
+### Bug Fix
+* Fix predicate attachment to match flow parser (#428) (Brian Ng)
+* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray)
+* Fix rest parameters with array and objects (#424) (Brian Ng)
+* Fix number parser (#433) (Alex Kuzmenko)
+
+### Docs
+* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko)
+
+### Internal
+* Use babel-register script when running babel smoke tests (#442) (Brian Ng)
+
+## 7.0.0-beta.7 (2017-03-22)
+
+### Spec Compliance
+* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu)
+
+### Bug Fix
+
+* Fix push-pop logic in flow (#405) (Daniel Tschinder)
+
+## 7.0.0-beta.6 (2017-03-21)
+
+### New Feature
+* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons)
+
+### Polish
+* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal)
+
+### Docs
+
+* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning)
+
+## 7.0.0-beta.5 (2017-03-21)
+
+### Bug Fix
+* Throw error if new.target is used outside of a function (#402) (Brian Ng)
+* Fix parsing of class properties (#351) (Kevin Gibbons)
+
+### Other
+ * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy)
+ * Optimize travis builds (#419) (Daniel Tschinder)
+ * Update codecov to 2.0 (#412) (Daniel Tschinder)
+ * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy)
+ * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning)
+ * Upgrade flow to 0.41 (Daniel Tschinder)
+ * Fix watch command (#403) (Brian Ng)
+ * Update yarn lock (Daniel Tschinder)
+ * Fix watch command (#403) (Brian Ng)
+ * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot])
+ * Add estree test for correct order of directives (Daniel Tschinder)
+ * Add DoExpression to spec (#364) (Alex Kuzmenko)
+ * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde)
+ * Explain how to run only one test (#389) [skip ci] (Aaron Ang)
+
+ ## 7.0.0-beta.4 (2017-03-01)
+
+* Don't consume async when checking for async func decl (#377) (Brian Ng)
+* add `ranges` option [skip ci] (Henry Zhu)
+* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine)
+
+## 7.0.0-beta.3 (2017-02-28)
+
+- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384)
+- Merge changes from 6.x
+
+## 7.0.0-beta.2 (2017-02-20)
+
+- estree: correctly change literals in all cases (#368) (Daniel Tschinder)
+
+## 7.0.0-beta.1 (2017-02-20)
+
+- Fix negative number literal typeannotations (#366) (Daniel Tschinder)
+- Update contributing with more test info [skip ci] (#355) (Brian Ng)
+
+## 7.0.0-beta.0 (2017-02-15)
+
+- Reintroduce Variance node (#333) (Daniel Tschinder)
+- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick)
+- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail)
+- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot])
+- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot])
+- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder)
+- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi)
+- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder)
+- Remove classConstructorCall plugin (#291) (Brian Ng)
+- Update yarn.lock (Daniel Tschinder)
+- Update cross-env to 3.x (Daniel Tschinder)
+- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov)
+- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens)
+
+## 6.16.1 (2017-02-23)
+
+### :bug: Regression
+
+- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375))
+
+Need to modify Babel for this AST node change, so moving to 7.0.
+
+- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376))
+
+[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted.
+
+## 6.16.0 (2017-02-23)
+
+### :rocket: New Feature
+
+***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder)
+
+We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/)
+
+We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc.
+
+To enable `estree` mode simply add the plugin in the config:
+```json
+{
+ "plugins": [ "estree" ]
+}
+```
+
+If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned.
+
+Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew)
+
+Babylon exports a new function to parse a single expression
+
+```js
+import { parseExpression } from 'babylon';
+
+const ast = parseExpression('x || y && z', options);
+```
+
+The returned AST will only consist of the expression. The options are the same as for `parse()`
+
+Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu)
+
+A new option was added to babylon allowing to change the initial linenumber for the first line which is usually `1`.
+Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ...
+
+Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris)
+
+Added support for function predicates which flow introduced in version 0.33.0
+
+```js
+declare function is_number(x: mixed): boolean %checks(typeof x === "number");
+```
+
+Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder)
+
+Added support for imports within module declarations which flow introduced in version 0.37.0
+
+```js
+declare module "C" {
+ import type { DT } from "D";
+ declare export type CT = { D: DT };
+}
+```
+
+### :eyeglasses: Spec Compliance
+
+Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons)
+
+This example now correctly throws an error when there is a semicolon after the decorator:
+
+```js
+class A {
+@a;
+foo(){}
+}
+```
+
+Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder)
+
+Using keywords in imports is not allowed anymore:
+
+```js
+import { default } from "foo";
+import { a as debugger } from "foo";
+```
+
+Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder)
+
+In flow it is now forbidden to overwrite the primitive types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration.
+
+Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder)
+
+The following code now correctly throws an error
+
+```js
+import type { type a } from "foo";
+```
+
+Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine)
+
+Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour.
+
+If you enable the flow plugin you can only define the type of the class properties, but not initialize them.
+
+Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder)
+
+Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`.
+
+```js
+export default async function bar() {};
+```
+
+### :nail_care: Polish
+
+Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng)
+
+### :bug: Bug Fix
+
+Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder)
+
+Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng)
+
+ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder)
+
+Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder)
+
+Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder)
+
+Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder)
+
+Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng)
+
+Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper)
+
+
+### :house: Internal
+
+Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray)
+
+Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray)
+
+Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder)
+
+chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot])
+
+Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder)
+
+Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot])
+
+Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot])
+
+devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo)
+
+Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder)
+
+Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder)
+
+### :memo: Documentation
+
+Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng)
+
+Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu)
+
+Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro)
+
+AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens)
+
+## 6.15.0 (2017-01-10)
+
+### :eyeglasses: Spec Compliance
+
+Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison)
+
+This change implements flows new shorthand import syntax
+and where previously you had to write this code:
+
+```js
+import {someValue} from "blah";
+import type {someType} from "blah";
+import typeof {someOtherValue} from "blah";
+```
+
+you can now write it like this:
+
+```js
+import {
+ someValue,
+ type someType,
+ typeof someOtherValue,
+} from "blah";
+```
+
+For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request.
+
+flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin)
+
+This change now allows a leading pipe everywhere types can be used:
+```js
+var f = (x): | 1 | 2 => 1;
+```
+
+Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo)
+
+Previously babylon parsed the following exports, although they are not valid:
+```js
+export typeof foo;
+export new Foo();
+export function() {};
+export for (;;);
+export while(foo);
+```
+
+### :bug: Bug Fix
+
+Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin)
+
+This fixes parsing of this case:
+
+```js
+const map = {
+ [age <= 17] : 'Too young'
+};
+```
+
+Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long)
+
+The following case produced an invalid AST
+```js
+
{/* foo */}
+```
+
+Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy)
+
+When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST.
+
+Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant)
+
+Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray)
+
+### :house: Internal
+
+User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder)
+
+Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo)
+
+Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine)
+
+Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder)
+
+Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine)
+
+Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU)
+
+Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot])
+
+chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot])
+
+chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot])
+
+## 6.14.1 (2016-11-17)
+
+### :bug: Bug Fix
+
+Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder)
+
+```js
+{
+ "plugins": ["*"]
+}
+```
+
+Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer.
+
+## 6.14.0 (2016-11-16)
+
+### :eyeglasses: Spec Compliance
+
+Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo)
+
+[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words)
+
+Babylon will throw for more reserved words such as `enum` or `await` (in strict mode).
+
+```
+class enum {} // throws
+class await {} // throws in strict mode (module)
+```
+
+Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi)
+
+So where you used to have to write
+
+```js
+type A = (x: string, y: boolean) => number;
+type B = (z: string) => number;
+type C = { [key: string]: number };
+```
+
+you can now write (with flow 0.34.0)
+
+```js
+type A = (string, boolean) => number;
+type B = string => number;
+type C = { [string]: number };
+```
+
+Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner)
+
+Supports these form now of specifying array types:
+
+```js
+var a: number[][][][];
+var b: string[][];
+```
+
+### :bug: Bug Fix
+
+Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder)
+
+```
+declare module "foo" { declare module.exports: number }
+declare module "foo" { declare module.exports: number; } // also allowed now
+```
+
+### :house: Internal
+
+ * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman)
+ * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger)
+ * Add node 7 (Daniel Tschinder)
+ * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper)
+
+## v6.13.1 (2016-10-26)
+
+### :nail_care: Polish
+
+- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML))
+
+```js
+const babylon = require('babylon');
+const ast = babylon.parse('var foo = "lol";');
+```
+
+With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph.
+
+**Without bundling**
+![image](https://cloud.githubusercontent.com/assets/5233399/19420264/3133497e-93ad-11e6-9a6a-2da59c4f5c13.png)
+
+**With bundling**
+![image](https://cloud.githubusercontent.com/assets/5233399/19420267/388f556e-93ad-11e6-813e-7c5c396be322.png)
+
+- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu)
+- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu)
+
+## v6.13.0 (2016-10-21)
+
+### :eyeglasses: Spec Compliance
+
+Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman)
+
+> See https://flowtype.org/docs/variance.html for more information
+
+```js
+type T = { +p: T };
+interface T { -p: T };
+declare class T { +[k:K]: V };
+class T { -[k:K]: V };
+class C2 { +p: T = e };
+```
+
+Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman)
+
+```js
+({ __proto__: 1, __proto__: 2 }) // Throws an error now
+```
+
+### :bug: Bug Fix
+
+Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman)
+
+```js
+declare class A {
+ static: T;
+}
+```
+
+Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine)
+
+```js
+var foo = { async, bar };
+```
+
+### :nail_care: Polish
+
+Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder)
+
+> This improves the performance slightly (because of hidden classes)
+
+### :house: Internal
+
+Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman)
+
+Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman)
+
+Readd missin .eslinignore for IDEs (Daniel Tschinder)
+
+Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman)
+
+Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman)
+
+Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman)
+
+## v6.12.0 (2016-10-14)
+
+### :eyeglasses: Spec Compliance
+
+Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler)
+
+#### Dynamic Import
+
+- Proposal Repo: https://github.com/domenic/proposal-dynamic-import
+- Championed by [@domenic](https://github.com/domenic)
+- stage-2
+- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import)
+
+> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript
+
+```js
+import(`./section-modules/${link.dataset.entryModule}.js`)
+.then(module => {
+ module.loadPageInto(main);
+})
+```
+
+Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman)
+
+#### EmptyTypeAnnotation
+
+Just wasn't covered before.
+
+```js
+type T = empty;
+```
+
+### :bug: Bug Fix
+
+Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels)
+
+```js
+// was failing due to sparse array
+export const { foo: [ ,, qux7 ] } = bar;
+```
+
+Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper)
+
+```js
+declare class X {
+ foobar(): void;
+ static foobar(): void;
+}
+```
+
+Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper)
+
+```js
+class Foo {
+ delete(item: T): T {
+ return item;
+ }
+}
+```
+
+Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder)
+
+```js
+function *foo() {
+ const x = (yield 5: any);
+}
+```
+
+### :nail_care: Polish
+
+Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman)
+
+```js
+// Unexpected token, expected ; (1:6)
+{ set 1 }
+```
+
+### :house: Internal
+
+Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder)
+
+Also run flow, linting, babel tests on separate instances (add back node 0.10)
+
+## v6.11.6 (2016-10-12)
+
+### :bug: Bug Fix/Regression
+
+Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels)
+
+```js
+// was failing with `Cannot read property 'type' of null` because of null identifiers
+export const { foo: [ ,, qux7 ] } = bar;
+```
+
+## v6.11.5 (2016-10-12)
+
+### :eyeglasses: Spec Compliance
+
+Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo)
+
+```js
+// `foo` has already been exported. Exported identifiers must be unique. (2:20)
+export function foo() {};
+export const { a: [{foo}] } = bar;
+```
+
+Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo)
+
+```js
+// `foo` has already been exported. Exported identifiers must be unique. (2:22)
+export const foo = 1;
+export const [bar, ...foo] = baz;
+```
+
+### :bug: Bug Fix
+
+Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo)
+
+```js
+// this is ok now
+const test = ({async = true}) => {};
+```
+
+### :nail_care: Polish
+
+Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder)
+
+```bash
+# So in the case of a missing ending curly (`}`)
+Module build failed: SyntaxError: Unexpected token, expected } (30:0)
+ 28 | }
+ 29 |
+> 30 |
+ | ^
+```
+
+## v6.11.4 (2016-10-03)
+
+Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu)
+
+## v6.11.3 (2016-10-01)
+
+### :eyeglasses: Spec Compliance
+
+Add static errors for object rest (#149) ([@danez](https://github.com/danez))
+
+> https://github.com/sebmarkbage/ecmascript-rest-spread
+
+Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right.
+
+```js
+let { x, y, ...z } = { x: 1, y: 2, z: 3 };
+// x = 1
+// y = 2
+// z = { z: 3 }
+```
+
+#### New Syntax Errors:
+
+**SyntaxError**: The rest element has to be the last element when destructuring (1:10)
+```bash
+> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3};
+ | ^
+# Previous behavior:
+# x = { x: 1, y: 2, z: 3 }
+# y = 2
+# z = 3
+```
+
+Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think.
+
+**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13)
+
+```bash
+> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3};
+ | ^
+# Previous behavior:
+# x = 1
+# y = { y: 2, z: 3 }
+# z = { y: 2, z: 3 }
+```
+
+Before y and z would just be the same value anyway so there is no reason to need to have both.
+
+**SyntaxError**: A trailing comma is not permitted after the rest element (1:16)
+
+```js
+let { x, y, ...z, } = obj;
+```
+
+The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense.
+
+---
+
+get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell))
+
+```js
+// valid
+function something({ set = null, get = null }) {}
+```
+
+## v6.11.2 (2016-09-23)
+
+### Bug Fix
+
+- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo
+
+```js
+// regression with duplicate export check
+SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13)
+ 20 |
+ 21 | export const { rhythm } = typography;
+> 22 | export const { TypographyStyle } = typography
+```
+
+Bail out for now, and make a change to account for destructuring in the next release.
+
+## 6.11.1 (2016-09-22)
+
+### Bug Fix
+- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez
+
+```javascript
+export toString from './toString';
+```
+
+```bash
+`toString` has already been exported. Exported identifiers must be unique. (1:7)
+> 1 | export toString from './toString';
+ | ^
+ 2 |
+```
+
+## 6.11.0 (2016-09-22)
+
+### Spec Compliance (will break CI)
+
+- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo
+
+```js
+// Only one default export allowed per module. (2:9)
+export default function() {};
+export { foo as default };
+
+// Only one default export allowed per module. (2:0)
+export default {};
+export default function() {};
+
+// `Foo` has already been exported. Exported identifiers must be unique. (2:0)
+export { Foo };
+export class Foo {};
+```
+
+### New Feature (Syntax)
+
+- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88
+
+```js
+// AST
+interface ClassProperty <: Node {
+ type: "ClassProperty";
+ key: Identifier;
+ value: Expression;
+ computed: boolean; // added
+}
+```
+
+```js
+// with "plugins": ["classProperties"]
+class Foo {
+ [x]
+ ['y']
+}
+
+class Bar {
+ [p]
+ [m] () {}
+}
+ ```
+
+### Bug Fix
+
+- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper
+
+```js
+declare class X {
+ a: number;
+ static b: number; // static
+ c: number; // this was being marked as static in the AST as well
+}
+```
+
+### Polish
+
+- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88
+
+```js
+// Used to error with:
+// SyntaxError: Assigning to rvalue (1:0)
+
+// Now:
+// Invalid left-hand side in assignment expression (1:0)
+3 = 4
+
+// Invalid left-hand side in for-in statement (1:5)
+for (+i in {});
+```
+
+### Internal
+
+- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez
+- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo
+
+## 6.10.0 (2016-09-19)
+
+> We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue.
+
+### Spec Compliance
+
+* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu)
+
+> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors
+
+More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists)
+
+For example:
+
+```js
+// this errors because it uses destructuring and default parameters
+// in a function with a "use strict" directive
+function a([ option1, option2 ] = []) {
+ "use strict";
+}
+ ```
+
+The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to.
+
+### New Feature
+
+* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer)
+
+Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8
+
+Looks like:
+
+```js
+var a : {| x: number, y: string |} = { x: 0, y: 'foo' };
+```
+
+### Bug Fixes
+
+* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder)
+* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper)
+* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper)
+
+### Misc
+
+* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder)
+* Fix Contributing guidelines [skip ci] (Daniel Tschinder)
+
+## 6.9.2 (2016-09-09)
+
+The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller.
+
+## 6.9.1 (2016-08-23)
+
+This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops.
+
+### Bug Fixes
+
+- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez
+- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez
+- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper
+- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez
+- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez
+
+## 6.9.0 (2016-08-16)
+
+### New syntax support
+
+- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer
+
+(Be aware that React is not going to support this syntax)
+
+```js
+
+ {...todos.map(todo => )}
+
+```
+
+- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez
+
+```js
+declare module "foo" {
+ declare module.exports: {}
+}
+```
+
+### New Features
+
+- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain
+- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens
+
+### Bug Fixes
+
+- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez
+- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez
+- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi
+- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez
+- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi
+- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez
+- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez
+
+### Internal
+
+- Add codecoverage to tests @danez
+- Fix tests to not save expected output if we expect the test to fail @danez
+- Make a shallow clone of babel for testing @danez
+- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot
+- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot
+- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot
+- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot
+
+## 6.8.4 (2016-07-06)
+
+### Bug Fixes
+
+- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez
+
+## 6.8.3 (2016-07-02)
+
+### Bug Fixes
+
+- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez
+
+## 6.8.2 (2016-06-24)
+
+### Bug Fixes
+
+- Fix parse error with yielding jsx elements in generators `function* it() { yield ; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal
+- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez
+- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez
+- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez
+- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez
+- Support negative numeric type literals @kittens
+- Remove line terminator restriction after await keyword @kittens
+- Remove grouped type arrow restriction as it seems flow no longer has it @kittens
+- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin
+- Fix parse error with arrow functions that have flow type parameter declarations `(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi
+
+### Documentation
+
+- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene
+- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo
+
+### Internal
+
+- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez
+- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez
+- Upgrade test runner ava @kittens
+- Add missing generate-identifier-regex script @kittens
+- Rename parser context types @kittens
+- Add node v6 to travis testing @hzoo
+- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens
+
+## 6.8.1 (2016-06-06)
+
+### New Feature
+
+- Parse type parameter declarations with defaults like `type Foo = T`
+
+### Bug Fixes
+- Type parameter declarations need 1 or more type parameters.
+- The existential type `*` is not a valid type parameter.
+- The existential type `*` is a primary type
+
+### Spec Compliance
+- The param list for type parameter declarations now consists of `TypeParameter` nodes
+- New `TypeParameter` AST Node (replaces using the `Identifier` node before)
+
+```
+interface TypeParameter <: Node {
+ bound: TypeAnnotation;
+ default: TypeAnnotation;
+ name: string;
+ variance: "plus" | "minus";
+}
+```
+
+## 6.8.0 (2016-05-02)
+
+#### New Feature
+
+##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12))
+
+> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md).
+
+Examples:
+
+```js
+class Foo {
+ constructor(@foo() x, @bar({ a: 123 }) @baz() y) {}
+}
+
+export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {}
+
+var obj = {
+ method(@foo() x, @bar({ a: 123 }) @baz() y) {}
+};
+```
+
+##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17))
+
+There is also a new node type, `ForAwaitStatement`.
+
+> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals).
+
+Example:
+
+```js
+async function f() {
+ for await (let x of y);
+}
+```
diff --git a/Fronts/node_modules/@babel/parser/LICENSE b/Fronts/node_modules/@babel/parser/LICENSE
new file mode 100644
index 0000000..d4c7fc5
--- /dev/null
+++ b/Fronts/node_modules/@babel/parser/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2012-2014 by various contributors (see AUTHORS)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Fronts/node_modules/@babel/parser/README.md b/Fronts/node_modules/@babel/parser/README.md
new file mode 100644
index 0000000..513748c
--- /dev/null
+++ b/Fronts/node_modules/@babel/parser/README.md
@@ -0,0 +1,19 @@
+# @babel/parser
+
+> A JavaScript parser
+
+See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package.
+
+## Install
+
+Using npm:
+
+```sh
+npm install --save-dev @babel/parser
+```
+
+or using yarn:
+
+```sh
+yarn add @babel/parser --dev
+```
diff --git a/Fronts/node_modules/@babel/parser/bin/babel-parser.js b/Fronts/node_modules/@babel/parser/bin/babel-parser.js
new file mode 100644
index 0000000..3aca314
--- /dev/null
+++ b/Fronts/node_modules/@babel/parser/bin/babel-parser.js
@@ -0,0 +1,15 @@
+#!/usr/bin/env node
+/* eslint no-var: 0 */
+
+var parser = require("..");
+var fs = require("fs");
+
+var filename = process.argv[2];
+if (!filename) {
+ console.error("no filename specified");
+} else {
+ var file = fs.readFileSync(filename, "utf8");
+ var ast = parser.parse(file);
+
+ console.log(JSON.stringify(ast, null, " "));
+}
diff --git a/Fronts/node_modules/@babel/parser/index.cjs b/Fronts/node_modules/@babel/parser/index.cjs
new file mode 100644
index 0000000..89863a9
--- /dev/null
+++ b/Fronts/node_modules/@babel/parser/index.cjs
@@ -0,0 +1,5 @@
+try {
+ module.exports = require("./lib/index.cjs");
+} catch {
+ module.exports = require("./lib/index.js");
+}
diff --git a/Fronts/node_modules/@babel/parser/lib/index.js b/Fronts/node_modules/@babel/parser/lib/index.js
new file mode 100644
index 0000000..3d841c8
--- /dev/null
+++ b/Fronts/node_modules/@babel/parser/lib/index.js
@@ -0,0 +1,16800 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+function _objectWithoutPropertiesLoose(source, excluded) {
+ if (source == null) return {};
+ var target = {};
+ var sourceKeys = Object.keys(source);
+ var key, i;
+
+ for (i = 0; i < sourceKeys.length; i++) {
+ key = sourceKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ target[key] = source[key];
+ }
+
+ return target;
+}
+
+class Position {
+ constructor(line, col, index) {
+ this.line = void 0;
+ this.column = void 0;
+ this.index = void 0;
+ this.line = line;
+ this.column = col;
+ this.index = index;
+ }
+
+}
+class SourceLocation {
+ constructor(start, end) {
+ this.start = void 0;
+ this.end = void 0;
+ this.filename = void 0;
+ this.identifierName = void 0;
+ this.start = start;
+ this.end = end;
+ }
+
+}
+function createPositionWithColumnOffset(position, columnOffset) {
+ const {
+ line,
+ column,
+ index
+ } = position;
+ return new Position(line, column + columnOffset, index + columnOffset);
+}
+
+var ParseErrorCode = {
+ SyntaxError: "BABEL_PARSER_SYNTAX_ERROR",
+ SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
+};
+
+const reflect = (keys, last = keys.length - 1) => ({
+ get() {
+ return keys.reduce((object, key) => object[key], this);
+ },
+
+ set(value) {
+ keys.reduce((item, key, i) => i === last ? item[key] = value : item[key], this);
+ }
+
+});
+
+const instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === "function" ? {
+ value: descriptor,
+ enumerable: false
+} : typeof descriptor.reflect === "string" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split("."))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({
+ configurable: true
+}, descriptor)), Object.assign(new constructor(), properties));
+
+var ModuleErrors = {
+ ImportMetaOutsideModule: {
+ message: `import.meta may appear only with 'sourceType: "module"'`,
+ code: ParseErrorCode.SourceTypeModuleError
+ },
+ ImportOutsideModule: {
+ message: `'import' and 'export' may appear only with 'sourceType: "module"'`,
+ code: ParseErrorCode.SourceTypeModuleError
+ }
+};
+
+const NodeDescriptions = {
+ ArrayPattern: "array destructuring pattern",
+ AssignmentExpression: "assignment expression",
+ AssignmentPattern: "assignment expression",
+ ArrowFunctionExpression: "arrow function expression",
+ ConditionalExpression: "conditional expression",
+ CatchClause: "catch clause",
+ ForOfStatement: "for-of statement",
+ ForInStatement: "for-in statement",
+ ForStatement: "for-loop",
+ FormalParameters: "function parameter list",
+ Identifier: "identifier",
+ ImportSpecifier: "import specifier",
+ ImportDefaultSpecifier: "import default specifier",
+ ImportNamespaceSpecifier: "import namespace specifier",
+ ObjectPattern: "object destructuring pattern",
+ ParenthesizedExpression: "parenthesized expression",
+ RestElement: "rest element",
+ UpdateExpression: {
+ true: "prefix operation",
+ false: "postfix operation"
+ },
+ VariableDeclarator: "variable declaration",
+ YieldExpression: "yield expression"
+};
+
+const toNodeDescription = ({
+ type,
+ prefix
+}) => type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[String(prefix)] : NodeDescriptions[type];
+
+var StandardErrors = {
+ AccessorIsGenerator: ({
+ kind
+ }) => `A ${kind}ter cannot be a generator.`,
+ ArgumentsInClass: "'arguments' is only allowed in functions and class methods.",
+ AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.",
+ AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.",
+ AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.",
+ AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
+ AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
+ AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
+ BadGetterArity: "A 'get' accesor must not have any formal parameters.",
+ BadSetterArity: "A 'set' accesor must have exactly one formal parameter.",
+ BadSetterRestParameter: "A 'set' accesor function argument must not be a rest parameter.",
+ ConstructorClassField: "Classes may not have a field named 'constructor'.",
+ ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
+ ConstructorIsAccessor: "Class constructor may not be an accessor.",
+ ConstructorIsAsync: "Constructor can't be an async function.",
+ ConstructorIsGenerator: "Constructor can't be a generator.",
+ DeclarationMissingInitializer: ({
+ kind
+ }) => `Missing initializer in ${kind} declaration.`,
+ DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.",
+ DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
+ DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.",
+ DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
+ DecoratorStaticBlock: "Decorators can't be used with a static block.",
+ DeletePrivateField: "Deleting a private field is not allowed.",
+ DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
+ DuplicateConstructor: "Duplicate constructor in the same class.",
+ DuplicateDefaultExport: "Only one default export allowed per module.",
+ DuplicateExport: ({
+ exportName
+ }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`,
+ DuplicateProto: "Redefinition of __proto__ property.",
+ DuplicateRegExpFlags: "Duplicate regular expression flag.",
+ ElementAfterRest: "Rest element must be last element.",
+ EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
+ ExportBindingIsString: ({
+ localName,
+ exportName
+ }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`,
+ ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
+ ForInOfLoopInitializer: ({
+ type
+ }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`,
+ ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
+ ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.",
+ GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.",
+ IllegalBreakContinue: ({
+ type
+ }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`,
+ IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
+ IllegalReturn: "'return' outside of function.",
+ ImportBindingIsString: ({
+ importName
+ }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`,
+ ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.",
+ ImportCallArity: ({
+ maxArgumentCount
+ }) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`,
+ ImportCallNotNewExpression: "Cannot use new with import(...).",
+ ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
+ ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.",
+ IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
+ InvalidBigIntLiteral: "Invalid BigIntLiteral.",
+ InvalidCodePoint: "Code point out of bounds.",
+ InvalidCoverInitializedName: "Invalid shorthand property initializer.",
+ InvalidDecimal: "Invalid decimal.",
+ InvalidDigit: ({
+ radix
+ }) => `Expected number in radix ${radix}.`,
+ InvalidEscapeSequence: "Bad character escape sequence.",
+ InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.",
+ InvalidEscapedReservedWord: ({
+ reservedWord
+ }) => `Escape sequence in keyword ${reservedWord}.`,
+ InvalidIdentifier: ({
+ identifierName
+ }) => `Invalid identifier ${identifierName}.`,
+ InvalidLhs: ({
+ ancestor
+ }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,
+ InvalidLhsBinding: ({
+ ancestor
+ }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,
+ InvalidNumber: "Invalid number.",
+ InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.",
+ InvalidOrUnexpectedToken: ({
+ unexpected
+ }) => `Unexpected character '${unexpected}'.`,
+ InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.",
+ InvalidPrivateFieldResolution: ({
+ identifierName
+ }) => `Private name #${identifierName} is not defined.`,
+ InvalidPropertyBindingPattern: "Binding member expression.",
+ InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.",
+ InvalidRestAssignmentPattern: "Invalid rest operator's argument.",
+ LabelRedeclaration: ({
+ labelName
+ }) => `Label '${labelName}' is already declared.`,
+ LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.",
+ LineTerminatorBeforeArrow: "No line break is allowed before '=>'.",
+ MalformedRegExpFlags: "Invalid regular expression flag.",
+ MissingClassName: "A class name is required.",
+ MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
+ MissingSemicolon: "Missing semicolon.",
+ MissingPlugin: ({
+ missingPlugin
+ }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`,
+ MissingOneOfPlugins: ({
+ missingPlugin
+ }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`,
+ MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
+ MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
+ ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
+ ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.",
+ ModuleAttributesWithDuplicateKeys: ({
+ key
+ }) => `Duplicate key "${key}" is not allowed in module attributes.`,
+ ModuleExportNameHasLoneSurrogate: ({
+ surrogateCharCode
+ }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`,
+ ModuleExportUndefined: ({
+ localName
+ }) => `Export '${localName}' is not defined.`,
+ MultipleDefaultsInSwitch: "Multiple default clauses.",
+ NewlineAfterThrow: "Illegal newline after throw.",
+ NoCatchOrFinally: "Missing catch or finally clause.",
+ NumberIdentifier: "Identifier directly after number.",
+ NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",
+ ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.",
+ OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.",
+ OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.",
+ OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.",
+ ParamDupe: "Argument name clash.",
+ PatternHasAccessor: "Object pattern can't contain getter or setter.",
+ PatternHasMethod: "Object pattern can't contain methods.",
+ PrivateInExpectedIn: ({
+ identifierName
+ }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`,
+ PrivateNameRedeclaration: ({
+ identifierName
+ }) => `Duplicate private name #${identifierName}.`,
+ RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
+ RecordNoProto: "'__proto__' is not allowed in Record expressions.",
+ RestTrailingComma: "Unexpected trailing comma after rest element.",
+ SloppyFunction: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",
+ StaticPrototype: "Classes may not have static property named prototype.",
+ SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
+ SuperPrivateField: "Private fields can't be accessed on super.",
+ TrailingDecorator: "Decorators must be attached to a class element.",
+ TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
+ UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.",
+ UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
+ UnexpectedDigitAfterHash: "Unexpected digit after hash token.",
+ UnexpectedImportExport: "'import' and 'export' may only appear at the top level.",
+ UnexpectedKeyword: ({
+ keyword
+ }) => `Unexpected keyword '${keyword}'.`,
+ UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.",
+ UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.",
+ UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.",
+ UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.",
+ UnexpectedPrivateField: "Unexpected private name.",
+ UnexpectedReservedWord: ({
+ reservedWord
+ }) => `Unexpected reserved word '${reservedWord}'.`,
+ UnexpectedSuper: "'super' is only allowed in object methods and classes.",
+ UnexpectedToken: ({
+ expected,
+ unexpected
+ }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`,
+ UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
+ UnsupportedBind: "Binding should be performed on object property.",
+ UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
+ UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
+ UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.",
+ UnsupportedMetaProperty: ({
+ target,
+ onlyValidPropertyName
+ }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,
+ UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.",
+ UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.",
+ UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",
+ UnterminatedComment: "Unterminated comment.",
+ UnterminatedRegExp: "Unterminated regular expression.",
+ UnterminatedString: "Unterminated string constant.",
+ UnterminatedTemplate: "Unterminated template.",
+ VarRedeclaration: ({
+ identifierName
+ }) => `Identifier '${identifierName}' has already been declared.`,
+ YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
+ YieldInParameter: "Yield expression is not allowed in formal parameters.",
+ ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0."
+};
+
+var StrictModeErrors = {
+ StrictDelete: "Deleting local variable in strict mode.",
+ StrictEvalArguments: ({
+ referenceName
+ }) => `Assigning to '${referenceName}' in strict mode.`,
+ StrictEvalArgumentsBinding: ({
+ bindingName
+ }) => `Binding '${bindingName}' in strict mode.`,
+ StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.",
+ StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.",
+ StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.",
+ StrictWith: "'with' in strict mode."
+};
+
+const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]);
+var PipelineOperatorErrors = {
+ PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
+ PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
+ PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
+ PipeTopicUnconfiguredToken: ({
+ token
+ }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`,
+ PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
+ PipeUnparenthesizedBody: ({
+ type
+ }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({
+ type
+ })}; please wrap it in parentheses.`,
+ PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
+ PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
+ PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
+ PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
+ PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
+ PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
+};
+
+const _excluded$1 = ["toMessage"],
+ _excluded2$1 = ["message"];
+
+function toParseErrorConstructor(_ref) {
+ let {
+ toMessage
+ } = _ref,
+ properties = _objectWithoutPropertiesLoose(_ref, _excluded$1);
+
+ return function constructor({
+ loc,
+ details
+ }) {
+ return instantiate(SyntaxError, Object.assign({}, properties, {
+ loc
+ }), {
+ clone(overrides = {}) {
+ const loc = overrides.loc || {};
+ return constructor({
+ loc: new Position("line" in loc ? loc.line : this.loc.line, "column" in loc ? loc.column : this.loc.column, "index" in loc ? loc.index : this.loc.index),
+ details: Object.assign({}, this.details, overrides.details)
+ });
+ },
+
+ details: {
+ value: details,
+ enumerable: false
+ },
+ message: {
+ get() {
+ return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`;
+ },
+
+ set(value) {
+ Object.defineProperty(this, "message", {
+ value
+ });
+ }
+
+ },
+ pos: {
+ reflect: "loc.index",
+ enumerable: true
+ },
+ missingPlugin: "missingPlugin" in details && {
+ reflect: "details.missingPlugin",
+ enumerable: true
+ }
+ });
+ };
+}
+
+function ParseErrorEnum(argument, syntaxPlugin) {
+ if (Array.isArray(argument)) {
+ return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]);
+ }
+
+ const ParseErrorConstructors = {};
+
+ for (const reasonCode of Object.keys(argument)) {
+ const template = argument[reasonCode];
+
+ const _ref2 = typeof template === "string" ? {
+ message: () => template
+ } : typeof template === "function" ? {
+ message: template
+ } : template,
+ {
+ message
+ } = _ref2,
+ rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$1);
+
+ const toMessage = typeof message === "string" ? () => message : message;
+ ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({
+ code: ParseErrorCode.SyntaxError,
+ reasonCode,
+ toMessage
+ }, syntaxPlugin ? {
+ syntaxPlugin
+ } : {}, rest));
+ }
+
+ return ParseErrorConstructors;
+}
+const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
+
+const {
+ defineProperty
+} = Object;
+
+const toUnenumerable = (object, key) => defineProperty(object, key, {
+ enumerable: false,
+ value: object[key]
+});
+
+function toESTreeLocation(node) {
+ node.loc.start && toUnenumerable(node.loc.start, "index");
+ node.loc.end && toUnenumerable(node.loc.end, "index");
+ return node;
+}
+
+var estree = (superClass => class ESTreeParserMixin extends superClass {
+ parse() {
+ const file = toESTreeLocation(super.parse());
+
+ if (this.options.tokens) {
+ file.tokens = file.tokens.map(toESTreeLocation);
+ }
+
+ return file;
+ }
+
+ parseRegExpLiteral({
+ pattern,
+ flags
+ }) {
+ let regex = null;
+
+ try {
+ regex = new RegExp(pattern, flags);
+ } catch (e) {}
+
+ const node = this.estreeParseLiteral(regex);
+ node.regex = {
+ pattern,
+ flags
+ };
+ return node;
+ }
+
+ parseBigIntLiteral(value) {
+ let bigInt;
+
+ try {
+ bigInt = BigInt(value);
+ } catch (_unused) {
+ bigInt = null;
+ }
+
+ const node = this.estreeParseLiteral(bigInt);
+ node.bigint = String(node.value || value);
+ return node;
+ }
+
+ parseDecimalLiteral(value) {
+ const decimal = null;
+ const node = this.estreeParseLiteral(decimal);
+ node.decimal = String(node.value || value);
+ return node;
+ }
+
+ estreeParseLiteral(value) {
+ return this.parseLiteral(value, "Literal");
+ }
+
+ parseStringLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+
+ parseNumericLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+
+ parseNullLiteral() {
+ return this.estreeParseLiteral(null);
+ }
+
+ parseBooleanLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+
+ directiveToStmt(directive) {
+ const directiveLiteral = directive.value;
+ const stmt = this.startNodeAt(directive.start, directive.loc.start);
+ const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);
+ expression.value = directiveLiteral.extra.expressionValue;
+ expression.raw = directiveLiteral.extra.raw;
+ stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.loc.end);
+ stmt.directive = directiveLiteral.extra.raw.slice(1, -1);
+ return this.finishNodeAt(stmt, "ExpressionStatement", directive.loc.end);
+ }
+
+ initFunction(node, isAsync) {
+ super.initFunction(node, isAsync);
+ node.expression = false;
+ }
+
+ checkDeclaration(node) {
+ if (node != null && this.isObjectProperty(node)) {
+ this.checkDeclaration(node.value);
+ } else {
+ super.checkDeclaration(node);
+ }
+ }
+
+ getObjectOrClassMethodParams(method) {
+ return method.value.params;
+ }
+
+ isValidDirective(stmt) {
+ var _stmt$expression$extr;
+
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);
+ }
+
+ parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
+ super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse);
+ const directiveStatements = node.directives.map(d => this.directiveToStmt(d));
+ node.body = directiveStatements.concat(node.body);
+ delete node.directives;
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
+
+ if (method.typeParameters) {
+ method.value.typeParameters = method.typeParameters;
+ delete method.typeParameters;
+ }
+
+ classBody.body.push(method);
+ }
+
+ parsePrivateName() {
+ const node = super.parsePrivateName();
+ {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return node;
+ }
+ }
+ return this.convertPrivateNameToPrivateIdentifier(node);
+ }
+
+ convertPrivateNameToPrivateIdentifier(node) {
+ const name = super.getPrivateNameSV(node);
+ node = node;
+ delete node.id;
+ node.name = name;
+ node.type = "PrivateIdentifier";
+ return node;
+ }
+
+ isPrivateName(node) {
+ {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return super.isPrivateName(node);
+ }
+ }
+ return node.type === "PrivateIdentifier";
+ }
+
+ getPrivateNameSV(node) {
+ {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return super.getPrivateNameSV(node);
+ }
+ }
+ return node.name;
+ }
+
+ parseLiteral(value, type) {
+ const node = super.parseLiteral(value, type);
+ node.raw = node.extra.raw;
+ delete node.extra;
+ return node;
+ }
+
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ super.parseFunctionBody(node, allowExpression, isMethod);
+ node.expression = node.body.type !== "BlockStatement";
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ let funcNode = this.startNode();
+ funcNode.kind = node.kind;
+ funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
+ funcNode.type = "FunctionExpression";
+ delete funcNode.kind;
+ node.value = funcNode;
+
+ if (type === "ClassPrivateMethod") {
+ node.computed = false;
+ }
+
+ return this.finishNode(node, "MethodDefinition");
+ }
+
+ parseClassProperty(...args) {
+ const propertyNode = super.parseClassProperty(...args);
+ {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return propertyNode;
+ }
+ }
+ propertyNode.type = "PropertyDefinition";
+ return propertyNode;
+ }
+
+ parseClassPrivateProperty(...args) {
+ const propertyNode = super.parseClassPrivateProperty(...args);
+ {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return propertyNode;
+ }
+ }
+ propertyNode.type = "PropertyDefinition";
+ propertyNode.computed = false;
+ return propertyNode;
+ }
+
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
+ const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);
+
+ if (node) {
+ node.type = "Property";
+
+ if (node.kind === "method") {
+ node.kind = "init";
+ }
+
+ node.shorthand = false;
+ }
+
+ return node;
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+
+ if (node) {
+ node.kind = "init";
+ node.type = "Property";
+ }
+
+ return node;
+ }
+
+ isValidLVal(type, isUnparenthesizedInAssign, binding) {
+ return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);
+ }
+
+ isAssignable(node, isBinding) {
+ if (node != null && this.isObjectProperty(node)) {
+ return this.isAssignable(node.value, isBinding);
+ }
+
+ return super.isAssignable(node, isBinding);
+ }
+
+ toAssignable(node, isLHS = false) {
+ if (node != null && this.isObjectProperty(node)) {
+ const {
+ key,
+ value
+ } = node;
+
+ if (this.isPrivateName(key)) {
+ this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
+ }
+
+ this.toAssignable(value, isLHS);
+ } else {
+ super.toAssignable(node, isLHS);
+ }
+ }
+
+ toAssignableObjectExpressionProp(prop, isLast, isLHS) {
+ if (prop.kind === "get" || prop.kind === "set") {
+ this.raise(Errors.PatternHasAccessor, {
+ at: prop.key
+ });
+ } else if (prop.method) {
+ this.raise(Errors.PatternHasMethod, {
+ at: prop.key
+ });
+ } else {
+ super.toAssignableObjectExpressionProp(prop, isLast, isLHS);
+ }
+ }
+
+ finishCallExpression(unfinished, optional) {
+ const node = super.finishCallExpression(unfinished, optional);
+
+ if (node.callee.type === "Import") {
+ node.type = "ImportExpression";
+ node.source = node.arguments[0];
+
+ if (this.hasPlugin("importAssertions")) {
+ var _node$arguments$;
+
+ node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null;
+ }
+
+ delete node.arguments;
+ delete node.callee;
+ }
+
+ return node;
+ }
+
+ toReferencedArguments(node) {
+ if (node.type === "ImportExpression") {
+ return;
+ }
+
+ super.toReferencedArguments(node);
+ }
+
+ parseExport(unfinished) {
+ const node = super.parseExport(unfinished);
+
+ switch (node.type) {
+ case "ExportAllDeclaration":
+ node.exported = null;
+ break;
+
+ case "ExportNamedDeclaration":
+ if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
+ node.type = "ExportAllDeclaration";
+ node.exported = node.specifiers[0].exported;
+ delete node.specifiers;
+ }
+
+ break;
+ }
+
+ return node;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ const node = super.parseSubscript(base, startPos, startLoc, noCalls, state);
+
+ if (state.optionalChainMember) {
+ if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") {
+ node.type = node.type.substring(8);
+ }
+
+ if (state.stop) {
+ const chain = this.startNodeAtNode(node);
+ chain.expression = node;
+ return this.finishNode(chain, "ChainExpression");
+ }
+ } else if (node.type === "MemberExpression" || node.type === "CallExpression") {
+ node.optional = false;
+ }
+
+ return node;
+ }
+
+ hasPropertyAsPrivateName(node) {
+ if (node.type === "ChainExpression") {
+ node = node.expression;
+ }
+
+ return super.hasPropertyAsPrivateName(node);
+ }
+
+ isOptionalChain(node) {
+ return node.type === "ChainExpression";
+ }
+
+ isObjectProperty(node) {
+ return node.type === "Property" && node.kind === "init" && !node.method;
+ }
+
+ isObjectMethod(node) {
+ return node.method || node.kind === "get" || node.kind === "set";
+ }
+
+ finishNodeAt(node, type, endLoc) {
+ return toESTreeLocation(super.finishNodeAt(node, type, endLoc));
+ }
+
+ resetStartLocation(node, start, startLoc) {
+ super.resetStartLocation(node, start, startLoc);
+ toESTreeLocation(node);
+ }
+
+ resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
+ super.resetEndLocation(node, endLoc);
+ toESTreeLocation(node);
+ }
+
+});
+
+class TokContext {
+ constructor(token, preserveSpace) {
+ this.token = void 0;
+ this.preserveSpace = void 0;
+ this.token = token;
+ this.preserveSpace = !!preserveSpace;
+ }
+
+}
+const types = {
+ brace: new TokContext("{"),
+ j_oTag: new TokContext("... ", true)
+};
+{
+ types.template = new TokContext("`", true);
+}
+
+const beforeExpr = true;
+const startsExpr = true;
+const isLoop = true;
+const isAssign = true;
+const prefix = true;
+const postfix = true;
+class ExportedTokenType {
+ constructor(label, conf = {}) {
+ this.label = void 0;
+ this.keyword = void 0;
+ this.beforeExpr = void 0;
+ this.startsExpr = void 0;
+ this.rightAssociative = void 0;
+ this.isLoop = void 0;
+ this.isAssign = void 0;
+ this.prefix = void 0;
+ this.postfix = void 0;
+ this.binop = void 0;
+ this.label = label;
+ this.keyword = conf.keyword;
+ this.beforeExpr = !!conf.beforeExpr;
+ this.startsExpr = !!conf.startsExpr;
+ this.rightAssociative = !!conf.rightAssociative;
+ this.isLoop = !!conf.isLoop;
+ this.isAssign = !!conf.isAssign;
+ this.prefix = !!conf.prefix;
+ this.postfix = !!conf.postfix;
+ this.binop = conf.binop != null ? conf.binop : null;
+ {
+ this.updateContext = null;
+ }
+ }
+
+}
+const keywords$1 = new Map();
+
+function createKeyword(name, options = {}) {
+ options.keyword = name;
+ const token = createToken(name, options);
+ keywords$1.set(name, token);
+ return token;
+}
+
+function createBinop(name, binop) {
+ return createToken(name, {
+ beforeExpr,
+ binop
+ });
+}
+
+let tokenTypeCounter = -1;
+const tokenTypes = [];
+const tokenLabels = [];
+const tokenBinops = [];
+const tokenBeforeExprs = [];
+const tokenStartsExprs = [];
+const tokenPrefixes = [];
+
+function createToken(name, options = {}) {
+ var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
+
+ ++tokenTypeCounter;
+ tokenLabels.push(name);
+ tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
+ tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
+ tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
+ tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
+ tokenTypes.push(new ExportedTokenType(name, options));
+ return tokenTypeCounter;
+}
+
+function createKeywordLike(name, options = {}) {
+ var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;
+
+ ++tokenTypeCounter;
+ keywords$1.set(name, tokenTypeCounter);
+ tokenLabels.push(name);
+ tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);
+ tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);
+ tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);
+ tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false);
+ tokenTypes.push(new ExportedTokenType("name", options));
+ return tokenTypeCounter;
+}
+
+const tt = {
+ bracketL: createToken("[", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketHashL: createToken("#[", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketBarL: createToken("[|", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketR: createToken("]"),
+ bracketBarR: createToken("|]"),
+ braceL: createToken("{", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceBarL: createToken("{|", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceHashL: createToken("#{", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceR: createToken("}"),
+ braceBarR: createToken("|}"),
+ parenL: createToken("(", {
+ beforeExpr,
+ startsExpr
+ }),
+ parenR: createToken(")"),
+ comma: createToken(",", {
+ beforeExpr
+ }),
+ semi: createToken(";", {
+ beforeExpr
+ }),
+ colon: createToken(":", {
+ beforeExpr
+ }),
+ doubleColon: createToken("::", {
+ beforeExpr
+ }),
+ dot: createToken("."),
+ question: createToken("?", {
+ beforeExpr
+ }),
+ questionDot: createToken("?."),
+ arrow: createToken("=>", {
+ beforeExpr
+ }),
+ template: createToken("template"),
+ ellipsis: createToken("...", {
+ beforeExpr
+ }),
+ backQuote: createToken("`", {
+ startsExpr
+ }),
+ dollarBraceL: createToken("${", {
+ beforeExpr,
+ startsExpr
+ }),
+ templateTail: createToken("...`", {
+ startsExpr
+ }),
+ templateNonTail: createToken("...${", {
+ beforeExpr,
+ startsExpr
+ }),
+ at: createToken("@"),
+ hash: createToken("#", {
+ startsExpr
+ }),
+ interpreterDirective: createToken("#!..."),
+ eq: createToken("=", {
+ beforeExpr,
+ isAssign
+ }),
+ assign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ slashAssign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ xorAssign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ moduloAssign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ incDec: createToken("++/--", {
+ prefix,
+ postfix,
+ startsExpr
+ }),
+ bang: createToken("!", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ tilde: createToken("~", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ doubleCaret: createToken("^^", {
+ startsExpr
+ }),
+ doubleAt: createToken("@@", {
+ startsExpr
+ }),
+ pipeline: createBinop("|>", 0),
+ nullishCoalescing: createBinop("??", 1),
+ logicalOR: createBinop("||", 1),
+ logicalAND: createBinop("&&", 2),
+ bitwiseOR: createBinop("|", 3),
+ bitwiseXOR: createBinop("^", 4),
+ bitwiseAND: createBinop("&", 5),
+ equality: createBinop("==/!=/===/!==", 6),
+ lt: createBinop(">/<=/>=", 7),
+ gt: createBinop(">/<=/>=", 7),
+ relational: createBinop(">/<=/>=", 7),
+ bitShift: createBinop("<>>/>>>", 8),
+ bitShiftL: createBinop("<>>/>>>", 8),
+ bitShiftR: createBinop("<>>/>>>", 8),
+ plusMin: createToken("+/-", {
+ beforeExpr,
+ binop: 9,
+ prefix,
+ startsExpr
+ }),
+ modulo: createToken("%", {
+ binop: 10,
+ startsExpr
+ }),
+ star: createToken("*", {
+ binop: 10
+ }),
+ slash: createBinop("/", 10),
+ exponent: createToken("**", {
+ beforeExpr,
+ binop: 11,
+ rightAssociative: true
+ }),
+ _in: createKeyword("in", {
+ beforeExpr,
+ binop: 7
+ }),
+ _instanceof: createKeyword("instanceof", {
+ beforeExpr,
+ binop: 7
+ }),
+ _break: createKeyword("break"),
+ _case: createKeyword("case", {
+ beforeExpr
+ }),
+ _catch: createKeyword("catch"),
+ _continue: createKeyword("continue"),
+ _debugger: createKeyword("debugger"),
+ _default: createKeyword("default", {
+ beforeExpr
+ }),
+ _else: createKeyword("else", {
+ beforeExpr
+ }),
+ _finally: createKeyword("finally"),
+ _function: createKeyword("function", {
+ startsExpr
+ }),
+ _if: createKeyword("if"),
+ _return: createKeyword("return", {
+ beforeExpr
+ }),
+ _switch: createKeyword("switch"),
+ _throw: createKeyword("throw", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _try: createKeyword("try"),
+ _var: createKeyword("var"),
+ _const: createKeyword("const"),
+ _with: createKeyword("with"),
+ _new: createKeyword("new", {
+ beforeExpr,
+ startsExpr
+ }),
+ _this: createKeyword("this", {
+ startsExpr
+ }),
+ _super: createKeyword("super", {
+ startsExpr
+ }),
+ _class: createKeyword("class", {
+ startsExpr
+ }),
+ _extends: createKeyword("extends", {
+ beforeExpr
+ }),
+ _export: createKeyword("export"),
+ _import: createKeyword("import", {
+ startsExpr
+ }),
+ _null: createKeyword("null", {
+ startsExpr
+ }),
+ _true: createKeyword("true", {
+ startsExpr
+ }),
+ _false: createKeyword("false", {
+ startsExpr
+ }),
+ _typeof: createKeyword("typeof", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _void: createKeyword("void", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _delete: createKeyword("delete", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _do: createKeyword("do", {
+ isLoop,
+ beforeExpr
+ }),
+ _for: createKeyword("for", {
+ isLoop
+ }),
+ _while: createKeyword("while", {
+ isLoop
+ }),
+ _as: createKeywordLike("as", {
+ startsExpr
+ }),
+ _assert: createKeywordLike("assert", {
+ startsExpr
+ }),
+ _async: createKeywordLike("async", {
+ startsExpr
+ }),
+ _await: createKeywordLike("await", {
+ startsExpr
+ }),
+ _from: createKeywordLike("from", {
+ startsExpr
+ }),
+ _get: createKeywordLike("get", {
+ startsExpr
+ }),
+ _let: createKeywordLike("let", {
+ startsExpr
+ }),
+ _meta: createKeywordLike("meta", {
+ startsExpr
+ }),
+ _of: createKeywordLike("of", {
+ startsExpr
+ }),
+ _sent: createKeywordLike("sent", {
+ startsExpr
+ }),
+ _set: createKeywordLike("set", {
+ startsExpr
+ }),
+ _static: createKeywordLike("static", {
+ startsExpr
+ }),
+ _yield: createKeywordLike("yield", {
+ startsExpr
+ }),
+ _asserts: createKeywordLike("asserts", {
+ startsExpr
+ }),
+ _checks: createKeywordLike("checks", {
+ startsExpr
+ }),
+ _exports: createKeywordLike("exports", {
+ startsExpr
+ }),
+ _global: createKeywordLike("global", {
+ startsExpr
+ }),
+ _implements: createKeywordLike("implements", {
+ startsExpr
+ }),
+ _intrinsic: createKeywordLike("intrinsic", {
+ startsExpr
+ }),
+ _infer: createKeywordLike("infer", {
+ startsExpr
+ }),
+ _is: createKeywordLike("is", {
+ startsExpr
+ }),
+ _mixins: createKeywordLike("mixins", {
+ startsExpr
+ }),
+ _proto: createKeywordLike("proto", {
+ startsExpr
+ }),
+ _require: createKeywordLike("require", {
+ startsExpr
+ }),
+ _keyof: createKeywordLike("keyof", {
+ startsExpr
+ }),
+ _readonly: createKeywordLike("readonly", {
+ startsExpr
+ }),
+ _unique: createKeywordLike("unique", {
+ startsExpr
+ }),
+ _abstract: createKeywordLike("abstract", {
+ startsExpr
+ }),
+ _declare: createKeywordLike("declare", {
+ startsExpr
+ }),
+ _enum: createKeywordLike("enum", {
+ startsExpr
+ }),
+ _module: createKeywordLike("module", {
+ startsExpr
+ }),
+ _namespace: createKeywordLike("namespace", {
+ startsExpr
+ }),
+ _interface: createKeywordLike("interface", {
+ startsExpr
+ }),
+ _type: createKeywordLike("type", {
+ startsExpr
+ }),
+ _opaque: createKeywordLike("opaque", {
+ startsExpr
+ }),
+ name: createToken("name", {
+ startsExpr
+ }),
+ string: createToken("string", {
+ startsExpr
+ }),
+ num: createToken("num", {
+ startsExpr
+ }),
+ bigint: createToken("bigint", {
+ startsExpr
+ }),
+ decimal: createToken("decimal", {
+ startsExpr
+ }),
+ regexp: createToken("regexp", {
+ startsExpr
+ }),
+ privateName: createToken("#name", {
+ startsExpr
+ }),
+ eof: createToken("eof"),
+ jsxName: createToken("jsxName"),
+ jsxText: createToken("jsxText", {
+ beforeExpr: true
+ }),
+ jsxTagStart: createToken("jsxTagStart", {
+ startsExpr: true
+ }),
+ jsxTagEnd: createToken("jsxTagEnd"),
+ placeholder: createToken("%%", {
+ startsExpr: true
+ })
+};
+function tokenIsIdentifier(token) {
+ return token >= 93 && token <= 128;
+}
+function tokenKeywordOrIdentifierIsKeyword(token) {
+ return token <= 92;
+}
+function tokenIsKeywordOrIdentifier(token) {
+ return token >= 58 && token <= 128;
+}
+function tokenIsLiteralPropertyName(token) {
+ return token >= 58 && token <= 132;
+}
+function tokenComesBeforeExpression(token) {
+ return tokenBeforeExprs[token];
+}
+function tokenCanStartExpression(token) {
+ return tokenStartsExprs[token];
+}
+function tokenIsAssignment(token) {
+ return token >= 29 && token <= 33;
+}
+function tokenIsFlowInterfaceOrTypeOrOpaque(token) {
+ return token >= 125 && token <= 127;
+}
+function tokenIsLoop(token) {
+ return token >= 90 && token <= 92;
+}
+function tokenIsKeyword(token) {
+ return token >= 58 && token <= 92;
+}
+function tokenIsOperator(token) {
+ return token >= 39 && token <= 59;
+}
+function tokenIsPostfix(token) {
+ return token === 34;
+}
+function tokenIsPrefix(token) {
+ return tokenPrefixes[token];
+}
+function tokenIsTSTypeOperator(token) {
+ return token >= 117 && token <= 119;
+}
+function tokenIsTSDeclarationStart(token) {
+ return token >= 120 && token <= 126;
+}
+function tokenLabelName(token) {
+ return tokenLabels[token];
+}
+function tokenOperatorPrecedence(token) {
+ return tokenBinops[token];
+}
+function tokenIsRightAssociative(token) {
+ return token === 57;
+}
+function tokenIsTemplate(token) {
+ return token >= 24 && token <= 25;
+}
+function getExportedToken(token) {
+ return tokenTypes[token];
+}
+{
+ tokenTypes[8].updateContext = context => {
+ context.pop();
+ };
+
+ tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => {
+ context.push(types.brace);
+ };
+
+ tokenTypes[22].updateContext = context => {
+ if (context[context.length - 1] === types.template) {
+ context.pop();
+ } else {
+ context.push(types.template);
+ }
+ };
+
+ tokenTypes[138].updateContext = context => {
+ context.push(types.j_expr, types.j_oTag);
+ };
+}
+
+let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
+const astralIdentifierStartCodes = [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, 68, 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, 349, 41, 7, 1, 79, 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, 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, 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, 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, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 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, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 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, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 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, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
+const astralIdentifierCodes = [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, 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, 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, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 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, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+
+function isInAstralSet(code, set) {
+ let pos = 0x10000;
+
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+
+ return false;
+}
+
+function isIdentifierStart(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet(code, astralIdentifierStartCodes);
+}
+function isIdentifierChar(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
+}
+
+const reservedWords = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+};
+const keywords = new Set(reservedWords.keyword);
+const reservedWordsStrictSet = new Set(reservedWords.strict);
+const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
+function isReservedWord(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+}
+function isStrictReservedWord(word, inModule) {
+ return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
+}
+function isStrictBindOnlyReservedWord(word) {
+ return reservedWordsStrictBindSet.has(word);
+}
+function isStrictBindReservedWord(word, inModule) {
+ return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
+}
+function isKeyword(word) {
+ return keywords.has(word);
+}
+
+function isIteratorStart(current, next, next2) {
+ return current === 64 && next === 64 && isIdentifierStart(next2);
+}
+const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]);
+function canBeReservedWord(word) {
+ return reservedWordLikeSet.has(word);
+}
+
+const SCOPE_OTHER = 0b000000000,
+ SCOPE_PROGRAM = 0b000000001,
+ SCOPE_FUNCTION = 0b000000010,
+ SCOPE_ARROW = 0b000000100,
+ SCOPE_SIMPLE_CATCH = 0b000001000,
+ SCOPE_SUPER = 0b000010000,
+ SCOPE_DIRECT_SUPER = 0b000100000,
+ SCOPE_CLASS = 0b001000000,
+ SCOPE_STATIC_BLOCK = 0b010000000,
+ SCOPE_TS_MODULE = 0b100000000,
+ SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;
+const BIND_KIND_VALUE = 0b000000000001,
+ BIND_KIND_TYPE = 0b000000000010,
+ BIND_SCOPE_VAR = 0b000000000100,
+ BIND_SCOPE_LEXICAL = 0b000000001000,
+ BIND_SCOPE_FUNCTION = 0b000000010000,
+ BIND_FLAGS_NONE = 0b000001000000,
+ BIND_FLAGS_CLASS = 0b000010000000,
+ BIND_FLAGS_TS_ENUM = 0b000100000000,
+ BIND_FLAGS_TS_CONST_ENUM = 0b001000000000,
+ BIND_FLAGS_TS_EXPORT_ONLY = 0b010000000000,
+ BIND_FLAGS_FLOW_DECLARE_FN = 0b100000000000;
+const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS,
+ BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0,
+ BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0,
+ BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0,
+ BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS,
+ BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0,
+ BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,
+ BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,
+ BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE,
+ BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE,
+ BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,
+ BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,
+ BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;
+const CLASS_ELEMENT_FLAG_STATIC = 0b100,
+ CLASS_ELEMENT_KIND_GETTER = 0b010,
+ CLASS_ELEMENT_KIND_SETTER = 0b001,
+ CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;
+const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,
+ CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,
+ CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,
+ CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,
+ CLASS_ELEMENT_OTHER = 0;
+
+class BaseParser {
+ constructor() {
+ this.sawUnambiguousESM = false;
+ this.ambiguousScriptDifferentAst = false;
+ }
+
+ hasPlugin(pluginConfig) {
+ if (typeof pluginConfig === "string") {
+ return this.plugins.has(pluginConfig);
+ } else {
+ const [pluginName, pluginOptions] = pluginConfig;
+
+ if (!this.hasPlugin(pluginName)) {
+ return false;
+ }
+
+ const actualOptions = this.plugins.get(pluginName);
+
+ for (const key of Object.keys(pluginOptions)) {
+ if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+
+ getPluginOption(plugin, name) {
+ var _this$plugins$get;
+
+ return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name];
+ }
+
+}
+
+function setTrailingComments(node, comments) {
+ if (node.trailingComments === undefined) {
+ node.trailingComments = comments;
+ } else {
+ node.trailingComments.unshift(...comments);
+ }
+}
+
+function setLeadingComments(node, comments) {
+ if (node.leadingComments === undefined) {
+ node.leadingComments = comments;
+ } else {
+ node.leadingComments.unshift(...comments);
+ }
+}
+
+function setInnerComments(node, comments) {
+ if (node.innerComments === undefined) {
+ node.innerComments = comments;
+ } else {
+ node.innerComments.unshift(...comments);
+ }
+}
+
+function adjustInnerComments(node, elements, commentWS) {
+ let lastElement = null;
+ let i = elements.length;
+
+ while (lastElement === null && i > 0) {
+ lastElement = elements[--i];
+ }
+
+ if (lastElement === null || lastElement.start > commentWS.start) {
+ setInnerComments(node, commentWS.comments);
+ } else {
+ setTrailingComments(lastElement, commentWS.comments);
+ }
+}
+
+class CommentsParser extends BaseParser {
+ addComment(comment) {
+ if (this.filename) comment.loc.filename = this.filename;
+ this.state.comments.push(comment);
+ }
+
+ processComment(node) {
+ const {
+ commentStack
+ } = this.state;
+ const commentStackLength = commentStack.length;
+ if (commentStackLength === 0) return;
+ let i = commentStackLength - 1;
+ const lastCommentWS = commentStack[i];
+
+ if (lastCommentWS.start === node.end) {
+ lastCommentWS.leadingNode = node;
+ i--;
+ }
+
+ const {
+ start: nodeStart
+ } = node;
+
+ for (; i >= 0; i--) {
+ const commentWS = commentStack[i];
+ const commentEnd = commentWS.end;
+
+ if (commentEnd > nodeStart) {
+ commentWS.containingNode = node;
+ this.finalizeComment(commentWS);
+ commentStack.splice(i, 1);
+ } else {
+ if (commentEnd === nodeStart) {
+ commentWS.trailingNode = node;
+ }
+
+ break;
+ }
+ }
+ }
+
+ finalizeComment(commentWS) {
+ const {
+ comments
+ } = commentWS;
+
+ if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {
+ if (commentWS.leadingNode !== null) {
+ setTrailingComments(commentWS.leadingNode, comments);
+ }
+
+ if (commentWS.trailingNode !== null) {
+ setLeadingComments(commentWS.trailingNode, comments);
+ }
+ } else {
+ const {
+ containingNode: node,
+ start: commentStart
+ } = commentWS;
+
+ if (this.input.charCodeAt(commentStart - 1) === 44) {
+ switch (node.type) {
+ case "ObjectExpression":
+ case "ObjectPattern":
+ case "RecordExpression":
+ adjustInnerComments(node, node.properties, commentWS);
+ break;
+
+ case "CallExpression":
+ case "OptionalCallExpression":
+ adjustInnerComments(node, node.arguments, commentWS);
+ break;
+
+ case "FunctionDeclaration":
+ case "FunctionExpression":
+ case "ArrowFunctionExpression":
+ case "ObjectMethod":
+ case "ClassMethod":
+ case "ClassPrivateMethod":
+ adjustInnerComments(node, node.params, commentWS);
+ break;
+
+ case "ArrayExpression":
+ case "ArrayPattern":
+ case "TupleExpression":
+ adjustInnerComments(node, node.elements, commentWS);
+ break;
+
+ case "ExportNamedDeclaration":
+ case "ImportDeclaration":
+ adjustInnerComments(node, node.specifiers, commentWS);
+ break;
+
+ default:
+ {
+ setInnerComments(node, comments);
+ }
+ }
+ } else {
+ setInnerComments(node, comments);
+ }
+ }
+ }
+
+ finalizeRemainingComments() {
+ const {
+ commentStack
+ } = this.state;
+
+ for (let i = commentStack.length - 1; i >= 0; i--) {
+ this.finalizeComment(commentStack[i]);
+ }
+
+ this.state.commentStack = [];
+ }
+
+ resetPreviousNodeTrailingComments(node) {
+ const {
+ commentStack
+ } = this.state;
+ const {
+ length
+ } = commentStack;
+ if (length === 0) return;
+ const commentWS = commentStack[length - 1];
+
+ if (commentWS.leadingNode === node) {
+ commentWS.leadingNode = null;
+ }
+ }
+
+ takeSurroundingComments(node, start, end) {
+ const {
+ commentStack
+ } = this.state;
+ const commentStackLength = commentStack.length;
+ if (commentStackLength === 0) return;
+ let i = commentStackLength - 1;
+
+ for (; i >= 0; i--) {
+ const commentWS = commentStack[i];
+ const commentEnd = commentWS.end;
+ const commentStart = commentWS.start;
+
+ if (commentStart === end) {
+ commentWS.leadingNode = node;
+ } else if (commentEnd === start) {
+ commentWS.trailingNode = node;
+ } else if (commentEnd < start) {
+ break;
+ }
+ }
+ }
+
+}
+
+const lineBreak = /\r\n?|[\n\u2028\u2029]/;
+const lineBreakG = new RegExp(lineBreak.source, "g");
+function isNewLine(code) {
+ switch (code) {
+ case 10:
+ case 13:
+ case 8232:
+ case 8233:
+ return true;
+
+ default:
+ return false;
+ }
+}
+const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
+const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y;
+const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y");
+function isWhitespace(code) {
+ switch (code) {
+ case 0x0009:
+ case 0x000b:
+ case 0x000c:
+ case 32:
+ case 160:
+ case 5760:
+ case 0x2000:
+ case 0x2001:
+ case 0x2002:
+ case 0x2003:
+ case 0x2004:
+ case 0x2005:
+ case 0x2006:
+ case 0x2007:
+ case 0x2008:
+ case 0x2009:
+ case 0x200a:
+ case 0x202f:
+ case 0x205f:
+ case 0x3000:
+ case 0xfeff:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+class State {
+ constructor() {
+ this.strict = void 0;
+ this.curLine = void 0;
+ this.lineStart = void 0;
+ this.startLoc = void 0;
+ this.endLoc = void 0;
+ this.errors = [];
+ this.potentialArrowAt = -1;
+ this.noArrowAt = [];
+ this.noArrowParamsConversionAt = [];
+ this.maybeInArrowParameters = false;
+ this.inType = false;
+ this.noAnonFunctionType = false;
+ this.hasFlowComment = false;
+ this.isAmbientContext = false;
+ this.inAbstractClass = false;
+ this.inDisallowConditionalTypesContext = false;
+ this.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+ this.soloAwait = false;
+ this.inFSharpPipelineDirectBody = false;
+ this.labels = [];
+ this.decoratorStack = [[]];
+ this.comments = [];
+ this.commentStack = [];
+ this.pos = 0;
+ this.type = 135;
+ this.value = null;
+ this.start = 0;
+ this.end = 0;
+ this.lastTokEndLoc = null;
+ this.lastTokStartLoc = null;
+ this.lastTokStart = 0;
+ this.context = [types.brace];
+ this.canStartJSXElement = true;
+ this.containsEsc = false;
+ this.strictErrors = new Map();
+ this.tokensLength = 0;
+ }
+
+ init({
+ strictMode,
+ sourceType,
+ startLine,
+ startColumn
+ }) {
+ this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module";
+ this.curLine = startLine;
+ this.lineStart = -startColumn;
+ this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);
+ }
+
+ curPosition() {
+ return new Position(this.curLine, this.pos - this.lineStart, this.pos);
+ }
+
+ clone(skipArrays) {
+ const state = new State();
+ const keys = Object.keys(this);
+
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+ let val = this[key];
+
+ if (!skipArrays && Array.isArray(val)) {
+ val = val.slice();
+ }
+
+ state[key] = val;
+ }
+
+ return state;
+ }
+
+}
+
+var _isDigit = function isDigit(code) {
+ return code >= 48 && code <= 57;
+};
+
+const forbiddenNumericSeparatorSiblings = {
+ decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
+ hex: new Set([46, 88, 95, 120])
+};
+const isAllowedNumericSeparatorSibling = {
+ bin: ch => ch === 48 || ch === 49,
+ oct: ch => ch >= 48 && ch <= 55,
+ dec: ch => ch >= 48 && ch <= 57,
+ hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
+};
+function readStringContents(type, input, pos, lineStart, curLine, errors) {
+ const initialPos = pos;
+ const initialLineStart = lineStart;
+ const initialCurLine = curLine;
+ let out = "";
+ let containsInvalid = false;
+ let chunkStart = pos;
+ const {
+ length
+ } = input;
+
+ for (;;) {
+ if (pos >= length) {
+ errors.unterminated(initialPos, initialLineStart, initialCurLine);
+ out += input.slice(chunkStart, pos);
+ break;
+ }
+
+ const ch = input.charCodeAt(pos);
+
+ if (isStringEnd(type, ch, input, pos)) {
+ out += input.slice(chunkStart, pos);
+ break;
+ }
+
+ if (ch === 92) {
+ out += input.slice(chunkStart, pos);
+ let escaped;
+ ({
+ ch: escaped,
+ pos,
+ lineStart,
+ curLine
+ } = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors));
+
+ if (escaped === null) {
+ containsInvalid = true;
+ } else {
+ out += escaped;
+ }
+
+ chunkStart = pos;
+ } else if (ch === 8232 || ch === 8233) {
+ ++pos;
+ ++curLine;
+ lineStart = pos;
+ } else if (ch === 10 || ch === 13) {
+ if (type === "template") {
+ out += input.slice(chunkStart, pos) + "\n";
+ ++pos;
+
+ if (ch === 13 && input.charCodeAt(pos) === 10) {
+ ++pos;
+ }
+
+ ++curLine;
+ chunkStart = lineStart = pos;
+ } else {
+ errors.unterminated(initialPos, initialLineStart, initialCurLine);
+ }
+ } else {
+ ++pos;
+ }
+ }
+
+ return {
+ pos,
+ str: out,
+ containsInvalid,
+ lineStart,
+ curLine
+ };
+}
+
+function isStringEnd(type, ch, input, pos) {
+ if (type === "template") {
+ return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
+ }
+
+ return ch === (type === "double" ? 34 : 39);
+}
+
+function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
+ const throwOnInvalid = !inTemplate;
+ pos++;
+
+ const res = ch => ({
+ pos,
+ ch,
+ lineStart,
+ curLine
+ });
+
+ const ch = input.charCodeAt(pos++);
+
+ switch (ch) {
+ case 110:
+ return res("\n");
+
+ case 114:
+ return res("\r");
+
+ case 120:
+ {
+ let code;
+ ({
+ code,
+ pos
+ } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));
+ return res(code === null ? null : String.fromCharCode(code));
+ }
+
+ case 117:
+ {
+ let code;
+ ({
+ code,
+ pos
+ } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));
+ return res(code === null ? null : String.fromCodePoint(code));
+ }
+
+ case 116:
+ return res("\t");
+
+ case 98:
+ return res("\b");
+
+ case 118:
+ return res("\u000b");
+
+ case 102:
+ return res("\f");
+
+ case 13:
+ if (input.charCodeAt(pos) === 10) {
+ ++pos;
+ }
+
+ case 10:
+ lineStart = pos;
+ ++curLine;
+
+ case 8232:
+ case 8233:
+ return res("");
+
+ case 56:
+ case 57:
+ if (inTemplate) {
+ return res(null);
+ } else {
+ errors.strictNumericEscape(pos - 1, lineStart, curLine);
+ }
+
+ default:
+ if (ch >= 48 && ch <= 55) {
+ const startPos = pos - 1;
+ const match = input.slice(startPos, pos + 2).match(/^[0-7]+/);
+ let octalStr = match[0];
+ let octal = parseInt(octalStr, 8);
+
+ if (octal > 255) {
+ octalStr = octalStr.slice(0, -1);
+ octal = parseInt(octalStr, 8);
+ }
+
+ pos += octalStr.length - 1;
+ const next = input.charCodeAt(pos);
+
+ if (octalStr !== "0" || next === 56 || next === 57) {
+ if (inTemplate) {
+ return res(null);
+ } else {
+ errors.strictNumericEscape(startPos, lineStart, curLine);
+ }
+ }
+
+ return res(String.fromCharCode(octal));
+ }
+
+ return res(String.fromCharCode(ch));
+ }
+}
+
+function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {
+ const initialPos = pos;
+ let n;
+ ({
+ n,
+ pos
+ } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors));
+
+ if (n === null) {
+ if (throwOnInvalid) {
+ errors.invalidEscapeSequence(initialPos, lineStart, curLine);
+ } else {
+ pos = initialPos - 1;
+ }
+ }
+
+ return {
+ code: n,
+ pos
+ };
+}
+
+function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors) {
+ const start = pos;
+ const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
+ const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
+ let invalid = false;
+ let total = 0;
+
+ for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
+ const code = input.charCodeAt(pos);
+ let val;
+
+ if (code === 95 && allowNumSeparator !== "bail") {
+ const prev = input.charCodeAt(pos - 1);
+ const next = input.charCodeAt(pos + 1);
+
+ if (!allowNumSeparator) {
+ errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
+ } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
+ errors.unexpectedNumericSeparator(pos, lineStart, curLine);
+ }
+
+ ++pos;
+ continue;
+ }
+
+ if (code >= 97) {
+ val = code - 97 + 10;
+ } else if (code >= 65) {
+ val = code - 65 + 10;
+ } else if (_isDigit(code)) {
+ val = code - 48;
+ } else {
+ val = Infinity;
+ }
+
+ if (val >= radix) {
+ if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {
+ val = 0;
+ } else if (forceLen) {
+ val = 0;
+ invalid = true;
+ } else {
+ break;
+ }
+ }
+
+ ++pos;
+ total = total * radix + val;
+ }
+
+ if (pos === start || len != null && pos - start !== len || invalid) {
+ return {
+ n: null,
+ pos
+ };
+ }
+
+ return {
+ n: total,
+ pos
+ };
+}
+function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
+ const ch = input.charCodeAt(pos);
+ let code;
+
+ if (ch === 123) {
+ ++pos;
+ ({
+ code,
+ pos
+ } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
+ ++pos;
+
+ if (code !== null && code > 0x10ffff) {
+ if (throwOnInvalid) {
+ errors.invalidCodePoint(pos, lineStart, curLine);
+ } else {
+ return {
+ code: null,
+ pos
+ };
+ }
+ }
+ } else {
+ ({
+ code,
+ pos
+ } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
+ }
+
+ return {
+ code,
+ pos
+ };
+}
+
+const _excluded = ["at"],
+ _excluded2 = ["at"];
+
+function buildPosition(pos, lineStart, curLine) {
+ return new Position(curLine, pos - lineStart, pos);
+}
+
+const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]);
+class Token {
+ constructor(state) {
+ this.type = state.type;
+ this.value = state.value;
+ this.start = state.start;
+ this.end = state.end;
+ this.loc = new SourceLocation(state.startLoc, state.endLoc);
+ }
+
+}
+class Tokenizer extends CommentsParser {
+ constructor(options, input) {
+ super();
+ this.isLookahead = void 0;
+ this.tokens = [];
+ this.errorHandlers_readInt = {
+ invalidDigit: (pos, lineStart, curLine, radix) => {
+ if (!this.options.errorRecovery) return false;
+ this.raise(Errors.InvalidDigit, {
+ at: buildPosition(pos, lineStart, curLine),
+ radix
+ });
+ return true;
+ },
+ numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),
+ unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator)
+ };
+ this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, {
+ invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),
+ invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint)
+ });
+ this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, {
+ strictNumericEscape: (pos, lineStart, curLine) => {
+ this.recordStrictModeErrors(Errors.StrictNumericEscape, {
+ at: buildPosition(pos, lineStart, curLine)
+ });
+ },
+ unterminated: (pos, lineStart, curLine) => {
+ throw this.raise(Errors.UnterminatedString, {
+ at: buildPosition(pos - 1, lineStart, curLine)
+ });
+ }
+ });
+ this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, {
+ strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),
+ unterminated: (pos, lineStart, curLine) => {
+ throw this.raise(Errors.UnterminatedTemplate, {
+ at: buildPosition(pos, lineStart, curLine)
+ });
+ }
+ });
+ this.state = new State();
+ this.state.init(options);
+ this.input = input;
+ this.length = input.length;
+ this.isLookahead = false;
+ }
+
+ pushToken(token) {
+ this.tokens.length = this.state.tokensLength;
+ this.tokens.push(token);
+ ++this.state.tokensLength;
+ }
+
+ next() {
+ this.checkKeywordEscapes();
+
+ if (this.options.tokens) {
+ this.pushToken(new Token(this.state));
+ }
+
+ this.state.lastTokStart = this.state.start;
+ this.state.lastTokEndLoc = this.state.endLoc;
+ this.state.lastTokStartLoc = this.state.startLoc;
+ this.nextToken();
+ }
+
+ eat(type) {
+ if (this.match(type)) {
+ this.next();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ match(type) {
+ return this.state.type === type;
+ }
+
+ createLookaheadState(state) {
+ return {
+ pos: state.pos,
+ value: null,
+ type: state.type,
+ start: state.start,
+ end: state.end,
+ context: [this.curContext()],
+ inType: state.inType,
+ startLoc: state.startLoc,
+ lastTokEndLoc: state.lastTokEndLoc,
+ curLine: state.curLine,
+ lineStart: state.lineStart,
+ curPosition: state.curPosition
+ };
+ }
+
+ lookahead() {
+ const old = this.state;
+ this.state = this.createLookaheadState(old);
+ this.isLookahead = true;
+ this.nextToken();
+ this.isLookahead = false;
+ const curr = this.state;
+ this.state = old;
+ return curr;
+ }
+
+ nextTokenStart() {
+ return this.nextTokenStartSince(this.state.pos);
+ }
+
+ nextTokenStartSince(pos) {
+ skipWhiteSpace.lastIndex = pos;
+ return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;
+ }
+
+ lookaheadCharCode() {
+ return this.input.charCodeAt(this.nextTokenStart());
+ }
+
+ codePointAtPos(pos) {
+ let cp = this.input.charCodeAt(pos);
+
+ if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {
+ const trail = this.input.charCodeAt(pos);
+
+ if ((trail & 0xfc00) === 0xdc00) {
+ cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
+ }
+ }
+
+ return cp;
+ }
+
+ setStrict(strict) {
+ this.state.strict = strict;
+
+ if (strict) {
+ this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, {
+ at
+ }));
+ this.state.strictErrors.clear();
+ }
+ }
+
+ curContext() {
+ return this.state.context[this.state.context.length - 1];
+ }
+
+ nextToken() {
+ this.skipSpace();
+ this.state.start = this.state.pos;
+ if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
+
+ if (this.state.pos >= this.length) {
+ this.finishToken(135);
+ return;
+ }
+
+ this.getTokenFromCode(this.codePointAtPos(this.state.pos));
+ }
+
+ skipBlockComment() {
+ let startLoc;
+ if (!this.isLookahead) startLoc = this.state.curPosition();
+ const start = this.state.pos;
+ const end = this.input.indexOf("*/", start + 2);
+
+ if (end === -1) {
+ throw this.raise(Errors.UnterminatedComment, {
+ at: this.state.curPosition()
+ });
+ }
+
+ this.state.pos = end + 2;
+ lineBreakG.lastIndex = start + 2;
+
+ while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {
+ ++this.state.curLine;
+ this.state.lineStart = lineBreakG.lastIndex;
+ }
+
+ if (this.isLookahead) return;
+ const comment = {
+ type: "CommentBlock",
+ value: this.input.slice(start + 2, end),
+ start,
+ end: end + 2,
+ loc: new SourceLocation(startLoc, this.state.curPosition())
+ };
+ if (this.options.tokens) this.pushToken(comment);
+ return comment;
+ }
+
+ skipLineComment(startSkip) {
+ const start = this.state.pos;
+ let startLoc;
+ if (!this.isLookahead) startLoc = this.state.curPosition();
+ let ch = this.input.charCodeAt(this.state.pos += startSkip);
+
+ if (this.state.pos < this.length) {
+ while (!isNewLine(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+ }
+
+ if (this.isLookahead) return;
+ const end = this.state.pos;
+ const value = this.input.slice(start + startSkip, end);
+ const comment = {
+ type: "CommentLine",
+ value,
+ start,
+ end,
+ loc: new SourceLocation(startLoc, this.state.curPosition())
+ };
+ if (this.options.tokens) this.pushToken(comment);
+ return comment;
+ }
+
+ skipSpace() {
+ const spaceStart = this.state.pos;
+ const comments = [];
+
+ loop: while (this.state.pos < this.length) {
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ switch (ch) {
+ case 32:
+ case 160:
+ case 9:
+ ++this.state.pos;
+ break;
+
+ case 13:
+ if (this.input.charCodeAt(this.state.pos + 1) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ case 8232:
+ case 8233:
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ break;
+
+ case 47:
+ switch (this.input.charCodeAt(this.state.pos + 1)) {
+ case 42:
+ {
+ const comment = this.skipBlockComment();
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+
+ break;
+ }
+
+ case 47:
+ {
+ const comment = this.skipLineComment(2);
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+
+ break;
+ }
+
+ default:
+ break loop;
+ }
+
+ break;
+
+ default:
+ if (isWhitespace(ch)) {
+ ++this.state.pos;
+ } else if (ch === 45 && !this.inModule) {
+ const pos = this.state.pos;
+
+ if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
+ const comment = this.skipLineComment(3);
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+ } else {
+ break loop;
+ }
+ } else if (ch === 60 && !this.inModule) {
+ const pos = this.state.pos;
+
+ if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) {
+ const comment = this.skipLineComment(4);
+
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+ } else {
+ break loop;
+ }
+ } else {
+ break loop;
+ }
+
+ }
+ }
+
+ if (comments.length > 0) {
+ const end = this.state.pos;
+ const commentWhitespace = {
+ start: spaceStart,
+ end,
+ comments,
+ leadingNode: null,
+ trailingNode: null,
+ containingNode: null
+ };
+ this.state.commentStack.push(commentWhitespace);
+ }
+ }
+
+ finishToken(type, val) {
+ this.state.end = this.state.pos;
+ this.state.endLoc = this.state.curPosition();
+ const prevType = this.state.type;
+ this.state.type = type;
+ this.state.value = val;
+
+ if (!this.isLookahead) {
+ this.updateContext(prevType);
+ }
+ }
+
+ replaceToken(type) {
+ this.state.type = type;
+ this.updateContext();
+ }
+
+ readToken_numberSign() {
+ if (this.state.pos === 0 && this.readToken_interpreter()) {
+ return;
+ }
+
+ const nextPos = this.state.pos + 1;
+ const next = this.codePointAtPos(nextPos);
+
+ if (next >= 48 && next <= 57) {
+ throw this.raise(Errors.UnexpectedDigitAfterHash, {
+ at: this.state.curPosition()
+ });
+ }
+
+ if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) {
+ this.expectPlugin("recordAndTuple");
+
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "hash") {
+ throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, {
+ at: this.state.curPosition()
+ });
+ }
+
+ this.state.pos += 2;
+
+ if (next === 123) {
+ this.finishToken(7);
+ } else {
+ this.finishToken(1);
+ }
+ } else if (isIdentifierStart(next)) {
+ ++this.state.pos;
+ this.finishToken(134, this.readWord1(next));
+ } else if (next === 92) {
+ ++this.state.pos;
+ this.finishToken(134, this.readWord1());
+ } else {
+ this.finishOp(27, 1);
+ }
+ }
+
+ readToken_dot() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next >= 48 && next <= 57) {
+ this.readNumber(true);
+ return;
+ }
+
+ if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
+ this.state.pos += 3;
+ this.finishToken(21);
+ } else {
+ ++this.state.pos;
+ this.finishToken(16);
+ }
+ }
+
+ readToken_slash() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(31, 2);
+ } else {
+ this.finishOp(56, 1);
+ }
+ }
+
+ readToken_interpreter() {
+ if (this.state.pos !== 0 || this.length < 2) return false;
+ let ch = this.input.charCodeAt(this.state.pos + 1);
+ if (ch !== 33) return false;
+ const start = this.state.pos;
+ this.state.pos += 1;
+
+ while (!isNewLine(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+
+ const value = this.input.slice(start + 2, this.state.pos);
+ this.finishToken(28, value);
+ return true;
+ }
+
+ readToken_mult_modulo(code) {
+ let type = code === 42 ? 55 : 54;
+ let width = 1;
+ let next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 42 && next === 42) {
+ width++;
+ next = this.input.charCodeAt(this.state.pos + 2);
+ type = 57;
+ }
+
+ if (next === 61 && !this.state.inType) {
+ width++;
+ type = code === 37 ? 33 : 30;
+ }
+
+ this.finishOp(type, width);
+ }
+
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === code) {
+ if (this.input.charCodeAt(this.state.pos + 2) === 61) {
+ this.finishOp(30, 3);
+ } else {
+ this.finishOp(code === 124 ? 41 : 42, 2);
+ }
+
+ return;
+ }
+
+ if (code === 124) {
+ if (next === 62) {
+ this.finishOp(39, 2);
+ return;
+ }
+
+ if (this.hasPlugin("recordAndTuple") && next === 125) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, {
+ at: this.state.curPosition()
+ });
+ }
+
+ this.state.pos += 2;
+ this.finishToken(9);
+ return;
+ }
+
+ if (this.hasPlugin("recordAndTuple") && next === 93) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, {
+ at: this.state.curPosition()
+ });
+ }
+
+ this.state.pos += 2;
+ this.finishToken(4);
+ return;
+ }
+ }
+
+ if (next === 61) {
+ this.finishOp(30, 2);
+ return;
+ }
+
+ this.finishOp(code === 124 ? 43 : 45, 1);
+ }
+
+ readToken_caret() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61 && !this.state.inType) {
+ this.finishOp(32, 2);
+ } else if (next === 94 && this.hasPlugin(["pipelineOperator", {
+ proposal: "hack",
+ topicToken: "^^"
+ }])) {
+ this.finishOp(37, 2);
+ const lookaheadCh = this.input.codePointAt(this.state.pos);
+
+ if (lookaheadCh === 94) {
+ throw this.unexpected();
+ }
+ } else {
+ this.finishOp(44, 1);
+ }
+ }
+
+ readToken_atSign() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 64 && this.hasPlugin(["pipelineOperator", {
+ proposal: "hack",
+ topicToken: "@@"
+ }])) {
+ this.finishOp(38, 2);
+ } else {
+ this.finishOp(26, 1);
+ }
+ }
+
+ readToken_plus_min(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === code) {
+ this.finishOp(34, 2);
+ return;
+ }
+
+ if (next === 61) {
+ this.finishOp(30, 2);
+ } else {
+ this.finishOp(53, 1);
+ }
+ }
+
+ readToken_lt() {
+ const {
+ pos
+ } = this.state;
+ const next = this.input.charCodeAt(pos + 1);
+
+ if (next === 60) {
+ if (this.input.charCodeAt(pos + 2) === 61) {
+ this.finishOp(30, 3);
+ return;
+ }
+
+ this.finishOp(51, 2);
+ return;
+ }
+
+ if (next === 61) {
+ this.finishOp(49, 2);
+ return;
+ }
+
+ this.finishOp(47, 1);
+ }
+
+ readToken_gt() {
+ const {
+ pos
+ } = this.state;
+ const next = this.input.charCodeAt(pos + 1);
+
+ if (next === 62) {
+ const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2;
+
+ if (this.input.charCodeAt(pos + size) === 61) {
+ this.finishOp(30, size + 1);
+ return;
+ }
+
+ this.finishOp(52, size);
+ return;
+ }
+
+ if (next === 61) {
+ this.finishOp(49, 2);
+ return;
+ }
+
+ this.finishOp(48, 1);
+ }
+
+ readToken_eq_excl(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
+ return;
+ }
+
+ if (code === 61 && next === 62) {
+ this.state.pos += 2;
+ this.finishToken(19);
+ return;
+ }
+
+ this.finishOp(code === 61 ? 29 : 35, 1);
+ }
+
+ readToken_question() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ const next2 = this.input.charCodeAt(this.state.pos + 2);
+
+ if (next === 63) {
+ if (next2 === 61) {
+ this.finishOp(30, 3);
+ } else {
+ this.finishOp(40, 2);
+ }
+ } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
+ this.state.pos += 2;
+ this.finishToken(18);
+ } else {
+ ++this.state.pos;
+ this.finishToken(17);
+ }
+ }
+
+ getTokenFromCode(code) {
+ switch (code) {
+ case 46:
+ this.readToken_dot();
+ return;
+
+ case 40:
+ ++this.state.pos;
+ this.finishToken(10);
+ return;
+
+ case 41:
+ ++this.state.pos;
+ this.finishToken(11);
+ return;
+
+ case 59:
+ ++this.state.pos;
+ this.finishToken(13);
+ return;
+
+ case 44:
+ ++this.state.pos;
+ this.finishToken(12);
+ return;
+
+ case 91:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, {
+ at: this.state.curPosition()
+ });
+ }
+
+ this.state.pos += 2;
+ this.finishToken(2);
+ } else {
+ ++this.state.pos;
+ this.finishToken(0);
+ }
+
+ return;
+
+ case 93:
+ ++this.state.pos;
+ this.finishToken(3);
+ return;
+
+ case 123:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, {
+ at: this.state.curPosition()
+ });
+ }
+
+ this.state.pos += 2;
+ this.finishToken(6);
+ } else {
+ ++this.state.pos;
+ this.finishToken(5);
+ }
+
+ return;
+
+ case 125:
+ ++this.state.pos;
+ this.finishToken(8);
+ return;
+
+ case 58:
+ if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
+ this.finishOp(15, 2);
+ } else {
+ ++this.state.pos;
+ this.finishToken(14);
+ }
+
+ return;
+
+ case 63:
+ this.readToken_question();
+ return;
+
+ case 96:
+ this.readTemplateToken();
+ return;
+
+ case 48:
+ {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 120 || next === 88) {
+ this.readRadixNumber(16);
+ return;
+ }
+
+ if (next === 111 || next === 79) {
+ this.readRadixNumber(8);
+ return;
+ }
+
+ if (next === 98 || next === 66) {
+ this.readRadixNumber(2);
+ return;
+ }
+ }
+
+ case 49:
+ case 50:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ this.readNumber(false);
+ return;
+
+ case 34:
+ case 39:
+ this.readString(code);
+ return;
+
+ case 47:
+ this.readToken_slash();
+ return;
+
+ case 37:
+ case 42:
+ this.readToken_mult_modulo(code);
+ return;
+
+ case 124:
+ case 38:
+ this.readToken_pipe_amp(code);
+ return;
+
+ case 94:
+ this.readToken_caret();
+ return;
+
+ case 43:
+ case 45:
+ this.readToken_plus_min(code);
+ return;
+
+ case 60:
+ this.readToken_lt();
+ return;
+
+ case 62:
+ this.readToken_gt();
+ return;
+
+ case 61:
+ case 33:
+ this.readToken_eq_excl(code);
+ return;
+
+ case 126:
+ this.finishOp(36, 1);
+ return;
+
+ case 64:
+ this.readToken_atSign();
+ return;
+
+ case 35:
+ this.readToken_numberSign();
+ return;
+
+ case 92:
+ this.readWord();
+ return;
+
+ default:
+ if (isIdentifierStart(code)) {
+ this.readWord(code);
+ return;
+ }
+
+ }
+
+ throw this.raise(Errors.InvalidOrUnexpectedToken, {
+ at: this.state.curPosition(),
+ unexpected: String.fromCodePoint(code)
+ });
+ }
+
+ finishOp(type, size) {
+ const str = this.input.slice(this.state.pos, this.state.pos + size);
+ this.state.pos += size;
+ this.finishToken(type, str);
+ }
+
+ readRegexp() {
+ const startLoc = this.state.startLoc;
+ const start = this.state.start + 1;
+ let escaped, inClass;
+ let {
+ pos
+ } = this.state;
+
+ for (;; ++pos) {
+ if (pos >= this.length) {
+ throw this.raise(Errors.UnterminatedRegExp, {
+ at: createPositionWithColumnOffset(startLoc, 1)
+ });
+ }
+
+ const ch = this.input.charCodeAt(pos);
+
+ if (isNewLine(ch)) {
+ throw this.raise(Errors.UnterminatedRegExp, {
+ at: createPositionWithColumnOffset(startLoc, 1)
+ });
+ }
+
+ if (escaped) {
+ escaped = false;
+ } else {
+ if (ch === 91) {
+ inClass = true;
+ } else if (ch === 93 && inClass) {
+ inClass = false;
+ } else if (ch === 47 && !inClass) {
+ break;
+ }
+
+ escaped = ch === 92;
+ }
+ }
+
+ const content = this.input.slice(start, pos);
+ ++pos;
+ let mods = "";
+
+ const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start);
+
+ while (pos < this.length) {
+ const cp = this.codePointAtPos(pos);
+ const char = String.fromCharCode(cp);
+
+ if (VALID_REGEX_FLAGS.has(cp)) {
+ if (cp === 118) {
+ this.expectPlugin("regexpUnicodeSets", nextPos());
+
+ if (mods.includes("u")) {
+ this.raise(Errors.IncompatibleRegExpUVFlags, {
+ at: nextPos()
+ });
+ }
+ } else if (cp === 117) {
+ if (mods.includes("v")) {
+ this.raise(Errors.IncompatibleRegExpUVFlags, {
+ at: nextPos()
+ });
+ }
+ }
+
+ if (mods.includes(char)) {
+ this.raise(Errors.DuplicateRegExpFlags, {
+ at: nextPos()
+ });
+ }
+ } else if (isIdentifierChar(cp) || cp === 92) {
+ this.raise(Errors.MalformedRegExpFlags, {
+ at: nextPos()
+ });
+ } else {
+ break;
+ }
+
+ ++pos;
+ mods += char;
+ }
+
+ this.state.pos = pos;
+ this.finishToken(133, {
+ pattern: content,
+ flags: mods
+ });
+ }
+
+ readInt(radix, len, forceLen = false, allowNumSeparator = true) {
+ const {
+ n,
+ pos
+ } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt);
+ this.state.pos = pos;
+ return n;
+ }
+
+ readRadixNumber(radix) {
+ const startLoc = this.state.curPosition();
+ let isBigInt = false;
+ this.state.pos += 2;
+ const val = this.readInt(radix);
+
+ if (val == null) {
+ this.raise(Errors.InvalidDigit, {
+ at: createPositionWithColumnOffset(startLoc, 2),
+ radix
+ });
+ }
+
+ const next = this.input.charCodeAt(this.state.pos);
+
+ if (next === 110) {
+ ++this.state.pos;
+ isBigInt = true;
+ } else if (next === 109) {
+ throw this.raise(Errors.InvalidDecimal, {
+ at: startLoc
+ });
+ }
+
+ if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
+ throw this.raise(Errors.NumberIdentifier, {
+ at: this.state.curPosition()
+ });
+ }
+
+ if (isBigInt) {
+ const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, "");
+ this.finishToken(131, str);
+ return;
+ }
+
+ this.finishToken(130, val);
+ }
+
+ readNumber(startsWithDot) {
+ const start = this.state.pos;
+ const startLoc = this.state.curPosition();
+ let isFloat = false;
+ let isBigInt = false;
+ let isDecimal = false;
+ let hasExponent = false;
+ let isOctal = false;
+
+ if (!startsWithDot && this.readInt(10) === null) {
+ this.raise(Errors.InvalidNumber, {
+ at: this.state.curPosition()
+ });
+ }
+
+ const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
+
+ if (hasLeadingZero) {
+ const integer = this.input.slice(start, this.state.pos);
+ this.recordStrictModeErrors(Errors.StrictOctalLiteral, {
+ at: startLoc
+ });
+
+ if (!this.state.strict) {
+ const underscorePos = integer.indexOf("_");
+
+ if (underscorePos > 0) {
+ this.raise(Errors.ZeroDigitNumericSeparator, {
+ at: createPositionWithColumnOffset(startLoc, underscorePos)
+ });
+ }
+ }
+
+ isOctal = hasLeadingZero && !/[89]/.test(integer);
+ }
+
+ let next = this.input.charCodeAt(this.state.pos);
+
+ if (next === 46 && !isOctal) {
+ ++this.state.pos;
+ this.readInt(10);
+ isFloat = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if ((next === 69 || next === 101) && !isOctal) {
+ next = this.input.charCodeAt(++this.state.pos);
+
+ if (next === 43 || next === 45) {
+ ++this.state.pos;
+ }
+
+ if (this.readInt(10) === null) {
+ this.raise(Errors.InvalidOrMissingExponent, {
+ at: startLoc
+ });
+ }
+
+ isFloat = true;
+ hasExponent = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if (next === 110) {
+ if (isFloat || hasLeadingZero) {
+ this.raise(Errors.InvalidBigIntLiteral, {
+ at: startLoc
+ });
+ }
+
+ ++this.state.pos;
+ isBigInt = true;
+ }
+
+ if (next === 109) {
+ this.expectPlugin("decimal", this.state.curPosition());
+
+ if (hasExponent || hasLeadingZero) {
+ this.raise(Errors.InvalidDecimal, {
+ at: startLoc
+ });
+ }
+
+ ++this.state.pos;
+ isDecimal = true;
+ }
+
+ if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
+ throw this.raise(Errors.NumberIdentifier, {
+ at: this.state.curPosition()
+ });
+ }
+
+ const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
+
+ if (isBigInt) {
+ this.finishToken(131, str);
+ return;
+ }
+
+ if (isDecimal) {
+ this.finishToken(132, str);
+ return;
+ }
+
+ const val = isOctal ? parseInt(str, 8) : parseFloat(str);
+ this.finishToken(130, val);
+ }
+
+ readCodePoint(throwOnInvalid) {
+ const {
+ code,
+ pos
+ } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint);
+ this.state.pos = pos;
+ return code;
+ }
+
+ readString(quote) {
+ const {
+ str,
+ pos,
+ curLine,
+ lineStart
+ } = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);
+ this.state.pos = pos + 1;
+ this.state.lineStart = lineStart;
+ this.state.curLine = curLine;
+ this.finishToken(129, str);
+ }
+
+ readTemplateContinuation() {
+ if (!this.match(8)) {
+ this.unexpected(null, 8);
+ }
+
+ this.state.pos--;
+ this.readTemplateToken();
+ }
+
+ readTemplateToken() {
+ const opening = this.input[this.state.pos];
+ const {
+ str,
+ containsInvalid,
+ pos,
+ curLine,
+ lineStart
+ } = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);
+ this.state.pos = pos + 1;
+ this.state.lineStart = lineStart;
+ this.state.curLine = curLine;
+
+ if (this.input.codePointAt(pos) === 96) {
+ this.finishToken(24, containsInvalid ? null : opening + str + "`");
+ } else {
+ this.state.pos++;
+ this.finishToken(25, containsInvalid ? null : opening + str + "${");
+ }
+ }
+
+ recordStrictModeErrors(toParseError, {
+ at
+ }) {
+ const index = at.index;
+
+ if (this.state.strict && !this.state.strictErrors.has(index)) {
+ this.raise(toParseError, {
+ at
+ });
+ } else {
+ this.state.strictErrors.set(index, [toParseError, at]);
+ }
+ }
+
+ readWord1(firstCode) {
+ this.state.containsEsc = false;
+ let word = "";
+ const start = this.state.pos;
+ let chunkStart = this.state.pos;
+
+ if (firstCode !== undefined) {
+ this.state.pos += firstCode <= 0xffff ? 1 : 2;
+ }
+
+ while (this.state.pos < this.length) {
+ const ch = this.codePointAtPos(this.state.pos);
+
+ if (isIdentifierChar(ch)) {
+ this.state.pos += ch <= 0xffff ? 1 : 2;
+ } else if (ch === 92) {
+ this.state.containsEsc = true;
+ word += this.input.slice(chunkStart, this.state.pos);
+ const escStart = this.state.curPosition();
+ const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;
+
+ if (this.input.charCodeAt(++this.state.pos) !== 117) {
+ this.raise(Errors.MissingUnicodeEscape, {
+ at: this.state.curPosition()
+ });
+ chunkStart = this.state.pos - 1;
+ continue;
+ }
+
+ ++this.state.pos;
+ const esc = this.readCodePoint(true);
+
+ if (esc !== null) {
+ if (!identifierCheck(esc)) {
+ this.raise(Errors.EscapedCharNotAnIdentifier, {
+ at: escStart
+ });
+ }
+
+ word += String.fromCodePoint(esc);
+ }
+
+ chunkStart = this.state.pos;
+ } else {
+ break;
+ }
+ }
+
+ return word + this.input.slice(chunkStart, this.state.pos);
+ }
+
+ readWord(firstCode) {
+ const word = this.readWord1(firstCode);
+ const type = keywords$1.get(word);
+
+ if (type !== undefined) {
+ this.finishToken(type, tokenLabelName(type));
+ } else {
+ this.finishToken(128, word);
+ }
+ }
+
+ checkKeywordEscapes() {
+ const {
+ type
+ } = this.state;
+
+ if (tokenIsKeyword(type) && this.state.containsEsc) {
+ this.raise(Errors.InvalidEscapedReservedWord, {
+ at: this.state.startLoc,
+ reservedWord: tokenLabelName(type)
+ });
+ }
+ }
+
+ raise(toParseError, raiseProperties) {
+ const {
+ at
+ } = raiseProperties,
+ details = _objectWithoutPropertiesLoose(raiseProperties, _excluded);
+
+ const loc = at instanceof Position ? at : at.loc.start;
+ const error = toParseError({
+ loc,
+ details
+ });
+ if (!this.options.errorRecovery) throw error;
+ if (!this.isLookahead) this.state.errors.push(error);
+ return error;
+ }
+
+ raiseOverwrite(toParseError, raiseProperties) {
+ const {
+ at
+ } = raiseProperties,
+ details = _objectWithoutPropertiesLoose(raiseProperties, _excluded2);
+
+ const loc = at instanceof Position ? at : at.loc.start;
+ const pos = loc.index;
+ const errors = this.state.errors;
+
+ for (let i = errors.length - 1; i >= 0; i--) {
+ const error = errors[i];
+
+ if (error.loc.index === pos) {
+ return errors[i] = toParseError({
+ loc,
+ details
+ });
+ }
+
+ if (error.loc.index < pos) break;
+ }
+
+ return this.raise(toParseError, raiseProperties);
+ }
+
+ updateContext(prevType) {}
+
+ unexpected(loc, type) {
+ throw this.raise(Errors.UnexpectedToken, {
+ expected: type ? tokenLabelName(type) : null,
+ at: loc != null ? loc : this.state.startLoc
+ });
+ }
+
+ expectPlugin(pluginName, loc) {
+ if (this.hasPlugin(pluginName)) {
+ return true;
+ }
+
+ throw this.raise(Errors.MissingPlugin, {
+ at: loc != null ? loc : this.state.startLoc,
+ missingPlugin: [pluginName]
+ });
+ }
+
+ expectOnePlugin(pluginNames) {
+ if (!pluginNames.some(name => this.hasPlugin(name))) {
+ throw this.raise(Errors.MissingOneOfPlugins, {
+ at: this.state.startLoc,
+ missingPlugin: pluginNames
+ });
+ }
+ }
+
+ errorBuilder(error) {
+ return (pos, lineStart, curLine) => {
+ this.raise(error, {
+ at: buildPosition(pos, lineStart, curLine)
+ });
+ };
+ }
+
+}
+
+class Scope {
+ constructor(flags) {
+ this.var = new Set();
+ this.lexical = new Set();
+ this.functions = new Set();
+ this.flags = flags;
+ }
+
+}
+class ScopeHandler {
+ constructor(parser, inModule) {
+ this.parser = void 0;
+ this.scopeStack = [];
+ this.inModule = void 0;
+ this.undefinedExports = new Map();
+ this.parser = parser;
+ this.inModule = inModule;
+ }
+
+ get inFunction() {
+ return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0;
+ }
+
+ get allowSuper() {
+ return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0;
+ }
+
+ get allowDirectSuper() {
+ return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0;
+ }
+
+ get inClass() {
+ return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0;
+ }
+
+ get inClassAndNotInNonArrowFunction() {
+ const flags = this.currentThisScopeFlags();
+ return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0;
+ }
+
+ get inStaticBlock() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+
+ if (flags & SCOPE_STATIC_BLOCK) {
+ return true;
+ }
+
+ if (flags & (SCOPE_VAR | SCOPE_CLASS)) {
+ return false;
+ }
+ }
+ }
+
+ get inNonArrowFunction() {
+ return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0;
+ }
+
+ get treatFunctionsAsVar() {
+ return this.treatFunctionsAsVarInScope(this.currentScope());
+ }
+
+ createScope(flags) {
+ return new Scope(flags);
+ }
+
+ enter(flags) {
+ this.scopeStack.push(this.createScope(flags));
+ }
+
+ exit() {
+ this.scopeStack.pop();
+ }
+
+ treatFunctionsAsVarInScope(scope) {
+ return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM);
+ }
+
+ declareName(name, bindingType, loc) {
+ let scope = this.currentScope();
+
+ if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {
+ this.checkRedeclarationInScope(scope, name, bindingType, loc);
+
+ if (bindingType & BIND_SCOPE_FUNCTION) {
+ scope.functions.add(name);
+ } else {
+ scope.lexical.add(name);
+ }
+
+ if (bindingType & BIND_SCOPE_LEXICAL) {
+ this.maybeExportDefined(scope, name);
+ }
+ } else if (bindingType & BIND_SCOPE_VAR) {
+ for (let i = this.scopeStack.length - 1; i >= 0; --i) {
+ scope = this.scopeStack[i];
+ this.checkRedeclarationInScope(scope, name, bindingType, loc);
+ scope.var.add(name);
+ this.maybeExportDefined(scope, name);
+ if (scope.flags & SCOPE_VAR) break;
+ }
+ }
+
+ if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {
+ this.undefinedExports.delete(name);
+ }
+ }
+
+ maybeExportDefined(scope, name) {
+ if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {
+ this.undefinedExports.delete(name);
+ }
+ }
+
+ checkRedeclarationInScope(scope, name, bindingType, loc) {
+ if (this.isRedeclaredInScope(scope, name, bindingType)) {
+ this.parser.raise(Errors.VarRedeclaration, {
+ at: loc,
+ identifierName: name
+ });
+ }
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (!(bindingType & BIND_KIND_VALUE)) return false;
+
+ if (bindingType & BIND_SCOPE_LEXICAL) {
+ return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name);
+ }
+
+ if (bindingType & BIND_SCOPE_FUNCTION) {
+ return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name);
+ }
+
+ return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name);
+ }
+
+ checkLocalExport(id) {
+ const {
+ name
+ } = id;
+ const topLevelScope = this.scopeStack[0];
+
+ if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) {
+ this.undefinedExports.set(name, id.loc.start);
+ }
+ }
+
+ currentScope() {
+ return this.scopeStack[this.scopeStack.length - 1];
+ }
+
+ currentVarScopeFlags() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+
+ if (flags & SCOPE_VAR) {
+ return flags;
+ }
+ }
+ }
+
+ currentThisScopeFlags() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+
+ if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) {
+ return flags;
+ }
+ }
+ }
+
+}
+
+class FlowScope extends Scope {
+ constructor(...args) {
+ super(...args);
+ this.declareFunctions = new Set();
+ }
+
+}
+
+class FlowScopeHandler extends ScopeHandler {
+ createScope(flags) {
+ return new FlowScope(flags);
+ }
+
+ declareName(name, bindingType, loc) {
+ const scope = this.currentScope();
+
+ if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
+ this.checkRedeclarationInScope(scope, name, bindingType, loc);
+ this.maybeExportDefined(scope, name);
+ scope.declareFunctions.add(name);
+ return;
+ }
+
+ super.declareName(name, bindingType, loc);
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (super.isRedeclaredInScope(scope, name, bindingType)) return true;
+
+ if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
+ return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));
+ }
+
+ return false;
+ }
+
+ checkLocalExport(id) {
+ if (!this.scopeStack[0].declareFunctions.has(id.name)) {
+ super.checkLocalExport(id);
+ }
+ }
+
+}
+
+class ClassScope {
+ constructor() {
+ this.privateNames = new Set();
+ this.loneAccessors = new Map();
+ this.undefinedPrivateNames = new Map();
+ }
+
+}
+class ClassScopeHandler {
+ constructor(parser) {
+ this.parser = void 0;
+ this.stack = [];
+ this.undefinedPrivateNames = new Map();
+ this.parser = parser;
+ }
+
+ current() {
+ return this.stack[this.stack.length - 1];
+ }
+
+ enter() {
+ this.stack.push(new ClassScope());
+ }
+
+ exit() {
+ const oldClassScope = this.stack.pop();
+ const current = this.current();
+
+ for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {
+ if (current) {
+ if (!current.undefinedPrivateNames.has(name)) {
+ current.undefinedPrivateNames.set(name, loc);
+ }
+ } else {
+ this.parser.raise(Errors.InvalidPrivateFieldResolution, {
+ at: loc,
+ identifierName: name
+ });
+ }
+ }
+ }
+
+ declarePrivateName(name, elementType, loc) {
+ const {
+ privateNames,
+ loneAccessors,
+ undefinedPrivateNames
+ } = this.current();
+ let redefined = privateNames.has(name);
+
+ if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {
+ const accessor = redefined && loneAccessors.get(name);
+
+ if (accessor) {
+ const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;
+ const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
+ const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;
+ const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
+ redefined = oldKind === newKind || oldStatic !== newStatic;
+ if (!redefined) loneAccessors.delete(name);
+ } else if (!redefined) {
+ loneAccessors.set(name, elementType);
+ }
+ }
+
+ if (redefined) {
+ this.parser.raise(Errors.PrivateNameRedeclaration, {
+ at: loc,
+ identifierName: name
+ });
+ }
+
+ privateNames.add(name);
+ undefinedPrivateNames.delete(name);
+ }
+
+ usePrivateName(name, loc) {
+ let classScope;
+
+ for (classScope of this.stack) {
+ if (classScope.privateNames.has(name)) return;
+ }
+
+ if (classScope) {
+ classScope.undefinedPrivateNames.set(name, loc);
+ } else {
+ this.parser.raise(Errors.InvalidPrivateFieldResolution, {
+ at: loc,
+ identifierName: name
+ });
+ }
+ }
+
+}
+
+const kExpression = 0,
+ kMaybeArrowParameterDeclaration = 1,
+ kMaybeAsyncArrowParameterDeclaration = 2,
+ kParameterDeclaration = 3;
+
+class ExpressionScope {
+ constructor(type = kExpression) {
+ this.type = void 0;
+ this.type = type;
+ }
+
+ canBeArrowParameterDeclaration() {
+ return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration;
+ }
+
+ isCertainlyParameterDeclaration() {
+ return this.type === kParameterDeclaration;
+ }
+
+}
+
+class ArrowHeadParsingScope extends ExpressionScope {
+ constructor(type) {
+ super(type);
+ this.declarationErrors = new Map();
+ }
+
+ recordDeclarationError(ParsingErrorClass, {
+ at
+ }) {
+ const index = at.index;
+ this.declarationErrors.set(index, [ParsingErrorClass, at]);
+ }
+
+ clearDeclarationError(index) {
+ this.declarationErrors.delete(index);
+ }
+
+ iterateErrors(iterator) {
+ this.declarationErrors.forEach(iterator);
+ }
+
+}
+
+class ExpressionScopeHandler {
+ constructor(parser) {
+ this.parser = void 0;
+ this.stack = [new ExpressionScope()];
+ this.parser = parser;
+ }
+
+ enter(scope) {
+ this.stack.push(scope);
+ }
+
+ exit() {
+ this.stack.pop();
+ }
+
+ recordParameterInitializerError(toParseError, {
+ at: node
+ }) {
+ const origin = {
+ at: node.loc.start
+ };
+ const {
+ stack
+ } = this;
+ let i = stack.length - 1;
+ let scope = stack[i];
+
+ while (!scope.isCertainlyParameterDeclaration()) {
+ if (scope.canBeArrowParameterDeclaration()) {
+ scope.recordDeclarationError(toParseError, origin);
+ } else {
+ return;
+ }
+
+ scope = stack[--i];
+ }
+
+ this.parser.raise(toParseError, origin);
+ }
+
+ recordArrowParemeterBindingError(error, {
+ at: node
+ }) {
+ const {
+ stack
+ } = this;
+ const scope = stack[stack.length - 1];
+ const origin = {
+ at: node.loc.start
+ };
+
+ if (scope.isCertainlyParameterDeclaration()) {
+ this.parser.raise(error, origin);
+ } else if (scope.canBeArrowParameterDeclaration()) {
+ scope.recordDeclarationError(error, origin);
+ } else {
+ return;
+ }
+ }
+
+ recordAsyncArrowParametersError({
+ at
+ }) {
+ const {
+ stack
+ } = this;
+ let i = stack.length - 1;
+ let scope = stack[i];
+
+ while (scope.canBeArrowParameterDeclaration()) {
+ if (scope.type === kMaybeAsyncArrowParameterDeclaration) {
+ scope.recordDeclarationError(Errors.AwaitBindingIdentifier, {
+ at
+ });
+ }
+
+ scope = stack[--i];
+ }
+ }
+
+ validateAsPattern() {
+ const {
+ stack
+ } = this;
+ const currentScope = stack[stack.length - 1];
+ if (!currentScope.canBeArrowParameterDeclaration()) return;
+ currentScope.iterateErrors(([toParseError, loc]) => {
+ this.parser.raise(toParseError, {
+ at: loc
+ });
+ let i = stack.length - 2;
+ let scope = stack[i];
+
+ while (scope.canBeArrowParameterDeclaration()) {
+ scope.clearDeclarationError(loc.index);
+ scope = stack[--i];
+ }
+ });
+ }
+
+}
+function newParameterDeclarationScope() {
+ return new ExpressionScope(kParameterDeclaration);
+}
+function newArrowHeadScope() {
+ return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration);
+}
+function newAsyncArrowScope() {
+ return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration);
+}
+function newExpressionScope() {
+ return new ExpressionScope();
+}
+
+const PARAM = 0b0000,
+ PARAM_YIELD = 0b0001,
+ PARAM_AWAIT = 0b0010,
+ PARAM_RETURN = 0b0100,
+ PARAM_IN = 0b1000;
+class ProductionParameterHandler {
+ constructor() {
+ this.stacks = [];
+ }
+
+ enter(flags) {
+ this.stacks.push(flags);
+ }
+
+ exit() {
+ this.stacks.pop();
+ }
+
+ currentFlags() {
+ return this.stacks[this.stacks.length - 1];
+ }
+
+ get hasAwait() {
+ return (this.currentFlags() & PARAM_AWAIT) > 0;
+ }
+
+ get hasYield() {
+ return (this.currentFlags() & PARAM_YIELD) > 0;
+ }
+
+ get hasReturn() {
+ return (this.currentFlags() & PARAM_RETURN) > 0;
+ }
+
+ get hasIn() {
+ return (this.currentFlags() & PARAM_IN) > 0;
+ }
+
+}
+function functionFlags(isAsync, isGenerator) {
+ return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);
+}
+
+class UtilParser extends Tokenizer {
+ addExtra(node, key, value, enumerable = true) {
+ if (!node) return;
+ const extra = node.extra = node.extra || {};
+
+ if (enumerable) {
+ extra[key] = value;
+ } else {
+ Object.defineProperty(extra, key, {
+ enumerable,
+ value
+ });
+ }
+ }
+
+ isContextual(token) {
+ return this.state.type === token && !this.state.containsEsc;
+ }
+
+ isUnparsedContextual(nameStart, name) {
+ const nameEnd = nameStart + name.length;
+
+ if (this.input.slice(nameStart, nameEnd) === name) {
+ const nextCh = this.input.charCodeAt(nameEnd);
+ return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800);
+ }
+
+ return false;
+ }
+
+ isLookaheadContextual(name) {
+ const next = this.nextTokenStart();
+ return this.isUnparsedContextual(next, name);
+ }
+
+ eatContextual(token) {
+ if (this.isContextual(token)) {
+ this.next();
+ return true;
+ }
+
+ return false;
+ }
+
+ expectContextual(token, toParseError) {
+ if (!this.eatContextual(token)) {
+ if (toParseError != null) {
+ throw this.raise(toParseError, {
+ at: this.state.startLoc
+ });
+ }
+
+ throw this.unexpected(null, token);
+ }
+ }
+
+ canInsertSemicolon() {
+ return this.match(135) || this.match(8) || this.hasPrecedingLineBreak();
+ }
+
+ hasPrecedingLineBreak() {
+ return lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start));
+ }
+
+ hasFollowingLineBreak() {
+ skipWhiteSpaceToLineBreak.lastIndex = this.state.end;
+ return skipWhiteSpaceToLineBreak.test(this.input);
+ }
+
+ isLineTerminator() {
+ return this.eat(13) || this.canInsertSemicolon();
+ }
+
+ semicolon(allowAsi = true) {
+ if (allowAsi ? this.isLineTerminator() : this.eat(13)) return;
+ this.raise(Errors.MissingSemicolon, {
+ at: this.state.lastTokEndLoc
+ });
+ }
+
+ expect(type, loc) {
+ this.eat(type) || this.unexpected(loc, type);
+ }
+
+ tryParse(fn, oldState = this.state.clone()) {
+ const abortSignal = {
+ node: null
+ };
+
+ try {
+ const node = fn((node = null) => {
+ abortSignal.node = node;
+ throw abortSignal;
+ });
+
+ if (this.state.errors.length > oldState.errors.length) {
+ const failState = this.state;
+ this.state = oldState;
+ this.state.tokensLength = failState.tokensLength;
+ return {
+ node,
+ error: failState.errors[oldState.errors.length],
+ thrown: false,
+ aborted: false,
+ failState
+ };
+ }
+
+ return {
+ node,
+ error: null,
+ thrown: false,
+ aborted: false,
+ failState: null
+ };
+ } catch (error) {
+ const failState = this.state;
+ this.state = oldState;
+
+ if (error instanceof SyntaxError) {
+ return {
+ node: null,
+ error,
+ thrown: true,
+ aborted: false,
+ failState
+ };
+ }
+
+ if (error === abortSignal) {
+ return {
+ node: abortSignal.node,
+ error: null,
+ thrown: false,
+ aborted: true,
+ failState
+ };
+ }
+
+ throw error;
+ }
+ }
+
+ checkExpressionErrors(refExpressionErrors, andThrow) {
+ if (!refExpressionErrors) return false;
+ const {
+ shorthandAssignLoc,
+ doubleProtoLoc,
+ privateKeyLoc,
+ optionalParametersLoc
+ } = refExpressionErrors;
+ const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc;
+
+ if (!andThrow) {
+ return hasErrors;
+ }
+
+ if (shorthandAssignLoc != null) {
+ this.raise(Errors.InvalidCoverInitializedName, {
+ at: shorthandAssignLoc
+ });
+ }
+
+ if (doubleProtoLoc != null) {
+ this.raise(Errors.DuplicateProto, {
+ at: doubleProtoLoc
+ });
+ }
+
+ if (privateKeyLoc != null) {
+ this.raise(Errors.UnexpectedPrivateField, {
+ at: privateKeyLoc
+ });
+ }
+
+ if (optionalParametersLoc != null) {
+ this.unexpected(optionalParametersLoc);
+ }
+ }
+
+ isLiteralPropertyName() {
+ return tokenIsLiteralPropertyName(this.state.type);
+ }
+
+ isPrivateName(node) {
+ return node.type === "PrivateName";
+ }
+
+ getPrivateNameSV(node) {
+ return node.id.name;
+ }
+
+ hasPropertyAsPrivateName(node) {
+ return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property);
+ }
+
+ isOptionalChain(node) {
+ return node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression";
+ }
+
+ isObjectProperty(node) {
+ return node.type === "ObjectProperty";
+ }
+
+ isObjectMethod(node) {
+ return node.type === "ObjectMethod";
+ }
+
+ initializeScopes(inModule = this.options.sourceType === "module") {
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ const oldExportedIdentifiers = this.exportedIdentifiers;
+ this.exportedIdentifiers = new Set();
+ const oldInModule = this.inModule;
+ this.inModule = inModule;
+ const oldScope = this.scope;
+ const ScopeHandler = this.getScopeHandler();
+ this.scope = new ScopeHandler(this, inModule);
+ const oldProdParam = this.prodParam;
+ this.prodParam = new ProductionParameterHandler();
+ const oldClassScope = this.classScope;
+ this.classScope = new ClassScopeHandler(this);
+ const oldExpressionScope = this.expressionScope;
+ this.expressionScope = new ExpressionScopeHandler(this);
+ return () => {
+ this.state.labels = oldLabels;
+ this.exportedIdentifiers = oldExportedIdentifiers;
+ this.inModule = oldInModule;
+ this.scope = oldScope;
+ this.prodParam = oldProdParam;
+ this.classScope = oldClassScope;
+ this.expressionScope = oldExpressionScope;
+ };
+ }
+
+ enterInitialScopes() {
+ let paramFlags = PARAM;
+
+ if (this.inModule) {
+ paramFlags |= PARAM_AWAIT;
+ }
+
+ this.scope.enter(SCOPE_PROGRAM);
+ this.prodParam.enter(paramFlags);
+ }
+
+ checkDestructuringPrivate(refExpressionErrors) {
+ const {
+ privateKeyLoc
+ } = refExpressionErrors;
+
+ if (privateKeyLoc !== null) {
+ this.expectPlugin("destructuringPrivate", privateKeyLoc);
+ }
+ }
+
+}
+class ExpressionErrors {
+ constructor() {
+ this.shorthandAssignLoc = null;
+ this.doubleProtoLoc = null;
+ this.privateKeyLoc = null;
+ this.optionalParametersLoc = null;
+ }
+
+}
+
+class Node {
+ constructor(parser, pos, loc) {
+ this.type = "";
+ this.start = pos;
+ this.end = 0;
+ this.loc = new SourceLocation(loc);
+ if (parser != null && parser.options.ranges) this.range = [pos, 0];
+ if (parser != null && parser.filename) this.loc.filename = parser.filename;
+ }
+
+}
+
+const NodePrototype = Node.prototype;
+{
+ NodePrototype.__clone = function () {
+ const newNode = new Node();
+ const keys = Object.keys(this);
+
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+
+ if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
+ newNode[key] = this[key];
+ }
+ }
+
+ return newNode;
+ };
+}
+
+function clonePlaceholder(node) {
+ return cloneIdentifier(node);
+}
+
+function cloneIdentifier(node) {
+ const {
+ type,
+ start,
+ end,
+ loc,
+ range,
+ extra,
+ name
+ } = node;
+ const cloned = Object.create(NodePrototype);
+ cloned.type = type;
+ cloned.start = start;
+ cloned.end = end;
+ cloned.loc = loc;
+ cloned.range = range;
+ cloned.extra = extra;
+ cloned.name = name;
+
+ if (type === "Placeholder") {
+ cloned.expectedNode = node.expectedNode;
+ }
+
+ return cloned;
+}
+function cloneStringLiteral(node) {
+ const {
+ type,
+ start,
+ end,
+ loc,
+ range,
+ extra
+ } = node;
+
+ if (type === "Placeholder") {
+ return clonePlaceholder(node);
+ }
+
+ const cloned = Object.create(NodePrototype);
+ cloned.type = type;
+ cloned.start = start;
+ cloned.end = end;
+ cloned.loc = loc;
+ cloned.range = range;
+
+ if (node.raw !== undefined) {
+ cloned.raw = node.raw;
+ } else {
+ cloned.extra = extra;
+ }
+
+ cloned.value = node.value;
+ return cloned;
+}
+class NodeUtils extends UtilParser {
+ startNode() {
+ return new Node(this, this.state.start, this.state.startLoc);
+ }
+
+ startNodeAt(pos, loc) {
+ return new Node(this, pos, loc);
+ }
+
+ startNodeAtNode(type) {
+ return this.startNodeAt(type.start, type.loc.start);
+ }
+
+ finishNode(node, type) {
+ return this.finishNodeAt(node, type, this.state.lastTokEndLoc);
+ }
+
+ finishNodeAt(node, type, endLoc) {
+
+ node.type = type;
+ node.end = endLoc.index;
+ node.loc.end = endLoc;
+ if (this.options.ranges) node.range[1] = endLoc.index;
+ if (this.options.attachComment) this.processComment(node);
+ return node;
+ }
+
+ resetStartLocation(node, start, startLoc) {
+ node.start = start;
+ node.loc.start = startLoc;
+ if (this.options.ranges) node.range[0] = start;
+ }
+
+ resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
+ node.end = endLoc.index;
+ node.loc.end = endLoc;
+ if (this.options.ranges) node.range[1] = endLoc.index;
+ }
+
+ resetStartLocationFromNode(node, locationNode) {
+ this.resetStartLocation(node, locationNode.start, locationNode.loc.start);
+ }
+
+}
+
+const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
+const FlowErrors = ParseErrorEnum`flow`({
+ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
+ AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",
+ AssignReservedType: ({
+ reservedType
+ }) => `Cannot overwrite reserved type ${reservedType}.`,
+ DeclareClassElement: "The `declare` modifier can only appear on class fields.",
+ DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.",
+ DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.",
+ EnumBooleanMemberNotInitialized: ({
+ memberName,
+ enumName
+ }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`,
+ EnumDuplicateMemberName: ({
+ memberName,
+ enumName
+ }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`,
+ EnumInconsistentMemberValues: ({
+ enumName
+ }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,
+ EnumInvalidExplicitType: ({
+ invalidEnumType,
+ enumName
+ }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`,
+ EnumInvalidExplicitTypeUnknownSupplied: ({
+ enumName
+ }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`,
+ EnumInvalidMemberInitializerPrimaryType: ({
+ enumName,
+ memberName,
+ explicitType
+ }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`,
+ EnumInvalidMemberInitializerSymbolType: ({
+ enumName,
+ memberName
+ }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`,
+ EnumInvalidMemberInitializerUnknownType: ({
+ enumName,
+ memberName
+ }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`,
+ EnumInvalidMemberName: ({
+ enumName,
+ memberName,
+ suggestion
+ }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`,
+ EnumNumberMemberNotInitialized: ({
+ enumName,
+ memberName
+ }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`,
+ EnumStringMemberInconsistentlyInitailized: ({
+ enumName
+ }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`,
+ GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.",
+ ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",
+ InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.",
+ InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.",
+ InexactVariance: "Explicit inexact syntax cannot have variance.",
+ InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.",
+ MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",
+ NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.",
+ NestedFlowComment: "Cannot have a flow comment inside another flow comment.",
+ PatternIsOptional: Object.assign({
+ message: "A binding pattern parameter cannot be optional in an implementation signature."
+ }, {
+ reasonCode: "OptionalBindingPattern"
+ }),
+ SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.",
+ SpreadVariance: "Spread properties cannot have variance.",
+ ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.",
+ ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",
+ ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.",
+ ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.",
+ ThisParamNoDefault: "The `this` parameter may not have a default value.",
+ TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
+ TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.",
+ UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.",
+ UnexpectedReservedType: ({
+ reservedType
+ }) => `Unexpected reserved type ${reservedType}.`,
+ UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.",
+ UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.",
+ UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.",
+ UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".',
+ UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.",
+ UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",
+ UnsupportedDeclareExportKind: ({
+ unsupportedExportKind,
+ suggestion
+ }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`,
+ UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.",
+ UnterminatedFlowComment: "Unterminated flow-comment."
+});
+
+function isEsModuleType(bodyElement) {
+ return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration");
+}
+
+function hasTypeImportKind(node) {
+ return node.importKind === "type" || node.importKind === "typeof";
+}
+
+function isMaybeDefaultImport(type) {
+ return tokenIsKeywordOrIdentifier(type) && type !== 97;
+}
+
+const exportSuggestions = {
+ const: "declare export var",
+ let: "declare export var",
+ type: "export type",
+ interface: "export interface"
+};
+
+function partition(list, test) {
+ const list1 = [];
+ const list2 = [];
+
+ for (let i = 0; i < list.length; i++) {
+ (test(list[i], i, list) ? list1 : list2).push(list[i]);
+ }
+
+ return [list1, list2];
+}
+
+const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
+var flow = (superClass => class FlowParserMixin extends superClass {
+ constructor(...args) {
+ super(...args);
+ this.flowPragma = undefined;
+ }
+
+ getScopeHandler() {
+ return FlowScopeHandler;
+ }
+
+ shouldParseTypes() {
+ return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
+ }
+
+ shouldParseEnums() {
+ return !!this.getPluginOption("flow", "enums");
+ }
+
+ finishToken(type, val) {
+ if (type !== 129 && type !== 13 && type !== 28) {
+ if (this.flowPragma === undefined) {
+ this.flowPragma = null;
+ }
+ }
+
+ return super.finishToken(type, val);
+ }
+
+ addComment(comment) {
+ if (this.flowPragma === undefined) {
+ const matches = FLOW_PRAGMA_REGEX.exec(comment.value);
+
+ if (!matches) ; else if (matches[1] === "flow") {
+ this.flowPragma = "flow";
+ } else if (matches[1] === "noflow") {
+ this.flowPragma = "noflow";
+ } else {
+ throw new Error("Unexpected flow pragma");
+ }
+ }
+
+ return super.addComment(comment);
+ }
+
+ flowParseTypeInitialiser(tok) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(tok || 14);
+ const type = this.flowParseType();
+ this.state.inType = oldInType;
+ return type;
+ }
+
+ flowParsePredicate() {
+ const node = this.startNode();
+ const moduloLoc = this.state.startLoc;
+ this.next();
+ this.expectContextual(107);
+
+ if (this.state.lastTokStart > moduloLoc.index + 1) {
+ this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, {
+ at: moduloLoc
+ });
+ }
+
+ if (this.eat(10)) {
+ node.value = super.parseExpression();
+ this.expect(11);
+ return this.finishNode(node, "DeclaredPredicate");
+ } else {
+ return this.finishNode(node, "InferredPredicate");
+ }
+ }
+
+ flowParseTypeAndPredicateInitialiser() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(14);
+ let type = null;
+ let predicate = null;
+
+ if (this.match(54)) {
+ this.state.inType = oldInType;
+ predicate = this.flowParsePredicate();
+ } else {
+ type = this.flowParseType();
+ this.state.inType = oldInType;
+
+ if (this.match(54)) {
+ predicate = this.flowParsePredicate();
+ }
+ }
+
+ return [type, predicate];
+ }
+
+ flowParseDeclareClass(node) {
+ this.next();
+ this.flowParseInterfaceish(node, true);
+ return this.finishNode(node, "DeclareClass");
+ }
+
+ flowParseDeclareFunction(node) {
+ this.next();
+ const id = node.id = this.parseIdentifier();
+ const typeNode = this.startNode();
+ const typeContainer = this.startNode();
+
+ if (this.match(47)) {
+ typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ typeNode.typeParameters = null;
+ }
+
+ this.expect(10);
+ const tmp = this.flowParseFunctionTypeParams();
+ typeNode.params = tmp.params;
+ typeNode.rest = tmp.rest;
+ typeNode.this = tmp._this;
+ this.expect(11);
+ [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
+ id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
+ this.resetEndLocation(id);
+ this.semicolon();
+ this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.loc.start);
+ return this.finishNode(node, "DeclareFunction");
+ }
+
+ flowParseDeclare(node, insideModule) {
+ if (this.match(80)) {
+ return this.flowParseDeclareClass(node);
+ } else if (this.match(68)) {
+ return this.flowParseDeclareFunction(node);
+ } else if (this.match(74)) {
+ return this.flowParseDeclareVariable(node);
+ } else if (this.eatContextual(123)) {
+ if (this.match(16)) {
+ return this.flowParseDeclareModuleExports(node);
+ } else {
+ if (insideModule) {
+ this.raise(FlowErrors.NestedDeclareModule, {
+ at: this.state.lastTokStartLoc
+ });
+ }
+
+ return this.flowParseDeclareModule(node);
+ }
+ } else if (this.isContextual(126)) {
+ return this.flowParseDeclareTypeAlias(node);
+ } else if (this.isContextual(127)) {
+ return this.flowParseDeclareOpaqueType(node);
+ } else if (this.isContextual(125)) {
+ return this.flowParseDeclareInterface(node);
+ } else if (this.match(82)) {
+ return this.flowParseDeclareExportDeclaration(node, insideModule);
+ } else {
+ throw this.unexpected();
+ }
+ }
+
+ flowParseDeclareVariable(node) {
+ this.next();
+ node.id = this.flowParseTypeAnnotatableIdentifier(true);
+ this.scope.declareName(node.id.name, BIND_VAR, node.id.loc.start);
+ this.semicolon();
+ return this.finishNode(node, "DeclareVariable");
+ }
+
+ flowParseDeclareModule(node) {
+ this.scope.enter(SCOPE_OTHER);
+
+ if (this.match(129)) {
+ node.id = super.parseExprAtom();
+ } else {
+ node.id = this.parseIdentifier();
+ }
+
+ const bodyNode = node.body = this.startNode();
+ const body = bodyNode.body = [];
+ this.expect(5);
+
+ while (!this.match(8)) {
+ let bodyNode = this.startNode();
+
+ if (this.match(83)) {
+ this.next();
+
+ if (!this.isContextual(126) && !this.match(87)) {
+ this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, {
+ at: this.state.lastTokStartLoc
+ });
+ }
+
+ super.parseImport(bodyNode);
+ } else {
+ this.expectContextual(121, FlowErrors.UnsupportedStatementInDeclareModule);
+ bodyNode = this.flowParseDeclare(bodyNode, true);
+ }
+
+ body.push(bodyNode);
+ }
+
+ this.scope.exit();
+ this.expect(8);
+ this.finishNode(bodyNode, "BlockStatement");
+ let kind = null;
+ let hasModuleExport = false;
+ body.forEach(bodyElement => {
+ if (isEsModuleType(bodyElement)) {
+ if (kind === "CommonJS") {
+ this.raise(FlowErrors.AmbiguousDeclareModuleKind, {
+ at: bodyElement
+ });
+ }
+
+ kind = "ES";
+ } else if (bodyElement.type === "DeclareModuleExports") {
+ if (hasModuleExport) {
+ this.raise(FlowErrors.DuplicateDeclareModuleExports, {
+ at: bodyElement
+ });
+ }
+
+ if (kind === "ES") {
+ this.raise(FlowErrors.AmbiguousDeclareModuleKind, {
+ at: bodyElement
+ });
+ }
+
+ kind = "CommonJS";
+ hasModuleExport = true;
+ }
+ });
+ node.kind = kind || "CommonJS";
+ return this.finishNode(node, "DeclareModule");
+ }
+
+ flowParseDeclareExportDeclaration(node, insideModule) {
+ this.expect(82);
+
+ if (this.eat(65)) {
+ if (this.match(68) || this.match(80)) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ } else {
+ node.declaration = this.flowParseType();
+ this.semicolon();
+ }
+
+ node.default = true;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else {
+ if (this.match(75) || this.isLet() || (this.isContextual(126) || this.isContextual(125)) && !insideModule) {
+ const label = this.state.value;
+ throw this.raise(FlowErrors.UnsupportedDeclareExportKind, {
+ at: this.state.startLoc,
+ unsupportedExportKind: label,
+ suggestion: exportSuggestions[label]
+ });
+ }
+
+ if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(127)) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ node.default = false;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else if (this.match(55) || this.match(5) || this.isContextual(125) || this.isContextual(126) || this.isContextual(127)) {
+ node = this.parseExport(node);
+
+ if (node.type === "ExportNamedDeclaration") {
+ node.type = "ExportDeclaration";
+ node.default = false;
+ delete node.exportKind;
+ }
+
+ node.type = "Declare" + node.type;
+ return node;
+ }
+ }
+
+ throw this.unexpected();
+ }
+
+ flowParseDeclareModuleExports(node) {
+ this.next();
+ this.expectContextual(108);
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ this.semicolon();
+ return this.finishNode(node, "DeclareModuleExports");
+ }
+
+ flowParseDeclareTypeAlias(node) {
+ this.next();
+ const finished = this.flowParseTypeAlias(node);
+ finished.type = "DeclareTypeAlias";
+ return finished;
+ }
+
+ flowParseDeclareOpaqueType(node) {
+ this.next();
+ const finished = this.flowParseOpaqueType(node, true);
+ finished.type = "DeclareOpaqueType";
+ return finished;
+ }
+
+ flowParseDeclareInterface(node) {
+ this.next();
+ this.flowParseInterfaceish(node);
+ return this.finishNode(node, "DeclareInterface");
+ }
+
+ flowParseInterfaceish(node, isClass = false) {
+ node.id = this.flowParseRestrictedIdentifier(!isClass, true);
+ this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.loc.start);
+
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.extends = [];
+ node.implements = [];
+ node.mixins = [];
+
+ if (this.eat(81)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (!isClass && this.eat(12));
+ }
+
+ if (this.isContextual(114)) {
+ this.next();
+
+ do {
+ node.mixins.push(this.flowParseInterfaceExtends());
+ } while (this.eat(12));
+ }
+
+ if (this.isContextual(110)) {
+ this.next();
+
+ do {
+ node.implements.push(this.flowParseInterfaceExtends());
+ } while (this.eat(12));
+ }
+
+ node.body = this.flowParseObjectType({
+ allowStatic: isClass,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: isClass,
+ allowInexact: false
+ });
+ }
+
+ flowParseInterfaceExtends() {
+ const node = this.startNode();
+ node.id = this.flowParseQualifiedTypeIdentifier();
+
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+
+ return this.finishNode(node, "InterfaceExtends");
+ }
+
+ flowParseInterface(node) {
+ this.flowParseInterfaceish(node);
+ return this.finishNode(node, "InterfaceDeclaration");
+ }
+
+ checkNotUnderscore(word) {
+ if (word === "_") {
+ this.raise(FlowErrors.UnexpectedReservedUnderscore, {
+ at: this.state.startLoc
+ });
+ }
+ }
+
+ checkReservedType(word, startLoc, declaration) {
+ if (!reservedTypes.has(word)) return;
+ this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, {
+ at: startLoc,
+ reservedType: word
+ });
+ }
+
+ flowParseRestrictedIdentifier(liberal, declaration) {
+ this.checkReservedType(this.state.value, this.state.startLoc, declaration);
+ return this.parseIdentifier(liberal);
+ }
+
+ flowParseTypeAlias(node) {
+ node.id = this.flowParseRestrictedIdentifier(false, true);
+ this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);
+
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.right = this.flowParseTypeInitialiser(29);
+ this.semicolon();
+ return this.finishNode(node, "TypeAlias");
+ }
+
+ flowParseOpaqueType(node, declare) {
+ this.expectContextual(126);
+ node.id = this.flowParseRestrictedIdentifier(true, true);
+ this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);
+
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.supertype = null;
+
+ if (this.match(14)) {
+ node.supertype = this.flowParseTypeInitialiser(14);
+ }
+
+ node.impltype = null;
+
+ if (!declare) {
+ node.impltype = this.flowParseTypeInitialiser(29);
+ }
+
+ this.semicolon();
+ return this.finishNode(node, "OpaqueType");
+ }
+
+ flowParseTypeParameter(requireDefault = false) {
+ const nodeStartLoc = this.state.startLoc;
+ const node = this.startNode();
+ const variance = this.flowParseVariance();
+ const ident = this.flowParseTypeAnnotatableIdentifier();
+ node.name = ident.name;
+ node.variance = variance;
+ node.bound = ident.typeAnnotation;
+
+ if (this.match(29)) {
+ this.eat(29);
+ node.default = this.flowParseType();
+ } else {
+ if (requireDefault) {
+ this.raise(FlowErrors.MissingTypeParamDefault, {
+ at: nodeStartLoc
+ });
+ }
+ }
+
+ return this.finishNode(node, "TypeParameter");
+ }
+
+ flowParseTypeParameterDeclaration() {
+ const oldInType = this.state.inType;
+ const node = this.startNode();
+ node.params = [];
+ this.state.inType = true;
+
+ if (this.match(47) || this.match(138)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+
+ let defaultRequired = false;
+
+ do {
+ const typeParameter = this.flowParseTypeParameter(defaultRequired);
+ node.params.push(typeParameter);
+
+ if (typeParameter.default) {
+ defaultRequired = true;
+ }
+
+ if (!this.match(48)) {
+ this.expect(12);
+ }
+ } while (!this.match(48));
+
+ this.expect(48);
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterDeclaration");
+ }
+
+ flowParseTypeParameterInstantiation() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expect(47);
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = false;
+
+ while (!this.match(48)) {
+ node.params.push(this.flowParseType());
+
+ if (!this.match(48)) {
+ this.expect(12);
+ }
+ }
+
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ this.expect(48);
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+
+ flowParseTypeParameterInstantiationCallOrNew() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expect(47);
+
+ while (!this.match(48)) {
+ node.params.push(this.flowParseTypeOrImplicitInstantiation());
+
+ if (!this.match(48)) {
+ this.expect(12);
+ }
+ }
+
+ this.expect(48);
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+
+ flowParseInterfaceType() {
+ const node = this.startNode();
+ this.expectContextual(125);
+ node.extends = [];
+
+ if (this.eat(81)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (this.eat(12));
+ }
+
+ node.body = this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: false,
+ allowInexact: false
+ });
+ return this.finishNode(node, "InterfaceTypeAnnotation");
+ }
+
+ flowParseObjectPropertyKey() {
+ return this.match(130) || this.match(129) ? super.parseExprAtom() : this.parseIdentifier(true);
+ }
+
+ flowParseObjectTypeIndexer(node, isStatic, variance) {
+ node.static = isStatic;
+
+ if (this.lookahead().type === 14) {
+ node.id = this.flowParseObjectPropertyKey();
+ node.key = this.flowParseTypeInitialiser();
+ } else {
+ node.id = null;
+ node.key = this.flowParseType();
+ }
+
+ this.expect(3);
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ return this.finishNode(node, "ObjectTypeIndexer");
+ }
+
+ flowParseObjectTypeInternalSlot(node, isStatic) {
+ node.static = isStatic;
+ node.id = this.flowParseObjectPropertyKey();
+ this.expect(3);
+ this.expect(3);
+
+ if (this.match(47) || this.match(10)) {
+ node.method = true;
+ node.optional = false;
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
+ } else {
+ node.method = false;
+
+ if (this.eat(17)) {
+ node.optional = true;
+ }
+
+ node.value = this.flowParseTypeInitialiser();
+ }
+
+ return this.finishNode(node, "ObjectTypeInternalSlot");
+ }
+
+ flowParseObjectTypeMethodish(node) {
+ node.params = [];
+ node.rest = null;
+ node.typeParameters = null;
+ node.this = null;
+
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ this.expect(10);
+
+ if (this.match(78)) {
+ node.this = this.flowParseFunctionTypeParam(true);
+ node.this.name = null;
+
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+
+ while (!this.match(11) && !this.match(21)) {
+ node.params.push(this.flowParseFunctionTypeParam(false));
+
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+
+ if (this.eat(21)) {
+ node.rest = this.flowParseFunctionTypeParam(false);
+ }
+
+ this.expect(11);
+ node.returnType = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ flowParseObjectTypeCallProperty(node, isStatic) {
+ const valueNode = this.startNode();
+ node.static = isStatic;
+ node.value = this.flowParseObjectTypeMethodish(valueNode);
+ return this.finishNode(node, "ObjectTypeCallProperty");
+ }
+
+ flowParseObjectType({
+ allowStatic,
+ allowExact,
+ allowSpread,
+ allowProto,
+ allowInexact
+ }) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const nodeStart = this.startNode();
+ nodeStart.callProperties = [];
+ nodeStart.properties = [];
+ nodeStart.indexers = [];
+ nodeStart.internalSlots = [];
+ let endDelim;
+ let exact;
+ let inexact = false;
+
+ if (allowExact && this.match(6)) {
+ this.expect(6);
+ endDelim = 9;
+ exact = true;
+ } else {
+ this.expect(5);
+ endDelim = 8;
+ exact = false;
+ }
+
+ nodeStart.exact = exact;
+
+ while (!this.match(endDelim)) {
+ let isStatic = false;
+ let protoStartLoc = null;
+ let inexactStartLoc = null;
+ const node = this.startNode();
+
+ if (allowProto && this.isContextual(115)) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type !== 14 && lookahead.type !== 17) {
+ this.next();
+ protoStartLoc = this.state.startLoc;
+ allowStatic = false;
+ }
+ }
+
+ if (allowStatic && this.isContextual(104)) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type !== 14 && lookahead.type !== 17) {
+ this.next();
+ isStatic = true;
+ }
+ }
+
+ const variance = this.flowParseVariance();
+
+ if (this.eat(0)) {
+ if (protoStartLoc != null) {
+ this.unexpected(protoStartLoc);
+ }
+
+ if (this.eat(0)) {
+ if (variance) {
+ this.unexpected(variance.loc.start);
+ }
+
+ nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));
+ } else {
+ nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
+ }
+ } else if (this.match(10) || this.match(47)) {
+ if (protoStartLoc != null) {
+ this.unexpected(protoStartLoc);
+ }
+
+ if (variance) {
+ this.unexpected(variance.loc.start);
+ }
+
+ nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
+ } else {
+ let kind = "init";
+
+ if (this.isContextual(98) || this.isContextual(103)) {
+ const lookahead = this.lookahead();
+
+ if (tokenIsLiteralPropertyName(lookahead.type)) {
+ kind = this.state.value;
+ this.next();
+ }
+ }
+
+ const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);
+
+ if (propOrInexact === null) {
+ inexact = true;
+ inexactStartLoc = this.state.lastTokStartLoc;
+ } else {
+ nodeStart.properties.push(propOrInexact);
+ }
+ }
+
+ this.flowObjectTypeSemicolon();
+
+ if (inexactStartLoc && !this.match(8) && !this.match(9)) {
+ this.raise(FlowErrors.UnexpectedExplicitInexactInObject, {
+ at: inexactStartLoc
+ });
+ }
+ }
+
+ this.expect(endDelim);
+
+ if (allowSpread) {
+ nodeStart.inexact = inexact;
+ }
+
+ const out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
+ this.state.inType = oldInType;
+ return out;
+ }
+
+ flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) {
+ if (this.eat(21)) {
+ const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9);
+
+ if (isInexactToken) {
+ if (!allowSpread) {
+ this.raise(FlowErrors.InexactInsideNonObject, {
+ at: this.state.lastTokStartLoc
+ });
+ } else if (!allowInexact) {
+ this.raise(FlowErrors.InexactInsideExact, {
+ at: this.state.lastTokStartLoc
+ });
+ }
+
+ if (variance) {
+ this.raise(FlowErrors.InexactVariance, {
+ at: variance
+ });
+ }
+
+ return null;
+ }
+
+ if (!allowSpread) {
+ this.raise(FlowErrors.UnexpectedSpreadType, {
+ at: this.state.lastTokStartLoc
+ });
+ }
+
+ if (protoStartLoc != null) {
+ this.unexpected(protoStartLoc);
+ }
+
+ if (variance) {
+ this.raise(FlowErrors.SpreadVariance, {
+ at: variance
+ });
+ }
+
+ node.argument = this.flowParseType();
+ return this.finishNode(node, "ObjectTypeSpreadProperty");
+ } else {
+ node.key = this.flowParseObjectPropertyKey();
+ node.static = isStatic;
+ node.proto = protoStartLoc != null;
+ node.kind = kind;
+ let optional = false;
+
+ if (this.match(47) || this.match(10)) {
+ node.method = true;
+
+ if (protoStartLoc != null) {
+ this.unexpected(protoStartLoc);
+ }
+
+ if (variance) {
+ this.unexpected(variance.loc.start);
+ }
+
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
+
+ if (kind === "get" || kind === "set") {
+ this.flowCheckGetterSetterParams(node);
+ }
+
+ if (!allowSpread && node.key.name === "constructor" && node.value.this) {
+ this.raise(FlowErrors.ThisParamBannedInConstructor, {
+ at: node.value.this
+ });
+ }
+ } else {
+ if (kind !== "init") this.unexpected();
+ node.method = false;
+
+ if (this.eat(17)) {
+ optional = true;
+ }
+
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ }
+
+ node.optional = optional;
+ return this.finishNode(node, "ObjectTypeProperty");
+ }
+ }
+
+ flowCheckGetterSetterParams(property) {
+ const paramCount = property.kind === "get" ? 0 : 1;
+ const length = property.value.params.length + (property.value.rest ? 1 : 0);
+
+ if (property.value.this) {
+ this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, {
+ at: property.value.this
+ });
+ }
+
+ if (length !== paramCount) {
+ this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, {
+ at: property
+ });
+ }
+
+ if (property.kind === "set" && property.value.rest) {
+ this.raise(Errors.BadSetterRestParameter, {
+ at: property
+ });
+ }
+ }
+
+ flowObjectTypeSemicolon() {
+ if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) {
+ this.unexpected();
+ }
+ }
+
+ flowParseQualifiedTypeIdentifier(startPos, startLoc, id) {
+ startPos = startPos || this.state.start;
+ startLoc = startLoc || this.state.startLoc;
+ let node = id || this.flowParseRestrictedIdentifier(true);
+
+ while (this.eat(16)) {
+ const node2 = this.startNodeAt(startPos, startLoc);
+ node2.qualification = node;
+ node2.id = this.flowParseRestrictedIdentifier(true);
+ node = this.finishNode(node2, "QualifiedTypeIdentifier");
+ }
+
+ return node;
+ }
+
+ flowParseGenericType(startPos, startLoc, id) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.typeParameters = null;
+ node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);
+
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ }
+
+ return this.finishNode(node, "GenericTypeAnnotation");
+ }
+
+ flowParseTypeofType() {
+ const node = this.startNode();
+ this.expect(87);
+ node.argument = this.flowParsePrimaryType();
+ return this.finishNode(node, "TypeofTypeAnnotation");
+ }
+
+ flowParseTupleType() {
+ const node = this.startNode();
+ node.types = [];
+ this.expect(0);
+
+ while (this.state.pos < this.length && !this.match(3)) {
+ node.types.push(this.flowParseType());
+ if (this.match(3)) break;
+ this.expect(12);
+ }
+
+ this.expect(3);
+ return this.finishNode(node, "TupleTypeAnnotation");
+ }
+
+ flowParseFunctionTypeParam(first) {
+ let name = null;
+ let optional = false;
+ let typeAnnotation = null;
+ const node = this.startNode();
+ const lh = this.lookahead();
+ const isThis = this.state.type === 78;
+
+ if (lh.type === 14 || lh.type === 17) {
+ if (isThis && !first) {
+ this.raise(FlowErrors.ThisParamMustBeFirst, {
+ at: node
+ });
+ }
+
+ name = this.parseIdentifier(isThis);
+
+ if (this.eat(17)) {
+ optional = true;
+
+ if (isThis) {
+ this.raise(FlowErrors.ThisParamMayNotBeOptional, {
+ at: node
+ });
+ }
+ }
+
+ typeAnnotation = this.flowParseTypeInitialiser();
+ } else {
+ typeAnnotation = this.flowParseType();
+ }
+
+ node.name = name;
+ node.optional = optional;
+ node.typeAnnotation = typeAnnotation;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+
+ reinterpretTypeAsFunctionTypeParam(type) {
+ const node = this.startNodeAt(type.start, type.loc.start);
+ node.name = null;
+ node.optional = false;
+ node.typeAnnotation = type;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+
+ flowParseFunctionTypeParams(params = []) {
+ let rest = null;
+ let _this = null;
+
+ if (this.match(78)) {
+ _this = this.flowParseFunctionTypeParam(true);
+ _this.name = null;
+
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+
+ while (!this.match(11) && !this.match(21)) {
+ params.push(this.flowParseFunctionTypeParam(false));
+
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+
+ if (this.eat(21)) {
+ rest = this.flowParseFunctionTypeParam(false);
+ }
+
+ return {
+ params,
+ rest,
+ _this
+ };
+ }
+
+ flowIdentToTypeAnnotation(startPos, startLoc, node, id) {
+ switch (id.name) {
+ case "any":
+ return this.finishNode(node, "AnyTypeAnnotation");
+
+ case "bool":
+ case "boolean":
+ return this.finishNode(node, "BooleanTypeAnnotation");
+
+ case "mixed":
+ return this.finishNode(node, "MixedTypeAnnotation");
+
+ case "empty":
+ return this.finishNode(node, "EmptyTypeAnnotation");
+
+ case "number":
+ return this.finishNode(node, "NumberTypeAnnotation");
+
+ case "string":
+ return this.finishNode(node, "StringTypeAnnotation");
+
+ case "symbol":
+ return this.finishNode(node, "SymbolTypeAnnotation");
+
+ default:
+ this.checkNotUnderscore(id.name);
+ return this.flowParseGenericType(startPos, startLoc, id);
+ }
+ }
+
+ flowParsePrimaryType() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const node = this.startNode();
+ let tmp;
+ let type;
+ let isGroupedType = false;
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+
+ switch (this.state.type) {
+ case 5:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: true
+ });
+
+ case 6:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: true,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: false
+ });
+
+ case 0:
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseTupleType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ return type;
+
+ case 47:
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ this.expect(10);
+ tmp = this.flowParseFunctionTypeParams();
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ node.this = tmp._this;
+ this.expect(11);
+ this.expect(19);
+ node.returnType = this.flowParseType();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+
+ case 10:
+ this.next();
+
+ if (!this.match(11) && !this.match(21)) {
+ if (tokenIsIdentifier(this.state.type) || this.match(78)) {
+ const token = this.lookahead().type;
+ isGroupedType = token !== 17 && token !== 14;
+ } else {
+ isGroupedType = true;
+ }
+ }
+
+ if (isGroupedType) {
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+
+ if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) {
+ this.expect(11);
+ return type;
+ } else {
+ this.eat(12);
+ }
+ }
+
+ if (type) {
+ tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
+ } else {
+ tmp = this.flowParseFunctionTypeParams();
+ }
+
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ node.this = tmp._this;
+ this.expect(11);
+ this.expect(19);
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+
+ case 129:
+ return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
+
+ case 85:
+ case 86:
+ node.value = this.match(85);
+ this.next();
+ return this.finishNode(node, "BooleanLiteralTypeAnnotation");
+
+ case 53:
+ if (this.state.value === "-") {
+ this.next();
+
+ if (this.match(130)) {
+ return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node);
+ }
+
+ if (this.match(131)) {
+ return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
+ }
+
+ throw this.raise(FlowErrors.UnexpectedSubtractionOperand, {
+ at: this.state.startLoc
+ });
+ }
+
+ throw this.unexpected();
+
+ case 130:
+ return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
+
+ case 131:
+ return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
+
+ case 88:
+ this.next();
+ return this.finishNode(node, "VoidTypeAnnotation");
+
+ case 84:
+ this.next();
+ return this.finishNode(node, "NullLiteralTypeAnnotation");
+
+ case 78:
+ this.next();
+ return this.finishNode(node, "ThisTypeAnnotation");
+
+ case 55:
+ this.next();
+ return this.finishNode(node, "ExistsTypeAnnotation");
+
+ case 87:
+ return this.flowParseTypeofType();
+
+ default:
+ if (tokenIsKeyword(this.state.type)) {
+ const label = tokenLabelName(this.state.type);
+ this.next();
+ return super.createIdentifier(node, label);
+ } else if (tokenIsIdentifier(this.state.type)) {
+ if (this.isContextual(125)) {
+ return this.flowParseInterfaceType();
+ }
+
+ return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
+ }
+
+ }
+
+ throw this.unexpected();
+ }
+
+ flowParsePostfixType() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let type = this.flowParsePrimaryType();
+ let seenOptionalIndexedAccess = false;
+
+ while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const optional = this.eat(18);
+ seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;
+ this.expect(0);
+
+ if (!optional && this.match(3)) {
+ node.elementType = type;
+ this.next();
+ type = this.finishNode(node, "ArrayTypeAnnotation");
+ } else {
+ node.objectType = type;
+ node.indexType = this.flowParseType();
+ this.expect(3);
+
+ if (seenOptionalIndexedAccess) {
+ node.optional = optional;
+ type = this.finishNode(node, "OptionalIndexedAccessType");
+ } else {
+ type = this.finishNode(node, "IndexedAccessType");
+ }
+ }
+ }
+
+ return type;
+ }
+
+ flowParsePrefixType() {
+ const node = this.startNode();
+
+ if (this.eat(17)) {
+ node.typeAnnotation = this.flowParsePrefixType();
+ return this.finishNode(node, "NullableTypeAnnotation");
+ } else {
+ return this.flowParsePostfixType();
+ }
+ }
+
+ flowParseAnonFunctionWithoutParens() {
+ const param = this.flowParsePrefixType();
+
+ if (!this.state.noAnonFunctionType && this.eat(19)) {
+ const node = this.startNodeAt(param.start, param.loc.start);
+ node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
+ node.rest = null;
+ node.this = null;
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ return param;
+ }
+
+ flowParseIntersectionType() {
+ const node = this.startNode();
+ this.eat(45);
+ const type = this.flowParseAnonFunctionWithoutParens();
+ node.types = [type];
+
+ while (this.eat(45)) {
+ node.types.push(this.flowParseAnonFunctionWithoutParens());
+ }
+
+ return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
+ }
+
+ flowParseUnionType() {
+ const node = this.startNode();
+ this.eat(43);
+ const type = this.flowParseIntersectionType();
+ node.types = [type];
+
+ while (this.eat(43)) {
+ node.types.push(this.flowParseIntersectionType());
+ }
+
+ return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
+ }
+
+ flowParseType() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const type = this.flowParseUnionType();
+ this.state.inType = oldInType;
+ return type;
+ }
+
+ flowParseTypeOrImplicitInstantiation() {
+ if (this.state.type === 128 && this.state.value === "_") {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const node = this.parseIdentifier();
+ return this.flowParseGenericType(startPos, startLoc, node);
+ } else {
+ return this.flowParseType();
+ }
+ }
+
+ flowParseTypeAnnotation() {
+ const node = this.startNode();
+ node.typeAnnotation = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "TypeAnnotation");
+ }
+
+ flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
+ const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
+
+ if (this.match(14)) {
+ ident.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(ident);
+ }
+
+ return ident;
+ }
+
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+
+ flowParseVariance() {
+ let variance = null;
+
+ if (this.match(53)) {
+ variance = this.startNode();
+
+ if (this.state.value === "+") {
+ variance.kind = "plus";
+ } else {
+ variance.kind = "minus";
+ }
+
+ this.next();
+ return this.finishNode(variance, "Variance");
+ }
+
+ return variance;
+ }
+
+ parseFunctionBody(node, allowExpressionBody, isMethod = false) {
+ if (allowExpressionBody) {
+ return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));
+ }
+
+ return super.parseFunctionBody(node, false, isMethod);
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(14)) {
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
+ }
+
+ return super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+
+ parseStatement(context, topLevel) {
+ if (this.state.strict && this.isContextual(125)) {
+ const lookahead = this.lookahead();
+
+ if (tokenIsKeywordOrIdentifier(lookahead.type)) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseInterface(node);
+ }
+ } else if (this.shouldParseEnums() && this.isContextual(122)) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+
+ const stmt = super.parseStatement(context, topLevel);
+
+ if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {
+ this.flowPragma = null;
+ }
+
+ return stmt;
+ }
+
+ parseExpressionStatement(node, expr) {
+ if (expr.type === "Identifier") {
+ if (expr.name === "declare") {
+ if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) {
+ return this.flowParseDeclare(node);
+ }
+ } else if (tokenIsIdentifier(this.state.type)) {
+ if (expr.name === "interface") {
+ return this.flowParseInterface(node);
+ } else if (expr.name === "type") {
+ return this.flowParseTypeAlias(node);
+ } else if (expr.name === "opaque") {
+ return this.flowParseOpaqueType(node, false);
+ }
+ }
+ }
+
+ return super.parseExpressionStatement(node, expr);
+ }
+
+ shouldParseExportDeclaration() {
+ const {
+ type
+ } = this.state;
+
+ if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 122) {
+ return !this.state.containsEsc;
+ }
+
+ return super.shouldParseExportDeclaration();
+ }
+
+ isExportDefaultSpecifier() {
+ const {
+ type
+ } = this.state;
+
+ if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 122) {
+ return this.state.containsEsc;
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseExportDefaultExpression() {
+ if (this.shouldParseEnums() && this.isContextual(122)) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseConditional(expr, startPos, startLoc, refExpressionErrors) {
+ if (!this.match(17)) return expr;
+
+ if (this.state.maybeInArrowParameters) {
+ const nextCh = this.lookaheadCharCode();
+
+ if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) {
+ this.setOptionalParametersError(refExpressionErrors);
+ return expr;
+ }
+ }
+
+ this.expect(17);
+ const state = this.state.clone();
+ const originalNoArrowAt = this.state.noArrowAt;
+ const node = this.startNodeAt(startPos, startLoc);
+ let {
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent();
+ let [valid, invalid] = this.getArrowLikeExpressions(consequent);
+
+ if (failed || invalid.length > 0) {
+ const noArrowAt = [...originalNoArrowAt];
+
+ if (invalid.length > 0) {
+ this.state = state;
+ this.state.noArrowAt = noArrowAt;
+
+ for (let i = 0; i < invalid.length; i++) {
+ noArrowAt.push(invalid[i].start);
+ }
+
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ [valid, invalid] = this.getArrowLikeExpressions(consequent);
+ }
+
+ if (failed && valid.length > 1) {
+ this.raise(FlowErrors.AmbiguousConditionalArrow, {
+ at: state.startLoc
+ });
+ }
+
+ if (failed && valid.length === 1) {
+ this.state = state;
+ noArrowAt.push(valid[0].start);
+ this.state.noArrowAt = noArrowAt;
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ }
+ }
+
+ this.getArrowLikeExpressions(consequent, true);
+ this.state.noArrowAt = originalNoArrowAt;
+ this.expect(14);
+ node.test = expr;
+ node.consequent = consequent;
+ node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined));
+ return this.finishNode(node, "ConditionalExpression");
+ }
+
+ tryParseConditionalConsequent() {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ const consequent = this.parseMaybeAssignAllowIn();
+ const failed = !this.match(14);
+ this.state.noArrowParamsConversionAt.pop();
+ return {
+ consequent,
+ failed
+ };
+ }
+
+ getArrowLikeExpressions(node, disallowInvalid) {
+ const stack = [node];
+ const arrows = [];
+
+ while (stack.length !== 0) {
+ const node = stack.pop();
+
+ if (node.type === "ArrowFunctionExpression") {
+ if (node.typeParameters || !node.returnType) {
+ this.finishArrowValidation(node);
+ } else {
+ arrows.push(node);
+ }
+
+ stack.push(node.body);
+ } else if (node.type === "ConditionalExpression") {
+ stack.push(node.consequent);
+ stack.push(node.alternate);
+ }
+ }
+
+ if (disallowInvalid) {
+ arrows.forEach(node => this.finishArrowValidation(node));
+ return [arrows, []];
+ }
+
+ return partition(arrows, node => node.params.every(param => this.isAssignable(param, true)));
+ }
+
+ finishArrowValidation(node) {
+ var _node$extra;
+
+ this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false);
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
+ super.checkParams(node, false, true);
+ this.scope.exit();
+ }
+
+ forwardNoArrowParamsConversionAt(node, parse) {
+ let result;
+
+ if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ result = parse();
+ this.state.noArrowParamsConversionAt.pop();
+ } else {
+ result = parse();
+ }
+
+ return result;
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ node = super.parseParenItem(node, startPos, startLoc);
+
+ if (this.eat(17)) {
+ node.optional = true;
+ this.resetEndLocation(node);
+ }
+
+ if (this.match(14)) {
+ const typeCastNode = this.startNodeAt(startPos, startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TypeCastExpression");
+ }
+
+ return node;
+ }
+
+ assertModuleNodeAllowed(node) {
+ if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") {
+ return;
+ }
+
+ super.assertModuleNodeAllowed(node);
+ }
+
+ parseExport(node) {
+ const decl = super.parseExport(node);
+
+ if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") {
+ decl.exportKind = decl.exportKind || "value";
+ }
+
+ return decl;
+ }
+
+ parseExportDeclaration(node) {
+ if (this.isContextual(126)) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+
+ if (this.match(5)) {
+ node.specifiers = this.parseExportSpecifiers(true);
+ super.parseExportFrom(node);
+ return null;
+ } else {
+ return this.flowParseTypeAlias(declarationNode);
+ }
+ } else if (this.isContextual(127)) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseOpaqueType(declarationNode, false);
+ } else if (this.isContextual(125)) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseInterface(declarationNode);
+ } else if (this.shouldParseEnums() && this.isContextual(122)) {
+ node.exportKind = "value";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(declarationNode);
+ } else {
+ return super.parseExportDeclaration(node);
+ }
+ }
+
+ eatExportStar(node) {
+ if (super.eatExportStar(node)) return true;
+
+ if (this.isContextual(126) && this.lookahead().type === 55) {
+ node.exportKind = "type";
+ this.next();
+ this.next();
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamespaceSpecifier(node) {
+ const {
+ startLoc
+ } = this.state;
+ const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);
+
+ if (hasNamespace && node.exportKind === "type") {
+ this.unexpected(startLoc);
+ }
+
+ return hasNamespace;
+ }
+
+ parseClassId(node, isStatement, optionalId) {
+ super.parseClassId(node, isStatement, optionalId);
+
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ }
+
+ parseClassMember(classBody, member, state) {
+ const {
+ startLoc
+ } = this.state;
+
+ if (this.isContextual(121)) {
+ if (super.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+
+ member.declare = true;
+ }
+
+ super.parseClassMember(classBody, member, state);
+
+ if (member.declare) {
+ if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") {
+ this.raise(FlowErrors.DeclareClassElement, {
+ at: startLoc
+ });
+ } else if (member.value) {
+ this.raise(FlowErrors.DeclareClassFieldInitializer, {
+ at: member.value
+ });
+ }
+ }
+ }
+
+ isIterator(word) {
+ return word === "iterator" || word === "asyncIterator";
+ }
+
+ readIterator() {
+ const word = super.readWord1();
+ const fullWord = "@@" + word;
+
+ if (!this.isIterator(word) || !this.state.inType) {
+ this.raise(Errors.InvalidIdentifier, {
+ at: this.state.curPosition(),
+ identifierName: fullWord
+ });
+ }
+
+ this.finishToken(128, fullWord);
+ }
+
+ getTokenFromCode(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 123 && next === 124) {
+ return this.finishOp(6, 2);
+ } else if (this.state.inType && (code === 62 || code === 60)) {
+ return this.finishOp(code === 62 ? 48 : 47, 1);
+ } else if (this.state.inType && code === 63) {
+ if (next === 46) {
+ return this.finishOp(18, 2);
+ }
+
+ return this.finishOp(17, 1);
+ } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) {
+ this.state.pos += 2;
+ return this.readIterator();
+ } else {
+ return super.getTokenFromCode(code);
+ }
+ }
+
+ isAssignable(node, isBinding) {
+ if (node.type === "TypeCastExpression") {
+ return this.isAssignable(node.expression, isBinding);
+ } else {
+ return super.isAssignable(node, isBinding);
+ }
+ }
+
+ toAssignable(node, isLHS = false) {
+ if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") {
+ node.left = this.typeCastToParameter(node.left);
+ }
+
+ super.toAssignable(node, isLHS);
+ }
+
+ toAssignableList(exprList, trailingCommaLoc, isLHS) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+
+ if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") {
+ exprList[i] = this.typeCastToParameter(expr);
+ }
+ }
+
+ super.toAssignableList(exprList, trailingCommaLoc, isLHS);
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ for (let i = 0; i < exprList.length; i++) {
+ var _expr$extra;
+
+ const expr = exprList[i];
+
+ if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
+ this.raise(FlowErrors.TypeCastInPattern, {
+ at: expr.typeAnnotation
+ });
+ }
+ }
+
+ return exprList;
+ }
+
+ parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
+ const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);
+
+ if (canBePattern && !this.state.maybeInArrowParameters) {
+ this.toReferencedList(node.elements);
+ }
+
+ return node;
+ }
+
+ isValidLVal(type, isParenthesized, binding) {
+ return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding);
+ }
+
+ parseClassProperty(node) {
+ if (this.match(14)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (this.match(14)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ return super.parseClassPrivateProperty(node);
+ }
+
+ isClassMethod() {
+ return this.match(47) || super.isClassMethod();
+ }
+
+ isClassProperty() {
+ return this.match(14) || super.isClassProperty();
+ }
+
+ isNonstaticConstructor(method) {
+ return !this.match(14) && super.isNonstaticConstructor(method);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ if (method.variance) {
+ this.unexpected(method.variance.loc.start);
+ }
+
+ delete method.variance;
+
+ if (this.match(47)) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+
+ if (method.params && isConstructor) {
+ const params = method.params;
+
+ if (params.length > 0 && this.isThisParam(params[0])) {
+ this.raise(FlowErrors.ThisParamBannedInConstructor, {
+ at: method
+ });
+ }
+ } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) {
+ const params = method.value.params;
+
+ if (params.length > 0 && this.isThisParam(params[0])) {
+ this.raise(FlowErrors.ThisParamBannedInConstructor, {
+ at: method
+ });
+ }
+ }
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ if (method.variance) {
+ this.unexpected(method.variance.loc.start);
+ }
+
+ delete method.variance;
+
+ if (this.match(47)) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+
+ if (node.superClass && this.match(47)) {
+ node.superTypeParameters = this.flowParseTypeParameterInstantiation();
+ }
+
+ if (this.isContextual(110)) {
+ this.next();
+ const implemented = node.implements = [];
+
+ do {
+ const node = this.startNode();
+ node.id = this.flowParseRestrictedIdentifier(true);
+
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+
+ implemented.push(this.finishNode(node, "ClassImplements"));
+ } while (this.eat(12));
+ }
+ }
+
+ checkGetterSetterParams(method) {
+ super.checkGetterSetterParams(method);
+ const params = this.getObjectOrClassMethodParams(method);
+
+ if (params.length > 0) {
+ const param = params[0];
+
+ if (this.isThisParam(param) && method.kind === "get") {
+ this.raise(FlowErrors.GetterMayNotHaveThisParam, {
+ at: param
+ });
+ } else if (this.isThisParam(param)) {
+ this.raise(FlowErrors.SetterMayNotHaveThisParam, {
+ at: param
+ });
+ }
+ }
+ }
+
+ parsePropertyNamePrefixOperator(node) {
+ node.variance = this.flowParseVariance();
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
+ if (prop.variance) {
+ this.unexpected(prop.variance.loc.start);
+ }
+
+ delete prop.variance;
+ let typeParameters;
+
+ if (this.match(47) && !isAccessor) {
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ if (!this.match(10)) this.unexpected();
+ }
+
+ const result = super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
+
+ if (typeParameters) {
+ (result.value || result).typeParameters = typeParameters;
+ }
+
+ return result;
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(17)) {
+ if (param.type !== "Identifier") {
+ this.raise(FlowErrors.PatternIsOptional, {
+ at: param
+ });
+ }
+
+ if (this.isThisParam(param)) {
+ this.raise(FlowErrors.ThisParamMayNotBeOptional, {
+ at: param
+ });
+ }
+
+ param.optional = true;
+ }
+
+ if (this.match(14)) {
+ param.typeAnnotation = this.flowParseTypeAnnotation();
+ } else if (this.isThisParam(param)) {
+ this.raise(FlowErrors.ThisParamAnnotationRequired, {
+ at: param
+ });
+ }
+
+ if (this.match(29) && this.isThisParam(param)) {
+ this.raise(FlowErrors.ThisParamNoDefault, {
+ at: param
+ });
+ }
+
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ const node = super.parseMaybeDefault(startPos, startLoc, left);
+
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(FlowErrors.TypeBeforeInitializer, {
+ at: node.typeAnnotation
+ });
+ }
+
+ return node;
+ }
+
+ shouldParseDefaultImport(node) {
+ if (!hasTypeImportKind(node)) {
+ return super.shouldParseDefaultImport(node);
+ }
+
+ return isMaybeDefaultImport(this.state.type);
+ }
+
+ parseImportSpecifierLocal(node, specifier, type) {
+ specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();
+ node.specifiers.push(this.finishImportSpecifier(specifier, type));
+ }
+
+ maybeParseDefaultImportSpecifier(node) {
+ node.importKind = "value";
+ let kind = null;
+
+ if (this.match(87)) {
+ kind = "typeof";
+ } else if (this.isContextual(126)) {
+ kind = "type";
+ }
+
+ if (kind) {
+ const lh = this.lookahead();
+ const {
+ type
+ } = lh;
+
+ if (kind === "type" && type === 55) {
+ this.unexpected(null, lh.type);
+ }
+
+ if (isMaybeDefaultImport(type) || type === 5 || type === 55) {
+ this.next();
+ node.importKind = kind;
+ }
+ }
+
+ return super.maybeParseDefaultImportSpecifier(node);
+ }
+
+ parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
+ const firstIdent = specifier.imported;
+ let specifierTypeKind = null;
+
+ if (firstIdent.type === "Identifier") {
+ if (firstIdent.name === "type") {
+ specifierTypeKind = "type";
+ } else if (firstIdent.name === "typeof") {
+ specifierTypeKind = "typeof";
+ }
+ }
+
+ let isBinding = false;
+
+ if (this.isContextual(93) && !this.isLookaheadContextual("as")) {
+ const as_ident = this.parseIdentifier(true);
+
+ if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) {
+ specifier.imported = as_ident;
+ specifier.importKind = specifierTypeKind;
+ specifier.local = cloneIdentifier(as_ident);
+ } else {
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ specifier.local = this.parseIdentifier();
+ }
+ } else {
+ if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) {
+ specifier.imported = this.parseIdentifier(true);
+ specifier.importKind = specifierTypeKind;
+ } else {
+ if (importedIsString) {
+ throw this.raise(Errors.ImportBindingIsString, {
+ at: specifier,
+ importName: firstIdent.value
+ });
+ }
+
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ }
+
+ if (this.eatContextual(93)) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ isBinding = true;
+ specifier.local = cloneIdentifier(specifier.imported);
+ }
+ }
+
+ const specifierIsTypeImport = hasTypeImportKind(specifier);
+
+ if (isInTypeOnlyImport && specifierIsTypeImport) {
+ this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, {
+ at: specifier
+ });
+ }
+
+ if (isInTypeOnlyImport || specifierIsTypeImport) {
+ this.checkReservedType(specifier.local.name, specifier.local.loc.start, true);
+ }
+
+ if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) {
+ this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true);
+ }
+
+ return this.finishImportSpecifier(specifier, "ImportSpecifier");
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 78:
+ return this.parseIdentifier(true);
+
+ default:
+ return super.parseBindingAtom();
+ }
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const kind = node.kind;
+
+ if (kind !== "get" && kind !== "set" && this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.parseFunctionParams(node, allowModifiers);
+ }
+
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+
+ if (this.match(14)) {
+ decl.id.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(decl.id);
+ }
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(14)) {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ node.returnType = this.flowParseTypeAnnotation();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ }
+
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(14) || super.shouldParseAsyncArrow();
+ }
+
+ parseMaybeAssign(refExpressionErrors, afterLeftParse) {
+ var _jsx;
+
+ let state = null;
+ let jsx;
+
+ if (this.hasPlugin("jsx") && (this.match(138) || this.match(47))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+ const currentContext = context[context.length - 1];
+
+ if (currentContext === types.j_oTag || currentContext === types.j_expr) {
+ context.pop();
+ }
+ }
+
+ if ((_jsx = jsx) != null && _jsx.error || this.match(47)) {
+ var _jsx2, _jsx3;
+
+ state = state || this.state.clone();
+ let typeParameters;
+ const arrow = this.tryParse(abort => {
+ var _arrowExpression$extr;
+
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => {
+ const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ this.resetStartLocationFromNode(result, typeParameters);
+ return result;
+ });
+ if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort();
+ const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);
+ if (expr.type !== "ArrowFunctionExpression") abort();
+ expr.typeParameters = typeParameters;
+ this.resetStartLocationFromNode(expr, typeParameters);
+ return arrowExpression;
+ }, state);
+ let arrowExpression = null;
+
+ if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") {
+ if (!arrow.error && !arrow.aborted) {
+ if (arrow.node.async) {
+ this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, {
+ at: typeParameters
+ });
+ }
+
+ return arrow.node;
+ }
+
+ arrowExpression = arrow.node;
+ }
+
+ if ((_jsx2 = jsx) != null && _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrowExpression) {
+ this.state = arrow.failState;
+ return arrowExpression;
+ }
+
+ if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, {
+ at: typeParameters
+ });
+ }
+
+ return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ }
+
+ parseArrow(node) {
+ if (this.match(14)) {
+ const result = this.tryParse(() => {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ if (this.canInsertSemicolon()) this.unexpected();
+ if (!this.match(19)) this.unexpected();
+ return typeNode;
+ });
+ if (result.thrown) return null;
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
+ }
+
+ return super.parseArrow(node);
+ }
+
+ shouldParseArrow(params) {
+ return this.match(14) || super.shouldParseArrow(params);
+ }
+
+ setArrowFunctionParameters(node, params) {
+ if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ node.params = params;
+ } else {
+ super.setArrowFunctionParameters(node, params);
+ }
+ }
+
+ checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
+ if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ return;
+ }
+
+ for (let i = 0; i < node.params.length; i++) {
+ if (this.isThisParam(node.params[i]) && i > 0) {
+ this.raise(FlowErrors.ThisParamMustBeFirst, {
+ at: node.params[i]
+ });
+ }
+ }
+
+ return super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged);
+ }
+
+ parseParenAndDistinguishExpression(canBeArrow) {
+ return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) {
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.arguments = super.parseCallExpressionArguments(11, false);
+ base = this.finishNode(node, "CallExpression");
+ } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) {
+ const state = this.state.clone();
+ const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+ const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state);
+ if (result.node && !result.error) return result.node;
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if (result.node) {
+ this.state = result.failState;
+ return result.node;
+ }
+
+ throw arrow.error || result.error;
+ }
+
+ return super.parseSubscripts(base, startPos, startLoc, noCalls);
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, subscriptState) {
+ if (this.match(18) && this.isLookaheadToken_lt()) {
+ subscriptState.optionalChainMember = true;
+
+ if (noCalls) {
+ subscriptState.stop = true;
+ return base;
+ }
+
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.typeArguments = this.flowParseTypeParameterInstantiation();
+ this.expect(10);
+ node.arguments = this.parseCallExpressionArguments(11, false);
+ node.optional = true;
+ return this.finishCallExpression(node, true);
+ } else if (!noCalls && this.shouldParseTypes() && this.match(47)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const result = this.tryParse(() => {
+ node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ this.expect(10);
+ node.arguments = super.parseCallExpressionArguments(11, false);
+
+ if (subscriptState.optionalChainMember) {
+ node.optional = false;
+ }
+
+ return this.finishCallExpression(node, subscriptState.optionalChainMember);
+ });
+
+ if (result.node) {
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState);
+ }
+
+ parseNewCallee(node) {
+ super.parseNewCallee(node);
+ let targs = null;
+
+ if (this.shouldParseTypes() && this.match(47)) {
+ targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;
+ }
+
+ node.typeArguments = targs;
+ }
+
+ parseAsyncArrowWithTypeParameters(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ this.parseFunctionParams(node);
+ if (!this.parseArrow(node)) return;
+ return super.parseArrowExpression(node, undefined, true);
+ }
+
+ readToken_mult_modulo(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 42 && next === 47 && this.state.hasFlowComment) {
+ this.state.hasFlowComment = false;
+ this.state.pos += 2;
+ this.nextToken();
+ return;
+ }
+
+ super.readToken_mult_modulo(code);
+ }
+
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 124 && next === 125) {
+ this.finishOp(9, 2);
+ return;
+ }
+
+ super.readToken_pipe_amp(code);
+ }
+
+ parseTopLevel(file, program) {
+ const fileNode = super.parseTopLevel(file, program);
+
+ if (this.state.hasFlowComment) {
+ this.raise(FlowErrors.UnterminatedFlowComment, {
+ at: this.state.curPosition()
+ });
+ }
+
+ return fileNode;
+ }
+
+ skipBlockComment() {
+ if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
+ if (this.state.hasFlowComment) {
+ throw this.raise(FlowErrors.NestedFlowComment, {
+ at: this.state.startLoc
+ });
+ }
+
+ this.hasFlowCommentCompletion();
+ const commentSkip = this.skipFlowComment();
+
+ if (commentSkip) {
+ this.state.pos += commentSkip;
+ this.state.hasFlowComment = true;
+ }
+
+ return;
+ }
+
+ if (this.state.hasFlowComment) {
+ const end = this.input.indexOf("*-/", this.state.pos + 2);
+
+ if (end === -1) {
+ throw this.raise(Errors.UnterminatedComment, {
+ at: this.state.curPosition()
+ });
+ }
+
+ this.state.pos = end + 2 + 3;
+ return;
+ }
+
+ return super.skipBlockComment();
+ }
+
+ skipFlowComment() {
+ const {
+ pos
+ } = this.state;
+ let shiftToFirstNonWhiteSpace = 2;
+
+ while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
+ shiftToFirstNonWhiteSpace++;
+ }
+
+ const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);
+ const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);
+
+ if (ch2 === 58 && ch3 === 58) {
+ return shiftToFirstNonWhiteSpace + 2;
+ }
+
+ if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") {
+ return shiftToFirstNonWhiteSpace + 12;
+ }
+
+ if (ch2 === 58 && ch3 !== 58) {
+ return shiftToFirstNonWhiteSpace;
+ }
+
+ return false;
+ }
+
+ hasFlowCommentCompletion() {
+ const end = this.input.indexOf("*/", this.state.pos);
+
+ if (end === -1) {
+ throw this.raise(Errors.UnterminatedComment, {
+ at: this.state.curPosition()
+ });
+ }
+ }
+
+ flowEnumErrorBooleanMemberNotInitialized(loc, {
+ enumName,
+ memberName
+ }) {
+ this.raise(FlowErrors.EnumBooleanMemberNotInitialized, {
+ at: loc,
+ memberName,
+ enumName
+ });
+ }
+
+ flowEnumErrorInvalidMemberInitializer(loc, enumContext) {
+ return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, Object.assign({
+ at: loc
+ }, enumContext));
+ }
+
+ flowEnumErrorNumberMemberNotInitialized(loc, {
+ enumName,
+ memberName
+ }) {
+ this.raise(FlowErrors.EnumNumberMemberNotInitialized, {
+ at: loc,
+ enumName,
+ memberName
+ });
+ }
+
+ flowEnumErrorStringMemberInconsistentlyInitailized(node, {
+ enumName
+ }) {
+ this.raise(FlowErrors.EnumStringMemberInconsistentlyInitailized, {
+ at: node,
+ enumName
+ });
+ }
+
+ flowEnumMemberInit() {
+ const startLoc = this.state.startLoc;
+
+ const endOfInit = () => this.match(12) || this.match(8);
+
+ switch (this.state.type) {
+ case 130:
+ {
+ const literal = this.parseNumericLiteral(this.state.value);
+
+ if (endOfInit()) {
+ return {
+ type: "number",
+ loc: literal.loc.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ loc: startLoc
+ };
+ }
+
+ case 129:
+ {
+ const literal = this.parseStringLiteral(this.state.value);
+
+ if (endOfInit()) {
+ return {
+ type: "string",
+ loc: literal.loc.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ loc: startLoc
+ };
+ }
+
+ case 85:
+ case 86:
+ {
+ const literal = this.parseBooleanLiteral(this.match(85));
+
+ if (endOfInit()) {
+ return {
+ type: "boolean",
+ loc: literal.loc.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ loc: startLoc
+ };
+ }
+
+ default:
+ return {
+ type: "invalid",
+ loc: startLoc
+ };
+ }
+ }
+
+ flowEnumMemberRaw() {
+ const loc = this.state.startLoc;
+ const id = this.parseIdentifier(true);
+ const init = this.eat(29) ? this.flowEnumMemberInit() : {
+ type: "none",
+ loc
+ };
+ return {
+ id,
+ init
+ };
+ }
+
+ flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
+ const {
+ explicitType
+ } = context;
+
+ if (explicitType === null) {
+ return;
+ }
+
+ if (explicitType !== expectedType) {
+ this.flowEnumErrorInvalidMemberInitializer(loc, context);
+ }
+ }
+
+ flowEnumMembers({
+ enumName,
+ explicitType
+ }) {
+ const seenNames = new Set();
+ const members = {
+ booleanMembers: [],
+ numberMembers: [],
+ stringMembers: [],
+ defaultedMembers: []
+ };
+ let hasUnknownMembers = false;
+
+ while (!this.match(8)) {
+ if (this.eat(21)) {
+ hasUnknownMembers = true;
+ break;
+ }
+
+ const memberNode = this.startNode();
+ const {
+ id,
+ init
+ } = this.flowEnumMemberRaw();
+ const memberName = id.name;
+
+ if (memberName === "") {
+ continue;
+ }
+
+ if (/^[a-z]/.test(memberName)) {
+ this.raise(FlowErrors.EnumInvalidMemberName, {
+ at: id,
+ memberName,
+ suggestion: memberName[0].toUpperCase() + memberName.slice(1),
+ enumName
+ });
+ }
+
+ if (seenNames.has(memberName)) {
+ this.raise(FlowErrors.EnumDuplicateMemberName, {
+ at: id,
+ memberName,
+ enumName
+ });
+ }
+
+ seenNames.add(memberName);
+ const context = {
+ enumName,
+ explicitType,
+ memberName
+ };
+ memberNode.id = id;
+
+ switch (init.type) {
+ case "boolean":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean");
+ memberNode.init = init.value;
+ members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
+ break;
+ }
+
+ case "number":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number");
+ memberNode.init = init.value;
+ members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
+ break;
+ }
+
+ case "string":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string");
+ memberNode.init = init.value;
+ members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
+ break;
+ }
+
+ case "invalid":
+ {
+ throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context);
+ }
+
+ case "none":
+ {
+ switch (explicitType) {
+ case "boolean":
+ this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context);
+ break;
+
+ case "number":
+ this.flowEnumErrorNumberMemberNotInitialized(init.loc, context);
+ break;
+
+ default:
+ members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
+ }
+ }
+ }
+
+ if (!this.match(8)) {
+ this.expect(12);
+ }
+ }
+
+ return {
+ members,
+ hasUnknownMembers
+ };
+ }
+
+ flowEnumStringMembers(initializedMembers, defaultedMembers, {
+ enumName
+ }) {
+ if (initializedMembers.length === 0) {
+ return defaultedMembers;
+ } else if (defaultedMembers.length === 0) {
+ return initializedMembers;
+ } else if (defaultedMembers.length > initializedMembers.length) {
+ for (const member of initializedMembers) {
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member, {
+ enumName
+ });
+ }
+
+ return defaultedMembers;
+ } else {
+ for (const member of defaultedMembers) {
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member, {
+ enumName
+ });
+ }
+
+ return initializedMembers;
+ }
+ }
+
+ flowEnumParseExplicitType({
+ enumName
+ }) {
+ if (!this.eatContextual(101)) return null;
+
+ if (!tokenIsIdentifier(this.state.type)) {
+ throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, {
+ at: this.state.startLoc,
+ enumName
+ });
+ }
+
+ const {
+ value
+ } = this.state;
+ this.next();
+
+ if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") {
+ this.raise(FlowErrors.EnumInvalidExplicitType, {
+ at: this.state.startLoc,
+ enumName,
+ invalidEnumType: value
+ });
+ }
+
+ return value;
+ }
+
+ flowEnumBody(node, id) {
+ const enumName = id.name;
+ const nameLoc = id.loc.start;
+ const explicitType = this.flowEnumParseExplicitType({
+ enumName
+ });
+ this.expect(5);
+ const {
+ members,
+ hasUnknownMembers
+ } = this.flowEnumMembers({
+ enumName,
+ explicitType
+ });
+ node.hasUnknownMembers = hasUnknownMembers;
+
+ switch (explicitType) {
+ case "boolean":
+ node.explicitType = true;
+ node.members = members.booleanMembers;
+ this.expect(8);
+ return this.finishNode(node, "EnumBooleanBody");
+
+ case "number":
+ node.explicitType = true;
+ node.members = members.numberMembers;
+ this.expect(8);
+ return this.finishNode(node, "EnumNumberBody");
+
+ case "string":
+ node.explicitType = true;
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(8);
+ return this.finishNode(node, "EnumStringBody");
+
+ case "symbol":
+ node.members = members.defaultedMembers;
+ this.expect(8);
+ return this.finishNode(node, "EnumSymbolBody");
+
+ default:
+ {
+ const empty = () => {
+ node.members = [];
+ this.expect(8);
+ return this.finishNode(node, "EnumStringBody");
+ };
+
+ node.explicitType = false;
+ const boolsLen = members.booleanMembers.length;
+ const numsLen = members.numberMembers.length;
+ const strsLen = members.stringMembers.length;
+ const defaultedLen = members.defaultedMembers.length;
+
+ if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
+ return empty();
+ } else if (!boolsLen && !numsLen) {
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(8);
+ return this.finishNode(node, "EnumStringBody");
+ } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
+ for (const member of members.defaultedMembers) {
+ this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.booleanMembers;
+ this.expect(8);
+ return this.finishNode(node, "EnumBooleanBody");
+ } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
+ for (const member of members.defaultedMembers) {
+ this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.numberMembers;
+ this.expect(8);
+ return this.finishNode(node, "EnumNumberBody");
+ } else {
+ this.raise(FlowErrors.EnumInconsistentMemberValues, {
+ at: nameLoc,
+ enumName
+ });
+ return empty();
+ }
+ }
+ }
+ }
+
+ flowParseEnumDeclaration(node) {
+ const id = this.parseIdentifier();
+ node.id = id;
+ node.body = this.flowEnumBody(this.startNode(), id);
+ return this.finishNode(node, "EnumDeclaration");
+ }
+
+ isLookaheadToken_lt() {
+ const next = this.nextTokenStart();
+
+ if (this.input.charCodeAt(next) === 60) {
+ const afterNext = this.input.charCodeAt(next + 1);
+ return afterNext !== 60 && afterNext !== 61;
+ }
+
+ return false;
+ }
+
+ maybeUnwrapTypeCastExpression(node) {
+ return node.type === "TypeCastExpression" ? node.expression : node;
+ }
+
+});
+
+const entities = {
+ __proto__: null,
+ quot: "\u0022",
+ amp: "&",
+ apos: "\u0027",
+ lt: "<",
+ gt: ">",
+ nbsp: "\u00A0",
+ iexcl: "\u00A1",
+ cent: "\u00A2",
+ pound: "\u00A3",
+ curren: "\u00A4",
+ yen: "\u00A5",
+ brvbar: "\u00A6",
+ sect: "\u00A7",
+ uml: "\u00A8",
+ copy: "\u00A9",
+ ordf: "\u00AA",
+ laquo: "\u00AB",
+ not: "\u00AC",
+ shy: "\u00AD",
+ reg: "\u00AE",
+ macr: "\u00AF",
+ deg: "\u00B0",
+ plusmn: "\u00B1",
+ sup2: "\u00B2",
+ sup3: "\u00B3",
+ acute: "\u00B4",
+ micro: "\u00B5",
+ para: "\u00B6",
+ middot: "\u00B7",
+ cedil: "\u00B8",
+ sup1: "\u00B9",
+ ordm: "\u00BA",
+ raquo: "\u00BB",
+ frac14: "\u00BC",
+ frac12: "\u00BD",
+ frac34: "\u00BE",
+ iquest: "\u00BF",
+ Agrave: "\u00C0",
+ Aacute: "\u00C1",
+ Acirc: "\u00C2",
+ Atilde: "\u00C3",
+ Auml: "\u00C4",
+ Aring: "\u00C5",
+ AElig: "\u00C6",
+ Ccedil: "\u00C7",
+ Egrave: "\u00C8",
+ Eacute: "\u00C9",
+ Ecirc: "\u00CA",
+ Euml: "\u00CB",
+ Igrave: "\u00CC",
+ Iacute: "\u00CD",
+ Icirc: "\u00CE",
+ Iuml: "\u00CF",
+ ETH: "\u00D0",
+ Ntilde: "\u00D1",
+ Ograve: "\u00D2",
+ Oacute: "\u00D3",
+ Ocirc: "\u00D4",
+ Otilde: "\u00D5",
+ Ouml: "\u00D6",
+ times: "\u00D7",
+ Oslash: "\u00D8",
+ Ugrave: "\u00D9",
+ Uacute: "\u00DA",
+ Ucirc: "\u00DB",
+ Uuml: "\u00DC",
+ Yacute: "\u00DD",
+ THORN: "\u00DE",
+ szlig: "\u00DF",
+ agrave: "\u00E0",
+ aacute: "\u00E1",
+ acirc: "\u00E2",
+ atilde: "\u00E3",
+ auml: "\u00E4",
+ aring: "\u00E5",
+ aelig: "\u00E6",
+ ccedil: "\u00E7",
+ egrave: "\u00E8",
+ eacute: "\u00E9",
+ ecirc: "\u00EA",
+ euml: "\u00EB",
+ igrave: "\u00EC",
+ iacute: "\u00ED",
+ icirc: "\u00EE",
+ iuml: "\u00EF",
+ eth: "\u00F0",
+ ntilde: "\u00F1",
+ ograve: "\u00F2",
+ oacute: "\u00F3",
+ ocirc: "\u00F4",
+ otilde: "\u00F5",
+ ouml: "\u00F6",
+ divide: "\u00F7",
+ oslash: "\u00F8",
+ ugrave: "\u00F9",
+ uacute: "\u00FA",
+ ucirc: "\u00FB",
+ uuml: "\u00FC",
+ yacute: "\u00FD",
+ thorn: "\u00FE",
+ yuml: "\u00FF",
+ OElig: "\u0152",
+ oelig: "\u0153",
+ Scaron: "\u0160",
+ scaron: "\u0161",
+ Yuml: "\u0178",
+ fnof: "\u0192",
+ circ: "\u02C6",
+ tilde: "\u02DC",
+ Alpha: "\u0391",
+ Beta: "\u0392",
+ Gamma: "\u0393",
+ Delta: "\u0394",
+ Epsilon: "\u0395",
+ Zeta: "\u0396",
+ Eta: "\u0397",
+ Theta: "\u0398",
+ Iota: "\u0399",
+ Kappa: "\u039A",
+ Lambda: "\u039B",
+ Mu: "\u039C",
+ Nu: "\u039D",
+ Xi: "\u039E",
+ Omicron: "\u039F",
+ Pi: "\u03A0",
+ Rho: "\u03A1",
+ Sigma: "\u03A3",
+ Tau: "\u03A4",
+ Upsilon: "\u03A5",
+ Phi: "\u03A6",
+ Chi: "\u03A7",
+ Psi: "\u03A8",
+ Omega: "\u03A9",
+ alpha: "\u03B1",
+ beta: "\u03B2",
+ gamma: "\u03B3",
+ delta: "\u03B4",
+ epsilon: "\u03B5",
+ zeta: "\u03B6",
+ eta: "\u03B7",
+ theta: "\u03B8",
+ iota: "\u03B9",
+ kappa: "\u03BA",
+ lambda: "\u03BB",
+ mu: "\u03BC",
+ nu: "\u03BD",
+ xi: "\u03BE",
+ omicron: "\u03BF",
+ pi: "\u03C0",
+ rho: "\u03C1",
+ sigmaf: "\u03C2",
+ sigma: "\u03C3",
+ tau: "\u03C4",
+ upsilon: "\u03C5",
+ phi: "\u03C6",
+ chi: "\u03C7",
+ psi: "\u03C8",
+ omega: "\u03C9",
+ thetasym: "\u03D1",
+ upsih: "\u03D2",
+ piv: "\u03D6",
+ ensp: "\u2002",
+ emsp: "\u2003",
+ thinsp: "\u2009",
+ zwnj: "\u200C",
+ zwj: "\u200D",
+ lrm: "\u200E",
+ rlm: "\u200F",
+ ndash: "\u2013",
+ mdash: "\u2014",
+ lsquo: "\u2018",
+ rsquo: "\u2019",
+ sbquo: "\u201A",
+ ldquo: "\u201C",
+ rdquo: "\u201D",
+ bdquo: "\u201E",
+ dagger: "\u2020",
+ Dagger: "\u2021",
+ bull: "\u2022",
+ hellip: "\u2026",
+ permil: "\u2030",
+ prime: "\u2032",
+ Prime: "\u2033",
+ lsaquo: "\u2039",
+ rsaquo: "\u203A",
+ oline: "\u203E",
+ frasl: "\u2044",
+ euro: "\u20AC",
+ image: "\u2111",
+ weierp: "\u2118",
+ real: "\u211C",
+ trade: "\u2122",
+ alefsym: "\u2135",
+ larr: "\u2190",
+ uarr: "\u2191",
+ rarr: "\u2192",
+ darr: "\u2193",
+ harr: "\u2194",
+ crarr: "\u21B5",
+ lArr: "\u21D0",
+ uArr: "\u21D1",
+ rArr: "\u21D2",
+ dArr: "\u21D3",
+ hArr: "\u21D4",
+ forall: "\u2200",
+ part: "\u2202",
+ exist: "\u2203",
+ empty: "\u2205",
+ nabla: "\u2207",
+ isin: "\u2208",
+ notin: "\u2209",
+ ni: "\u220B",
+ prod: "\u220F",
+ sum: "\u2211",
+ minus: "\u2212",
+ lowast: "\u2217",
+ radic: "\u221A",
+ prop: "\u221D",
+ infin: "\u221E",
+ ang: "\u2220",
+ and: "\u2227",
+ or: "\u2228",
+ cap: "\u2229",
+ cup: "\u222A",
+ int: "\u222B",
+ there4: "\u2234",
+ sim: "\u223C",
+ cong: "\u2245",
+ asymp: "\u2248",
+ ne: "\u2260",
+ equiv: "\u2261",
+ le: "\u2264",
+ ge: "\u2265",
+ sub: "\u2282",
+ sup: "\u2283",
+ nsub: "\u2284",
+ sube: "\u2286",
+ supe: "\u2287",
+ oplus: "\u2295",
+ otimes: "\u2297",
+ perp: "\u22A5",
+ sdot: "\u22C5",
+ lceil: "\u2308",
+ rceil: "\u2309",
+ lfloor: "\u230A",
+ rfloor: "\u230B",
+ lang: "\u2329",
+ rang: "\u232A",
+ loz: "\u25CA",
+ spades: "\u2660",
+ clubs: "\u2663",
+ hearts: "\u2665",
+ diams: "\u2666"
+};
+
+const JsxErrors = ParseErrorEnum`jsx`({
+ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
+ MissingClosingTagElement: ({
+ openingTagName
+ }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`,
+ MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
+ UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",
+ UnexpectedToken: ({
+ unexpected,
+ HTMLEntity
+ }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`,
+ UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.",
+ UnterminatedJsxContent: "Unterminated JSX contents.",
+ UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...>?"
+});
+
+function isFragment(object) {
+ return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
+}
+
+function getQualifiedJSXName(object) {
+ if (object.type === "JSXIdentifier") {
+ return object.name;
+ }
+
+ if (object.type === "JSXNamespacedName") {
+ return object.namespace.name + ":" + object.name.name;
+ }
+
+ if (object.type === "JSXMemberExpression") {
+ return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
+ }
+
+ throw new Error("Node had unexpected type: " + object.type);
+}
+
+var jsx = (superClass => class JSXParserMixin extends superClass {
+ jsxReadToken() {
+ let out = "";
+ let chunkStart = this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(JsxErrors.UnterminatedJsxContent, {
+ at: this.state.startLoc
+ });
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ switch (ch) {
+ case 60:
+ case 123:
+ if (this.state.pos === this.state.start) {
+ if (ch === 60 && this.state.canStartJSXElement) {
+ ++this.state.pos;
+ return this.finishToken(138);
+ }
+
+ return super.getTokenFromCode(ch);
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos);
+ return this.finishToken(137, out);
+
+ case 38:
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ break;
+
+ case 62:
+ case 125:
+
+ default:
+ if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(true);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+
+ }
+ }
+ }
+
+ jsxReadNewLine(normalizeCRLF) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ let out;
+ ++this.state.pos;
+
+ if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ out = normalizeCRLF ? "\n" : "\r\n";
+ } else {
+ out = String.fromCharCode(ch);
+ }
+
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ return out;
+ }
+
+ jsxReadString(quote) {
+ let out = "";
+ let chunkStart = ++this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(Errors.UnterminatedString, {
+ at: this.state.startLoc
+ });
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+ if (ch === quote) break;
+
+ if (ch === 38) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(false);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos++);
+ return this.finishToken(129, out);
+ }
+
+ jsxReadEntity() {
+ const startPos = ++this.state.pos;
+
+ if (this.codePointAtPos(this.state.pos) === 35) {
+ ++this.state.pos;
+ let radix = 10;
+
+ if (this.codePointAtPos(this.state.pos) === 120) {
+ radix = 16;
+ ++this.state.pos;
+ }
+
+ const codePoint = this.readInt(radix, undefined, false, "bail");
+
+ if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) {
+ ++this.state.pos;
+ return String.fromCodePoint(codePoint);
+ }
+ } else {
+ let count = 0;
+ let semi = false;
+
+ while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) == 59)) {
+ ++this.state.pos;
+ }
+
+ if (semi) {
+ const desc = this.input.slice(startPos, this.state.pos);
+ const entity = entities[desc];
+ ++this.state.pos;
+
+ if (entity) {
+ return entity;
+ }
+ }
+ }
+
+ this.state.pos = startPos;
+ return "&";
+ }
+
+ jsxReadWord() {
+ let ch;
+ const start = this.state.pos;
+
+ do {
+ ch = this.input.charCodeAt(++this.state.pos);
+ } while (isIdentifierChar(ch) || ch === 45);
+
+ return this.finishToken(136, this.input.slice(start, this.state.pos));
+ }
+
+ jsxParseIdentifier() {
+ const node = this.startNode();
+
+ if (this.match(136)) {
+ node.name = this.state.value;
+ } else if (tokenIsKeyword(this.state.type)) {
+ node.name = tokenLabelName(this.state.type);
+ } else {
+ this.unexpected();
+ }
+
+ this.next();
+ return this.finishNode(node, "JSXIdentifier");
+ }
+
+ jsxParseNamespacedName() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const name = this.jsxParseIdentifier();
+ if (!this.eat(14)) return name;
+ const node = this.startNodeAt(startPos, startLoc);
+ node.namespace = name;
+ node.name = this.jsxParseIdentifier();
+ return this.finishNode(node, "JSXNamespacedName");
+ }
+
+ jsxParseElementName() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let node = this.jsxParseNamespacedName();
+
+ if (node.type === "JSXNamespacedName") {
+ return node;
+ }
+
+ while (this.eat(16)) {
+ const newNode = this.startNodeAt(startPos, startLoc);
+ newNode.object = node;
+ newNode.property = this.jsxParseIdentifier();
+ node = this.finishNode(newNode, "JSXMemberExpression");
+ }
+
+ return node;
+ }
+
+ jsxParseAttributeValue() {
+ let node;
+
+ switch (this.state.type) {
+ case 5:
+ node = this.startNode();
+ this.setContext(types.brace);
+ this.next();
+ node = this.jsxParseExpressionContainer(node, types.j_oTag);
+
+ if (node.expression.type === "JSXEmptyExpression") {
+ this.raise(JsxErrors.AttributeIsEmpty, {
+ at: node
+ });
+ }
+
+ return node;
+
+ case 138:
+ case 129:
+ return this.parseExprAtom();
+
+ default:
+ throw this.raise(JsxErrors.UnsupportedJsxValue, {
+ at: this.state.startLoc
+ });
+ }
+ }
+
+ jsxParseEmptyExpression() {
+ const node = this.startNodeAt(this.state.lastTokEndLoc.index, this.state.lastTokEndLoc);
+ return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc);
+ }
+
+ jsxParseSpreadChild(node) {
+ this.next();
+ node.expression = this.parseExpression();
+ this.setContext(types.j_oTag);
+ this.state.canStartJSXElement = true;
+ this.expect(8);
+ return this.finishNode(node, "JSXSpreadChild");
+ }
+
+ jsxParseExpressionContainer(node, previousContext) {
+ if (this.match(8)) {
+ node.expression = this.jsxParseEmptyExpression();
+ } else {
+ const expression = this.parseExpression();
+ node.expression = expression;
+ }
+
+ this.setContext(previousContext);
+ this.state.canStartJSXElement = true;
+ this.expect(8);
+ return this.finishNode(node, "JSXExpressionContainer");
+ }
+
+ jsxParseAttribute() {
+ const node = this.startNode();
+
+ if (this.match(5)) {
+ this.setContext(types.brace);
+ this.next();
+ this.expect(21);
+ node.argument = this.parseMaybeAssignAllowIn();
+ this.setContext(types.j_oTag);
+ this.state.canStartJSXElement = true;
+ this.expect(8);
+ return this.finishNode(node, "JSXSpreadAttribute");
+ }
+
+ node.name = this.jsxParseNamespacedName();
+ node.value = this.eat(29) ? this.jsxParseAttributeValue() : null;
+ return this.finishNode(node, "JSXAttribute");
+ }
+
+ jsxParseOpeningElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+
+ if (this.eat(139)) {
+ return this.finishNode(node, "JSXOpeningFragment");
+ }
+
+ node.name = this.jsxParseElementName();
+ return this.jsxParseOpeningElementAfterName(node);
+ }
+
+ jsxParseOpeningElementAfterName(node) {
+ const attributes = [];
+
+ while (!this.match(56) && !this.match(139)) {
+ attributes.push(this.jsxParseAttribute());
+ }
+
+ node.attributes = attributes;
+ node.selfClosing = this.eat(56);
+ this.expect(139);
+ return this.finishNode(node, "JSXOpeningElement");
+ }
+
+ jsxParseClosingElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+
+ if (this.eat(139)) {
+ return this.finishNode(node, "JSXClosingFragment");
+ }
+
+ node.name = this.jsxParseElementName();
+ this.expect(139);
+ return this.finishNode(node, "JSXClosingElement");
+ }
+
+ jsxParseElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const children = [];
+ const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
+ let closingElement = null;
+
+ if (!openingElement.selfClosing) {
+ contents: for (;;) {
+ switch (this.state.type) {
+ case 138:
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ this.next();
+
+ if (this.eat(56)) {
+ closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
+ break contents;
+ }
+
+ children.push(this.jsxParseElementAt(startPos, startLoc));
+ break;
+
+ case 137:
+ children.push(this.parseExprAtom());
+ break;
+
+ case 5:
+ {
+ const node = this.startNode();
+ this.setContext(types.brace);
+ this.next();
+
+ if (this.match(21)) {
+ children.push(this.jsxParseSpreadChild(node));
+ } else {
+ children.push(this.jsxParseExpressionContainer(node, types.j_expr));
+ }
+
+ break;
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) {
+ this.raise(JsxErrors.MissingClosingTagFragment, {
+ at: closingElement
+ });
+ } else if (!isFragment(openingElement) && isFragment(closingElement)) {
+ this.raise(JsxErrors.MissingClosingTagElement, {
+ at: closingElement,
+ openingTagName: getQualifiedJSXName(openingElement.name)
+ });
+ } else if (!isFragment(openingElement) && !isFragment(closingElement)) {
+ if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
+ this.raise(JsxErrors.MissingClosingTagElement, {
+ at: closingElement,
+ openingTagName: getQualifiedJSXName(openingElement.name)
+ });
+ }
+ }
+ }
+
+ if (isFragment(openingElement)) {
+ node.openingFragment = openingElement;
+ node.closingFragment = closingElement;
+ } else {
+ node.openingElement = openingElement;
+ node.closingElement = closingElement;
+ }
+
+ node.children = children;
+
+ if (this.match(47)) {
+ throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, {
+ at: this.state.startLoc
+ });
+ }
+
+ return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
+ }
+
+ jsxParseElement() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.next();
+ return this.jsxParseElementAt(startPos, startLoc);
+ }
+
+ setContext(newContext) {
+ const {
+ context
+ } = this.state;
+ context[context.length - 1] = newContext;
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ if (this.match(137)) {
+ return this.parseLiteral(this.state.value, "JSXText");
+ } else if (this.match(138)) {
+ return this.jsxParseElement();
+ } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) {
+ this.replaceToken(138);
+ return this.jsxParseElement();
+ } else {
+ return super.parseExprAtom(refExpressionErrors);
+ }
+ }
+
+ skipSpace() {
+ const curContext = this.curContext();
+ if (!curContext.preserveSpace) super.skipSpace();
+ }
+
+ getTokenFromCode(code) {
+ const context = this.curContext();
+
+ if (context === types.j_expr) {
+ return this.jsxReadToken();
+ }
+
+ if (context === types.j_oTag || context === types.j_cTag) {
+ if (isIdentifierStart(code)) {
+ return this.jsxReadWord();
+ }
+
+ if (code === 62) {
+ ++this.state.pos;
+ return this.finishToken(139);
+ }
+
+ if ((code === 34 || code === 39) && context === types.j_oTag) {
+ return this.jsxReadString(code);
+ }
+ }
+
+ if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
+ ++this.state.pos;
+ return this.finishToken(138);
+ }
+
+ return super.getTokenFromCode(code);
+ }
+
+ updateContext(prevType) {
+ const {
+ context,
+ type
+ } = this.state;
+
+ if (type === 56 && prevType === 138) {
+ context.splice(-2, 2, types.j_cTag);
+ this.state.canStartJSXElement = false;
+ } else if (type === 138) {
+ context.push(types.j_oTag);
+ } else if (type === 139) {
+ const out = context[context.length - 1];
+
+ if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) {
+ context.pop();
+ this.state.canStartJSXElement = context[context.length - 1] === types.j_expr;
+ } else {
+ this.setContext(types.j_expr);
+ this.state.canStartJSXElement = true;
+ }
+ } else {
+ this.state.canStartJSXElement = tokenComesBeforeExpression(type);
+ }
+ }
+
+});
+
+class TypeScriptScope extends Scope {
+ constructor(...args) {
+ super(...args);
+ this.types = new Set();
+ this.enums = new Set();
+ this.constEnums = new Set();
+ this.classes = new Set();
+ this.exportOnlyBindings = new Set();
+ }
+
+}
+
+class TypeScriptScopeHandler extends ScopeHandler {
+ createScope(flags) {
+ return new TypeScriptScope(flags);
+ }
+
+ declareName(name, bindingType, loc) {
+ const scope = this.currentScope();
+
+ if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {
+ this.maybeExportDefined(scope, name);
+ scope.exportOnlyBindings.add(name);
+ return;
+ }
+
+ super.declareName(name, bindingType, loc);
+
+ if (bindingType & BIND_KIND_TYPE) {
+ if (!(bindingType & BIND_KIND_VALUE)) {
+ this.checkRedeclarationInScope(scope, name, bindingType, loc);
+ this.maybeExportDefined(scope, name);
+ }
+
+ scope.types.add(name);
+ }
+
+ if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name);
+ if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name);
+ if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name);
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (scope.enums.has(name)) {
+ if (bindingType & BIND_FLAGS_TS_ENUM) {
+ const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);
+ const wasConst = scope.constEnums.has(name);
+ return isConst !== wasConst;
+ }
+
+ return true;
+ }
+
+ if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {
+ if (scope.lexical.has(name)) {
+ return !!(bindingType & BIND_KIND_VALUE);
+ } else {
+ return false;
+ }
+ }
+
+ if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {
+ return true;
+ }
+
+ return super.isRedeclaredInScope(scope, name, bindingType);
+ }
+
+ checkLocalExport(id) {
+ const topLevelScope = this.scopeStack[0];
+ const {
+ name
+ } = id;
+
+ if (!topLevelScope.types.has(name) && !topLevelScope.exportOnlyBindings.has(name)) {
+ super.checkLocalExport(id);
+ }
+ }
+
+}
+
+const getOwn$1 = (object, key) => Object.hasOwnProperty.call(object, key) && object[key];
+
+function nonNull(x) {
+ if (x == null) {
+ throw new Error(`Unexpected ${x} value.`);
+ }
+
+ return x;
+}
+
+function assert(x) {
+ if (!x) {
+ throw new Error("Assert fail");
+ }
+}
+
+const TSErrors = ParseErrorEnum`typescript`({
+ AbstractMethodHasImplementation: ({
+ methodName
+ }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`,
+ AbstractPropertyHasInitializer: ({
+ propertyName
+ }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,
+ AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
+ AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
+ CannotFindName: ({
+ name
+ }) => `Cannot find name '${name}'.`,
+ ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
+ ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
+ ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
+ ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.",
+ DeclareAccessor: ({
+ kind
+ }) => `'declare' is not allowed in ${kind}ters.`,
+ DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.",
+ DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.",
+ DuplicateAccessibilityModifier: ({
+ modifier
+ }) => `Accessibility modifier already seen.`,
+ DuplicateModifier: ({
+ modifier
+ }) => `Duplicate modifier: '${modifier}'.`,
+ EmptyHeritageClauseType: ({
+ token
+ }) => `'${token}' list cannot be empty.`,
+ EmptyTypeArguments: "Type argument list cannot be empty.",
+ EmptyTypeParameters: "Type parameter list cannot be empty.",
+ ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.",
+ ImportAliasHasImportType: "An import alias can not use 'import type'.",
+ IncompatibleModifiers: ({
+ modifiers
+ }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`,
+ IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.",
+ IndexSignatureHasAccessibility: ({
+ modifier
+ }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`,
+ IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.",
+ IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.",
+ IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.",
+ InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.",
+ InvalidModifierOnTypeMember: ({
+ modifier
+ }) => `'${modifier}' modifier cannot appear on a type member.`,
+ InvalidModifierOnTypeParameter: ({
+ modifier
+ }) => `'${modifier}' modifier cannot appear on a type parameter.`,
+ InvalidModifierOnTypeParameterPositions: ({
+ modifier
+ }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`,
+ InvalidModifiersOrder: ({
+ orderedModifiers
+ }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`,
+ InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.",
+ InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.",
+ MissingInterfaceName: "'interface' declarations must be followed by an identifier.",
+ MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.",
+ NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.",
+ NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.",
+ OptionalTypeBeforeRequired: "A required element cannot follow an optional element.",
+ OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.",
+ PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
+ PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.",
+ PrivateElementHasAccessibility: ({
+ modifier
+ }) => `Private elements cannot have an accessibility modifier ('${modifier}').`,
+ ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.",
+ ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",
+ ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",
+ SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.",
+ SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.",
+ SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.",
+ SingleTypeParameterWithoutTrailingComma: ({
+ typeParameterName
+ }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`,
+ StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.",
+ TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
+ TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.",
+ TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",
+ TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",
+ UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.",
+ UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.",
+ UnexpectedTypeAnnotation: "Did not expect a type annotation here.",
+ UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.",
+ UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.",
+ UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.",
+ UnsupportedSignatureParameterKind: ({
+ type
+ }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`
+});
+
+function keywordTypeFromName(value) {
+ switch (value) {
+ case "any":
+ return "TSAnyKeyword";
+
+ case "boolean":
+ return "TSBooleanKeyword";
+
+ case "bigint":
+ return "TSBigIntKeyword";
+
+ case "never":
+ return "TSNeverKeyword";
+
+ case "number":
+ return "TSNumberKeyword";
+
+ case "object":
+ return "TSObjectKeyword";
+
+ case "string":
+ return "TSStringKeyword";
+
+ case "symbol":
+ return "TSSymbolKeyword";
+
+ case "undefined":
+ return "TSUndefinedKeyword";
+
+ case "unknown":
+ return "TSUnknownKeyword";
+
+ default:
+ return undefined;
+ }
+}
+
+function tsIsAccessModifier(modifier) {
+ return modifier === "private" || modifier === "public" || modifier === "protected";
+}
+
+function tsIsVarianceAnnotations(modifier) {
+ return modifier === "in" || modifier === "out";
+}
+
+var typescript = (superClass => class TypeScriptParserMixin extends superClass {
+ getScopeHandler() {
+ return TypeScriptScopeHandler;
+ }
+
+ tsIsIdentifier() {
+ return tokenIsIdentifier(this.state.type);
+ }
+
+ tsTokenCanFollowModifier() {
+ return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(134) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak();
+ }
+
+ tsNextTokenCanFollowModifier() {
+ this.next();
+ return this.tsTokenCanFollowModifier();
+ }
+
+ tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) {
+ if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58) {
+ return undefined;
+ }
+
+ const modifier = this.state.value;
+
+ if (allowedModifiers.indexOf(modifier) !== -1) {
+ if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {
+ return undefined;
+ }
+
+ if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {
+ return modifier;
+ }
+ }
+
+ return undefined;
+ }
+
+ tsParseModifiers({
+ modified,
+ allowedModifiers,
+ disallowedModifiers,
+ stopOnStartOfClassStaticBlock,
+ errorTemplate = TSErrors.InvalidModifierOnTypeMember
+ }) {
+ const enforceOrder = (loc, modifier, before, after) => {
+ if (modifier === before && modified[after]) {
+ this.raise(TSErrors.InvalidModifiersOrder, {
+ at: loc,
+ orderedModifiers: [before, after]
+ });
+ }
+ };
+
+ const incompatible = (loc, modifier, mod1, mod2) => {
+ if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) {
+ this.raise(TSErrors.IncompatibleModifiers, {
+ at: loc,
+ modifiers: [mod1, mod2]
+ });
+ }
+ };
+
+ for (;;) {
+ const {
+ startLoc
+ } = this.state;
+ const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock);
+ if (!modifier) break;
+
+ if (tsIsAccessModifier(modifier)) {
+ if (modified.accessibility) {
+ this.raise(TSErrors.DuplicateAccessibilityModifier, {
+ at: startLoc,
+ modifier
+ });
+ } else {
+ enforceOrder(startLoc, modifier, modifier, "override");
+ enforceOrder(startLoc, modifier, modifier, "static");
+ enforceOrder(startLoc, modifier, modifier, "readonly");
+ modified.accessibility = modifier;
+ }
+ } else if (tsIsVarianceAnnotations(modifier)) {
+ if (modified[modifier]) {
+ this.raise(TSErrors.DuplicateModifier, {
+ at: startLoc,
+ modifier
+ });
+ }
+
+ modified[modifier] = true;
+ enforceOrder(startLoc, modifier, "in", "out");
+ } else {
+ if (Object.hasOwnProperty.call(modified, modifier)) {
+ this.raise(TSErrors.DuplicateModifier, {
+ at: startLoc,
+ modifier
+ });
+ } else {
+ enforceOrder(startLoc, modifier, "static", "readonly");
+ enforceOrder(startLoc, modifier, "static", "override");
+ enforceOrder(startLoc, modifier, "override", "readonly");
+ enforceOrder(startLoc, modifier, "abstract", "override");
+ incompatible(startLoc, modifier, "declare", "override");
+ incompatible(startLoc, modifier, "static", "abstract");
+ }
+
+ modified[modifier] = true;
+ }
+
+ if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) {
+ this.raise(errorTemplate, {
+ at: startLoc,
+ modifier
+ });
+ }
+ }
+ }
+
+ tsIsListTerminator(kind) {
+ switch (kind) {
+ case "EnumMembers":
+ case "TypeMembers":
+ return this.match(8);
+
+ case "HeritageClauseElement":
+ return this.match(5);
+
+ case "TupleElementTypes":
+ return this.match(3);
+
+ case "TypeParametersOrArguments":
+ return this.match(48);
+ }
+
+ throw new Error("Unreachable");
+ }
+
+ tsParseList(kind, parseElement) {
+ const result = [];
+
+ while (!this.tsIsListTerminator(kind)) {
+ result.push(parseElement());
+ }
+
+ return result;
+ }
+
+ tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) {
+ return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos));
+ }
+
+ tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) {
+ const result = [];
+ let trailingCommaPos = -1;
+
+ for (;;) {
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+
+ trailingCommaPos = -1;
+ const element = parseElement();
+
+ if (element == null) {
+ return undefined;
+ }
+
+ result.push(element);
+
+ if (this.eat(12)) {
+ trailingCommaPos = this.state.lastTokStart;
+ continue;
+ }
+
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+
+ if (expectSuccess) {
+ this.expect(12);
+ }
+
+ return undefined;
+ }
+
+ if (refTrailingCommaPos) {
+ refTrailingCommaPos.value = trailingCommaPos;
+ }
+
+ return result;
+ }
+
+ tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) {
+ if (!skipFirstToken) {
+ if (bracket) {
+ this.expect(0);
+ } else {
+ this.expect(47);
+ }
+ }
+
+ const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos);
+
+ if (bracket) {
+ this.expect(3);
+ } else {
+ this.expect(48);
+ }
+
+ return result;
+ }
+
+ tsParseImportType() {
+ const node = this.startNode();
+ this.expect(83);
+ this.expect(10);
+
+ if (!this.match(129)) {
+ this.raise(TSErrors.UnsupportedImportTypeArgument, {
+ at: this.state.startLoc
+ });
+ }
+
+ node.argument = super.parseExprAtom();
+ this.expect(11);
+
+ if (this.eat(16)) {
+ node.qualifier = this.tsParseEntityName();
+ }
+
+ if (this.match(47)) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSImportType");
+ }
+
+ tsParseEntityName(allowReservedWords = true) {
+ let entity = this.parseIdentifier(allowReservedWords);
+
+ while (this.eat(16)) {
+ const node = this.startNodeAtNode(entity);
+ node.left = entity;
+ node.right = this.parseIdentifier(allowReservedWords);
+ entity = this.finishNode(node, "TSQualifiedName");
+ }
+
+ return entity;
+ }
+
+ tsParseTypeReference() {
+ const node = this.startNode();
+ node.typeName = this.tsParseEntityName();
+
+ if (!this.hasPrecedingLineBreak() && this.match(47)) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSTypeReference");
+ }
+
+ tsParseThisTypePredicate(lhs) {
+ this.next();
+ const node = this.startNodeAtNode(lhs);
+ node.parameterName = lhs;
+ node.typeAnnotation = this.tsParseTypeAnnotation(false);
+ node.asserts = false;
+ return this.finishNode(node, "TSTypePredicate");
+ }
+
+ tsParseThisTypeNode() {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "TSThisType");
+ }
+
+ tsParseTypeQuery() {
+ const node = this.startNode();
+ this.expect(87);
+
+ if (this.match(83)) {
+ node.exprName = this.tsParseImportType();
+ } else {
+ node.exprName = this.tsParseEntityName();
+ }
+
+ if (!this.hasPrecedingLineBreak() && this.match(47)) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSTypeQuery");
+ }
+
+ tsParseInOutModifiers(node) {
+ this.tsParseModifiers({
+ modified: node,
+ allowedModifiers: ["in", "out"],
+ disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"],
+ errorTemplate: TSErrors.InvalidModifierOnTypeParameter
+ });
+ }
+
+ tsParseNoneModifiers(node) {
+ this.tsParseModifiers({
+ modified: node,
+ allowedModifiers: [],
+ disallowedModifiers: ["in", "out"],
+ errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions
+ });
+ }
+
+ tsParseTypeParameter(parseModifiers = this.tsParseNoneModifiers.bind(this)) {
+ const node = this.startNode();
+ parseModifiers(node);
+ node.name = this.tsParseTypeParameterName();
+ node.constraint = this.tsEatThenParseType(81);
+ node.default = this.tsEatThenParseType(29);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+
+ tsTryParseTypeParameters(parseModifiers) {
+ if (this.match(47)) {
+ return this.tsParseTypeParameters(parseModifiers);
+ }
+ }
+
+ tsParseTypeParameters(parseModifiers) {
+ const node = this.startNode();
+
+ if (this.match(47) || this.match(138)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+
+ const refTrailingCommaPos = {
+ value: -1
+ };
+ node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);
+
+ if (node.params.length === 0) {
+ this.raise(TSErrors.EmptyTypeParameters, {
+ at: node
+ });
+ }
+
+ if (refTrailingCommaPos.value !== -1) {
+ this.addExtra(node, "trailingComma", refTrailingCommaPos.value);
+ }
+
+ return this.finishNode(node, "TSTypeParameterDeclaration");
+ }
+
+ tsTryNextParseConstantContext() {
+ if (this.lookahead().type !== 75) return null;
+ this.next();
+ const typeReference = this.tsParseTypeReference();
+
+ if (typeReference.typeParameters) {
+ this.raise(TSErrors.CannotFindName, {
+ at: typeReference.typeName,
+ name: "const"
+ });
+ }
+
+ return typeReference;
+ }
+
+ tsFillSignature(returnToken, signature) {
+ const returnTokenRequired = returnToken === 19;
+ const paramsKey = "parameters";
+ const returnTypeKey = "typeAnnotation";
+ signature.typeParameters = this.tsTryParseTypeParameters();
+ this.expect(10);
+ signature[paramsKey] = this.tsParseBindingListForSignature();
+
+ if (returnTokenRequired) {
+ signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ } else if (this.match(returnToken)) {
+ signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ }
+ }
+
+ tsParseBindingListForSignature() {
+ return super.parseBindingList(11, 41).map(pattern => {
+ if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") {
+ this.raise(TSErrors.UnsupportedSignatureParameterKind, {
+ at: pattern,
+ type: pattern.type
+ });
+ }
+
+ return pattern;
+ });
+ }
+
+ tsParseTypeMemberSemicolon() {
+ if (!this.eat(12) && !this.isLineTerminator()) {
+ this.expect(13);
+ }
+ }
+
+ tsParseSignatureMember(kind, node) {
+ this.tsFillSignature(14, node);
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, kind);
+ }
+
+ tsIsUnambiguouslyIndexSignature() {
+ this.next();
+
+ if (tokenIsIdentifier(this.state.type)) {
+ this.next();
+ return this.match(14);
+ }
+
+ return false;
+ }
+
+ tsTryParseIndexSignature(node) {
+ if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {
+ return undefined;
+ }
+
+ this.expect(0);
+ const id = this.parseIdentifier();
+ id.typeAnnotation = this.tsParseTypeAnnotation();
+ this.resetEndLocation(id);
+ this.expect(3);
+ node.parameters = [id];
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, "TSIndexSignature");
+ }
+
+ tsParsePropertyOrMethodSignature(node, readonly) {
+ if (this.eat(17)) node.optional = true;
+ const nodeAny = node;
+
+ if (this.match(10) || this.match(47)) {
+ if (readonly) {
+ this.raise(TSErrors.ReadonlyForMethodSignature, {
+ at: node
+ });
+ }
+
+ const method = nodeAny;
+
+ if (method.kind && this.match(47)) {
+ this.raise(TSErrors.AccesorCannotHaveTypeParameters, {
+ at: this.state.curPosition()
+ });
+ }
+
+ this.tsFillSignature(14, method);
+ this.tsParseTypeMemberSemicolon();
+ const paramsKey = "parameters";
+ const returnTypeKey = "typeAnnotation";
+
+ if (method.kind === "get") {
+ if (method[paramsKey].length > 0) {
+ this.raise(Errors.BadGetterArity, {
+ at: this.state.curPosition()
+ });
+
+ if (this.isThisParam(method[paramsKey][0])) {
+ this.raise(TSErrors.AccesorCannotDeclareThisParameter, {
+ at: this.state.curPosition()
+ });
+ }
+ }
+ } else if (method.kind === "set") {
+ if (method[paramsKey].length !== 1) {
+ this.raise(Errors.BadSetterArity, {
+ at: this.state.curPosition()
+ });
+ } else {
+ const firstParameter = method[paramsKey][0];
+
+ if (this.isThisParam(firstParameter)) {
+ this.raise(TSErrors.AccesorCannotDeclareThisParameter, {
+ at: this.state.curPosition()
+ });
+ }
+
+ if (firstParameter.type === "Identifier" && firstParameter.optional) {
+ this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, {
+ at: this.state.curPosition()
+ });
+ }
+
+ if (firstParameter.type === "RestElement") {
+ this.raise(TSErrors.SetAccesorCannotHaveRestParameter, {
+ at: this.state.curPosition()
+ });
+ }
+ }
+
+ if (method[returnTypeKey]) {
+ this.raise(TSErrors.SetAccesorCannotHaveReturnType, {
+ at: method[returnTypeKey]
+ });
+ }
+ } else {
+ method.kind = "method";
+ }
+
+ return this.finishNode(method, "TSMethodSignature");
+ } else {
+ const property = nodeAny;
+ if (readonly) property.readonly = true;
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) property.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(property, "TSPropertySignature");
+ }
+ }
+
+ tsParseTypeMember() {
+ const node = this.startNode();
+
+ if (this.match(10) || this.match(47)) {
+ return this.tsParseSignatureMember("TSCallSignatureDeclaration", node);
+ }
+
+ if (this.match(77)) {
+ const id = this.startNode();
+ this.next();
+
+ if (this.match(10) || this.match(47)) {
+ return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node);
+ } else {
+ node.key = this.createIdentifier(id, "new");
+ return this.tsParsePropertyOrMethodSignature(node, false);
+ }
+ }
+
+ this.tsParseModifiers({
+ modified: node,
+ allowedModifiers: ["readonly"],
+ disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"]
+ });
+ const idx = this.tsTryParseIndexSignature(node);
+
+ if (idx) {
+ return idx;
+ }
+
+ super.parsePropertyName(node);
+
+ if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) {
+ node.kind = node.key.name;
+ super.parsePropertyName(node);
+ }
+
+ return this.tsParsePropertyOrMethodSignature(node, !!node.readonly);
+ }
+
+ tsParseTypeLiteral() {
+ const node = this.startNode();
+ node.members = this.tsParseObjectTypeMembers();
+ return this.finishNode(node, "TSTypeLiteral");
+ }
+
+ tsParseObjectTypeMembers() {
+ this.expect(5);
+ const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
+ this.expect(8);
+ return members;
+ }
+
+ tsIsStartOfMappedType() {
+ this.next();
+
+ if (this.eat(53)) {
+ return this.isContextual(118);
+ }
+
+ if (this.isContextual(118)) {
+ this.next();
+ }
+
+ if (!this.match(0)) {
+ return false;
+ }
+
+ this.next();
+
+ if (!this.tsIsIdentifier()) {
+ return false;
+ }
+
+ this.next();
+ return this.match(58);
+ }
+
+ tsParseMappedTypeParameter() {
+ const node = this.startNode();
+ node.name = this.tsParseTypeParameterName();
+ node.constraint = this.tsExpectThenParseType(58);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+
+ tsParseMappedType() {
+ const node = this.startNode();
+ this.expect(5);
+
+ if (this.match(53)) {
+ node.readonly = this.state.value;
+ this.next();
+ this.expectContextual(118);
+ } else if (this.eatContextual(118)) {
+ node.readonly = true;
+ }
+
+ this.expect(0);
+ node.typeParameter = this.tsParseMappedTypeParameter();
+ node.nameType = this.eatContextual(93) ? this.tsParseType() : null;
+ this.expect(3);
+
+ if (this.match(53)) {
+ node.optional = this.state.value;
+ this.next();
+ this.expect(17);
+ } else if (this.eat(17)) {
+ node.optional = true;
+ }
+
+ node.typeAnnotation = this.tsTryParseType();
+ this.semicolon();
+ this.expect(8);
+ return this.finishNode(node, "TSMappedType");
+ }
+
+ tsParseTupleType() {
+ const node = this.startNode();
+ node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
+ let seenOptionalElement = false;
+ let labeledElements = null;
+ node.elementTypes.forEach(elementNode => {
+ var _labeledElements;
+
+ const {
+ type
+ } = elementNode;
+
+ if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) {
+ this.raise(TSErrors.OptionalTypeBeforeRequired, {
+ at: elementNode
+ });
+ }
+
+ seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType");
+ let checkType = type;
+
+ if (type === "TSRestType") {
+ elementNode = elementNode.typeAnnotation;
+ checkType = elementNode.type;
+ }
+
+ const isLabeled = checkType === "TSNamedTupleMember";
+ (_labeledElements = labeledElements) != null ? _labeledElements : labeledElements = isLabeled;
+
+ if (labeledElements !== isLabeled) {
+ this.raise(TSErrors.MixedLabeledAndUnlabeledElements, {
+ at: elementNode
+ });
+ }
+ });
+ return this.finishNode(node, "TSTupleType");
+ }
+
+ tsParseTupleElementType() {
+ const {
+ start: startPos,
+ startLoc
+ } = this.state;
+ const rest = this.eat(21);
+ let type = this.tsParseType();
+ const optional = this.eat(17);
+ const labeled = this.eat(14);
+
+ if (labeled) {
+ const labeledNode = this.startNodeAtNode(type);
+ labeledNode.optional = optional;
+
+ if (type.type === "TSTypeReference" && !type.typeParameters && type.typeName.type === "Identifier") {
+ labeledNode.label = type.typeName;
+ } else {
+ this.raise(TSErrors.InvalidTupleMemberLabel, {
+ at: type
+ });
+ labeledNode.label = type;
+ }
+
+ labeledNode.elementType = this.tsParseType();
+ type = this.finishNode(labeledNode, "TSNamedTupleMember");
+ } else if (optional) {
+ const optionalTypeNode = this.startNodeAtNode(type);
+ optionalTypeNode.typeAnnotation = type;
+ type = this.finishNode(optionalTypeNode, "TSOptionalType");
+ }
+
+ if (rest) {
+ const restNode = this.startNodeAt(startPos, startLoc);
+ restNode.typeAnnotation = type;
+ type = this.finishNode(restNode, "TSRestType");
+ }
+
+ return type;
+ }
+
+ tsParseParenthesizedType() {
+ const node = this.startNode();
+ this.expect(10);
+ node.typeAnnotation = this.tsParseType();
+ this.expect(11);
+ return this.finishNode(node, "TSParenthesizedType");
+ }
+
+ tsParseFunctionOrConstructorType(type, abstract) {
+ const node = this.startNode();
+
+ if (type === "TSConstructorType") {
+ node.abstract = !!abstract;
+ if (abstract) this.next();
+ this.next();
+ }
+
+ this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node));
+ return this.finishNode(node, type);
+ }
+
+ tsParseLiteralTypeNode() {
+ const node = this.startNode();
+
+ node.literal = (() => {
+ switch (this.state.type) {
+ case 130:
+ case 131:
+ case 129:
+ case 85:
+ case 86:
+ return super.parseExprAtom();
+
+ default:
+ throw this.unexpected();
+ }
+ })();
+
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ tsParseTemplateLiteralType() {
+ const node = this.startNode();
+ node.literal = super.parseTemplate(false);
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ parseTemplateSubstitution() {
+ if (this.state.inType) return this.tsParseType();
+ return super.parseTemplateSubstitution();
+ }
+
+ tsParseThisTypeOrThisTypePredicate() {
+ const thisKeyword = this.tsParseThisTypeNode();
+
+ if (this.isContextual(113) && !this.hasPrecedingLineBreak()) {
+ return this.tsParseThisTypePredicate(thisKeyword);
+ } else {
+ return thisKeyword;
+ }
+ }
+
+ tsParseNonArrayType() {
+ switch (this.state.type) {
+ case 129:
+ case 130:
+ case 131:
+ case 85:
+ case 86:
+ return this.tsParseLiteralTypeNode();
+
+ case 53:
+ if (this.state.value === "-") {
+ const node = this.startNode();
+ const nextToken = this.lookahead();
+
+ if (nextToken.type !== 130 && nextToken.type !== 131) {
+ throw this.unexpected();
+ }
+
+ node.literal = this.parseMaybeUnary();
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ break;
+
+ case 78:
+ return this.tsParseThisTypeOrThisTypePredicate();
+
+ case 87:
+ return this.tsParseTypeQuery();
+
+ case 83:
+ return this.tsParseImportType();
+
+ case 5:
+ return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
+
+ case 0:
+ return this.tsParseTupleType();
+
+ case 10:
+ return this.tsParseParenthesizedType();
+
+ case 25:
+ case 24:
+ return this.tsParseTemplateLiteralType();
+
+ default:
+ {
+ const {
+ type
+ } = this.state;
+
+ if (tokenIsIdentifier(type) || type === 88 || type === 84) {
+ const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value);
+
+ if (nodeType !== undefined && this.lookaheadCharCode() !== 46) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, nodeType);
+ }
+
+ return this.tsParseTypeReference();
+ }
+ }
+ }
+
+ throw this.unexpected();
+ }
+
+ tsParseArrayTypeOrHigher() {
+ let type = this.tsParseNonArrayType();
+
+ while (!this.hasPrecedingLineBreak() && this.eat(0)) {
+ if (this.match(3)) {
+ const node = this.startNodeAtNode(type);
+ node.elementType = type;
+ this.expect(3);
+ type = this.finishNode(node, "TSArrayType");
+ } else {
+ const node = this.startNodeAtNode(type);
+ node.objectType = type;
+ node.indexType = this.tsParseType();
+ this.expect(3);
+ type = this.finishNode(node, "TSIndexedAccessType");
+ }
+ }
+
+ return type;
+ }
+
+ tsParseTypeOperator() {
+ const node = this.startNode();
+ const operator = this.state.value;
+ this.next();
+ node.operator = operator;
+ node.typeAnnotation = this.tsParseTypeOperatorOrHigher();
+
+ if (operator === "readonly") {
+ this.tsCheckTypeAnnotationForReadOnly(node);
+ }
+
+ return this.finishNode(node, "TSTypeOperator");
+ }
+
+ tsCheckTypeAnnotationForReadOnly(node) {
+ switch (node.typeAnnotation.type) {
+ case "TSTupleType":
+ case "TSArrayType":
+ return;
+
+ default:
+ this.raise(TSErrors.UnexpectedReadonly, {
+ at: node
+ });
+ }
+ }
+
+ tsParseInferType() {
+ const node = this.startNode();
+ this.expectContextual(112);
+ const typeParameter = this.startNode();
+ typeParameter.name = this.tsParseTypeParameterName();
+ typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType());
+ node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
+ return this.finishNode(node, "TSInferType");
+ }
+
+ tsParseConstraintForInferType() {
+ if (this.eat(81)) {
+ const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType());
+
+ if (this.state.inDisallowConditionalTypesContext || !this.match(17)) {
+ return constraint;
+ }
+ }
+ }
+
+ tsParseTypeOperatorOrHigher() {
+ const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;
+ return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(112) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());
+ }
+
+ tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
+ const node = this.startNode();
+ const hasLeadingOperator = this.eat(operator);
+ const types = [];
+
+ do {
+ types.push(parseConstituentType());
+ } while (this.eat(operator));
+
+ if (types.length === 1 && !hasLeadingOperator) {
+ return types[0];
+ }
+
+ node.types = types;
+ return this.finishNode(node, kind);
+ }
+
+ tsParseIntersectionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45);
+ }
+
+ tsParseUnionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43);
+ }
+
+ tsIsStartOfFunctionType() {
+ if (this.match(47)) {
+ return true;
+ }
+
+ return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
+ }
+
+ tsSkipParameterStart() {
+ if (tokenIsIdentifier(this.state.type) || this.match(78)) {
+ this.next();
+ return true;
+ }
+
+ if (this.match(5)) {
+ const {
+ errors
+ } = this.state;
+ const previousErrorCount = errors.length;
+
+ try {
+ this.parseObjectLike(8, true);
+ return errors.length === previousErrorCount;
+ } catch (_unused) {
+ return false;
+ }
+ }
+
+ if (this.match(0)) {
+ this.next();
+ const {
+ errors
+ } = this.state;
+ const previousErrorCount = errors.length;
+
+ try {
+ super.parseBindingList(3, 93, true);
+ return errors.length === previousErrorCount;
+ } catch (_unused2) {
+ return false;
+ }
+ }
+
+ return false;
+ }
+
+ tsIsUnambiguouslyStartOfFunctionType() {
+ this.next();
+
+ if (this.match(11) || this.match(21)) {
+ return true;
+ }
+
+ if (this.tsSkipParameterStart()) {
+ if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) {
+ return true;
+ }
+
+ if (this.match(11)) {
+ this.next();
+
+ if (this.match(19)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ tsParseTypeOrTypePredicateAnnotation(returnToken) {
+ return this.tsInType(() => {
+ const t = this.startNode();
+ this.expect(returnToken);
+ const node = this.startNode();
+ const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
+
+ if (asserts && this.match(78)) {
+ let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
+
+ if (thisTypePredicate.type === "TSThisType") {
+ node.parameterName = thisTypePredicate;
+ node.asserts = true;
+ node.typeAnnotation = null;
+ thisTypePredicate = this.finishNode(node, "TSTypePredicate");
+ } else {
+ this.resetStartLocationFromNode(thisTypePredicate, node);
+ thisTypePredicate.asserts = true;
+ }
+
+ t.typeAnnotation = thisTypePredicate;
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
+
+ if (!typePredicateVariable) {
+ if (!asserts) {
+ return this.tsParseTypeAnnotation(false, t);
+ }
+
+ node.parameterName = this.parseIdentifier();
+ node.asserts = asserts;
+ node.typeAnnotation = null;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const type = this.tsParseTypeAnnotation(false);
+ node.parameterName = typePredicateVariable;
+ node.typeAnnotation = type;
+ node.asserts = asserts;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ });
+ }
+
+ tsTryParseTypeOrTypePredicateAnnotation() {
+ return this.match(14) ? this.tsParseTypeOrTypePredicateAnnotation(14) : undefined;
+ }
+
+ tsTryParseTypeAnnotation() {
+ return this.match(14) ? this.tsParseTypeAnnotation() : undefined;
+ }
+
+ tsTryParseType() {
+ return this.tsEatThenParseType(14);
+ }
+
+ tsParseTypePredicatePrefix() {
+ const id = this.parseIdentifier();
+
+ if (this.isContextual(113) && !this.hasPrecedingLineBreak()) {
+ this.next();
+ return id;
+ }
+ }
+
+ tsParseTypePredicateAsserts() {
+ if (this.state.type !== 106) {
+ return false;
+ }
+
+ const containsEsc = this.state.containsEsc;
+ this.next();
+
+ if (!tokenIsIdentifier(this.state.type) && !this.match(78)) {
+ return false;
+ }
+
+ if (containsEsc) {
+ this.raise(Errors.InvalidEscapedReservedWord, {
+ at: this.state.lastTokStartLoc,
+ reservedWord: "asserts"
+ });
+ }
+
+ return true;
+ }
+
+ tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {
+ this.tsInType(() => {
+ if (eatColon) this.expect(14);
+ t.typeAnnotation = this.tsParseType();
+ });
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ tsParseType() {
+ assert(this.state.inType);
+ const type = this.tsParseNonConditionalType();
+
+ if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) {
+ return type;
+ }
+
+ const node = this.startNodeAtNode(type);
+ node.checkType = type;
+ node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType());
+ this.expect(17);
+ node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());
+ this.expect(14);
+ node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());
+ return this.finishNode(node, "TSConditionalType");
+ }
+
+ isAbstractConstructorSignature() {
+ return this.isContextual(120) && this.lookahead().type === 77;
+ }
+
+ tsParseNonConditionalType() {
+ if (this.tsIsStartOfFunctionType()) {
+ return this.tsParseFunctionOrConstructorType("TSFunctionType");
+ }
+
+ if (this.match(77)) {
+ return this.tsParseFunctionOrConstructorType("TSConstructorType");
+ } else if (this.isAbstractConstructorSignature()) {
+ return this.tsParseFunctionOrConstructorType("TSConstructorType", true);
+ }
+
+ return this.tsParseUnionTypeOrHigher();
+ }
+
+ tsParseTypeAssertion() {
+ if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
+ this.raise(TSErrors.ReservedTypeAssertion, {
+ at: this.state.startLoc
+ });
+ }
+
+ const node = this.startNode();
+
+ const _const = this.tsTryNextParseConstantContext();
+
+ node.typeAnnotation = _const || this.tsNextThenParseType();
+ this.expect(48);
+ node.expression = this.parseMaybeUnary();
+ return this.finishNode(node, "TSTypeAssertion");
+ }
+
+ tsParseHeritageClause(token) {
+ const originalStartLoc = this.state.startLoc;
+ const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => {
+ const node = this.startNode();
+ node.expression = this.tsParseEntityName();
+
+ if (this.match(47)) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSExpressionWithTypeArguments");
+ });
+
+ if (!delimitedList.length) {
+ this.raise(TSErrors.EmptyHeritageClauseType, {
+ at: originalStartLoc,
+ token
+ });
+ }
+
+ return delimitedList;
+ }
+
+ tsParseInterfaceDeclaration(node, properties = {}) {
+ if (this.hasFollowingLineBreak()) return null;
+ this.expectContextual(125);
+ if (properties.declare) node.declare = true;
+
+ if (tokenIsIdentifier(this.state.type)) {
+ node.id = this.parseIdentifier();
+ this.checkIdentifier(node.id, BIND_TS_INTERFACE);
+ } else {
+ node.id = null;
+ this.raise(TSErrors.MissingInterfaceName, {
+ at: this.state.startLoc
+ });
+ }
+
+ node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));
+
+ if (this.eat(81)) {
+ node.extends = this.tsParseHeritageClause("extends");
+ }
+
+ const body = this.startNode();
+ body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));
+ node.body = this.finishNode(body, "TSInterfaceBody");
+ return this.finishNode(node, "TSInterfaceDeclaration");
+ }
+
+ tsParseTypeAliasDeclaration(node) {
+ node.id = this.parseIdentifier();
+ this.checkIdentifier(node.id, BIND_TS_TYPE);
+ node.typeAnnotation = this.tsInType(() => {
+ node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));
+ this.expect(29);
+
+ if (this.isContextual(111) && this.lookahead().type !== 16) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "TSIntrinsicKeyword");
+ }
+
+ return this.tsParseType();
+ });
+ this.semicolon();
+ return this.finishNode(node, "TSTypeAliasDeclaration");
+ }
+
+ tsInNoContext(cb) {
+ const oldContext = this.state.context;
+ this.state.context = [oldContext[0]];
+
+ try {
+ return cb();
+ } finally {
+ this.state.context = oldContext;
+ }
+ }
+
+ tsInType(cb) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+
+ try {
+ return cb();
+ } finally {
+ this.state.inType = oldInType;
+ }
+ }
+
+ tsInDisallowConditionalTypesContext(cb) {
+ const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;
+ this.state.inDisallowConditionalTypesContext = true;
+
+ try {
+ return cb();
+ } finally {
+ this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;
+ }
+ }
+
+ tsInAllowConditionalTypesContext(cb) {
+ const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;
+ this.state.inDisallowConditionalTypesContext = false;
+
+ try {
+ return cb();
+ } finally {
+ this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;
+ }
+ }
+
+ tsEatThenParseType(token) {
+ return !this.match(token) ? undefined : this.tsNextThenParseType();
+ }
+
+ tsExpectThenParseType(token) {
+ return this.tsDoThenParseType(() => this.expect(token));
+ }
+
+ tsNextThenParseType() {
+ return this.tsDoThenParseType(() => this.next());
+ }
+
+ tsDoThenParseType(cb) {
+ return this.tsInType(() => {
+ cb();
+ return this.tsParseType();
+ });
+ }
+
+ tsParseEnumMember() {
+ const node = this.startNode();
+ node.id = this.match(129) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);
+
+ if (this.eat(29)) {
+ node.initializer = super.parseMaybeAssignAllowIn();
+ }
+
+ return this.finishNode(node, "TSEnumMember");
+ }
+
+ tsParseEnumDeclaration(node, properties = {}) {
+ if (properties.const) node.const = true;
+ if (properties.declare) node.declare = true;
+ this.expectContextual(122);
+ node.id = this.parseIdentifier();
+ this.checkIdentifier(node.id, node.const ? BIND_TS_CONST_ENUM : BIND_TS_ENUM);
+ this.expect(5);
+ node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
+ this.expect(8);
+ return this.finishNode(node, "TSEnumDeclaration");
+ }
+
+ tsParseModuleBlock() {
+ const node = this.startNode();
+ this.scope.enter(SCOPE_OTHER);
+ this.expect(5);
+ super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8);
+ this.scope.exit();
+ return this.finishNode(node, "TSModuleBlock");
+ }
+
+ tsParseModuleOrNamespaceDeclaration(node, nested = false) {
+ node.id = this.parseIdentifier();
+
+ if (!nested) {
+ this.checkIdentifier(node.id, BIND_TS_NAMESPACE);
+ }
+
+ if (this.eat(16)) {
+ const inner = this.startNode();
+ this.tsParseModuleOrNamespaceDeclaration(inner, true);
+ node.body = inner;
+ } else {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseAmbientExternalModuleDeclaration(node) {
+ if (this.isContextual(109)) {
+ node.global = true;
+ node.id = this.parseIdentifier();
+ } else if (this.match(129)) {
+ node.id = super.parseStringLiteral(this.state.value);
+ } else {
+ this.unexpected();
+ }
+
+ if (this.match(5)) {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ } else {
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseImportEqualsDeclaration(node, isExport) {
+ node.isExport = isExport || false;
+ node.id = this.parseIdentifier();
+ this.checkIdentifier(node.id, BIND_LEXICAL);
+ this.expect(29);
+ const moduleReference = this.tsParseModuleReference();
+
+ if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") {
+ this.raise(TSErrors.ImportAliasHasImportType, {
+ at: moduleReference
+ });
+ }
+
+ node.moduleReference = moduleReference;
+ this.semicolon();
+ return this.finishNode(node, "TSImportEqualsDeclaration");
+ }
+
+ tsIsExternalModuleReference() {
+ return this.isContextual(116) && this.lookaheadCharCode() === 40;
+ }
+
+ tsParseModuleReference() {
+ return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);
+ }
+
+ tsParseExternalModuleReference() {
+ const node = this.startNode();
+ this.expectContextual(116);
+ this.expect(10);
+
+ if (!this.match(129)) {
+ throw this.unexpected();
+ }
+
+ node.expression = super.parseExprAtom();
+ this.expect(11);
+ return this.finishNode(node, "TSExternalModuleReference");
+ }
+
+ tsLookAhead(f) {
+ const state = this.state.clone();
+ const res = f();
+ this.state = state;
+ return res;
+ }
+
+ tsTryParseAndCatch(f) {
+ const result = this.tryParse(abort => f() || abort());
+ if (result.aborted || !result.node) return undefined;
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ tsTryParse(f) {
+ const state = this.state.clone();
+ const result = f();
+
+ if (result !== undefined && result !== false) {
+ return result;
+ } else {
+ this.state = state;
+ return undefined;
+ }
+ }
+
+ tsTryParseDeclare(nany) {
+ if (this.isLineTerminator()) {
+ return;
+ }
+
+ let starttype = this.state.type;
+ let kind;
+
+ if (this.isContextual(99)) {
+ starttype = 74;
+ kind = "let";
+ }
+
+ return this.tsInAmbientContext(() => {
+ if (starttype === 68) {
+ nany.declare = true;
+ return super.parseFunctionStatement(nany, false, true);
+ }
+
+ if (starttype === 80) {
+ nany.declare = true;
+ return this.parseClass(nany, true, false);
+ }
+
+ if (starttype === 122) {
+ return this.tsParseEnumDeclaration(nany, {
+ declare: true
+ });
+ }
+
+ if (starttype === 109) {
+ return this.tsParseAmbientExternalModuleDeclaration(nany);
+ }
+
+ if (starttype === 75 || starttype === 74) {
+ if (!this.match(75) || !this.isLookaheadContextual("enum")) {
+ nany.declare = true;
+ return this.parseVarStatement(nany, kind || this.state.value, true);
+ }
+
+ this.expect(75);
+ return this.tsParseEnumDeclaration(nany, {
+ const: true,
+ declare: true
+ });
+ }
+
+ if (starttype === 125) {
+ const result = this.tsParseInterfaceDeclaration(nany, {
+ declare: true
+ });
+ if (result) return result;
+ }
+
+ if (tokenIsIdentifier(starttype)) {
+ return this.tsParseDeclaration(nany, this.state.value, true);
+ }
+ });
+ }
+
+ tsTryParseExportDeclaration() {
+ return this.tsParseDeclaration(this.startNode(), this.state.value, true);
+ }
+
+ tsParseExpressionStatement(node, expr) {
+ switch (expr.name) {
+ case "declare":
+ {
+ const declaration = this.tsTryParseDeclare(node);
+
+ if (declaration) {
+ declaration.declare = true;
+ return declaration;
+ }
+
+ break;
+ }
+
+ case "global":
+ if (this.match(5)) {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ const mod = node;
+ mod.global = true;
+ mod.id = expr;
+ mod.body = this.tsParseModuleBlock();
+ this.scope.exit();
+ this.prodParam.exit();
+ return this.finishNode(mod, "TSModuleDeclaration");
+ }
+
+ break;
+
+ default:
+ return this.tsParseDeclaration(node, expr.name, false);
+ }
+ }
+
+ tsParseDeclaration(node, value, next) {
+ switch (value) {
+ case "abstract":
+ if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) {
+ return this.tsParseAbstractDeclaration(node);
+ }
+
+ break;
+
+ case "module":
+ if (this.tsCheckLineTerminator(next)) {
+ if (this.match(129)) {
+ return this.tsParseAmbientExternalModuleDeclaration(node);
+ } else if (tokenIsIdentifier(this.state.type)) {
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+ }
+
+ break;
+
+ case "namespace":
+ if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+
+ break;
+
+ case "type":
+ if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
+ return this.tsParseTypeAliasDeclaration(node);
+ }
+
+ break;
+ }
+ }
+
+ tsCheckLineTerminator(next) {
+ if (next) {
+ if (this.hasFollowingLineBreak()) return false;
+ this.next();
+ return true;
+ }
+
+ return !this.isLineTerminator();
+ }
+
+ tsTryParseGenericAsyncArrowFunction(startPos, startLoc) {
+ if (!this.match(47)) {
+ return undefined;
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ this.state.maybeInArrowParameters = true;
+ const res = this.tsTryParseAndCatch(() => {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.typeParameters = this.tsParseTypeParameters();
+ super.parseFunctionParams(node);
+ node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();
+ this.expect(19);
+ return node;
+ });
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+
+ if (!res) {
+ return undefined;
+ }
+
+ return super.parseArrowExpression(res, null, true);
+ }
+
+ tsParseTypeArgumentsInExpression() {
+ if (this.reScan_lt() !== 47) {
+ return undefined;
+ }
+
+ return this.tsParseTypeArguments();
+ }
+
+ tsParseTypeArguments() {
+ const node = this.startNode();
+ node.params = this.tsInType(() => this.tsInNoContext(() => {
+ this.expect(47);
+ return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
+ }));
+
+ if (node.params.length === 0) {
+ this.raise(TSErrors.EmptyTypeArguments, {
+ at: node
+ });
+ }
+
+ this.expect(48);
+ return this.finishNode(node, "TSTypeParameterInstantiation");
+ }
+
+ tsIsDeclarationStart() {
+ return tokenIsTSDeclarationStart(this.state.type);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.tsIsDeclarationStart()) return false;
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseAssignableListItem(allowModifiers, decorators) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let accessibility;
+ let readonly = false;
+ let override = false;
+
+ if (allowModifiers !== undefined) {
+ const modified = {};
+ this.tsParseModifiers({
+ modified,
+ allowedModifiers: ["public", "private", "protected", "override", "readonly"]
+ });
+ accessibility = modified.accessibility;
+ override = modified.override;
+ readonly = modified.readonly;
+
+ if (allowModifiers === false && (accessibility || readonly || override)) {
+ this.raise(TSErrors.UnexpectedParameterModifier, {
+ at: startLoc
+ });
+ }
+ }
+
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left);
+ const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
+
+ if (accessibility || readonly || override) {
+ const pp = this.startNodeAt(startPos, startLoc);
+
+ if (decorators.length) {
+ pp.decorators = decorators;
+ }
+
+ if (accessibility) pp.accessibility = accessibility;
+ if (readonly) pp.readonly = readonly;
+ if (override) pp.override = override;
+
+ if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
+ this.raise(TSErrors.UnsupportedParameterPropertyKind, {
+ at: pp
+ });
+ }
+
+ pp.parameter = elt;
+ return this.finishNode(pp, "TSParameterProperty");
+ }
+
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+
+ return elt;
+ }
+
+ isSimpleParameter(node) {
+ return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node);
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(14)) {
+ node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14);
+ }
+
+ const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined;
+
+ if (bodilessType && !this.match(5) && this.isLineTerminator()) {
+ return this.finishNode(node, bodilessType);
+ }
+
+ if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) {
+ this.raise(TSErrors.DeclareFunctionHasImplementation, {
+ at: node
+ });
+
+ if (node.declare) {
+ return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);
+ }
+ }
+
+ return super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.body && node.id) {
+ this.checkIdentifier(node.id, BIND_TS_AMBIENT);
+ } else {
+ super.registerFunctionStatementId(node);
+ }
+ }
+
+ tsCheckForInvalidTypeCasts(items) {
+ items.forEach(node => {
+ if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") {
+ this.raise(TSErrors.UnexpectedTypeAnnotation, {
+ at: node.typeAnnotation
+ });
+ }
+ });
+ }
+
+ toReferencedList(exprList, isInParens) {
+ this.tsCheckForInvalidTypeCasts(exprList);
+ return exprList;
+ }
+
+ parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
+ const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);
+
+ if (node.type === "ArrayExpression") {
+ this.tsCheckForInvalidTypeCasts(node.elements);
+ }
+
+ return node;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ if (!this.hasPrecedingLineBreak() && this.match(35)) {
+ this.state.canStartJSXElement = false;
+ this.next();
+ const nonNullExpression = this.startNodeAt(startPos, startLoc);
+ nonNullExpression.expression = base;
+ return this.finishNode(nonNullExpression, "TSNonNullExpression");
+ }
+
+ let isOptionalCall = false;
+
+ if (this.match(18) && this.lookaheadCharCode() === 60) {
+ if (noCalls) {
+ state.stop = true;
+ return base;
+ }
+
+ state.optionalChainMember = isOptionalCall = true;
+ this.next();
+ }
+
+ if (this.match(47) || this.match(51)) {
+ let missingParenErrorLoc;
+ const result = this.tsTryParseAndCatch(() => {
+ if (!noCalls && this.atPossibleAsyncArrow(base)) {
+ const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc);
+
+ if (asyncArrowFn) {
+ return asyncArrowFn;
+ }
+ }
+
+ const typeArguments = this.tsParseTypeArgumentsInExpression();
+ if (!typeArguments) return;
+
+ if (isOptionalCall && !this.match(10)) {
+ missingParenErrorLoc = this.state.curPosition();
+ return;
+ }
+
+ if (tokenIsTemplate(this.state.type)) {
+ const result = super.parseTaggedTemplateExpression(base, startPos, startLoc, state);
+ result.typeParameters = typeArguments;
+ return result;
+ }
+
+ if (!noCalls && this.eat(10)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.arguments = this.parseCallExpressionArguments(11, false);
+ this.tsCheckForInvalidTypeCasts(node.arguments);
+ node.typeParameters = typeArguments;
+
+ if (state.optionalChainMember) {
+ node.optional = isOptionalCall;
+ }
+
+ return this.finishCallExpression(node, state.optionalChainMember);
+ }
+
+ const tokenType = this.state.type;
+
+ if (tokenType === 48 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
+ return;
+ }
+
+ const node = this.startNodeAt(startPos, startLoc);
+ node.expression = base;
+ node.typeParameters = typeArguments;
+ return this.finishNode(node, "TSInstantiationExpression");
+ });
+
+ if (missingParenErrorLoc) {
+ this.unexpected(missingParenErrorLoc, 10);
+ }
+
+ if (result) {
+ if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) {
+ this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, {
+ at: this.state.startLoc
+ });
+ }
+
+ return result;
+ }
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, state);
+ }
+
+ parseNewCallee(node) {
+ var _callee$extra;
+
+ super.parseNewCallee(node);
+ const {
+ callee
+ } = node;
+
+ if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) {
+ node.typeParameters = callee.typeParameters;
+ node.callee = callee.expression;
+ }
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec) {
+ if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual(93)) {
+ const node = this.startNodeAt(leftStartPos, leftStartLoc);
+ node.expression = left;
+
+ const _const = this.tsTryNextParseConstantContext();
+
+ if (_const) {
+ node.typeAnnotation = _const;
+ } else {
+ node.typeAnnotation = this.tsNextThenParseType();
+ }
+
+ this.finishNode(node, "TSAsExpression");
+ this.reScan_lt_gt();
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec);
+ }
+
+ return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec);
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (!this.state.isAmbientContext) {
+ super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
+ }
+ }
+
+ checkDuplicateExports() {}
+
+ parseImport(node) {
+ node.importKind = "value";
+
+ if (tokenIsIdentifier(this.state.type) || this.match(55) || this.match(5)) {
+ let ahead = this.lookahead();
+
+ if (this.isContextual(126) && ahead.type !== 12 && ahead.type !== 97 && ahead.type !== 29) {
+ node.importKind = "type";
+ this.next();
+ ahead = this.lookahead();
+ }
+
+ if (tokenIsIdentifier(this.state.type) && ahead.type === 29) {
+ return this.tsParseImportEqualsDeclaration(node);
+ }
+ }
+
+ const importNode = super.parseImport(node);
+
+ if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
+ this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, {
+ at: importNode
+ });
+ }
+
+ return importNode;
+ }
+
+ parseExport(node) {
+ if (this.match(83)) {
+ this.next();
+
+ if (this.isContextual(126) && this.lookaheadCharCode() !== 61) {
+ node.importKind = "type";
+ this.next();
+ } else {
+ node.importKind = "value";
+ }
+
+ return this.tsParseImportEqualsDeclaration(node, true);
+ } else if (this.eat(29)) {
+ const assign = node;
+ assign.expression = super.parseExpression();
+ this.semicolon();
+ return this.finishNode(assign, "TSExportAssignment");
+ } else if (this.eatContextual(93)) {
+ const decl = node;
+ this.expectContextual(124);
+ decl.id = this.parseIdentifier();
+ this.semicolon();
+ return this.finishNode(decl, "TSNamespaceExportDeclaration");
+ } else {
+ if (this.isContextual(126) && this.lookahead().type === 5) {
+ this.next();
+ node.exportKind = "type";
+ } else {
+ node.exportKind = "value";
+ }
+
+ return super.parseExport(node);
+ }
+ }
+
+ isAbstractClass() {
+ return this.isContextual(120) && this.lookahead().type === 80;
+ }
+
+ parseExportDefaultExpression() {
+ if (this.isAbstractClass()) {
+ const cls = this.startNode();
+ this.next();
+ cls.abstract = true;
+ return this.parseClass(cls, true, true);
+ }
+
+ if (this.match(125)) {
+ const result = this.tsParseInterfaceDeclaration(this.startNode());
+ if (result) return result;
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseVarStatement(node, kind, allowMissingInitializer = false) {
+ const {
+ isAmbientContext
+ } = this.state;
+ const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext);
+ if (!isAmbientContext) return declaration;
+
+ for (const {
+ id,
+ init
+ } of declaration.declarations) {
+ if (!init) continue;
+
+ if (kind !== "const" || !!id.typeAnnotation) {
+ this.raise(TSErrors.InitializerNotAllowedInAmbientContext, {
+ at: init
+ });
+ } else if (init.type !== "StringLiteral" && init.type !== "BooleanLiteral" && init.type !== "NumericLiteral" && init.type !== "BigIntLiteral" && (init.type !== "TemplateLiteral" || init.expressions.length > 0) && !isPossiblyLiteralEnum(init)) {
+ this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, {
+ at: init
+ });
+ }
+ }
+
+ return declaration;
+ }
+
+ parseStatementContent(context, topLevel) {
+ if (this.match(75) && this.isLookaheadContextual("enum")) {
+ const node = this.startNode();
+ this.expect(75);
+ return this.tsParseEnumDeclaration(node, {
+ const: true
+ });
+ }
+
+ if (this.isContextual(122)) {
+ return this.tsParseEnumDeclaration(this.startNode());
+ }
+
+ if (this.isContextual(125)) {
+ const result = this.tsParseInterfaceDeclaration(this.startNode());
+ if (result) return result;
+ }
+
+ return super.parseStatementContent(context, topLevel);
+ }
+
+ parseAccessModifier() {
+ return this.tsParseModifier(["public", "protected", "private"]);
+ }
+
+ tsHasSomeModifiers(member, modifiers) {
+ return modifiers.some(modifier => {
+ if (tsIsAccessModifier(modifier)) {
+ return member.accessibility === modifier;
+ }
+
+ return !!member[modifier];
+ });
+ }
+
+ tsIsStartOfStaticBlocks() {
+ return this.isContextual(104) && this.lookaheadCharCode() === 123;
+ }
+
+ parseClassMember(classBody, member, state) {
+ const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"];
+ this.tsParseModifiers({
+ modified: member,
+ allowedModifiers: modifiers,
+ disallowedModifiers: ["in", "out"],
+ stopOnStartOfClassStaticBlock: true,
+ errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions
+ });
+
+ const callParseClassMemberWithIsStatic = () => {
+ if (this.tsIsStartOfStaticBlocks()) {
+ this.next();
+ this.next();
+
+ if (this.tsHasSomeModifiers(member, modifiers)) {
+ this.raise(TSErrors.StaticBlockCannotHaveModifier, {
+ at: this.state.curPosition()
+ });
+ }
+
+ super.parseClassStaticBlock(classBody, member);
+ } else {
+ this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static);
+ }
+ };
+
+ if (member.declare) {
+ this.tsInAmbientContext(callParseClassMemberWithIsStatic);
+ } else {
+ callParseClassMemberWithIsStatic();
+ }
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
+ const idx = this.tsTryParseIndexSignature(member);
+
+ if (idx) {
+ classBody.body.push(idx);
+
+ if (member.abstract) {
+ this.raise(TSErrors.IndexSignatureHasAbstract, {
+ at: member
+ });
+ }
+
+ if (member.accessibility) {
+ this.raise(TSErrors.IndexSignatureHasAccessibility, {
+ at: member,
+ modifier: member.accessibility
+ });
+ }
+
+ if (member.declare) {
+ this.raise(TSErrors.IndexSignatureHasDeclare, {
+ at: member
+ });
+ }
+
+ if (member.override) {
+ this.raise(TSErrors.IndexSignatureHasOverride, {
+ at: member
+ });
+ }
+
+ return;
+ }
+
+ if (!this.state.inAbstractClass && member.abstract) {
+ this.raise(TSErrors.NonAbstractClassHasAbstractMethod, {
+ at: member
+ });
+ }
+
+ if (member.override) {
+ if (!state.hadSuperClass) {
+ this.raise(TSErrors.OverrideNotInSubClass, {
+ at: member
+ });
+ }
+ }
+
+ super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {
+ const optional = this.eat(17);
+ if (optional) methodOrProp.optional = true;
+
+ if (methodOrProp.readonly && this.match(10)) {
+ this.raise(TSErrors.ClassMethodHasReadonly, {
+ at: methodOrProp
+ });
+ }
+
+ if (methodOrProp.declare && this.match(10)) {
+ this.raise(TSErrors.ClassMethodHasDeclare, {
+ at: methodOrProp
+ });
+ }
+ }
+
+ parseExpressionStatement(node, expr) {
+ const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined;
+ return decl || super.parseExpressionStatement(node, expr);
+ }
+
+ shouldParseExportDeclaration() {
+ if (this.tsIsDeclarationStart()) return true;
+ return super.shouldParseExportDeclaration();
+ }
+
+ parseConditional(expr, startPos, startLoc, refExpressionErrors) {
+ if (!this.state.maybeInArrowParameters || !this.match(17)) {
+ return super.parseConditional(expr, startPos, startLoc, refExpressionErrors);
+ }
+
+ const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc));
+
+ if (!result.node) {
+ if (result.error) {
+ super.setOptionalParametersError(refExpressionErrors, result.error);
+ }
+
+ return expr;
+ }
+
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ node = super.parseParenItem(node, startPos, startLoc);
+
+ if (this.eat(17)) {
+ node.optional = true;
+ this.resetEndLocation(node);
+ }
+
+ if (this.match(14)) {
+ const typeCastNode = this.startNodeAt(startPos, startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TSTypeCastExpression");
+ }
+
+ return node;
+ }
+
+ parseExportDeclaration(node) {
+ if (!this.state.isAmbientContext && this.isContextual(121)) {
+ return this.tsInAmbientContext(() => this.parseExportDeclaration(node));
+ }
+
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const isDeclare = this.eatContextual(121);
+
+ if (isDeclare && (this.isContextual(121) || !this.shouldParseExportDeclaration())) {
+ throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, {
+ at: this.state.startLoc
+ });
+ }
+
+ const isIdentifier = tokenIsIdentifier(this.state.type);
+ const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node);
+ if (!declaration) return null;
+
+ if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) {
+ node.exportKind = "type";
+ }
+
+ if (isDeclare) {
+ this.resetStartLocation(declaration, startPos, startLoc);
+ declaration.declare = true;
+ }
+
+ return declaration;
+ }
+
+ parseClassId(node, isStatement, optionalId, bindingType) {
+ if ((!isStatement || optionalId) && this.isContextual(110)) {
+ return;
+ }
+
+ super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS);
+ const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));
+ if (typeParameters) node.typeParameters = typeParameters;
+ }
+
+ parseClassPropertyAnnotation(node) {
+ if (!node.optional && this.eat(35)) {
+ node.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ }
+
+ parseClassProperty(node) {
+ this.parseClassPropertyAnnotation(node);
+
+ if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) {
+ this.raise(TSErrors.DeclareClassFieldHasInitializer, {
+ at: this.state.startLoc
+ });
+ }
+
+ if (node.abstract && this.match(29)) {
+ const {
+ key
+ } = node;
+ this.raise(TSErrors.AbstractPropertyHasInitializer, {
+ at: this.state.startLoc,
+ propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`
+ });
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (node.abstract) {
+ this.raise(TSErrors.PrivateElementHasAbstract, {
+ at: node
+ });
+ }
+
+ if (node.accessibility) {
+ this.raise(TSErrors.PrivateElementHasAccessibility, {
+ at: node,
+ modifier: node.accessibility
+ });
+ }
+
+ this.parseClassPropertyAnnotation(node);
+ return super.parseClassPrivateProperty(node);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ const typeParameters = this.tsTryParseTypeParameters();
+
+ if (typeParameters && isConstructor) {
+ this.raise(TSErrors.ConstructorHasTypeParameters, {
+ at: typeParameters
+ });
+ }
+
+ const {
+ declare = false,
+ kind
+ } = method;
+
+ if (declare && (kind === "get" || kind === "set")) {
+ this.raise(TSErrors.DeclareAccessor, {
+ at: method,
+ kind
+ });
+ }
+
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+
+ declareClassPrivateMethodInScope(node, kind) {
+ if (node.type === "TSDeclareMethod") return;
+ if (node.type === "MethodDefinition" && !node.value.body) return;
+ super.declareClassPrivateMethodInScope(node, kind);
+ }
+
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+
+ if (node.superClass && (this.match(47) || this.match(51))) {
+ node.superTypeParameters = this.tsParseTypeArgumentsInExpression();
+ }
+
+ if (this.eatContextual(110)) {
+ node.implements = this.tsParseHeritageClause("implements");
+ }
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) prop.typeParameters = typeParameters;
+ return super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) node.typeParameters = typeParameters;
+ super.parseFunctionParams(node, allowModifiers);
+ }
+
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+
+ if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) {
+ decl.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+
+ if (type) {
+ decl.id.typeAnnotation = type;
+ this.resetEndLocation(decl.id);
+ }
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(14)) {
+ node.returnType = this.tsParseTypeAnnotation();
+ }
+
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+
+ parseMaybeAssign(refExpressionErrors, afterLeftParse) {
+ var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3;
+
+ let state;
+ let jsx;
+ let typeCast;
+
+ if (this.hasPlugin("jsx") && (this.match(138) || this.match(47))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+ const currentContext = context[context.length - 1];
+
+ if (currentContext === types.j_oTag || currentContext === types.j_expr) {
+ context.pop();
+ }
+ }
+
+ if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) {
+ return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ }
+
+ if (!state || state === this.state) state = this.state.clone();
+ let typeParameters;
+ const arrow = this.tryParse(abort => {
+ var _expr$extra, _typeParameters;
+
+ typeParameters = this.tsParseTypeParameters();
+ const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+
+ if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
+ abort();
+ }
+
+ if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {
+ this.resetStartLocationFromNode(expr, typeParameters);
+ }
+
+ expr.typeParameters = typeParameters;
+ return expr;
+ }, state);
+
+ if (!arrow.error && !arrow.aborted) {
+ if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);
+ return arrow.node;
+ }
+
+ if (!jsx) {
+ assert(!this.hasPlugin("jsx"));
+ typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
+ if (!typeCast.error) return typeCast.node;
+ }
+
+ if ((_jsx2 = jsx) != null && _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);
+ return arrow.node;
+ }
+
+ if ((_typeCast = typeCast) != null && _typeCast.node) {
+ this.state = typeCast.failState;
+ return typeCast.node;
+ }
+
+ if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ if ((_typeCast2 = typeCast) != null && _typeCast2.thrown) throw typeCast.error;
+ throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error);
+ }
+
+ reportReservedArrowTypeParam(node) {
+ var _node$extra;
+
+ if (node.params.length === 1 && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
+ this.raise(TSErrors.ReservedArrowTypeParam, {
+ at: node
+ });
+ }
+ }
+
+ parseMaybeUnary(refExpressionErrors, sawUnary) {
+ if (!this.hasPlugin("jsx") && this.match(47)) {
+ return this.tsParseTypeAssertion();
+ } else {
+ return super.parseMaybeUnary(refExpressionErrors, sawUnary);
+ }
+ }
+
+ parseArrow(node) {
+ if (this.match(14)) {
+ const result = this.tryParse(abort => {
+ const returnType = this.tsParseTypeOrTypePredicateAnnotation(14);
+ if (this.canInsertSemicolon() || !this.match(19)) abort();
+ return returnType;
+ });
+ if (result.aborted) return;
+
+ if (!result.thrown) {
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node;
+ }
+ }
+
+ return super.parseArrow(node);
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(17)) {
+ if (param.type !== "Identifier" && !this.state.isAmbientContext && !this.state.inType) {
+ this.raise(TSErrors.PatternIsOptional, {
+ at: param
+ });
+ }
+
+ param.optional = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "TSTypeCastExpression":
+ return this.isAssignable(node.expression, isBinding);
+
+ case "TSParameterProperty":
+ return true;
+
+ default:
+ return super.isAssignable(node, isBinding);
+ }
+ }
+
+ toAssignable(node, isLHS = false) {
+ switch (node.type) {
+ case "ParenthesizedExpression":
+ this.toAssignableParenthesizedExpression(node, isLHS);
+ break;
+
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ if (isLHS) {
+ this.expressionScope.recordArrowParemeterBindingError(TSErrors.UnexpectedTypeCastInParameter, {
+ at: node
+ });
+ } else {
+ this.raise(TSErrors.UnexpectedTypeCastInParameter, {
+ at: node
+ });
+ }
+
+ this.toAssignable(node.expression, isLHS);
+ break;
+
+ case "AssignmentExpression":
+ if (!isLHS && node.left.type === "TSTypeCastExpression") {
+ node.left = this.typeCastToParameter(node.left);
+ }
+
+ default:
+ super.toAssignable(node, isLHS);
+ }
+ }
+
+ toAssignableParenthesizedExpression(node, isLHS) {
+ switch (node.expression.type) {
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ case "ParenthesizedExpression":
+ this.toAssignable(node.expression, isLHS);
+ break;
+
+ default:
+ super.toAssignable(node, isLHS);
+ }
+ }
+
+ checkToRestConversion(node, allowPattern) {
+ switch (node.type) {
+ case "TSAsExpression":
+ case "TSTypeAssertion":
+ case "TSNonNullExpression":
+ this.checkToRestConversion(node.expression, false);
+ break;
+
+ default:
+ super.checkToRestConversion(node, allowPattern);
+ }
+ }
+
+ isValidLVal(type, isUnparenthesizedInAssign, binding) {
+ return getOwn$1({
+ TSTypeCastExpression: true,
+ TSParameterProperty: "parameter",
+ TSNonNullExpression: "expression",
+ TSAsExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true],
+ TSTypeAssertion: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true]
+ }, type) || super.isValidLVal(type, isUnparenthesizedInAssign, binding);
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 78:
+ return this.parseIdentifier(true);
+
+ default:
+ return super.parseBindingAtom();
+ }
+ }
+
+ parseMaybeDecoratorArguments(expr) {
+ if (this.match(47) || this.match(51)) {
+ const typeArguments = this.tsParseTypeArgumentsInExpression();
+
+ if (this.match(10)) {
+ const call = super.parseMaybeDecoratorArguments(expr);
+ call.typeParameters = typeArguments;
+ return call;
+ }
+
+ this.unexpected(null, 10);
+ }
+
+ return super.parseMaybeDecoratorArguments(expr);
+ }
+
+ checkCommaAfterRest(close) {
+ if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) {
+ this.next();
+ return false;
+ } else {
+ return super.checkCommaAfterRest(close);
+ }
+ }
+
+ isClassMethod() {
+ return this.match(47) || super.isClassMethod();
+ }
+
+ isClassProperty() {
+ return this.match(35) || this.match(14) || super.isClassProperty();
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ const node = super.parseMaybeDefault(startPos, startLoc, left);
+
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(TSErrors.TypeAnnotationAfterAssign, {
+ at: node.typeAnnotation
+ });
+ }
+
+ return node;
+ }
+
+ getTokenFromCode(code) {
+ if (this.state.inType) {
+ if (code === 62) {
+ return this.finishOp(48, 1);
+ }
+
+ if (code === 60) {
+ return this.finishOp(47, 1);
+ }
+ }
+
+ return super.getTokenFromCode(code);
+ }
+
+ reScan_lt_gt() {
+ const {
+ type
+ } = this.state;
+
+ if (type === 47) {
+ this.state.pos -= 1;
+ this.readToken_lt();
+ } else if (type === 48) {
+ this.state.pos -= 1;
+ this.readToken_gt();
+ }
+ }
+
+ reScan_lt() {
+ const {
+ type
+ } = this.state;
+
+ if (type === 51) {
+ this.state.pos -= 2;
+ this.finishOp(47, 1);
+ return 47;
+ }
+
+ return type;
+ }
+
+ toAssignableList(exprList, trailingCommaLoc, isLHS) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+
+ if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") {
+ exprList[i] = this.typeCastToParameter(expr);
+ }
+ }
+
+ super.toAssignableList(exprList, trailingCommaLoc, isLHS);
+ }
+
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+
+ shouldParseArrow(params) {
+ if (this.match(14)) {
+ return params.every(expr => this.isAssignable(expr, true));
+ }
+
+ return super.shouldParseArrow(params);
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(14) || super.shouldParseAsyncArrow();
+ }
+
+ canHaveLeadingDecorator() {
+ return super.canHaveLeadingDecorator() || this.isAbstractClass();
+ }
+
+ jsxParseOpeningElementAfterName(node) {
+ if (this.match(47) || this.match(51)) {
+ const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression());
+ if (typeArguments) node.typeParameters = typeArguments;
+ }
+
+ return super.jsxParseOpeningElementAfterName(node);
+ }
+
+ getGetterSetterExpectedParamCount(method) {
+ const baseCount = super.getGetterSetterExpectedParamCount(method);
+ const params = this.getObjectOrClassMethodParams(method);
+ const firstParam = params[0];
+ const hasContextParam = firstParam && this.isThisParam(firstParam);
+ return hasContextParam ? baseCount + 1 : baseCount;
+ }
+
+ parseCatchClauseParam() {
+ const param = super.parseCatchClauseParam();
+ const type = this.tsTryParseTypeAnnotation();
+
+ if (type) {
+ param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ }
+
+ return param;
+ }
+
+ tsInAmbientContext(cb) {
+ const oldIsAmbientContext = this.state.isAmbientContext;
+ this.state.isAmbientContext = true;
+
+ try {
+ return cb();
+ } finally {
+ this.state.isAmbientContext = oldIsAmbientContext;
+ }
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ const oldInAbstractClass = this.state.inAbstractClass;
+ this.state.inAbstractClass = !!node.abstract;
+
+ try {
+ return super.parseClass(node, isStatement, optionalId);
+ } finally {
+ this.state.inAbstractClass = oldInAbstractClass;
+ }
+ }
+
+ tsParseAbstractDeclaration(node) {
+ if (this.match(80)) {
+ node.abstract = true;
+ return this.parseClass(node, true, false);
+ } else if (this.isContextual(125)) {
+ if (!this.hasFollowingLineBreak()) {
+ node.abstract = true;
+ this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, {
+ at: node
+ });
+ return this.tsParseInterfaceDeclaration(node);
+ }
+ } else {
+ this.unexpected(null, 80);
+ }
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
+ const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
+
+ if (method.abstract) {
+ const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body;
+
+ if (hasBody) {
+ const {
+ key
+ } = method;
+ this.raise(TSErrors.AbstractMethodHasImplementation, {
+ at: method,
+ methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`
+ });
+ }
+ }
+
+ return method;
+ }
+
+ tsParseTypeParameterName() {
+ const typeName = this.parseIdentifier();
+ return typeName.name;
+ }
+
+ shouldParseAsAmbientContext() {
+ return !!this.getPluginOption("typescript", "dts");
+ }
+
+ parse() {
+ if (this.shouldParseAsAmbientContext()) {
+ this.state.isAmbientContext = true;
+ }
+
+ return super.parse();
+ }
+
+ getExpression() {
+ if (this.shouldParseAsAmbientContext()) {
+ this.state.isAmbientContext = true;
+ }
+
+ return super.getExpression();
+ }
+
+ parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {
+ if (!isString && isMaybeTypeOnly) {
+ this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport);
+ return this.finishNode(node, "ExportSpecifier");
+ }
+
+ node.exportKind = "value";
+ return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly);
+ }
+
+ parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
+ if (!importedIsString && isMaybeTypeOnly) {
+ this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport);
+ return this.finishNode(specifier, "ImportSpecifier");
+ }
+
+ specifier.importKind = "value";
+ return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly);
+ }
+
+ parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) {
+ const leftOfAsKey = isImport ? "imported" : "local";
+ const rightOfAsKey = isImport ? "local" : "exported";
+ let leftOfAs = node[leftOfAsKey];
+ let rightOfAs;
+ let hasTypeSpecifier = false;
+ let canParseAsKeyword = true;
+ const loc = leftOfAs.loc.start;
+
+ if (this.isContextual(93)) {
+ const firstAs = this.parseIdentifier();
+
+ if (this.isContextual(93)) {
+ const secondAs = this.parseIdentifier();
+
+ if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ hasTypeSpecifier = true;
+ leftOfAs = firstAs;
+ rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();
+ canParseAsKeyword = false;
+ } else {
+ rightOfAs = secondAs;
+ canParseAsKeyword = false;
+ }
+ } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ canParseAsKeyword = false;
+ rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();
+ } else {
+ hasTypeSpecifier = true;
+ leftOfAs = firstAs;
+ }
+ } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ hasTypeSpecifier = true;
+
+ if (isImport) {
+ leftOfAs = this.parseIdentifier(true);
+
+ if (!this.isContextual(93)) {
+ this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true);
+ }
+ } else {
+ leftOfAs = this.parseModuleExportName();
+ }
+ }
+
+ if (hasTypeSpecifier && isInTypeOnlyImportExport) {
+ this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, {
+ at: loc
+ });
+ }
+
+ node[leftOfAsKey] = leftOfAs;
+ node[rightOfAsKey] = rightOfAs;
+ const kindKey = isImport ? "importKind" : "exportKind";
+ node[kindKey] = hasTypeSpecifier ? "type" : "value";
+
+ if (canParseAsKeyword && this.eatContextual(93)) {
+ node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName();
+ }
+
+ if (!node[rightOfAsKey]) {
+ node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]);
+ }
+
+ if (isImport) {
+ this.checkIdentifier(node[rightOfAsKey], BIND_LEXICAL);
+ }
+ }
+
+});
+
+function isPossiblyLiteralEnum(expression) {
+ if (expression.type !== "MemberExpression") return false;
+ const {
+ computed,
+ property
+ } = expression;
+
+ if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) {
+ return false;
+ }
+
+ return isUncomputedMemberExpressionChain(expression.object);
+}
+
+function isUncomputedMemberExpressionChain(expression) {
+ if (expression.type === "Identifier") return true;
+ if (expression.type !== "MemberExpression") return false;
+ if (expression.computed) return false;
+ return isUncomputedMemberExpressionChain(expression.object);
+}
+
+const PlaceholderErrors = ParseErrorEnum`placeholders`({
+ ClassNameIsRequired: "A class name is required.",
+ UnexpectedSpace: "Unexpected space in placeholder."
+});
+var placeholders = (superClass => class PlaceholdersParserMixin extends superClass {
+ parsePlaceholder(expectedNode) {
+ if (this.match(140)) {
+ const node = this.startNode();
+ this.next();
+ this.assertNoSpace();
+ node.name = super.parseIdentifier(true);
+ this.assertNoSpace();
+ this.expect(140);
+ return this.finishPlaceholder(node, expectedNode);
+ }
+ }
+
+ finishPlaceholder(node, expectedNode) {
+ const isFinished = !!(node.expectedNode && node.type === "Placeholder");
+ node.expectedNode = expectedNode;
+ return isFinished ? node : this.finishNode(node, "Placeholder");
+ }
+
+ getTokenFromCode(code) {
+ if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
+ return this.finishOp(140, 2);
+ }
+
+ return super.getTokenFromCode(code);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors);
+ }
+
+ parseIdentifier(liberal) {
+ return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal);
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (word !== undefined) {
+ super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
+ }
+ }
+
+ parseBindingAtom() {
+ return this.parsePlaceholder("Pattern") || super.parseBindingAtom();
+ }
+
+ isValidLVal(type, isParenthesized, binding) {
+ return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding);
+ }
+
+ toAssignable(node, isLHS) {
+ if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
+ node.expectedNode = "Pattern";
+ } else {
+ super.toAssignable(node, isLHS);
+ }
+ }
+
+ isLet(context) {
+ if (super.isLet(context)) {
+ return true;
+ }
+
+ if (!this.isContextual(99)) {
+ return false;
+ }
+
+ if (context) return false;
+ const nextToken = this.lookahead();
+
+ if (nextToken.type === 140) {
+ return true;
+ }
+
+ return false;
+ }
+
+ verifyBreakContinue(node, isBreak) {
+ if (node.label && node.label.type === "Placeholder") return;
+ super.verifyBreakContinue(node, isBreak);
+ }
+
+ parseExpressionStatement(node, expr) {
+ if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) {
+ return super.parseExpressionStatement(node, expr);
+ }
+
+ if (this.match(14)) {
+ const stmt = node;
+ stmt.label = this.finishPlaceholder(expr, "Identifier");
+ this.next();
+ stmt.body = super.parseStatement("label");
+ return this.finishNode(stmt, "LabeledStatement");
+ }
+
+ this.semicolon();
+ node.name = expr.name;
+ return this.finishPlaceholder(node, "Statement");
+ }
+
+ parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) {
+ return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse);
+ }
+
+ parseFunctionId(requireId) {
+ return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId);
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ const type = isStatement ? "ClassDeclaration" : "ClassExpression";
+ this.next();
+ this.takeDecorators(node);
+ const oldStrict = this.state.strict;
+ const placeholder = this.parsePlaceholder("Identifier");
+
+ if (placeholder) {
+ if (this.match(81) || this.match(140) || this.match(5)) {
+ node.id = placeholder;
+ } else if (optionalId || !isStatement) {
+ node.id = null;
+ node.body = this.finishPlaceholder(placeholder, "ClassBody");
+ return this.finishNode(node, type);
+ } else {
+ throw this.raise(PlaceholderErrors.ClassNameIsRequired, {
+ at: this.state.startLoc
+ });
+ }
+ } else {
+ this.parseClassId(node, isStatement, optionalId);
+ }
+
+ super.parseClassSuper(node);
+ node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict);
+ return this.finishNode(node, type);
+ }
+
+ parseExport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseExport(node);
+
+ if (!this.isContextual(97) && !this.match(12)) {
+ node.specifiers = [];
+ node.source = null;
+ node.declaration = this.finishPlaceholder(placeholder, "Declaration");
+ return this.finishNode(node, "ExportNamedDeclaration");
+ }
+
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = placeholder;
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return super.parseExport(node);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(65)) {
+ const next = this.nextTokenStart();
+
+ if (this.isUnparsedContextual(next, "from")) {
+ if (this.input.startsWith(tokenLabelName(140), this.nextTokenStartSince(next + 4))) {
+ return true;
+ }
+ }
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (node.specifiers && node.specifiers.length > 0) {
+ return true;
+ }
+
+ return super.maybeParseExportDefaultSpecifier(node);
+ }
+
+ checkExport(node) {
+ const {
+ specifiers
+ } = node;
+
+ if (specifiers != null && specifiers.length) {
+ node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder");
+ }
+
+ super.checkExport(node);
+ node.specifiers = specifiers;
+ }
+
+ parseImport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseImport(node);
+ node.specifiers = [];
+
+ if (!this.isContextual(97) && !this.match(12)) {
+ node.source = this.finishPlaceholder(placeholder, "StringLiteral");
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ const specifier = this.startNodeAtNode(placeholder);
+ specifier.local = placeholder;
+ node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier"));
+
+ if (this.eat(12)) {
+ const hasStarImport = this.maybeParseStarImportSpecifier(node);
+ if (!hasStarImport) this.parseNamedImportSpecifiers(node);
+ }
+
+ this.expectContextual(97);
+ node.source = this.parseImportSource();
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ parseImportSource() {
+ return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
+ }
+
+ assertNoSpace() {
+ if (this.state.start > this.state.lastTokEndLoc.index) {
+ this.raise(PlaceholderErrors.UnexpectedSpace, {
+ at: this.state.lastTokEndLoc
+ });
+ }
+ }
+
+});
+
+var v8intrinsic = (superClass => class V8IntrinsicMixin extends superClass {
+ parseV8Intrinsic() {
+ if (this.match(54)) {
+ const v8IntrinsicStartLoc = this.state.startLoc;
+ const node = this.startNode();
+ this.next();
+
+ if (tokenIsIdentifier(this.state.type)) {
+ const name = this.parseIdentifierName(this.state.start);
+ const identifier = this.createIdentifier(node, name);
+ identifier.type = "V8IntrinsicIdentifier";
+
+ if (this.match(10)) {
+ return identifier;
+ }
+ }
+
+ this.unexpected(v8IntrinsicStartLoc);
+ }
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors);
+ }
+
+});
+
+function hasPlugin(plugins, expectedConfig) {
+ const [expectedName, expectedOptions] = typeof expectedConfig === "string" ? [expectedConfig, {}] : expectedConfig;
+ const expectedKeys = Object.keys(expectedOptions);
+ const expectedOptionsIsEmpty = expectedKeys.length === 0;
+ return plugins.some(p => {
+ if (typeof p === "string") {
+ return expectedOptionsIsEmpty && p === expectedName;
+ } else {
+ const [pluginName, pluginOptions] = p;
+
+ if (pluginName !== expectedName) {
+ return false;
+ }
+
+ for (const key of expectedKeys) {
+ if (pluginOptions[key] !== expectedOptions[key]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ });
+}
+function getPluginOption(plugins, name, option) {
+ const plugin = plugins.find(plugin => {
+ if (Array.isArray(plugin)) {
+ return plugin[0] === name;
+ } else {
+ return plugin === name;
+ }
+ });
+
+ if (plugin && Array.isArray(plugin)) {
+ return plugin[1][option];
+ }
+
+ return null;
+}
+const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"];
+const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"];
+const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
+function validatePlugins(plugins) {
+ if (hasPlugin(plugins, "decorators")) {
+ if (hasPlugin(plugins, "decorators-legacy")) {
+ throw new Error("Cannot use the decorators and decorators-legacy plugin together");
+ }
+
+ const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport");
+
+ if (decoratorsBeforeExport == null) {
+ throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'.");
+ } else if (typeof decoratorsBeforeExport !== "boolean") {
+ throw new Error("'decoratorsBeforeExport' must be a boolean.");
+ }
+ }
+
+ if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) {
+ throw new Error("Cannot combine flow and typescript plugins.");
+ }
+
+ if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) {
+ throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
+ }
+
+ if (hasPlugin(plugins, "pipelineOperator")) {
+ const proposal = getPluginOption(plugins, "pipelineOperator", "proposal");
+
+ if (!PIPELINE_PROPOSALS.includes(proposal)) {
+ const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", ");
+ throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`);
+ }
+
+ const tupleSyntaxIsHash = hasPlugin(plugins, ["recordAndTuple", {
+ syntaxType: "hash"
+ }]);
+
+ if (proposal === "hack") {
+ if (hasPlugin(plugins, "placeholders")) {
+ throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");
+ }
+
+ if (hasPlugin(plugins, "v8intrinsic")) {
+ throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
+ }
+
+ const topicToken = getPluginOption(plugins, "pipelineOperator", "topicToken");
+
+ if (!TOPIC_TOKENS.includes(topicToken)) {
+ const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", ");
+ throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`);
+ }
+
+ if (topicToken === "#" && tupleSyntaxIsHash) {
+ throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.');
+ }
+ } else if (proposal === "smart" && tupleSyntaxIsHash) {
+ throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.');
+ }
+ }
+
+ if (hasPlugin(plugins, "moduleAttributes")) {
+ {
+ if (hasPlugin(plugins, "importAssertions")) {
+ throw new Error("Cannot combine importAssertions and moduleAttributes plugins.");
+ }
+
+ const moduleAttributesVersionPluginOption = getPluginOption(plugins, "moduleAttributes", "version");
+
+ if (moduleAttributesVersionPluginOption !== "may-2020") {
+ throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'.");
+ }
+ }
+ }
+
+ if (hasPlugin(plugins, "recordAndTuple") && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) {
+ throw new Error("'recordAndTuple' requires 'syntaxType' option whose value should be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", "));
+ }
+
+ if (hasPlugin(plugins, "asyncDoExpressions") && !hasPlugin(plugins, "doExpressions")) {
+ const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");
+ error.missingPlugins = "doExpressions";
+ throw error;
+ }
+}
+const mixinPlugins = {
+ estree,
+ jsx,
+ flow,
+ typescript,
+ v8intrinsic,
+ placeholders
+};
+const mixinPluginNames = Object.keys(mixinPlugins);
+
+const defaultOptions = {
+ sourceType: "script",
+ sourceFilename: undefined,
+ startColumn: 0,
+ startLine: 1,
+ allowAwaitOutsideFunction: false,
+ allowReturnOutsideFunction: false,
+ allowImportExportEverywhere: false,
+ allowSuperOutsideMethod: false,
+ allowUndeclaredExports: false,
+ plugins: [],
+ strictMode: null,
+ ranges: false,
+ tokens: false,
+ createParenthesizedExpressions: false,
+ errorRecovery: false,
+ attachComment: true
+};
+function getOptions(opts) {
+ const options = {};
+
+ for (const key of Object.keys(defaultOptions)) {
+ options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];
+ }
+
+ return options;
+}
+
+const getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key];
+
+const unwrapParenthesizedExpression = node => {
+ return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
+};
+
+class LValParser extends NodeUtils {
+ toAssignable(node, isLHS = false) {
+ var _node$extra, _node$extra3;
+
+ let parenthesized = undefined;
+
+ if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) {
+ parenthesized = unwrapParenthesizedExpression(node);
+
+ if (isLHS) {
+ if (parenthesized.type === "Identifier") {
+ this.expressionScope.recordArrowParemeterBindingError(Errors.InvalidParenthesizedAssignment, {
+ at: node
+ });
+ } else if (parenthesized.type !== "MemberExpression") {
+ this.raise(Errors.InvalidParenthesizedAssignment, {
+ at: node
+ });
+ }
+ } else {
+ this.raise(Errors.InvalidParenthesizedAssignment, {
+ at: node
+ });
+ }
+ }
+
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ case "RestElement":
+ break;
+
+ case "ObjectExpression":
+ node.type = "ObjectPattern";
+
+ for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
+ var _node$extra2;
+
+ const prop = node.properties[i];
+ const isLast = i === last;
+ this.toAssignableObjectExpressionProp(prop, isLast, isLHS);
+
+ if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) {
+ this.raise(Errors.RestTrailingComma, {
+ at: node.extra.trailingCommaLoc
+ });
+ }
+ }
+
+ break;
+
+ case "ObjectProperty":
+ {
+ const {
+ key,
+ value
+ } = node;
+
+ if (this.isPrivateName(key)) {
+ this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
+ }
+
+ this.toAssignable(value, isLHS);
+ break;
+ }
+
+ case "SpreadElement":
+ {
+ throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller.");
+ }
+
+ case "ArrayExpression":
+ node.type = "ArrayPattern";
+ this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS);
+ break;
+
+ case "AssignmentExpression":
+ if (node.operator !== "=") {
+ this.raise(Errors.MissingEqInAssignment, {
+ at: node.left.loc.end
+ });
+ }
+
+ node.type = "AssignmentPattern";
+ delete node.operator;
+ this.toAssignable(node.left, isLHS);
+ break;
+
+ case "ParenthesizedExpression":
+ this.toAssignable(parenthesized, isLHS);
+ break;
+ }
+ }
+
+ toAssignableObjectExpressionProp(prop, isLast, isLHS) {
+ if (prop.type === "ObjectMethod") {
+ this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, {
+ at: prop.key
+ });
+ } else if (prop.type === "SpreadElement") {
+ prop.type = "RestElement";
+ const arg = prop.argument;
+ this.checkToRestConversion(arg, false);
+ this.toAssignable(arg, isLHS);
+
+ if (!isLast) {
+ this.raise(Errors.RestTrailingComma, {
+ at: prop
+ });
+ }
+ } else {
+ this.toAssignable(prop, isLHS);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaLoc, isLHS) {
+ const end = exprList.length - 1;
+
+ for (let i = 0; i <= end; i++) {
+ const elt = exprList[i];
+ if (!elt) continue;
+
+ if (elt.type === "SpreadElement") {
+ elt.type = "RestElement";
+ const arg = elt.argument;
+ this.checkToRestConversion(arg, true);
+ this.toAssignable(arg, isLHS);
+ } else {
+ this.toAssignable(elt, isLHS);
+ }
+
+ if (elt.type === "RestElement") {
+ if (i < end) {
+ this.raise(Errors.RestTrailingComma, {
+ at: elt
+ });
+ } else if (trailingCommaLoc) {
+ this.raise(Errors.RestTrailingComma, {
+ at: trailingCommaLoc
+ });
+ }
+ }
+ }
+ }
+
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ case "RestElement":
+ return true;
+
+ case "ObjectExpression":
+ {
+ const last = node.properties.length - 1;
+ return node.properties.every((prop, i) => {
+ return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop);
+ });
+ }
+
+ case "ObjectProperty":
+ return this.isAssignable(node.value);
+
+ case "SpreadElement":
+ return this.isAssignable(node.argument);
+
+ case "ArrayExpression":
+ return node.elements.every(element => element === null || this.isAssignable(element));
+
+ case "AssignmentExpression":
+ return node.operator === "=";
+
+ case "ParenthesizedExpression":
+ return this.isAssignable(node.expression);
+
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ return !isBinding;
+
+ default:
+ return false;
+ }
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ return exprList;
+ }
+
+ toReferencedListDeep(exprList, isParenthesizedExpr) {
+ this.toReferencedList(exprList, isParenthesizedExpr);
+
+ for (const expr of exprList) {
+ if ((expr == null ? void 0 : expr.type) === "ArrayExpression") {
+ this.toReferencedListDeep(expr.elements);
+ }
+ }
+ }
+
+ parseSpread(refExpressionErrors) {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined);
+ return this.finishNode(node, "SpreadElement");
+ }
+
+ parseRestBinding() {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseBindingAtom();
+ return this.finishNode(node, "RestElement");
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 0:
+ {
+ const node = this.startNode();
+ this.next();
+ node.elements = this.parseBindingList(3, 93, true);
+ return this.finishNode(node, "ArrayPattern");
+ }
+
+ case 5:
+ return this.parseObjectLike(8, true);
+ }
+
+ return this.parseIdentifier();
+ }
+
+ parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12);
+ }
+
+ if (allowEmpty && this.match(12)) {
+ elts.push(null);
+ } else if (this.eat(close)) {
+ break;
+ } else if (this.match(21)) {
+ elts.push(this.parseAssignableListItemTypes(this.parseRestBinding()));
+
+ if (!this.checkCommaAfterRest(closeCharCode)) {
+ this.expect(close);
+ break;
+ }
+ } else {
+ const decorators = [];
+
+ if (this.match(26) && this.hasPlugin("decorators")) {
+ this.raise(Errors.UnsupportedParameterDecorator, {
+ at: this.state.startLoc
+ });
+ }
+
+ while (this.match(26)) {
+ decorators.push(this.parseDecorator());
+ }
+
+ elts.push(this.parseAssignableListItem(allowModifiers, decorators));
+ }
+ }
+
+ return elts;
+ }
+
+ parseBindingRestProperty(prop) {
+ this.next();
+ prop.argument = this.parseIdentifier();
+ this.checkCommaAfterRest(125);
+ return this.finishNode(prop, "RestElement");
+ }
+
+ parseBindingProperty() {
+ const prop = this.startNode();
+ const {
+ type,
+ start: startPos,
+ startLoc
+ } = this.state;
+
+ if (type === 21) {
+ return this.parseBindingRestProperty(prop);
+ } else if (type === 134) {
+ this.expectPlugin("destructuringPrivate", startLoc);
+ this.classScope.usePrivateName(this.state.value, startLoc);
+ prop.key = this.parsePrivateName();
+ } else {
+ this.parsePropertyName(prop);
+ }
+
+ prop.method = false;
+ return this.parseObjPropValue(prop, startPos, startLoc, false, false, true, false);
+ }
+
+ parseAssignableListItem(allowModifiers, decorators) {
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left);
+ const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
+
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+
+ return elt;
+ }
+
+ parseAssignableListItemTypes(param) {
+ return param;
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ var _startLoc, _startPos, _left;
+
+ startLoc = (_startLoc = startLoc) != null ? _startLoc : this.state.startLoc;
+ startPos = (_startPos = startPos) != null ? _startPos : this.state.start;
+ left = (_left = left) != null ? _left : this.parseBindingAtom();
+ if (!this.eat(29)) return left;
+ const node = this.startNodeAt(startPos, startLoc);
+ node.left = left;
+ node.right = this.parseMaybeAssignAllowIn();
+ return this.finishNode(node, "AssignmentPattern");
+ }
+
+ isValidLVal(type, isUnparenthesizedInAssign, binding) {
+ return getOwn({
+ AssignmentPattern: "left",
+ RestElement: "argument",
+ ObjectProperty: "value",
+ ParenthesizedExpression: "expression",
+ ArrayPattern: "elements",
+ ObjectPattern: "properties"
+ }, type);
+ }
+
+ checkLVal(expression, {
+ in: ancestor,
+ binding = BIND_NONE,
+ checkClashes = false,
+ strictModeChanged = false,
+ allowingSloppyLetBinding = !(binding & BIND_SCOPE_LEXICAL),
+ hasParenthesizedAncestor = false
+ }) {
+ var _expression$extra;
+
+ const type = expression.type;
+ if (this.isObjectMethod(expression)) return;
+
+ if (type === "MemberExpression") {
+ if (binding !== BIND_NONE) {
+ this.raise(Errors.InvalidPropertyBindingPattern, {
+ at: expression
+ });
+ }
+
+ return;
+ }
+
+ if (expression.type === "Identifier") {
+ this.checkIdentifier(expression, binding, strictModeChanged, allowingSloppyLetBinding);
+ const {
+ name
+ } = expression;
+
+ if (checkClashes) {
+ if (checkClashes.has(name)) {
+ this.raise(Errors.ParamDupe, {
+ at: expression
+ });
+ } else {
+ checkClashes.add(name);
+ }
+ }
+
+ return;
+ }
+
+ const validity = this.isValidLVal(expression.type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding);
+ if (validity === true) return;
+
+ if (validity === false) {
+ const ParseErrorClass = binding === BIND_NONE ? Errors.InvalidLhs : Errors.InvalidLhsBinding;
+ this.raise(ParseErrorClass, {
+ at: expression,
+ ancestor: ancestor.type === "UpdateExpression" ? {
+ type: "UpdateExpression",
+ prefix: ancestor.prefix
+ } : {
+ type: ancestor.type
+ }
+ });
+ return;
+ }
+
+ const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === "ParenthesizedExpression"];
+ const nextAncestor = expression.type === "ArrayPattern" || expression.type === "ObjectPattern" || expression.type === "ParenthesizedExpression" ? expression : ancestor;
+
+ for (const child of [].concat(expression[key])) {
+ if (child) {
+ this.checkLVal(child, {
+ in: nextAncestor,
+ binding,
+ checkClashes,
+ allowingSloppyLetBinding,
+ strictModeChanged,
+ hasParenthesizedAncestor: isParenthesizedExpression
+ });
+ }
+ }
+ }
+
+ checkIdentifier(at, bindingType, strictModeChanged = false, allowLetBinding = !(bindingType & BIND_SCOPE_LEXICAL)) {
+ if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) {
+ if (bindingType === BIND_NONE) {
+ this.raise(Errors.StrictEvalArguments, {
+ at,
+ referenceName: at.name
+ });
+ } else {
+ this.raise(Errors.StrictEvalArgumentsBinding, {
+ at,
+ bindingName: at.name
+ });
+ }
+ }
+
+ if (!allowLetBinding && at.name === "let") {
+ this.raise(Errors.LetInLexicalBinding, {
+ at
+ });
+ }
+
+ if (!(bindingType & BIND_NONE)) {
+ this.declareNameFromIdentifier(at, bindingType);
+ }
+ }
+
+ declareNameFromIdentifier(identifier, binding) {
+ this.scope.declareName(identifier.name, binding, identifier.loc.start);
+ }
+
+ checkToRestConversion(node, allowPattern) {
+ switch (node.type) {
+ case "ParenthesizedExpression":
+ this.checkToRestConversion(node.expression, allowPattern);
+ break;
+
+ case "Identifier":
+ case "MemberExpression":
+ break;
+
+ case "ArrayExpression":
+ case "ObjectExpression":
+ if (allowPattern) break;
+
+ default:
+ this.raise(Errors.InvalidRestAssignmentPattern, {
+ at: node
+ });
+ }
+ }
+
+ checkCommaAfterRest(close) {
+ if (!this.match(12)) {
+ return false;
+ }
+
+ this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, {
+ at: this.state.startLoc
+ });
+ return true;
+ }
+
+}
+
+class ExpressionParser extends LValParser {
+ checkProto(prop, isRecord, protoRef, refExpressionErrors) {
+ if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) {
+ return;
+ }
+
+ const key = prop.key;
+ const name = key.type === "Identifier" ? key.name : key.value;
+
+ if (name === "__proto__") {
+ if (isRecord) {
+ this.raise(Errors.RecordNoProto, {
+ at: key
+ });
+ return;
+ }
+
+ if (protoRef.used) {
+ if (refExpressionErrors) {
+ if (refExpressionErrors.doubleProtoLoc === null) {
+ refExpressionErrors.doubleProtoLoc = key.loc.start;
+ }
+ } else {
+ this.raise(Errors.DuplicateProto, {
+ at: key
+ });
+ }
+ }
+
+ protoRef.used = true;
+ }
+ }
+
+ shouldExitDescending(expr, potentialArrowAt) {
+ return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt;
+ }
+
+ getExpression() {
+ this.enterInitialScopes();
+ this.nextToken();
+ const expr = this.parseExpression();
+
+ if (!this.match(135)) {
+ this.unexpected();
+ }
+
+ this.finalizeRemainingComments();
+ expr.comments = this.state.comments;
+ expr.errors = this.state.errors;
+
+ if (this.options.tokens) {
+ expr.tokens = this.tokens;
+ }
+
+ return expr;
+ }
+
+ parseExpression(disallowIn, refExpressionErrors) {
+ if (disallowIn) {
+ return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors));
+ }
+
+ return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
+ }
+
+ parseExpressionBase(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const expr = this.parseMaybeAssign(refExpressionErrors);
+
+ if (this.match(12)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.expressions = [expr];
+
+ while (this.eat(12)) {
+ node.expressions.push(this.parseMaybeAssign(refExpressionErrors));
+ }
+
+ this.toReferencedList(node.expressions);
+ return this.finishNode(node, "SequenceExpression");
+ }
+
+ return expr;
+ }
+
+ parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) {
+ return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
+ }
+
+ parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) {
+ return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
+ }
+
+ setOptionalParametersError(refExpressionErrors, resultError) {
+ var _resultError$loc;
+
+ refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc;
+ }
+
+ parseMaybeAssign(refExpressionErrors, afterLeftParse) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ if (this.isContextual(105)) {
+ if (this.prodParam.hasYield) {
+ let left = this.parseYield();
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ return left;
+ }
+ }
+
+ let ownExpressionErrors;
+
+ if (refExpressionErrors) {
+ ownExpressionErrors = false;
+ } else {
+ refExpressionErrors = new ExpressionErrors();
+ ownExpressionErrors = true;
+ }
+
+ const {
+ type
+ } = this.state;
+
+ if (type === 10 || tokenIsIdentifier(type)) {
+ this.state.potentialArrowAt = this.state.start;
+ }
+
+ let left = this.parseMaybeConditional(refExpressionErrors);
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ if (tokenIsAssignment(this.state.type)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const operator = this.state.value;
+ node.operator = operator;
+
+ if (this.match(29)) {
+ this.toAssignable(left, true);
+ node.left = left;
+
+ if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startPos) {
+ refExpressionErrors.doubleProtoLoc = null;
+ }
+
+ if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startPos) {
+ refExpressionErrors.shorthandAssignLoc = null;
+ }
+
+ if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startPos) {
+ this.checkDestructuringPrivate(refExpressionErrors);
+ refExpressionErrors.privateKeyLoc = null;
+ }
+ } else {
+ node.left = left;
+ }
+
+ this.next();
+ node.right = this.parseMaybeAssign();
+ this.checkLVal(left, {
+ in: this.finishNode(node, "AssignmentExpression")
+ });
+ return node;
+ } else if (ownExpressionErrors) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ return left;
+ }
+
+ parseMaybeConditional(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprOps(refExpressionErrors);
+
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+
+ return this.parseConditional(expr, startPos, startLoc, refExpressionErrors);
+ }
+
+ parseConditional(expr, startPos, startLoc, refExpressionErrors) {
+ if (this.eat(17)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.test = expr;
+ node.consequent = this.parseMaybeAssignAllowIn();
+ this.expect(14);
+ node.alternate = this.parseMaybeAssign();
+ return this.finishNode(node, "ConditionalExpression");
+ }
+
+ return expr;
+ }
+
+ parseMaybeUnaryOrPrivate(refExpressionErrors) {
+ return this.match(134) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
+ }
+
+ parseExprOps(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);
+
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+
+ return this.parseExprOp(expr, startPos, startLoc, -1);
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec) {
+ if (this.isPrivateName(left)) {
+ const value = this.getPrivateNameSV(left);
+
+ if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) {
+ this.raise(Errors.PrivateInExpectedIn, {
+ at: left,
+ identifierName: value
+ });
+ }
+
+ this.classScope.usePrivateName(value, left.loc.start);
+ }
+
+ const op = this.state.type;
+
+ if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) {
+ let prec = tokenOperatorPrecedence(op);
+
+ if (prec > minPrec) {
+ if (op === 39) {
+ this.expectPlugin("pipelineOperator");
+
+ if (this.state.inFSharpPipelineDirectBody) {
+ return left;
+ }
+
+ this.checkPipelineAtInfixOperator(left, leftStartLoc);
+ }
+
+ const node = this.startNodeAt(leftStartPos, leftStartLoc);
+ node.left = left;
+ node.operator = this.state.value;
+ const logical = op === 41 || op === 42;
+ const coalesce = op === 40;
+
+ if (coalesce) {
+ prec = tokenOperatorPrecedence(42);
+ }
+
+ this.next();
+
+ if (op === 39 && this.hasPlugin(["pipelineOperator", {
+ proposal: "minimal"
+ }])) {
+ if (this.state.type === 96 && this.prodParam.hasAwait) {
+ throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, {
+ at: this.state.startLoc
+ });
+ }
+ }
+
+ node.right = this.parseExprOpRightExpr(op, prec);
+ const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
+ const nextOp = this.state.type;
+
+ if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) {
+ throw this.raise(Errors.MixingCoalesceWithLogical, {
+ at: this.state.startLoc
+ });
+ }
+
+ return this.parseExprOp(finishedNode, leftStartPos, leftStartLoc, minPrec);
+ }
+ }
+
+ return left;
+ }
+
+ parseExprOpRightExpr(op, prec) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ switch (op) {
+ case 39:
+ switch (this.getPluginOption("pipelineOperator", "proposal")) {
+ case "hack":
+ return this.withTopicBindingContext(() => {
+ return this.parseHackPipeBody();
+ });
+
+ case "smart":
+ return this.withTopicBindingContext(() => {
+ if (this.prodParam.hasYield && this.isContextual(105)) {
+ throw this.raise(Errors.PipeBodyIsTighter, {
+ at: this.state.startLoc
+ });
+ }
+
+ return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startPos, startLoc);
+ });
+
+ case "fsharp":
+ return this.withSoloAwaitPermittingContext(() => {
+ return this.parseFSharpPipelineBody(prec);
+ });
+ }
+
+ default:
+ return this.parseExprOpBaseRightExpr(op, prec);
+ }
+ }
+
+ parseExprOpBaseRightExpr(op, prec) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startPos, startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec);
+ }
+
+ parseHackPipeBody() {
+ var _body$extra;
+
+ const {
+ startLoc
+ } = this.state;
+ const body = this.parseMaybeAssign();
+ const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type);
+
+ if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) {
+ this.raise(Errors.PipeUnparenthesizedBody, {
+ at: startLoc,
+ type: body.type
+ });
+ }
+
+ if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(Errors.PipeTopicUnused, {
+ at: startLoc
+ });
+ }
+
+ return body;
+ }
+
+ checkExponentialAfterUnary(node) {
+ if (this.match(57)) {
+ this.raise(Errors.UnexpectedTokenUnaryExponentiation, {
+ at: node.argument
+ });
+ }
+ }
+
+ parseMaybeUnary(refExpressionErrors, sawUnary) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const isAwait = this.isContextual(96);
+
+ if (isAwait && this.isAwaitAllowed()) {
+ this.next();
+ const expr = this.parseAwait(startPos, startLoc);
+ if (!sawUnary) this.checkExponentialAfterUnary(expr);
+ return expr;
+ }
+
+ const update = this.match(34);
+ const node = this.startNode();
+
+ if (tokenIsPrefix(this.state.type)) {
+ node.operator = this.state.value;
+ node.prefix = true;
+
+ if (this.match(72)) {
+ this.expectPlugin("throwExpressions");
+ }
+
+ const isDelete = this.match(89);
+ this.next();
+ node.argument = this.parseMaybeUnary(null, true);
+ this.checkExpressionErrors(refExpressionErrors, true);
+
+ if (this.state.strict && isDelete) {
+ const arg = node.argument;
+
+ if (arg.type === "Identifier") {
+ this.raise(Errors.StrictDelete, {
+ at: node
+ });
+ } else if (this.hasPropertyAsPrivateName(arg)) {
+ this.raise(Errors.DeletePrivateField, {
+ at: node
+ });
+ }
+ }
+
+ if (!update) {
+ if (!sawUnary) {
+ this.checkExponentialAfterUnary(node);
+ }
+
+ return this.finishNode(node, "UnaryExpression");
+ }
+ }
+
+ const expr = this.parseUpdate(node, update, refExpressionErrors);
+
+ if (isAwait) {
+ const {
+ type
+ } = this.state;
+ const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);
+
+ if (startsExpr && !this.isAmbiguousAwait()) {
+ this.raiseOverwrite(Errors.AwaitNotInAsyncContext, {
+ at: startLoc
+ });
+ return this.parseAwait(startPos, startLoc);
+ }
+ }
+
+ return expr;
+ }
+
+ parseUpdate(node, update, refExpressionErrors) {
+ if (update) {
+ const updateExpressionNode = node;
+ this.checkLVal(updateExpressionNode.argument, {
+ in: this.finishNode(updateExpressionNode, "UpdateExpression")
+ });
+ return node;
+ }
+
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr = this.parseExprSubscripts(refExpressionErrors);
+ if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;
+
+ while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.operator = this.state.value;
+ node.prefix = false;
+ node.argument = expr;
+ this.next();
+ this.checkLVal(expr, {
+ in: expr = this.finishNode(node, "UpdateExpression")
+ });
+ }
+
+ return expr;
+ }
+
+ parseExprSubscripts(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprAtom(refExpressionErrors);
+
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+
+ return this.parseSubscripts(expr, startPos, startLoc);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ const state = {
+ optionalChainMember: false,
+ maybeAsyncArrow: this.atPossibleAsyncArrow(base),
+ stop: false
+ };
+
+ do {
+ base = this.parseSubscript(base, startPos, startLoc, noCalls, state);
+ state.maybeAsyncArrow = false;
+ } while (!state.stop);
+
+ return base;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ const {
+ type
+ } = this.state;
+
+ if (!noCalls && type === 15) {
+ return this.parseBind(base, startPos, startLoc, noCalls, state);
+ } else if (tokenIsTemplate(type)) {
+ return this.parseTaggedTemplateExpression(base, startPos, startLoc, state);
+ }
+
+ let optional = false;
+
+ if (type === 18) {
+ if (noCalls && this.lookaheadCharCode() === 40) {
+ state.stop = true;
+ return base;
+ }
+
+ state.optionalChainMember = optional = true;
+ this.next();
+ }
+
+ if (!noCalls && this.match(10)) {
+ return this.parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional);
+ } else {
+ const computed = this.eat(0);
+
+ if (computed || optional || this.eat(16)) {
+ return this.parseMember(base, startPos, startLoc, state, computed, optional);
+ } else {
+ state.stop = true;
+ return base;
+ }
+ }
+ }
+
+ parseMember(base, startPos, startLoc, state, computed, optional) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.computed = computed;
+
+ if (computed) {
+ node.property = this.parseExpression();
+ this.expect(3);
+ } else if (this.match(134)) {
+ if (base.type === "Super") {
+ this.raise(Errors.SuperPrivateField, {
+ at: startLoc
+ });
+ }
+
+ this.classScope.usePrivateName(this.state.value, this.state.startLoc);
+ node.property = this.parsePrivateName();
+ } else {
+ node.property = this.parseIdentifier(true);
+ }
+
+ if (state.optionalChainMember) {
+ node.optional = optional;
+ return this.finishNode(node, "OptionalMemberExpression");
+ } else {
+ return this.finishNode(node, "MemberExpression");
+ }
+ }
+
+ parseBind(base, startPos, startLoc, noCalls, state) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ this.next();
+ node.callee = this.parseNoCallExpr();
+ state.stop = true;
+ return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls);
+ }
+
+ parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional) {
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ let refExpressionErrors = null;
+ this.state.maybeInArrowParameters = true;
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const {
+ maybeAsyncArrow,
+ optionalChainMember
+ } = state;
+
+ if (maybeAsyncArrow) {
+ this.expressionScope.enter(newAsyncArrowScope());
+ refExpressionErrors = new ExpressionErrors();
+ }
+
+ if (optionalChainMember) {
+ node.optional = optional;
+ }
+
+ if (optional) {
+ node.arguments = this.parseCallExpressionArguments(11);
+ } else {
+ node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type !== "Super", node, refExpressionErrors);
+ }
+
+ let finishedNode = this.finishCallExpression(node, optionalChainMember);
+
+ if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
+ state.stop = true;
+ this.checkDestructuringPrivate(refExpressionErrors);
+ this.expressionScope.validateAsPattern();
+ this.expressionScope.exit();
+ finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), finishedNode);
+ } else {
+ if (maybeAsyncArrow) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ this.expressionScope.exit();
+ }
+
+ this.toReferencedArguments(finishedNode);
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return finishedNode;
+ }
+
+ toReferencedArguments(node, isParenthesizedExpr) {
+ this.toReferencedListDeep(node.arguments, isParenthesizedExpr);
+ }
+
+ parseTaggedTemplateExpression(base, startPos, startLoc, state) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.tag = base;
+ node.quasi = this.parseTemplate(true);
+
+ if (state.optionalChainMember) {
+ this.raise(Errors.OptionalChainingNoTemplate, {
+ at: startLoc
+ });
+ }
+
+ return this.finishNode(node, "TaggedTemplateExpression");
+ }
+
+ atPossibleAsyncArrow(base) {
+ return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt;
+ }
+
+ finishCallExpression(node, optional) {
+ if (node.callee.type === "Import") {
+ if (node.arguments.length === 2) {
+ {
+ if (!this.hasPlugin("moduleAttributes")) {
+ this.expectPlugin("importAssertions");
+ }
+ }
+ }
+
+ if (node.arguments.length === 0 || node.arguments.length > 2) {
+ this.raise(Errors.ImportCallArity, {
+ at: node,
+ maxArgumentCount: this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1
+ });
+ } else {
+ for (const arg of node.arguments) {
+ if (arg.type === "SpreadElement") {
+ this.raise(Errors.ImportCallSpreadArgument, {
+ at: arg
+ });
+ }
+ }
+ }
+ }
+
+ return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
+ }
+
+ parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) {
+ const elts = [];
+ let first = true;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12);
+
+ if (this.match(close)) {
+ if (dynamicImport && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) {
+ this.raise(Errors.ImportCallArgumentTrailingComma, {
+ at: this.state.lastTokStartLoc
+ });
+ }
+
+ if (nodeForExtra) {
+ this.addTrailingCommaExtraToNode(nodeForExtra);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder));
+ }
+
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return elts;
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(19) && !this.canInsertSemicolon();
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ var _call$extra;
+
+ this.resetPreviousNodeTrailingComments(call);
+ this.expect(19);
+ this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc);
+
+ if (call.innerComments) {
+ setInnerComments(node, call.innerComments);
+ }
+
+ if (call.callee.trailingComments) {
+ setInnerComments(node, call.callee.trailingComments);
+ }
+
+ return node;
+ }
+
+ parseNoCallExpr() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ let node;
+ const {
+ type
+ } = this.state;
+
+ switch (type) {
+ case 79:
+ return this.parseSuper();
+
+ case 83:
+ node = this.startNode();
+ this.next();
+
+ if (this.match(16)) {
+ return this.parseImportMetaProperty(node);
+ }
+
+ if (!this.match(10)) {
+ this.raise(Errors.UnsupportedImport, {
+ at: this.state.lastTokStartLoc
+ });
+ }
+
+ return this.finishNode(node, "Import");
+
+ case 78:
+ node = this.startNode();
+ this.next();
+ return this.finishNode(node, "ThisExpression");
+
+ case 90:
+ {
+ return this.parseDo(this.startNode(), false);
+ }
+
+ case 56:
+ case 31:
+ {
+ this.readRegexp();
+ return this.parseRegExpLiteral(this.state.value);
+ }
+
+ case 130:
+ return this.parseNumericLiteral(this.state.value);
+
+ case 131:
+ return this.parseBigIntLiteral(this.state.value);
+
+ case 132:
+ return this.parseDecimalLiteral(this.state.value);
+
+ case 129:
+ return this.parseStringLiteral(this.state.value);
+
+ case 84:
+ return this.parseNullLiteral();
+
+ case 85:
+ return this.parseBooleanLiteral(true);
+
+ case 86:
+ return this.parseBooleanLiteral(false);
+
+ case 10:
+ {
+ const canBeArrow = this.state.potentialArrowAt === this.state.start;
+ return this.parseParenAndDistinguishExpression(canBeArrow);
+ }
+
+ case 2:
+ case 1:
+ {
+ return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true);
+ }
+
+ case 0:
+ {
+ return this.parseArrayLike(3, true, false, refExpressionErrors);
+ }
+
+ case 6:
+ case 7:
+ {
+ return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true);
+ }
+
+ case 5:
+ {
+ return this.parseObjectLike(8, false, false, refExpressionErrors);
+ }
+
+ case 68:
+ return this.parseFunctionOrFunctionSent();
+
+ case 26:
+ this.parseDecorators();
+
+ case 80:
+ node = this.startNode();
+ this.takeDecorators(node);
+ return this.parseClass(node, false);
+
+ case 77:
+ return this.parseNewOrNewTarget();
+
+ case 25:
+ case 24:
+ return this.parseTemplate(false);
+
+ case 15:
+ {
+ node = this.startNode();
+ this.next();
+ node.object = null;
+ const callee = node.callee = this.parseNoCallExpr();
+
+ if (callee.type === "MemberExpression") {
+ return this.finishNode(node, "BindExpression");
+ } else {
+ throw this.raise(Errors.UnsupportedBind, {
+ at: callee
+ });
+ }
+ }
+
+ case 134:
+ {
+ this.raise(Errors.PrivateInExpectedIn, {
+ at: this.state.startLoc,
+ identifierName: this.state.value
+ });
+ return this.parsePrivateName();
+ }
+
+ case 33:
+ {
+ return this.parseTopicReferenceThenEqualsSign(54, "%");
+ }
+
+ case 32:
+ {
+ return this.parseTopicReferenceThenEqualsSign(44, "^");
+ }
+
+ case 37:
+ case 38:
+ {
+ return this.parseTopicReference("hack");
+ }
+
+ case 44:
+ case 54:
+ case 27:
+ {
+ const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
+
+ if (pipeProposal) {
+ return this.parseTopicReference(pipeProposal);
+ } else {
+ throw this.unexpected();
+ }
+ }
+
+ case 47:
+ {
+ const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
+
+ if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {
+ this.expectOnePlugin(["jsx", "flow", "typescript"]);
+ break;
+ } else {
+ throw this.unexpected();
+ }
+ }
+
+ default:
+ if (tokenIsIdentifier(type)) {
+ if (this.isContextual(123) && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) {
+ return this.parseModuleExpression();
+ }
+
+ const canBeArrow = this.state.potentialArrowAt === this.state.start;
+ const containsEsc = this.state.containsEsc;
+ const id = this.parseIdentifier();
+
+ if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) {
+ const {
+ type
+ } = this.state;
+
+ if (type === 68) {
+ this.resetPreviousNodeTrailingComments(id);
+ this.next();
+ return this.parseFunction(this.startNodeAtNode(id), undefined, true);
+ } else if (tokenIsIdentifier(type)) {
+ if (this.lookaheadCharCode() === 61) {
+ return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
+ } else {
+ return id;
+ }
+ } else if (type === 90) {
+ this.resetPreviousNodeTrailingComments(id);
+ return this.parseDo(this.startNodeAtNode(id), true);
+ }
+ }
+
+ if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) {
+ this.next();
+ return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);
+ }
+
+ return id;
+ } else {
+ throw this.unexpected();
+ }
+
+ }
+ }
+
+ parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) {
+ const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
+
+ if (pipeProposal) {
+ this.state.type = topicTokenType;
+ this.state.value = topicTokenValue;
+ this.state.pos--;
+ this.state.end--;
+ this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);
+ return this.parseTopicReference(pipeProposal);
+ } else {
+ throw this.unexpected();
+ }
+ }
+
+ parseTopicReference(pipeProposal) {
+ const node = this.startNode();
+ const startLoc = this.state.startLoc;
+ const tokenType = this.state.type;
+ this.next();
+ return this.finishTopicReference(node, startLoc, pipeProposal, tokenType);
+ }
+
+ finishTopicReference(node, startLoc, pipeProposal, tokenType) {
+ if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {
+ const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference";
+
+ if (!this.topicReferenceIsAllowedInCurrentContext()) {
+ this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, {
+ at: startLoc
+ });
+ }
+
+ this.registerTopicReference();
+ return this.finishNode(node, nodeType);
+ } else {
+ throw this.raise(Errors.PipeTopicUnconfiguredToken, {
+ at: startLoc,
+ token: tokenLabelName(tokenType)
+ });
+ }
+ }
+
+ testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) {
+ switch (pipeProposal) {
+ case "hack":
+ {
+ return this.hasPlugin(["pipelineOperator", {
+ topicToken: tokenLabelName(tokenType)
+ }]);
+ }
+
+ case "smart":
+ return tokenType === 27;
+
+ default:
+ throw this.raise(Errors.PipeTopicRequiresHackPipes, {
+ at: startLoc
+ });
+ }
+ }
+
+ parseAsyncArrowUnaryFunction(node) {
+ this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));
+ const params = [this.parseIdentifier()];
+ this.prodParam.exit();
+
+ if (this.hasPrecedingLineBreak()) {
+ this.raise(Errors.LineTerminatorBeforeArrow, {
+ at: this.state.curPosition()
+ });
+ }
+
+ this.expect(19);
+ return this.parseArrowExpression(node, params, true);
+ }
+
+ parseDo(node, isAsync) {
+ this.expectPlugin("doExpressions");
+
+ if (isAsync) {
+ this.expectPlugin("asyncDoExpressions");
+ }
+
+ node.async = isAsync;
+ this.next();
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+
+ if (isAsync) {
+ this.prodParam.enter(PARAM_AWAIT);
+ node.body = this.parseBlock();
+ this.prodParam.exit();
+ } else {
+ node.body = this.parseBlock();
+ }
+
+ this.state.labels = oldLabels;
+ return this.finishNode(node, "DoExpression");
+ }
+
+ parseSuper() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(Errors.SuperNotAllowed, {
+ at: node
+ });
+ } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(Errors.UnexpectedSuper, {
+ at: node
+ });
+ }
+
+ if (!this.match(10) && !this.match(0) && !this.match(16)) {
+ this.raise(Errors.UnsupportedSuper, {
+ at: node
+ });
+ }
+
+ return this.finishNode(node, "Super");
+ }
+
+ parsePrivateName() {
+ const node = this.startNode();
+ const id = this.startNodeAt(this.state.start + 1, new Position(this.state.curLine, this.state.start + 1 - this.state.lineStart, this.state.start + 1));
+ const name = this.state.value;
+ this.next();
+ node.id = this.createIdentifier(id, name);
+ return this.finishNode(node, "PrivateName");
+ }
+
+ parseFunctionOrFunctionSent() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.prodParam.hasYield && this.match(16)) {
+ const meta = this.createIdentifier(this.startNodeAtNode(node), "function");
+ this.next();
+
+ if (this.match(102)) {
+ this.expectPlugin("functionSent");
+ } else if (!this.hasPlugin("functionSent")) {
+ this.unexpected();
+ }
+
+ return this.parseMetaProperty(node, meta, "sent");
+ }
+
+ return this.parseFunction(node);
+ }
+
+ parseMetaProperty(node, meta, propertyName) {
+ node.meta = meta;
+ const containsEsc = this.state.containsEsc;
+ node.property = this.parseIdentifier(true);
+
+ if (node.property.name !== propertyName || containsEsc) {
+ this.raise(Errors.UnsupportedMetaProperty, {
+ at: node.property,
+ target: meta.name,
+ onlyValidPropertyName: propertyName
+ });
+ }
+
+ return this.finishNode(node, "MetaProperty");
+ }
+
+ parseImportMetaProperty(node) {
+ const id = this.createIdentifier(this.startNodeAtNode(node), "import");
+ this.next();
+
+ if (this.isContextual(100)) {
+ if (!this.inModule) {
+ this.raise(Errors.ImportMetaOutsideModule, {
+ at: id
+ });
+ }
+
+ this.sawUnambiguousESM = true;
+ }
+
+ return this.parseMetaProperty(node, id, "meta");
+ }
+
+ parseLiteralAtNode(value, type, node) {
+ this.addExtra(node, "rawValue", value);
+ this.addExtra(node, "raw", this.input.slice(node.start, this.state.end));
+ node.value = value;
+ this.next();
+ return this.finishNode(node, type);
+ }
+
+ parseLiteral(value, type) {
+ const node = this.startNode();
+ return this.parseLiteralAtNode(value, type, node);
+ }
+
+ parseStringLiteral(value) {
+ return this.parseLiteral(value, "StringLiteral");
+ }
+
+ parseNumericLiteral(value) {
+ return this.parseLiteral(value, "NumericLiteral");
+ }
+
+ parseBigIntLiteral(value) {
+ return this.parseLiteral(value, "BigIntLiteral");
+ }
+
+ parseDecimalLiteral(value) {
+ return this.parseLiteral(value, "DecimalLiteral");
+ }
+
+ parseRegExpLiteral(value) {
+ const node = this.parseLiteral(value.value, "RegExpLiteral");
+ node.pattern = value.pattern;
+ node.flags = value.flags;
+ return node;
+ }
+
+ parseBooleanLiteral(value) {
+ const node = this.startNode();
+ node.value = value;
+ this.next();
+ return this.finishNode(node, "BooleanLiteral");
+ }
+
+ parseNullLiteral() {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "NullLiteral");
+ }
+
+ parseParenAndDistinguishExpression(canBeArrow) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let val;
+ this.next();
+ this.expressionScope.enter(newArrowHeadScope());
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.maybeInArrowParameters = true;
+ this.state.inFSharpPipelineDirectBody = false;
+ const innerStartPos = this.state.start;
+ const innerStartLoc = this.state.startLoc;
+ const exprList = [];
+ const refExpressionErrors = new ExpressionErrors();
+ let first = true;
+ let spreadStartLoc;
+ let optionalCommaStartLoc;
+
+ while (!this.match(11)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc);
+
+ if (this.match(11)) {
+ optionalCommaStartLoc = this.state.startLoc;
+ break;
+ }
+ }
+
+ if (this.match(21)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ spreadStartLoc = this.state.startLoc;
+ exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc));
+
+ if (!this.checkCommaAfterRest(41)) {
+ break;
+ }
+ } else {
+ exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem));
+ }
+ }
+
+ const innerEndLoc = this.state.lastTokEndLoc;
+ this.expect(11);
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ let arrowNode = this.startNodeAt(startPos, startLoc);
+
+ if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {
+ this.checkDestructuringPrivate(refExpressionErrors);
+ this.expressionScope.validateAsPattern();
+ this.expressionScope.exit();
+ this.parseArrowExpression(arrowNode, exprList, false);
+ return arrowNode;
+ }
+
+ this.expressionScope.exit();
+
+ if (!exprList.length) {
+ this.unexpected(this.state.lastTokStartLoc);
+ }
+
+ if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc);
+ if (spreadStartLoc) this.unexpected(spreadStartLoc);
+ this.checkExpressionErrors(refExpressionErrors, true);
+ this.toReferencedListDeep(exprList, true);
+
+ if (exprList.length > 1) {
+ val = this.startNodeAt(innerStartPos, innerStartLoc);
+ val.expressions = exprList;
+ this.finishNode(val, "SequenceExpression");
+ this.resetEndLocation(val, innerEndLoc);
+ } else {
+ val = exprList[0];
+ }
+
+ return this.wrapParenthesis(startPos, startLoc, val);
+ }
+
+ wrapParenthesis(startPos, startLoc, expression) {
+ if (!this.options.createParenthesizedExpressions) {
+ this.addExtra(expression, "parenthesized", true);
+ this.addExtra(expression, "parenStart", startPos);
+ this.takeSurroundingComments(expression, startPos, this.state.lastTokEndLoc.index);
+ return expression;
+ }
+
+ const parenExpression = this.startNodeAt(startPos, startLoc);
+ parenExpression.expression = expression;
+ return this.finishNode(parenExpression, "ParenthesizedExpression");
+ }
+
+ shouldParseArrow(params) {
+ return !this.canInsertSemicolon();
+ }
+
+ parseArrow(node) {
+ if (this.eat(19)) {
+ return node;
+ }
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ return node;
+ }
+
+ parseNewOrNewTarget() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.match(16)) {
+ const meta = this.createIdentifier(this.startNodeAtNode(node), "new");
+ this.next();
+ const metaProp = this.parseMetaProperty(node, meta, "target");
+
+ if (!this.scope.inNonArrowFunction && !this.scope.inClass) {
+ this.raise(Errors.UnexpectedNewTarget, {
+ at: metaProp
+ });
+ }
+
+ return metaProp;
+ }
+
+ return this.parseNew(node);
+ }
+
+ parseNew(node) {
+ this.parseNewCallee(node);
+
+ if (this.eat(10)) {
+ const args = this.parseExprList(11);
+ this.toReferencedList(args);
+ node.arguments = args;
+ } else {
+ node.arguments = [];
+ }
+
+ return this.finishNode(node, "NewExpression");
+ }
+
+ parseNewCallee(node) {
+ node.callee = this.parseNoCallExpr();
+
+ if (node.callee.type === "Import") {
+ this.raise(Errors.ImportCallNotNewExpression, {
+ at: node.callee
+ });
+ } else if (this.isOptionalChain(node.callee)) {
+ this.raise(Errors.OptionalChainingNoNew, {
+ at: this.state.lastTokEndLoc
+ });
+ } else if (this.eat(18)) {
+ this.raise(Errors.OptionalChainingNoNew, {
+ at: this.state.startLoc
+ });
+ }
+ }
+
+ parseTemplateElement(isTagged) {
+ const {
+ start,
+ startLoc,
+ end,
+ value
+ } = this.state;
+ const elemStart = start + 1;
+ const elem = this.startNodeAt(elemStart, createPositionWithColumnOffset(startLoc, 1));
+
+ if (value === null) {
+ if (!isTagged) {
+ this.raise(Errors.InvalidEscapeSequenceTemplate, {
+ at: createPositionWithColumnOffset(startLoc, 2)
+ });
+ }
+ }
+
+ const isTail = this.match(24);
+ const endOffset = isTail ? -1 : -2;
+ const elemEnd = end + endOffset;
+ elem.value = {
+ raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"),
+ cooked: value === null ? null : value.slice(1, endOffset)
+ };
+ elem.tail = isTail;
+ this.next();
+ const finishedNode = this.finishNode(elem, "TemplateElement");
+ this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset));
+ return finishedNode;
+ }
+
+ parseTemplate(isTagged) {
+ const node = this.startNode();
+ node.expressions = [];
+ let curElt = this.parseTemplateElement(isTagged);
+ node.quasis = [curElt];
+
+ while (!curElt.tail) {
+ node.expressions.push(this.parseTemplateSubstitution());
+ this.readTemplateContinuation();
+ node.quasis.push(curElt = this.parseTemplateElement(isTagged));
+ }
+
+ return this.finishNode(node, "TemplateLiteral");
+ }
+
+ parseTemplateSubstitution() {
+ return this.parseExpression();
+ }
+
+ parseObjectLike(close, isPattern, isRecord, refExpressionErrors) {
+ if (isRecord) {
+ this.expectPlugin("recordAndTuple");
+ }
+
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const propHash = Object.create(null);
+ let first = true;
+ const node = this.startNode();
+ node.properties = [];
+ this.next();
+
+ while (!this.match(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12);
+
+ if (this.match(close)) {
+ this.addTrailingCommaExtraToNode(node);
+ break;
+ }
+ }
+
+ let prop;
+
+ if (isPattern) {
+ prop = this.parseBindingProperty();
+ } else {
+ prop = this.parsePropertyDefinition(refExpressionErrors);
+ this.checkProto(prop, isRecord, propHash, refExpressionErrors);
+ }
+
+ if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") {
+ this.raise(Errors.InvalidRecordProperty, {
+ at: prop
+ });
+ }
+
+ if (prop.shorthand) {
+ this.addExtra(prop, "shorthand", true);
+ }
+
+ node.properties.push(prop);
+ }
+
+ this.next();
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ let type = "ObjectExpression";
+
+ if (isPattern) {
+ type = "ObjectPattern";
+ } else if (isRecord) {
+ type = "RecordExpression";
+ }
+
+ return this.finishNode(node, type);
+ }
+
+ addTrailingCommaExtraToNode(node) {
+ this.addExtra(node, "trailingComma", this.state.lastTokStart);
+ this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false);
+ }
+
+ maybeAsyncOrAccessorProp(prop) {
+ return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55));
+ }
+
+ parsePropertyDefinition(refExpressionErrors) {
+ let decorators = [];
+
+ if (this.match(26)) {
+ if (this.hasPlugin("decorators")) {
+ this.raise(Errors.UnsupportedPropertyDecorator, {
+ at: this.state.startLoc
+ });
+ }
+
+ while (this.match(26)) {
+ decorators.push(this.parseDecorator());
+ }
+ }
+
+ const prop = this.startNode();
+ let isAsync = false;
+ let isAccessor = false;
+ let startPos;
+ let startLoc;
+
+ if (this.match(21)) {
+ if (decorators.length) this.unexpected();
+ return this.parseSpread();
+ }
+
+ if (decorators.length) {
+ prop.decorators = decorators;
+ decorators = [];
+ }
+
+ prop.method = false;
+
+ if (refExpressionErrors) {
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ }
+
+ let isGenerator = this.eat(55);
+ this.parsePropertyNamePrefixOperator(prop);
+ const containsEsc = this.state.containsEsc;
+ const key = this.parsePropertyName(prop, refExpressionErrors);
+
+ if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {
+ const keyName = key.name;
+
+ if (keyName === "async" && !this.hasPrecedingLineBreak()) {
+ isAsync = true;
+ this.resetPreviousNodeTrailingComments(key);
+ isGenerator = this.eat(55);
+ this.parsePropertyName(prop);
+ }
+
+ if (keyName === "get" || keyName === "set") {
+ isAccessor = true;
+ this.resetPreviousNodeTrailingComments(key);
+ prop.kind = keyName;
+
+ if (this.match(55)) {
+ isGenerator = true;
+ this.raise(Errors.AccessorIsGenerator, {
+ at: this.state.curPosition(),
+ kind: keyName
+ });
+ this.next();
+ }
+
+ this.parsePropertyName(prop);
+ }
+ }
+
+ return this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors);
+ }
+
+ getGetterSetterExpectedParamCount(method) {
+ return method.kind === "get" ? 0 : 1;
+ }
+
+ getObjectOrClassMethodParams(method) {
+ return method.params;
+ }
+
+ checkGetterSetterParams(method) {
+ var _params;
+
+ const paramCount = this.getGetterSetterExpectedParamCount(method);
+ const params = this.getObjectOrClassMethodParams(method);
+
+ if (params.length !== paramCount) {
+ this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, {
+ at: method
+ });
+ }
+
+ if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") {
+ this.raise(Errors.BadSetterRestParameter, {
+ at: method
+ });
+ }
+ }
+
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
+ if (isAccessor) {
+ const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod");
+ this.checkGetterSetterParams(finishedProp);
+ return finishedProp;
+ }
+
+ if (isAsync || isGenerator || this.match(10)) {
+ if (isPattern) this.unexpected();
+ prop.kind = "method";
+ prop.method = true;
+ return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod");
+ }
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ prop.shorthand = false;
+
+ if (this.eat(14)) {
+ prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors);
+ return this.finishNode(prop, "ObjectProperty");
+ }
+
+ if (!prop.computed && prop.key.type === "Identifier") {
+ this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false);
+
+ if (isPattern) {
+ prop.value = this.parseMaybeDefault(startPos, startLoc, cloneIdentifier(prop.key));
+ } else if (this.match(29)) {
+ const shorthandAssignLoc = this.state.startLoc;
+
+ if (refExpressionErrors != null) {
+ if (refExpressionErrors.shorthandAssignLoc === null) {
+ refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc;
+ }
+ } else {
+ this.raise(Errors.InvalidCoverInitializedName, {
+ at: shorthandAssignLoc
+ });
+ }
+
+ prop.value = this.parseMaybeDefault(startPos, startLoc, cloneIdentifier(prop.key));
+ } else {
+ prop.value = cloneIdentifier(prop.key);
+ }
+
+ prop.shorthand = true;
+ return this.finishNode(prop, "ObjectProperty");
+ }
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
+ const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+ if (!node) this.unexpected();
+ return node;
+ }
+
+ parsePropertyName(prop, refExpressionErrors) {
+ if (this.eat(0)) {
+ prop.computed = true;
+ prop.key = this.parseMaybeAssignAllowIn();
+ this.expect(3);
+ } else {
+ const {
+ type,
+ value
+ } = this.state;
+ let key;
+
+ if (tokenIsKeywordOrIdentifier(type)) {
+ key = this.parseIdentifier(true);
+ } else {
+ switch (type) {
+ case 130:
+ key = this.parseNumericLiteral(value);
+ break;
+
+ case 129:
+ key = this.parseStringLiteral(value);
+ break;
+
+ case 131:
+ key = this.parseBigIntLiteral(value);
+ break;
+
+ case 132:
+ key = this.parseDecimalLiteral(value);
+ break;
+
+ case 134:
+ {
+ const privateKeyLoc = this.state.startLoc;
+
+ if (refExpressionErrors != null) {
+ if (refExpressionErrors.privateKeyLoc === null) {
+ refExpressionErrors.privateKeyLoc = privateKeyLoc;
+ }
+ } else {
+ this.raise(Errors.UnexpectedPrivateField, {
+ at: privateKeyLoc
+ });
+ }
+
+ key = this.parsePrivateName();
+ break;
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ prop.key = key;
+
+ if (type !== 134) {
+ prop.computed = false;
+ }
+ }
+
+ return prop.key;
+ }
+
+ initFunction(node, isAsync) {
+ node.id = null;
+ node.generator = false;
+ node.async = !!isAsync;
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ this.initFunction(node, isAsync);
+ node.generator = !!isGenerator;
+ const allowModifiers = isConstructor;
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+ this.parseFunctionParams(node, allowModifiers);
+ const finishedNode = this.parseFunctionBodyAndFinish(node, type, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ return finishedNode;
+ }
+
+ parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
+ if (isTuple) {
+ this.expectPlugin("recordAndTuple");
+ }
+
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression");
+ }
+
+ parseArrowExpression(node, params, isAsync, trailingCommaLoc) {
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
+ let flags = functionFlags(isAsync, false);
+
+ if (!this.match(5) && this.prodParam.hasIn) {
+ flags |= PARAM_IN;
+ }
+
+ this.prodParam.enter(flags);
+ this.initFunction(node, isAsync);
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+
+ if (params) {
+ this.state.maybeInArrowParameters = true;
+ this.setArrowFunctionParameters(node, params, trailingCommaLoc);
+ }
+
+ this.state.maybeInArrowParameters = false;
+ this.parseFunctionBody(node, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return this.finishNode(node, "ArrowFunctionExpression");
+ }
+
+ setArrowFunctionParameters(node, params, trailingCommaLoc) {
+ this.toAssignableList(params, trailingCommaLoc, false);
+ node.params = params;
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ this.parseFunctionBody(node, false, isMethod);
+ return this.finishNode(node, type);
+ }
+
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ const isExpression = allowExpression && !this.match(5);
+ this.expressionScope.enter(newExpressionScope());
+
+ if (isExpression) {
+ node.body = this.parseMaybeAssign();
+ this.checkParams(node, false, allowExpression, false);
+ } else {
+ const oldStrict = this.state.strict;
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);
+ node.body = this.parseBlock(true, false, hasStrictModeDirective => {
+ const nonSimple = !this.isSimpleParamList(node.params);
+
+ if (hasStrictModeDirective && nonSimple) {
+ this.raise(Errors.IllegalLanguageModeDirective, {
+ at: (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node
+ });
+ }
+
+ const strictModeChanged = !oldStrict && this.state.strict;
+ this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
+
+ if (this.state.strict && node.id) {
+ this.checkIdentifier(node.id, BIND_OUTSIDE, strictModeChanged);
+ }
+ });
+ this.prodParam.exit();
+ this.state.labels = oldLabels;
+ }
+
+ this.expressionScope.exit();
+ }
+
+ isSimpleParameter(node) {
+ return node.type === "Identifier";
+ }
+
+ isSimpleParamList(params) {
+ for (let i = 0, len = params.length; i < len; i++) {
+ if (!this.isSimpleParameter(params[i])) return false;
+ }
+
+ return true;
+ }
+
+ checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
+ const checkClashes = !allowDuplicates && new Set();
+ const formalParameters = {
+ type: "FormalParameters"
+ };
+
+ for (const param of node.params) {
+ this.checkLVal(param, {
+ in: formalParameters,
+ binding: BIND_VAR,
+ checkClashes,
+ strictModeChanged
+ });
+ }
+ }
+
+ parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12);
+
+ if (this.match(close)) {
+ if (nodeForExtra) {
+ this.addTrailingCommaExtraToNode(nodeForExtra);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));
+ }
+
+ return elts;
+ }
+
+ parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) {
+ let elt;
+
+ if (this.match(12)) {
+ if (!allowEmpty) {
+ this.raise(Errors.UnexpectedToken, {
+ at: this.state.curPosition(),
+ unexpected: ","
+ });
+ }
+
+ elt = null;
+ } else if (this.match(21)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartPos, spreadNodeStartLoc);
+ } else if (this.match(17)) {
+ this.expectPlugin("partialApplication");
+
+ if (!allowPlaceholder) {
+ this.raise(Errors.UnexpectedArgumentPlaceholder, {
+ at: this.state.startLoc
+ });
+ }
+
+ const node = this.startNode();
+ this.next();
+ elt = this.finishNode(node, "ArgumentPlaceholder");
+ } else {
+ elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem);
+ }
+
+ return elt;
+ }
+
+ parseIdentifier(liberal) {
+ const node = this.startNode();
+ const name = this.parseIdentifierName(node.start, liberal);
+ return this.createIdentifier(node, name);
+ }
+
+ createIdentifier(node, name) {
+ node.name = name;
+ node.loc.identifierName = name;
+ return this.finishNode(node, "Identifier");
+ }
+
+ parseIdentifierName(pos, liberal) {
+ let name;
+ const {
+ startLoc,
+ type
+ } = this.state;
+
+ if (tokenIsKeywordOrIdentifier(type)) {
+ name = this.state.value;
+ } else {
+ throw this.unexpected();
+ }
+
+ const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type);
+
+ if (liberal) {
+ if (tokenIsKeyword) {
+ this.replaceToken(128);
+ }
+ } else {
+ this.checkReservedWord(name, startLoc, tokenIsKeyword, false);
+ }
+
+ this.next();
+ return name;
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (word.length > 10) {
+ return;
+ }
+
+ if (!canBeReservedWord(word)) {
+ return;
+ }
+
+ if (word === "yield") {
+ if (this.prodParam.hasYield) {
+ this.raise(Errors.YieldBindingIdentifier, {
+ at: startLoc
+ });
+ return;
+ }
+ } else if (word === "await") {
+ if (this.prodParam.hasAwait) {
+ this.raise(Errors.AwaitBindingIdentifier, {
+ at: startLoc
+ });
+ return;
+ }
+
+ if (this.scope.inStaticBlock) {
+ this.raise(Errors.AwaitBindingIdentifierInStaticBlock, {
+ at: startLoc
+ });
+ return;
+ }
+
+ this.expressionScope.recordAsyncArrowParametersError({
+ at: startLoc
+ });
+ } else if (word === "arguments") {
+ if (this.scope.inClassAndNotInNonArrowFunction) {
+ this.raise(Errors.ArgumentsInClass, {
+ at: startLoc
+ });
+ return;
+ }
+ }
+
+ if (checkKeywords && isKeyword(word)) {
+ this.raise(Errors.UnexpectedKeyword, {
+ at: startLoc,
+ keyword: word
+ });
+ return;
+ }
+
+ const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;
+
+ if (reservedTest(word, this.inModule)) {
+ this.raise(Errors.UnexpectedReservedWord, {
+ at: startLoc,
+ reservedWord: word
+ });
+ }
+ }
+
+ isAwaitAllowed() {
+ if (this.prodParam.hasAwait) return true;
+
+ if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) {
+ return true;
+ }
+
+ return false;
+ }
+
+ parseAwait(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, {
+ at: node
+ });
+
+ if (this.eat(55)) {
+ this.raise(Errors.ObsoleteAwaitStar, {
+ at: node
+ });
+ }
+
+ if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
+ if (this.isAmbiguousAwait()) {
+ this.ambiguousScriptDifferentAst = true;
+ } else {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ if (!this.state.soloAwait) {
+ node.argument = this.parseMaybeUnary(null, true);
+ }
+
+ return this.finishNode(node, "AwaitExpression");
+ }
+
+ isAmbiguousAwait() {
+ if (this.hasPrecedingLineBreak()) return true;
+ const {
+ type
+ } = this.state;
+ return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 133 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54;
+ }
+
+ parseYield() {
+ const node = this.startNode();
+ this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, {
+ at: node
+ });
+ this.next();
+ let delegating = false;
+ let argument = null;
+
+ if (!this.hasPrecedingLineBreak()) {
+ delegating = this.eat(55);
+
+ switch (this.state.type) {
+ case 13:
+ case 135:
+ case 8:
+ case 11:
+ case 3:
+ case 9:
+ case 14:
+ case 12:
+ if (!delegating) break;
+
+ default:
+ argument = this.parseMaybeAssign();
+ }
+ }
+
+ node.delegate = delegating;
+ node.argument = argument;
+ return this.finishNode(node, "YieldExpression");
+ }
+
+ checkPipelineAtInfixOperator(left, leftStartLoc) {
+ if (this.hasPlugin(["pipelineOperator", {
+ proposal: "smart"
+ }])) {
+ if (left.type === "SequenceExpression") {
+ this.raise(Errors.PipelineHeadSequenceExpression, {
+ at: leftStartLoc
+ });
+ }
+ }
+ }
+
+ parseSmartPipelineBodyInStyle(childExpr, startPos, startLoc) {
+ if (this.isSimpleReference(childExpr)) {
+ const bodyNode = this.startNodeAt(startPos, startLoc);
+ bodyNode.callee = childExpr;
+ return this.finishNode(bodyNode, "PipelineBareFunction");
+ } else {
+ const bodyNode = this.startNodeAt(startPos, startLoc);
+ this.checkSmartPipeTopicBodyEarlyErrors(startLoc);
+ bodyNode.expression = childExpr;
+ return this.finishNode(bodyNode, "PipelineTopicExpression");
+ }
+ }
+
+ isSimpleReference(expression) {
+ switch (expression.type) {
+ case "MemberExpression":
+ return !expression.computed && this.isSimpleReference(expression.object);
+
+ case "Identifier":
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ checkSmartPipeTopicBodyEarlyErrors(startLoc) {
+ if (this.match(19)) {
+ throw this.raise(Errors.PipelineBodyNoArrow, {
+ at: this.state.startLoc
+ });
+ }
+
+ if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(Errors.PipelineTopicUnused, {
+ at: startLoc
+ });
+ }
+ }
+
+ withTopicBindingContext(callback) {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 1,
+ maxTopicIndex: null
+ };
+
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ }
+
+ withSmartMixTopicForbiddingContext(callback) {
+ if (this.hasPlugin(["pipelineOperator", {
+ proposal: "smart"
+ }])) {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ } else {
+ return callback();
+ }
+ }
+
+ withSoloAwaitPermittingContext(callback) {
+ const outerContextSoloAwaitState = this.state.soloAwait;
+ this.state.soloAwait = true;
+
+ try {
+ return callback();
+ } finally {
+ this.state.soloAwait = outerContextSoloAwaitState;
+ }
+ }
+
+ allowInAnd(callback) {
+ const flags = this.prodParam.currentFlags();
+ const prodParamToSet = PARAM_IN & ~flags;
+
+ if (prodParamToSet) {
+ this.prodParam.enter(flags | PARAM_IN);
+
+ try {
+ return callback();
+ } finally {
+ this.prodParam.exit();
+ }
+ }
+
+ return callback();
+ }
+
+ disallowInAnd(callback) {
+ const flags = this.prodParam.currentFlags();
+ const prodParamToClear = PARAM_IN & flags;
+
+ if (prodParamToClear) {
+ this.prodParam.enter(flags & ~PARAM_IN);
+
+ try {
+ return callback();
+ } finally {
+ this.prodParam.exit();
+ }
+ }
+
+ return callback();
+ }
+
+ registerTopicReference() {
+ this.state.topicContext.maxTopicIndex = 0;
+ }
+
+ topicReferenceIsAllowedInCurrentContext() {
+ return this.state.topicContext.maxNumOfResolvableTopics >= 1;
+ }
+
+ topicReferenceWasUsedInCurrentContext() {
+ return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;
+ }
+
+ parseFSharpPipelineBody(prec) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.state.potentialArrowAt = this.state.start;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = true;
+ const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startPos, startLoc, prec);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return ret;
+ }
+
+ parseModuleExpression() {
+ this.expectPlugin("moduleBlocks");
+ const node = this.startNode();
+ this.next();
+ this.eat(5);
+ const revertScopes = this.initializeScopes(true);
+ this.enterInitialScopes();
+ const program = this.startNode();
+
+ try {
+ node.body = this.parseProgram(program, 8, "module");
+ } finally {
+ revertScopes();
+ }
+
+ this.eat(8);
+ return this.finishNode(node, "ModuleExpression");
+ }
+
+ parsePropertyNamePrefixOperator(prop) {}
+
+}
+
+const loopLabel = {
+ kind: "loop"
+},
+ switchLabel = {
+ kind: "switch"
+};
+const FUNC_NO_FLAGS = 0b000,
+ FUNC_STATEMENT = 0b001,
+ FUNC_HANGING_STATEMENT = 0b010,
+ FUNC_NULLABLE_ID = 0b100;
+const loneSurrogate = /[\uD800-\uDFFF]/u;
+const keywordRelationalOperator = /in(?:stanceof)?/y;
+
+function babel7CompatTokens(tokens, input) {
+ for (let i = 0; i < tokens.length; i++) {
+ const token = tokens[i];
+ const {
+ type
+ } = token;
+
+ if (typeof type === "number") {
+ {
+ if (type === 134) {
+ const {
+ loc,
+ start,
+ value,
+ end
+ } = token;
+ const hashEndPos = start + 1;
+ const hashEndLoc = createPositionWithColumnOffset(loc.start, 1);
+ tokens.splice(i, 1, new Token({
+ type: getExportedToken(27),
+ value: "#",
+ start: start,
+ end: hashEndPos,
+ startLoc: loc.start,
+ endLoc: hashEndLoc
+ }), new Token({
+ type: getExportedToken(128),
+ value: value,
+ start: hashEndPos,
+ end: end,
+ startLoc: hashEndLoc,
+ endLoc: loc.end
+ }));
+ i++;
+ continue;
+ }
+
+ if (tokenIsTemplate(type)) {
+ const {
+ loc,
+ start,
+ value,
+ end
+ } = token;
+ const backquoteEnd = start + 1;
+ const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);
+ let startToken;
+
+ if (input.charCodeAt(start) === 96) {
+ startToken = new Token({
+ type: getExportedToken(22),
+ value: "`",
+ start: start,
+ end: backquoteEnd,
+ startLoc: loc.start,
+ endLoc: backquoteEndLoc
+ });
+ } else {
+ startToken = new Token({
+ type: getExportedToken(8),
+ value: "}",
+ start: start,
+ end: backquoteEnd,
+ startLoc: loc.start,
+ endLoc: backquoteEndLoc
+ });
+ }
+
+ let templateValue, templateElementEnd, templateElementEndLoc, endToken;
+
+ if (type === 24) {
+ templateElementEnd = end - 1;
+ templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1);
+ templateValue = value === null ? null : value.slice(1, -1);
+ endToken = new Token({
+ type: getExportedToken(22),
+ value: "`",
+ start: templateElementEnd,
+ end: end,
+ startLoc: templateElementEndLoc,
+ endLoc: loc.end
+ });
+ } else {
+ templateElementEnd = end - 2;
+ templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2);
+ templateValue = value === null ? null : value.slice(1, -2);
+ endToken = new Token({
+ type: getExportedToken(23),
+ value: "${",
+ start: templateElementEnd,
+ end: end,
+ startLoc: templateElementEndLoc,
+ endLoc: loc.end
+ });
+ }
+
+ tokens.splice(i, 1, startToken, new Token({
+ type: getExportedToken(20),
+ value: templateValue,
+ start: backquoteEnd,
+ end: templateElementEnd,
+ startLoc: backquoteEndLoc,
+ endLoc: templateElementEndLoc
+ }), endToken);
+ i += 2;
+ continue;
+ }
+ }
+ token.type = getExportedToken(type);
+ }
+ }
+
+ return tokens;
+}
+
+class StatementParser extends ExpressionParser {
+ parseTopLevel(file, program) {
+ file.program = this.parseProgram(program);
+ file.comments = this.state.comments;
+
+ if (this.options.tokens) {
+ file.tokens = babel7CompatTokens(this.tokens, this.input);
+ }
+
+ return this.finishNode(file, "File");
+ }
+
+ parseProgram(program, end = 135, sourceType = this.options.sourceType) {
+ program.sourceType = sourceType;
+ program.interpreter = this.parseInterpreterDirective();
+ this.parseBlockBody(program, true, true, end);
+
+ if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {
+ for (const [localName, at] of Array.from(this.scope.undefinedExports)) {
+ this.raise(Errors.ModuleExportUndefined, {
+ at,
+ localName
+ });
+ }
+ }
+
+ return this.finishNode(program, "Program");
+ }
+
+ stmtToDirective(stmt) {
+ const directive = stmt;
+ directive.type = "Directive";
+ directive.value = directive.expression;
+ delete directive.expression;
+ const directiveLiteral = directive.value;
+ const expressionValue = directiveLiteral.value;
+ const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end);
+ const val = directiveLiteral.value = raw.slice(1, -1);
+ this.addExtra(directiveLiteral, "raw", raw);
+ this.addExtra(directiveLiteral, "rawValue", val);
+ this.addExtra(directiveLiteral, "expressionValue", expressionValue);
+ directiveLiteral.type = "DirectiveLiteral";
+ return directive;
+ }
+
+ parseInterpreterDirective() {
+ if (!this.match(28)) {
+ return null;
+ }
+
+ const node = this.startNode();
+ node.value = this.state.value;
+ this.next();
+ return this.finishNode(node, "InterpreterDirective");
+ }
+
+ isLet(context) {
+ if (!this.isContextual(99)) {
+ return false;
+ }
+
+ return this.isLetKeyword(context);
+ }
+
+ isLetKeyword(context) {
+ const next = this.nextTokenStart();
+ const nextCh = this.codePointAtPos(next);
+
+ if (nextCh === 92 || nextCh === 91) {
+ return true;
+ }
+
+ if (context) return false;
+ if (nextCh === 123) return true;
+
+ if (isIdentifierStart(nextCh)) {
+ keywordRelationalOperator.lastIndex = next;
+
+ if (keywordRelationalOperator.test(this.input)) {
+ const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex);
+
+ if (!isIdentifierChar(endCh) && endCh !== 92) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ parseStatement(context, topLevel) {
+ if (this.match(26)) {
+ this.parseDecorators(true);
+ }
+
+ return this.parseStatementContent(context, topLevel);
+ }
+
+ parseStatementContent(context, topLevel) {
+ let starttype = this.state.type;
+ const node = this.startNode();
+ let kind;
+
+ if (this.isLet(context)) {
+ starttype = 74;
+ kind = "let";
+ }
+
+ switch (starttype) {
+ case 60:
+ return this.parseBreakContinueStatement(node, true);
+
+ case 63:
+ return this.parseBreakContinueStatement(node, false);
+
+ case 64:
+ return this.parseDebuggerStatement(node);
+
+ case 90:
+ return this.parseDoStatement(node);
+
+ case 91:
+ return this.parseForStatement(node);
+
+ case 68:
+ if (this.lookaheadCharCode() === 46) break;
+
+ if (context) {
+ if (this.state.strict) {
+ this.raise(Errors.StrictFunction, {
+ at: this.state.startLoc
+ });
+ } else if (context !== "if" && context !== "label") {
+ this.raise(Errors.SloppyFunction, {
+ at: this.state.startLoc
+ });
+ }
+ }
+
+ return this.parseFunctionStatement(node, false, !context);
+
+ case 80:
+ if (context) this.unexpected();
+ return this.parseClass(node, true);
+
+ case 69:
+ return this.parseIfStatement(node);
+
+ case 70:
+ return this.parseReturnStatement(node);
+
+ case 71:
+ return this.parseSwitchStatement(node);
+
+ case 72:
+ return this.parseThrowStatement(node);
+
+ case 73:
+ return this.parseTryStatement(node);
+
+ case 75:
+ case 74:
+ kind = kind || this.state.value;
+
+ if (context && kind !== "var") {
+ this.raise(Errors.UnexpectedLexicalDeclaration, {
+ at: this.state.startLoc
+ });
+ }
+
+ return this.parseVarStatement(node, kind);
+
+ case 92:
+ return this.parseWhileStatement(node);
+
+ case 76:
+ return this.parseWithStatement(node);
+
+ case 5:
+ return this.parseBlock();
+
+ case 13:
+ return this.parseEmptyStatement(node);
+
+ case 83:
+ {
+ const nextTokenCharCode = this.lookaheadCharCode();
+
+ if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
+ break;
+ }
+ }
+
+ case 82:
+ {
+ if (!this.options.allowImportExportEverywhere && !topLevel) {
+ this.raise(Errors.UnexpectedImportExport, {
+ at: this.state.startLoc
+ });
+ }
+
+ this.next();
+ let result;
+
+ if (starttype === 83) {
+ result = this.parseImport(node);
+
+ if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
+ this.sawUnambiguousESM = true;
+ }
+ } else {
+ result = this.parseExport(node);
+
+ if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ this.assertModuleNodeAllowed(result);
+ return result;
+ }
+
+ default:
+ {
+ if (this.isAsyncFunction()) {
+ if (context) {
+ this.raise(Errors.AsyncFunctionInSingleStatementContext, {
+ at: this.state.startLoc
+ });
+ }
+
+ this.next();
+ return this.parseFunctionStatement(node, true, !context);
+ }
+ }
+ }
+
+ const maybeName = this.state.value;
+ const expr = this.parseExpression();
+
+ if (tokenIsIdentifier(starttype) && expr.type === "Identifier" && this.eat(14)) {
+ return this.parseLabeledStatement(node, maybeName, expr, context);
+ } else {
+ return this.parseExpressionStatement(node, expr);
+ }
+ }
+
+ assertModuleNodeAllowed(node) {
+ if (!this.options.allowImportExportEverywhere && !this.inModule) {
+ this.raise(Errors.ImportOutsideModule, {
+ at: node
+ });
+ }
+ }
+
+ takeDecorators(node) {
+ const decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ if (decorators.length) {
+ node.decorators = decorators;
+ this.resetStartLocationFromNode(node, decorators[0]);
+ this.state.decoratorStack[this.state.decoratorStack.length - 1] = [];
+ }
+ }
+
+ canHaveLeadingDecorator() {
+ return this.match(80);
+ }
+
+ parseDecorators(allowExport) {
+ const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ while (this.match(26)) {
+ const decorator = this.parseDecorator();
+ currentContextDecorators.push(decorator);
+ }
+
+ if (this.match(82)) {
+ if (!allowExport) {
+ this.unexpected();
+ }
+
+ if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.raise(Errors.DecoratorExportClass, {
+ at: this.state.startLoc
+ });
+ }
+ } else if (!this.canHaveLeadingDecorator()) {
+ throw this.raise(Errors.UnexpectedLeadingDecorator, {
+ at: this.state.startLoc
+ });
+ }
+ }
+
+ parseDecorator() {
+ this.expectOnePlugin(["decorators", "decorators-legacy"]);
+ const node = this.startNode();
+ this.next();
+
+ if (this.hasPlugin("decorators")) {
+ this.state.decoratorStack.push([]);
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr;
+
+ if (this.match(10)) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.next();
+ expr = this.parseExpression();
+ this.expect(11);
+ expr = this.wrapParenthesis(startPos, startLoc, expr);
+ } else {
+ expr = this.parseIdentifier(false);
+
+ while (this.eat(16)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = expr;
+ node.property = this.parseIdentifier(true);
+ node.computed = false;
+ expr = this.finishNode(node, "MemberExpression");
+ }
+ }
+
+ node.expression = this.parseMaybeDecoratorArguments(expr);
+ this.state.decoratorStack.pop();
+ } else {
+ node.expression = this.parseExprSubscripts();
+ }
+
+ return this.finishNode(node, "Decorator");
+ }
+
+ parseMaybeDecoratorArguments(expr) {
+ if (this.eat(10)) {
+ const node = this.startNodeAtNode(expr);
+ node.callee = expr;
+ node.arguments = this.parseCallExpressionArguments(11, false);
+ this.toReferencedList(node.arguments);
+ return this.finishNode(node, "CallExpression");
+ }
+
+ return expr;
+ }
+
+ parseBreakContinueStatement(node, isBreak) {
+ this.next();
+
+ if (this.isLineTerminator()) {
+ node.label = null;
+ } else {
+ node.label = this.parseIdentifier();
+ this.semicolon();
+ }
+
+ this.verifyBreakContinue(node, isBreak);
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
+ }
+
+ verifyBreakContinue(node, isBreak) {
+ let i;
+
+ for (i = 0; i < this.state.labels.length; ++i) {
+ const lab = this.state.labels[i];
+
+ if (node.label == null || lab.name === node.label.name) {
+ if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
+ if (node.label && isBreak) break;
+ }
+ }
+
+ if (i === this.state.labels.length) {
+ const type = isBreak ? "BreakStatement" : "ContinueStatement";
+ this.raise(Errors.IllegalBreakContinue, {
+ at: node,
+ type
+ });
+ }
+ }
+
+ parseDebuggerStatement(node) {
+ this.next();
+ this.semicolon();
+ return this.finishNode(node, "DebuggerStatement");
+ }
+
+ parseHeaderExpression() {
+ this.expect(10);
+ const val = this.parseExpression();
+ this.expect(11);
+ return val;
+ }
+
+ parseDoStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("do"));
+ this.state.labels.pop();
+ this.expect(92);
+ node.test = this.parseHeaderExpression();
+ this.eat(13);
+ return this.finishNode(node, "DoWhileStatement");
+ }
+
+ parseForStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel);
+ let awaitAt = null;
+
+ if (this.isAwaitAllowed() && this.eatContextual(96)) {
+ awaitAt = this.state.lastTokStartLoc;
+ }
+
+ this.scope.enter(SCOPE_OTHER);
+ this.expect(10);
+
+ if (this.match(13)) {
+ if (awaitAt !== null) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, null);
+ }
+
+ const startsWithLet = this.isContextual(99);
+ const isLet = startsWithLet && this.isLetKeyword();
+
+ if (this.match(74) || this.match(75) || isLet) {
+ const initNode = this.startNode();
+ const kind = isLet ? "let" : this.state.value;
+ this.next();
+ this.parseVar(initNode, true, kind);
+ const init = this.finishNode(initNode, "VariableDeclaration");
+
+ if ((this.match(58) || this.isContextual(101)) && init.declarations.length === 1) {
+ return this.parseForIn(node, init, awaitAt);
+ }
+
+ if (awaitAt !== null) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, init);
+ }
+
+ const startsWithAsync = this.isContextual(95);
+ const refExpressionErrors = new ExpressionErrors();
+ const init = this.parseExpression(true, refExpressionErrors);
+ const isForOf = this.isContextual(101);
+
+ if (isForOf) {
+ if (startsWithLet) {
+ this.raise(Errors.ForOfLet, {
+ at: init
+ });
+ }
+
+ if (awaitAt === null && startsWithAsync && init.type === "Identifier") {
+ this.raise(Errors.ForOfAsync, {
+ at: init
+ });
+ }
+ }
+
+ if (isForOf || this.match(58)) {
+ this.checkDestructuringPrivate(refExpressionErrors);
+ this.toAssignable(init, true);
+ const type = isForOf ? "ForOfStatement" : "ForInStatement";
+ this.checkLVal(init, {
+ in: {
+ type
+ }
+ });
+ return this.parseForIn(node, init, awaitAt);
+ } else {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ if (awaitAt !== null) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, init);
+ }
+
+ parseFunctionStatement(node, isAsync, declarationPosition) {
+ this.next();
+ return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync);
+ }
+
+ parseIfStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ node.consequent = this.parseStatement("if");
+ node.alternate = this.eat(66) ? this.parseStatement("if") : null;
+ return this.finishNode(node, "IfStatement");
+ }
+
+ parseReturnStatement(node) {
+ if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {
+ this.raise(Errors.IllegalReturn, {
+ at: this.state.startLoc
+ });
+ }
+
+ this.next();
+
+ if (this.isLineTerminator()) {
+ node.argument = null;
+ } else {
+ node.argument = this.parseExpression();
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "ReturnStatement");
+ }
+
+ parseSwitchStatement(node) {
+ this.next();
+ node.discriminant = this.parseHeaderExpression();
+ const cases = node.cases = [];
+ this.expect(5);
+ this.state.labels.push(switchLabel);
+ this.scope.enter(SCOPE_OTHER);
+ let cur;
+
+ for (let sawDefault; !this.match(8);) {
+ if (this.match(61) || this.match(65)) {
+ const isCase = this.match(61);
+ if (cur) this.finishNode(cur, "SwitchCase");
+ cases.push(cur = this.startNode());
+ cur.consequent = [];
+ this.next();
+
+ if (isCase) {
+ cur.test = this.parseExpression();
+ } else {
+ if (sawDefault) {
+ this.raise(Errors.MultipleDefaultsInSwitch, {
+ at: this.state.lastTokStartLoc
+ });
+ }
+
+ sawDefault = true;
+ cur.test = null;
+ }
+
+ this.expect(14);
+ } else {
+ if (cur) {
+ cur.consequent.push(this.parseStatement(null));
+ } else {
+ this.unexpected();
+ }
+ }
+ }
+
+ this.scope.exit();
+ if (cur) this.finishNode(cur, "SwitchCase");
+ this.next();
+ this.state.labels.pop();
+ return this.finishNode(node, "SwitchStatement");
+ }
+
+ parseThrowStatement(node) {
+ this.next();
+
+ if (this.hasPrecedingLineBreak()) {
+ this.raise(Errors.NewlineAfterThrow, {
+ at: this.state.lastTokEndLoc
+ });
+ }
+
+ node.argument = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(node, "ThrowStatement");
+ }
+
+ parseCatchClauseParam() {
+ const param = this.parseBindingAtom();
+ const simple = param.type === "Identifier";
+ this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0);
+ this.checkLVal(param, {
+ in: {
+ type: "CatchClause"
+ },
+ binding: BIND_LEXICAL,
+ allowingSloppyLetBinding: true
+ });
+ return param;
+ }
+
+ parseTryStatement(node) {
+ this.next();
+ node.block = this.parseBlock();
+ node.handler = null;
+
+ if (this.match(62)) {
+ const clause = this.startNode();
+ this.next();
+
+ if (this.match(10)) {
+ this.expect(10);
+ clause.param = this.parseCatchClauseParam();
+ this.expect(11);
+ } else {
+ clause.param = null;
+ this.scope.enter(SCOPE_OTHER);
+ }
+
+ clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false));
+ this.scope.exit();
+ node.handler = this.finishNode(clause, "CatchClause");
+ }
+
+ node.finalizer = this.eat(67) ? this.parseBlock() : null;
+
+ if (!node.handler && !node.finalizer) {
+ this.raise(Errors.NoCatchOrFinally, {
+ at: node
+ });
+ }
+
+ return this.finishNode(node, "TryStatement");
+ }
+
+ parseVarStatement(node, kind, allowMissingInitializer = false) {
+ this.next();
+ this.parseVar(node, false, kind, allowMissingInitializer);
+ this.semicolon();
+ return this.finishNode(node, "VariableDeclaration");
+ }
+
+ parseWhileStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ this.state.labels.push(loopLabel);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("while"));
+ this.state.labels.pop();
+ return this.finishNode(node, "WhileStatement");
+ }
+
+ parseWithStatement(node) {
+ if (this.state.strict) {
+ this.raise(Errors.StrictWith, {
+ at: this.state.startLoc
+ });
+ }
+
+ this.next();
+ node.object = this.parseHeaderExpression();
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("with"));
+ return this.finishNode(node, "WithStatement");
+ }
+
+ parseEmptyStatement(node) {
+ this.next();
+ return this.finishNode(node, "EmptyStatement");
+ }
+
+ parseLabeledStatement(node, maybeName, expr, context) {
+ for (const label of this.state.labels) {
+ if (label.name === maybeName) {
+ this.raise(Errors.LabelRedeclaration, {
+ at: expr,
+ labelName: maybeName
+ });
+ }
+ }
+
+ const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(71) ? "switch" : null;
+
+ for (let i = this.state.labels.length - 1; i >= 0; i--) {
+ const label = this.state.labels[i];
+
+ if (label.statementStart === node.start) {
+ label.statementStart = this.state.start;
+ label.kind = kind;
+ } else {
+ break;
+ }
+ }
+
+ this.state.labels.push({
+ name: maybeName,
+ kind: kind,
+ statementStart: this.state.start
+ });
+ node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
+ this.state.labels.pop();
+ node.label = expr;
+ return this.finishNode(node, "LabeledStatement");
+ }
+
+ parseExpressionStatement(node, expr) {
+ node.expression = expr;
+ this.semicolon();
+ return this.finishNode(node, "ExpressionStatement");
+ }
+
+ parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {
+ const node = this.startNode();
+
+ if (allowDirectives) {
+ this.state.strictErrors.clear();
+ }
+
+ this.expect(5);
+
+ if (createNewLexicalScope) {
+ this.scope.enter(SCOPE_OTHER);
+ }
+
+ this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse);
+
+ if (createNewLexicalScope) {
+ this.scope.exit();
+ }
+
+ return this.finishNode(node, "BlockStatement");
+ }
+
+ isValidDirective(stmt) {
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
+ }
+
+ parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
+ const body = node.body = [];
+ const directives = node.directives = [];
+ this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse);
+ }
+
+ parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {
+ const oldStrict = this.state.strict;
+ let hasStrictModeDirective = false;
+ let parsedNonDirective = false;
+
+ while (!this.match(end)) {
+ const stmt = this.parseStatement(null, topLevel);
+
+ if (directives && !parsedNonDirective) {
+ if (this.isValidDirective(stmt)) {
+ const directive = this.stmtToDirective(stmt);
+ directives.push(directive);
+
+ if (!hasStrictModeDirective && directive.value.value === "use strict") {
+ hasStrictModeDirective = true;
+ this.setStrict(true);
+ }
+
+ continue;
+ }
+
+ parsedNonDirective = true;
+ this.state.strictErrors.clear();
+ }
+
+ body.push(stmt);
+ }
+
+ if (afterBlockParse) {
+ afterBlockParse.call(this, hasStrictModeDirective);
+ }
+
+ if (!oldStrict) {
+ this.setStrict(false);
+ }
+
+ this.next();
+ }
+
+ parseFor(node, init) {
+ node.init = init;
+ this.semicolon(false);
+ node.test = this.match(13) ? null : this.parseExpression();
+ this.semicolon(false);
+ node.update = this.match(11) ? null : this.parseExpression();
+ this.expect(11);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("for"));
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, "ForStatement");
+ }
+
+ parseForIn(node, init, awaitAt) {
+ const isForIn = this.match(58);
+ this.next();
+
+ if (isForIn) {
+ if (awaitAt !== null) this.unexpected(awaitAt);
+ } else {
+ node.await = awaitAt !== null;
+ }
+
+ if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
+ this.raise(Errors.ForInOfLoopInitializer, {
+ at: init,
+ type: isForIn ? "ForInStatement" : "ForOfStatement"
+ });
+ }
+
+ if (init.type === "AssignmentPattern") {
+ this.raise(Errors.InvalidLhs, {
+ at: init,
+ ancestor: {
+ type: "ForStatement"
+ }
+ });
+ }
+
+ node.left = init;
+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
+ this.expect(11);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("for"));
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
+ }
+
+ parseVar(node, isFor, kind, allowMissingInitializer = false) {
+ const declarations = node.declarations = [];
+ node.kind = kind;
+
+ for (;;) {
+ const decl = this.startNode();
+ this.parseVarId(decl, kind);
+ decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();
+
+ if (decl.init === null && !allowMissingInitializer) {
+ if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(101)))) {
+ this.raise(Errors.DeclarationMissingInitializer, {
+ at: this.state.lastTokEndLoc,
+ kind: "destructuring"
+ });
+ } else if (kind === "const" && !(this.match(58) || this.isContextual(101))) {
+ this.raise(Errors.DeclarationMissingInitializer, {
+ at: this.state.lastTokEndLoc,
+ kind: "const"
+ });
+ }
+ }
+
+ declarations.push(this.finishNode(decl, "VariableDeclarator"));
+ if (!this.eat(12)) break;
+ }
+
+ return node;
+ }
+
+ parseVarId(decl, kind) {
+ decl.id = this.parseBindingAtom();
+ this.checkLVal(decl.id, {
+ in: {
+ type: "VariableDeclarator"
+ },
+ binding: kind === "var" ? BIND_VAR : BIND_LEXICAL
+ });
+ }
+
+ parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) {
+ const isStatement = statement & FUNC_STATEMENT;
+ const isHangingStatement = statement & FUNC_HANGING_STATEMENT;
+ const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID);
+ this.initFunction(node, isAsync);
+
+ if (this.match(55) && isHangingStatement) {
+ this.raise(Errors.GeneratorInSingleStatementContext, {
+ at: this.state.startLoc
+ });
+ }
+
+ node.generator = this.eat(55);
+
+ if (isStatement) {
+ node.id = this.parseFunctionId(requireId);
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ this.state.maybeInArrowParameters = false;
+ this.scope.enter(SCOPE_FUNCTION);
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+
+ if (!isStatement) {
+ node.id = this.parseFunctionId();
+ }
+
+ this.parseFunctionParams(node, false);
+ this.withSmartMixTopicForbiddingContext(() => {
+ this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
+ });
+ this.prodParam.exit();
+ this.scope.exit();
+
+ if (isStatement && !isHangingStatement) {
+ this.registerFunctionStatementId(node);
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return node;
+ }
+
+ parseFunctionId(requireId) {
+ return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null;
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ this.expect(10);
+ this.expressionScope.enter(newParameterDeclarationScope());
+ node.params = this.parseBindingList(11, 41, false, allowModifiers);
+ this.expressionScope.exit();
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.id) return;
+ this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.loc.start);
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ this.next();
+ this.takeDecorators(node);
+ const oldStrict = this.state.strict;
+ this.state.strict = true;
+ this.parseClassId(node, isStatement, optionalId);
+ this.parseClassSuper(node);
+ node.body = this.parseClassBody(!!node.superClass, oldStrict);
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
+ }
+
+ isClassProperty() {
+ return this.match(29) || this.match(13) || this.match(8);
+ }
+
+ isClassMethod() {
+ return this.match(10);
+ }
+
+ isNonstaticConstructor(method) {
+ return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor");
+ }
+
+ parseClassBody(hadSuperClass, oldStrict) {
+ this.classScope.enter();
+ const state = {
+ hadConstructor: false,
+ hadSuperClass
+ };
+ let decorators = [];
+ const classBody = this.startNode();
+ classBody.body = [];
+ this.expect(5);
+ this.withSmartMixTopicForbiddingContext(() => {
+ while (!this.match(8)) {
+ if (this.eat(13)) {
+ if (decorators.length > 0) {
+ throw this.raise(Errors.DecoratorSemicolon, {
+ at: this.state.lastTokEndLoc
+ });
+ }
+
+ continue;
+ }
+
+ if (this.match(26)) {
+ decorators.push(this.parseDecorator());
+ continue;
+ }
+
+ const member = this.startNode();
+
+ if (decorators.length) {
+ member.decorators = decorators;
+ this.resetStartLocationFromNode(member, decorators[0]);
+ decorators = [];
+ }
+
+ this.parseClassMember(classBody, member, state);
+
+ if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
+ this.raise(Errors.DecoratorConstructor, {
+ at: member
+ });
+ }
+ }
+ });
+ this.state.strict = oldStrict;
+ this.next();
+
+ if (decorators.length) {
+ throw this.raise(Errors.TrailingDecorator, {
+ at: this.state.startLoc
+ });
+ }
+
+ this.classScope.exit();
+ return this.finishNode(classBody, "ClassBody");
+ }
+
+ parseClassMemberFromModifier(classBody, member) {
+ const key = this.parseIdentifier(true);
+
+ if (this.isClassMethod()) {
+ const method = member;
+ method.kind = "method";
+ method.computed = false;
+ method.key = key;
+ method.static = false;
+ this.pushClassMethod(classBody, method, false, false, false, false);
+ return true;
+ } else if (this.isClassProperty()) {
+ const prop = member;
+ prop.computed = false;
+ prop.key = key;
+ prop.static = false;
+ classBody.body.push(this.parseClassProperty(prop));
+ return true;
+ }
+
+ this.resetPreviousNodeTrailingComments(key);
+ return false;
+ }
+
+ parseClassMember(classBody, member, state) {
+ const isStatic = this.isContextual(104);
+
+ if (isStatic) {
+ if (this.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+
+ if (this.eat(5)) {
+ this.parseClassStaticBlock(classBody, member);
+ return;
+ }
+ }
+
+ this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
+ const publicMethod = member;
+ const privateMethod = member;
+ const publicProp = member;
+ const privateProp = member;
+ const accessorProp = member;
+ const method = publicMethod;
+ const publicMember = publicMethod;
+ member.static = isStatic;
+ this.parsePropertyNamePrefixOperator(member);
+
+ if (this.eat(55)) {
+ method.kind = "method";
+ const isPrivateName = this.match(134);
+ this.parseClassElementName(method);
+
+ if (isPrivateName) {
+ this.pushClassPrivateMethod(classBody, privateMethod, true, false);
+ return;
+ }
+
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(Errors.ConstructorIsGenerator, {
+ at: publicMethod.key
+ });
+ }
+
+ this.pushClassMethod(classBody, publicMethod, true, false, false, false);
+ return;
+ }
+
+ const isContextual = tokenIsIdentifier(this.state.type) && !this.state.containsEsc;
+ const isPrivate = this.match(134);
+ const key = this.parseClassElementName(member);
+ const maybeQuestionTokenStartLoc = this.state.startLoc;
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (this.isClassMethod()) {
+ method.kind = "method";
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ return;
+ }
+
+ const isConstructor = this.isNonstaticConstructor(publicMethod);
+ let allowsDirectSuper = false;
+
+ if (isConstructor) {
+ publicMethod.kind = "constructor";
+
+ if (state.hadConstructor && !this.hasPlugin("typescript")) {
+ this.raise(Errors.DuplicateConstructor, {
+ at: key
+ });
+ }
+
+ if (isConstructor && this.hasPlugin("typescript") && member.override) {
+ this.raise(Errors.OverrideOnConstructor, {
+ at: key
+ });
+ }
+
+ state.hadConstructor = true;
+ allowsDirectSuper = state.hadSuperClass;
+ }
+
+ this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
+ } else if (this.isClassProperty()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else if (isContextual && key.name === "async" && !this.isLineTerminator()) {
+ this.resetPreviousNodeTrailingComments(key);
+ const isGenerator = this.eat(55);
+
+ if (publicMember.optional) {
+ this.unexpected(maybeQuestionTokenStartLoc);
+ }
+
+ method.kind = "method";
+ const isPrivate = this.match(134);
+ this.parseClassElementName(method);
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(Errors.ConstructorIsAsync, {
+ at: publicMethod.key
+ });
+ }
+
+ this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
+ }
+ } else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(55) && this.isLineTerminator())) {
+ this.resetPreviousNodeTrailingComments(key);
+ method.kind = key.name;
+ const isPrivate = this.match(134);
+ this.parseClassElementName(publicMethod);
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(Errors.ConstructorIsAccessor, {
+ at: publicMethod.key
+ });
+ }
+
+ this.pushClassMethod(classBody, publicMethod, false, false, false, false);
+ }
+
+ this.checkGetterSetterParams(publicMethod);
+ } else if (isContextual && key.name === "accessor" && !this.isLineTerminator()) {
+ this.expectPlugin("decoratorAutoAccessors");
+ this.resetPreviousNodeTrailingComments(key);
+ const isPrivate = this.match(134);
+ this.parseClassElementName(publicProp);
+ this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);
+ } else if (this.isLineTerminator()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else {
+ this.unexpected();
+ }
+ }
+
+ parseClassElementName(member) {
+ const {
+ type,
+ value
+ } = this.state;
+
+ if ((type === 128 || type === 129) && member.static && value === "prototype") {
+ this.raise(Errors.StaticPrototype, {
+ at: this.state.startLoc
+ });
+ }
+
+ if (type === 134) {
+ if (value === "constructor") {
+ this.raise(Errors.ConstructorClassPrivateField, {
+ at: this.state.startLoc
+ });
+ }
+
+ const key = this.parsePrivateName();
+ member.key = key;
+ return key;
+ }
+
+ return this.parsePropertyName(member);
+ }
+
+ parseClassStaticBlock(classBody, member) {
+ var _member$decorators;
+
+ this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER);
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(PARAM);
+ const body = member.body = [];
+ this.parseBlockOrModuleBlockBody(body, undefined, false, 8);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.labels = oldLabels;
+ classBody.body.push(this.finishNode(member, "StaticBlock"));
+
+ if ((_member$decorators = member.decorators) != null && _member$decorators.length) {
+ this.raise(Errors.DecoratorStaticBlock, {
+ at: member
+ });
+ }
+ }
+
+ pushClassProperty(classBody, prop) {
+ if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) {
+ this.raise(Errors.ConstructorClassField, {
+ at: prop.key
+ });
+ }
+
+ classBody.body.push(this.parseClassProperty(prop));
+ }
+
+ pushClassPrivateProperty(classBody, prop) {
+ const node = this.parseClassPrivateProperty(prop);
+ classBody.body.push(node);
+ this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start);
+ }
+
+ pushClassAccessorProperty(classBody, prop, isPrivate) {
+ if (!isPrivate && !prop.computed) {
+ const key = prop.key;
+
+ if (key.name === "constructor" || key.value === "constructor") {
+ this.raise(Errors.ConstructorClassField, {
+ at: key
+ });
+ }
+ }
+
+ const node = this.parseClassAccessorProperty(prop);
+ classBody.body.push(node);
+
+ if (isPrivate) {
+ this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start);
+ }
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true));
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true);
+ classBody.body.push(node);
+ const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER;
+ this.declareClassPrivateMethodInScope(node, kind);
+ }
+
+ declareClassPrivateMethodInScope(node, kind) {
+ this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {}
+
+ parseClassPrivateProperty(node) {
+ this.parseInitializer(node);
+ this.semicolon();
+ return this.finishNode(node, "ClassPrivateProperty");
+ }
+
+ parseClassProperty(node) {
+ this.parseInitializer(node);
+ this.semicolon();
+ return this.finishNode(node, "ClassProperty");
+ }
+
+ parseClassAccessorProperty(node) {
+ this.parseInitializer(node);
+ this.semicolon();
+ return this.finishNode(node, "ClassAccessorProperty");
+ }
+
+ parseInitializer(node) {
+ this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
+ this.expressionScope.enter(newExpressionScope());
+ this.prodParam.enter(PARAM);
+ node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null;
+ this.expressionScope.exit();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+
+ parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) {
+ if (tokenIsIdentifier(this.state.type)) {
+ node.id = this.parseIdentifier();
+
+ if (isStatement) {
+ this.declareNameFromIdentifier(node.id, bindingType);
+ }
+ } else {
+ if (optionalId || !isStatement) {
+ node.id = null;
+ } else {
+ throw this.raise(Errors.MissingClassName, {
+ at: this.state.startLoc
+ });
+ }
+ }
+ }
+
+ parseClassSuper(node) {
+ node.superClass = this.eat(81) ? this.parseExprSubscripts() : null;
+ }
+
+ parseExport(node) {
+ const hasDefault = this.maybeParseExportDefaultSpecifier(node);
+ const parseAfterDefault = !hasDefault || this.eat(12);
+ const hasStar = parseAfterDefault && this.eatExportStar(node);
+ const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
+ const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12));
+ const isFromRequired = hasDefault || hasStar;
+
+ if (hasStar && !hasNamespace) {
+ if (hasDefault) this.unexpected();
+ this.parseExportFrom(node, true);
+ return this.finishNode(node, "ExportAllDeclaration");
+ }
+
+ const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
+
+ if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) {
+ throw this.unexpected(null, 5);
+ }
+
+ let hasDeclaration;
+
+ if (isFromRequired || hasSpecifiers) {
+ hasDeclaration = false;
+ this.parseExportFrom(node, isFromRequired);
+ } else {
+ hasDeclaration = this.maybeParseExportDeclaration(node);
+ }
+
+ if (isFromRequired || hasSpecifiers || hasDeclaration) {
+ this.checkExport(node, true, false, !!node.source);
+ return this.finishNode(node, "ExportNamedDeclaration");
+ }
+
+ if (this.eat(65)) {
+ node.declaration = this.parseExportDefaultExpression();
+ this.checkExport(node, true, true);
+ return this.finishNode(node, "ExportDefaultDeclaration");
+ }
+
+ throw this.unexpected(null, 5);
+ }
+
+ eatExportStar(node) {
+ return this.eat(55);
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (this.isExportDefaultSpecifier()) {
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = this.parseIdentifier(true);
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamespaceSpecifier(node) {
+ if (this.isContextual(93)) {
+ if (!node.specifiers) node.specifiers = [];
+ const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc);
+ this.next();
+ specifier.exported = this.parseModuleExportName();
+ node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamedSpecifiers(node) {
+ if (this.match(5)) {
+ if (!node.specifiers) node.specifiers = [];
+ const isTypeExport = node.exportKind === "type";
+ node.specifiers.push(...this.parseExportSpecifiers(isTypeExport));
+ node.source = null;
+ node.declaration = null;
+
+ if (this.hasPlugin("importAssertions")) {
+ node.assertions = [];
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportDeclaration(node) {
+ if (this.shouldParseExportDeclaration()) {
+ node.specifiers = [];
+ node.source = null;
+
+ if (this.hasPlugin("importAssertions")) {
+ node.assertions = [];
+ }
+
+ node.declaration = this.parseExportDeclaration(node);
+ return true;
+ }
+
+ return false;
+ }
+
+ isAsyncFunction() {
+ if (!this.isContextual(95)) return false;
+ const next = this.nextTokenStart();
+ return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function");
+ }
+
+ parseExportDefaultExpression() {
+ const expr = this.startNode();
+ const isAsync = this.isAsyncFunction();
+
+ if (this.match(68) || isAsync) {
+ this.next();
+
+ if (isAsync) {
+ this.next();
+ }
+
+ return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync);
+ }
+
+ if (this.match(80)) {
+ return this.parseClass(expr, true, true);
+ }
+
+ if (this.match(26)) {
+ if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.raise(Errors.DecoratorBeforeExport, {
+ at: this.state.startLoc
+ });
+ }
+
+ this.parseDecorators(false);
+ return this.parseClass(expr, true, true);
+ }
+
+ if (this.match(75) || this.match(74) || this.isLet()) {
+ throw this.raise(Errors.UnsupportedDefaultExport, {
+ at: this.state.startLoc
+ });
+ }
+
+ const res = this.parseMaybeAssignAllowIn();
+ this.semicolon();
+ return res;
+ }
+
+ parseExportDeclaration(node) {
+ return this.parseStatement(null);
+ }
+
+ isExportDefaultSpecifier() {
+ const {
+ type
+ } = this.state;
+
+ if (tokenIsIdentifier(type)) {
+ if (type === 95 && !this.state.containsEsc || type === 99) {
+ return false;
+ }
+
+ if ((type === 126 || type === 125) && !this.state.containsEsc) {
+ const {
+ type: nextType
+ } = this.lookahead();
+
+ if (tokenIsIdentifier(nextType) && nextType !== 97 || nextType === 5) {
+ this.expectOnePlugin(["flow", "typescript"]);
+ return false;
+ }
+ }
+ } else if (!this.match(65)) {
+ return false;
+ }
+
+ const next = this.nextTokenStart();
+ const hasFrom = this.isUnparsedContextual(next, "from");
+
+ if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) {
+ return true;
+ }
+
+ if (this.match(65) && hasFrom) {
+ const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));
+ return nextAfterFrom === 34 || nextAfterFrom === 39;
+ }
+
+ return false;
+ }
+
+ parseExportFrom(node, expect) {
+ if (this.eatContextual(97)) {
+ node.source = this.parseImportSource();
+ this.checkExport(node);
+ const assertions = this.maybeParseImportAssertions();
+
+ if (assertions) {
+ node.assertions = assertions;
+ this.checkJSONModuleImport(node);
+ }
+ } else if (expect) {
+ this.unexpected();
+ }
+
+ this.semicolon();
+ }
+
+ shouldParseExportDeclaration() {
+ const {
+ type
+ } = this.state;
+
+ if (type === 26) {
+ this.expectOnePlugin(["decorators", "decorators-legacy"]);
+
+ if (this.hasPlugin("decorators")) {
+ if (this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ throw this.raise(Errors.DecoratorBeforeExport, {
+ at: this.state.startLoc
+ });
+ }
+
+ return true;
+ }
+ }
+
+ return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction();
+ }
+
+ checkExport(node, checkNames, isDefault, isFrom) {
+ if (checkNames) {
+ if (isDefault) {
+ this.checkDuplicateExports(node, "default");
+
+ if (this.hasPlugin("exportDefaultFrom")) {
+ var _declaration$extra;
+
+ const declaration = node.declaration;
+
+ if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {
+ this.raise(Errors.ExportDefaultFromAsIdentifier, {
+ at: declaration
+ });
+ }
+ }
+ } else if (node.specifiers && node.specifiers.length) {
+ for (const specifier of node.specifiers) {
+ const {
+ exported
+ } = specifier;
+ const exportName = exported.type === "Identifier" ? exported.name : exported.value;
+ this.checkDuplicateExports(specifier, exportName);
+
+ if (!isFrom && specifier.local) {
+ const {
+ local
+ } = specifier;
+
+ if (local.type !== "Identifier") {
+ this.raise(Errors.ExportBindingIsString, {
+ at: specifier,
+ localName: local.value,
+ exportName
+ });
+ } else {
+ this.checkReservedWord(local.name, local.loc.start, true, false);
+ this.scope.checkLocalExport(local);
+ }
+ }
+ }
+ } else if (node.declaration) {
+ if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
+ const id = node.declaration.id;
+ if (!id) throw new Error("Assertion failure");
+ this.checkDuplicateExports(node, id.name);
+ } else if (node.declaration.type === "VariableDeclaration") {
+ for (const declaration of node.declaration.declarations) {
+ this.checkDeclaration(declaration.id);
+ }
+ }
+ }
+ }
+
+ const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ if (currentContextDecorators.length) {
+ throw this.raise(Errors.UnsupportedDecoratorExport, {
+ at: node
+ });
+ }
+ }
+
+ checkDeclaration(node) {
+ if (node.type === "Identifier") {
+ this.checkDuplicateExports(node, node.name);
+ } else if (node.type === "ObjectPattern") {
+ for (const prop of node.properties) {
+ this.checkDeclaration(prop);
+ }
+ } else if (node.type === "ArrayPattern") {
+ for (const elem of node.elements) {
+ if (elem) {
+ this.checkDeclaration(elem);
+ }
+ }
+ } else if (node.type === "ObjectProperty") {
+ this.checkDeclaration(node.value);
+ } else if (node.type === "RestElement") {
+ this.checkDeclaration(node.argument);
+ } else if (node.type === "AssignmentPattern") {
+ this.checkDeclaration(node.left);
+ }
+ }
+
+ checkDuplicateExports(node, exportName) {
+ if (this.exportedIdentifiers.has(exportName)) {
+ if (exportName === "default") {
+ this.raise(Errors.DuplicateDefaultExport, {
+ at: node
+ });
+ } else {
+ this.raise(Errors.DuplicateExport, {
+ at: node,
+ exportName
+ });
+ }
+ }
+
+ this.exportedIdentifiers.add(exportName);
+ }
+
+ parseExportSpecifiers(isInTypeExport) {
+ const nodes = [];
+ let first = true;
+ this.expect(5);
+
+ while (!this.eat(8)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12);
+ if (this.eat(8)) break;
+ }
+
+ const isMaybeTypeOnly = this.isContextual(126);
+ const isString = this.match(129);
+ const node = this.startNode();
+ node.local = this.parseModuleExportName();
+ nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly));
+ }
+
+ return nodes;
+ }
+
+ parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {
+ if (this.eatContextual(93)) {
+ node.exported = this.parseModuleExportName();
+ } else if (isString) {
+ node.exported = cloneStringLiteral(node.local);
+ } else if (!node.exported) {
+ node.exported = cloneIdentifier(node.local);
+ }
+
+ return this.finishNode(node, "ExportSpecifier");
+ }
+
+ parseModuleExportName() {
+ if (this.match(129)) {
+ const result = this.parseStringLiteral(this.state.value);
+ const surrogate = result.value.match(loneSurrogate);
+
+ if (surrogate) {
+ this.raise(Errors.ModuleExportNameHasLoneSurrogate, {
+ at: result,
+ surrogateCharCode: surrogate[0].charCodeAt(0)
+ });
+ }
+
+ return result;
+ }
+
+ return this.parseIdentifier(true);
+ }
+
+ isJSONModuleImport(node) {
+ if (node.assertions != null) {
+ return node.assertions.some(({
+ key,
+ value
+ }) => {
+ return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type");
+ });
+ }
+
+ return false;
+ }
+
+ checkJSONModuleImport(node) {
+ if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") {
+ const {
+ specifiers
+ } = node;
+
+ if (node.specifiers != null) {
+ const nonDefaultNamedSpecifier = specifiers.find(specifier => {
+ let imported;
+
+ if (specifier.type === "ExportSpecifier") {
+ imported = specifier.local;
+ } else if (specifier.type === "ImportSpecifier") {
+ imported = specifier.imported;
+ }
+
+ if (imported !== undefined) {
+ return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default";
+ }
+ });
+
+ if (nonDefaultNamedSpecifier !== undefined) {
+ this.raise(Errors.ImportJSONBindingNotDefault, {
+ at: nonDefaultNamedSpecifier.loc.start
+ });
+ }
+ }
+ }
+ }
+
+ parseImport(node) {
+ node.specifiers = [];
+
+ if (!this.match(129)) {
+ const hasDefault = this.maybeParseDefaultImportSpecifier(node);
+ const parseNext = !hasDefault || this.eat(12);
+ const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
+ if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);
+ this.expectContextual(97);
+ }
+
+ node.source = this.parseImportSource();
+ const assertions = this.maybeParseImportAssertions();
+
+ if (assertions) {
+ node.assertions = assertions;
+ } else {
+ const attributes = this.maybeParseModuleAttributes();
+
+ if (attributes) {
+ node.attributes = attributes;
+ }
+ }
+
+ this.checkJSONModuleImport(node);
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ parseImportSource() {
+ if (!this.match(129)) this.unexpected();
+ return this.parseExprAtom();
+ }
+
+ shouldParseDefaultImport(node) {
+ return tokenIsIdentifier(this.state.type);
+ }
+
+ parseImportSpecifierLocal(node, specifier, type) {
+ specifier.local = this.parseIdentifier();
+ node.specifiers.push(this.finishImportSpecifier(specifier, type));
+ }
+
+ finishImportSpecifier(specifier, type) {
+ this.checkLVal(specifier.local, {
+ in: specifier,
+ binding: BIND_LEXICAL
+ });
+ return this.finishNode(specifier, type);
+ }
+
+ parseAssertEntries() {
+ const attrs = [];
+ const attrNames = new Set();
+
+ do {
+ if (this.match(8)) {
+ break;
+ }
+
+ const node = this.startNode();
+ const keyName = this.state.value;
+
+ if (attrNames.has(keyName)) {
+ this.raise(Errors.ModuleAttributesWithDuplicateKeys, {
+ at: this.state.startLoc,
+ key: keyName
+ });
+ }
+
+ attrNames.add(keyName);
+
+ if (this.match(129)) {
+ node.key = this.parseStringLiteral(keyName);
+ } else {
+ node.key = this.parseIdentifier(true);
+ }
+
+ this.expect(14);
+
+ if (!this.match(129)) {
+ throw this.raise(Errors.ModuleAttributeInvalidValue, {
+ at: this.state.startLoc
+ });
+ }
+
+ node.value = this.parseStringLiteral(this.state.value);
+ attrs.push(this.finishNode(node, "ImportAttribute"));
+ } while (this.eat(12));
+
+ return attrs;
+ }
+
+ maybeParseModuleAttributes() {
+ if (this.match(76) && !this.hasPrecedingLineBreak()) {
+ this.expectPlugin("moduleAttributes");
+ this.next();
+ } else {
+ if (this.hasPlugin("moduleAttributes")) return [];
+ return null;
+ }
+
+ const attrs = [];
+ const attributes = new Set();
+
+ do {
+ const node = this.startNode();
+ node.key = this.parseIdentifier(true);
+
+ if (node.key.name !== "type") {
+ this.raise(Errors.ModuleAttributeDifferentFromType, {
+ at: node.key
+ });
+ }
+
+ if (attributes.has(node.key.name)) {
+ this.raise(Errors.ModuleAttributesWithDuplicateKeys, {
+ at: node.key,
+ key: node.key.name
+ });
+ }
+
+ attributes.add(node.key.name);
+ this.expect(14);
+
+ if (!this.match(129)) {
+ throw this.raise(Errors.ModuleAttributeInvalidValue, {
+ at: this.state.startLoc
+ });
+ }
+
+ node.value = this.parseStringLiteral(this.state.value);
+ this.finishNode(node, "ImportAttribute");
+ attrs.push(node);
+ } while (this.eat(12));
+
+ return attrs;
+ }
+
+ maybeParseImportAssertions() {
+ if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {
+ this.expectPlugin("importAssertions");
+ this.next();
+ } else {
+ if (this.hasPlugin("importAssertions")) return [];
+ return null;
+ }
+
+ this.eat(5);
+ const attrs = this.parseAssertEntries();
+ this.eat(8);
+ return attrs;
+ }
+
+ maybeParseDefaultImportSpecifier(node) {
+ if (this.shouldParseDefaultImport(node)) {
+ this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier");
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseStarImportSpecifier(node) {
+ if (this.match(55)) {
+ const specifier = this.startNode();
+ this.next();
+ this.expectContextual(93);
+ this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier");
+ return true;
+ }
+
+ return false;
+ }
+
+ parseNamedImportSpecifiers(node) {
+ let first = true;
+ this.expect(5);
+
+ while (!this.eat(8)) {
+ if (first) {
+ first = false;
+ } else {
+ if (this.eat(14)) {
+ throw this.raise(Errors.DestructureNamedImport, {
+ at: this.state.startLoc
+ });
+ }
+
+ this.expect(12);
+ if (this.eat(8)) break;
+ }
+
+ const specifier = this.startNode();
+ const importedIsString = this.match(129);
+ const isMaybeTypeOnly = this.isContextual(126);
+ specifier.imported = this.parseModuleExportName();
+ const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly);
+ node.specifiers.push(importSpecifier);
+ }
+ }
+
+ parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
+ if (this.eatContextual(93)) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ const {
+ imported
+ } = specifier;
+
+ if (importedIsString) {
+ throw this.raise(Errors.ImportBindingIsString, {
+ at: specifier,
+ importName: imported.value
+ });
+ }
+
+ this.checkReservedWord(imported.name, specifier.loc.start, true, true);
+
+ if (!specifier.local) {
+ specifier.local = cloneIdentifier(imported);
+ }
+ }
+
+ return this.finishImportSpecifier(specifier, "ImportSpecifier");
+ }
+
+ isThisParam(param) {
+ return param.type === "Identifier" && param.name === "this";
+ }
+
+}
+
+class Parser extends StatementParser {
+ constructor(options, input) {
+ options = getOptions(options);
+ super(options, input);
+ this.options = options;
+ this.initializeScopes();
+ this.plugins = pluginsMap(this.options.plugins);
+ this.filename = options.sourceFilename;
+ }
+
+ getScopeHandler() {
+ return ScopeHandler;
+ }
+
+ parse() {
+ this.enterInitialScopes();
+ const file = this.startNode();
+ const program = this.startNode();
+ this.nextToken();
+ file.errors = null;
+ this.parseTopLevel(file, program);
+ file.errors = this.state.errors;
+ return file;
+ }
+
+}
+
+function pluginsMap(plugins) {
+ const pluginMap = new Map();
+
+ for (const plugin of plugins) {
+ const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];
+ if (!pluginMap.has(name)) pluginMap.set(name, options || {});
+ }
+
+ return pluginMap;
+}
+
+function parse(input, options) {
+ var _options;
+
+ if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
+ options = Object.assign({}, options);
+
+ try {
+ options.sourceType = "module";
+ const parser = getParser(options, input);
+ const ast = parser.parse();
+
+ if (parser.sawUnambiguousESM) {
+ return ast;
+ }
+
+ if (parser.ambiguousScriptDifferentAst) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused) {}
+ } else {
+ ast.program.sourceType = "script";
+ }
+
+ return ast;
+ } catch (moduleError) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused2) {}
+
+ throw moduleError;
+ }
+ } else {
+ return getParser(options, input).parse();
+ }
+}
+function parseExpression(input, options) {
+ const parser = getParser(options, input);
+
+ if (parser.options.strictMode) {
+ parser.state.strict = true;
+ }
+
+ return parser.getExpression();
+}
+
+function generateExportedTokenTypes(internalTokenTypes) {
+ const tokenTypes = {};
+
+ for (const typeName of Object.keys(internalTokenTypes)) {
+ tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]);
+ }
+
+ return tokenTypes;
+}
+
+const tokTypes = generateExportedTokenTypes(tt);
+
+function getParser(options, input) {
+ let cls = Parser;
+
+ if (options != null && options.plugins) {
+ validatePlugins(options.plugins);
+ cls = getParserClass(options.plugins);
+ }
+
+ return new cls(options, input);
+}
+
+const parserClassCache = {};
+
+function getParserClass(pluginsFromOptions) {
+ const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name));
+ const key = pluginList.join("/");
+ let cls = parserClassCache[key];
+
+ if (!cls) {
+ cls = Parser;
+
+ for (const plugin of pluginList) {
+ cls = mixinPlugins[plugin](cls);
+ }
+
+ parserClassCache[key] = cls;
+ }
+
+ return cls;
+}
+
+exports.parse = parse;
+exports.parseExpression = parseExpression;
+exports.tokTypes = tokTypes;
+//# sourceMappingURL=index.js.map
diff --git a/Fronts/node_modules/@babel/parser/lib/index.js.map b/Fronts/node_modules/@babel/parser/lib/index.js.map
new file mode 100644
index 0000000..13c8d5e
--- /dev/null
+++ b/Fronts/node_modules/@babel/parser/lib/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../src/util/location.ts","../src/parse-error/credentials.ts","../src/parse-error/module-errors.ts","../src/parse-error/to-node-description.ts","../src/parse-error/standard-errors.ts","../src/parse-error/strict-mode-errors.ts","../src/parse-error/pipeline-operator-errors.ts","../src/parse-error.ts","../src/plugins/estree.ts","../src/tokenizer/context.ts","../src/tokenizer/types.ts","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.ts","../src/util/scopeflags.ts","../src/parser/base.ts","../src/parser/comments.ts","../src/util/whitespace.ts","../src/tokenizer/state.ts","../../babel-helper-string-parser/src/index.ts","../src/tokenizer/index.ts","../src/util/scope.ts","../src/plugins/flow/scope.ts","../src/util/class-scope.ts","../src/util/expression-scope.ts","../src/util/production-parameter.ts","../src/parser/util.ts","../src/parser/node.ts","../src/plugins/flow/index.ts","../src/plugins/jsx/xhtml.ts","../src/plugins/jsx/index.ts","../src/plugins/typescript/scope.ts","../src/plugins/typescript/index.ts","../src/plugins/placeholders.ts","../src/plugins/v8intrinsic.ts","../src/plugin-utils.ts","../src/options.ts","../src/parser/lval.ts","../src/parser/expression.ts","../src/parser/statement.ts","../src/parser/index.ts","../src/index.ts"],"sourcesContent":["export type Pos = {\n start: number;\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: string | undefined | null;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n *\n * @export\n * @param {Position} position\n * @param {number} columnOffset\n * @returns {Position}\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n","export const enum ParseErrorCode {\n SyntaxError = \"BABEL_PARSER_SYNTAX_ERROR\",\n SourceTypeModuleError = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\",\n}\n\nexport type SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\nexport type ToMessage = (self: ErrorDetails) => string;\n\nexport type ParseErrorCredentials = {\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n toMessage: ToMessage;\n};\n\nconst reflect = (keys: string[], last = keys.length - 1) => ({\n get(this: unknown): unknown {\n return keys.reduce(\n (object, key) =>\n // @ts-expect-error key should index object\n object[key],\n this,\n );\n },\n set(this: unknown, value: unknown) {\n keys.reduce(\n // @ts-expect-error key should index item\n (item, key, i) => (i === last ? (item[key] = value) : item[key]),\n this,\n );\n },\n});\n\nconst instantiate = (\n constructor: new () => T,\n properties: any,\n descriptors: any,\n) =>\n Object.keys(descriptors)\n .map(key => [key, descriptors[key]])\n .filter(([, descriptor]) => !!descriptor)\n .map(([key, descriptor]) => [\n key,\n typeof descriptor === \"function\"\n ? { value: descriptor, enumerable: false }\n : typeof descriptor.reflect === \"string\"\n ? { ...descriptor, ...reflect(descriptor.reflect.split(\".\")) }\n : descriptor,\n ])\n .reduce(\n (instance, [key, descriptor]) =>\n Object.defineProperty(instance, key, {\n configurable: true,\n ...descriptor,\n }),\n Object.assign(new constructor(), properties),\n );\n\nexport { instantiate };\n","import { ParseErrorCode } from \"../parse-error\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError,\n },\n};\n","const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\n// @ts-expect-error prefix is specified only when type is UpdateExpression\n// eslint-disable-next-line no-confusing-arrow\nconst toNodeDescription = ({ type, prefix }: NodeWithDescription) =>\n type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[String(prefix) as \"true\" | \"false\"]\n : NodeDescriptions[type];\n\nexport default toNodeDescription;\n","import toNodeDescription from \"./to-node-description\";\n\nexport type LValAncestor =\n | { type: \"UpdateExpression\"; prefix: boolean }\n | {\n type:\n | \"ArrayPattern\"\n | \"AssignmentExpression\"\n | \"CatchClause\"\n | \"ForOfStatement\"\n | \"FormalParameters\"\n | \"ForInStatement\"\n | \"ForStatement\"\n | \"ImportSpecifier\"\n | \"ImportNamespaceSpecifier\"\n | \"ImportDefaultSpecifier\"\n | \"ObjectPattern\"\n | \"RestElement\"\n | \"VariableDeclarator\";\n };\n\nexport default {\n AccessorIsGenerator: ({ kind }: { kind: \"get\" | \"set\" }) =>\n `A ${kind}ter cannot be a generator.`,\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock:\n \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter:\n \"'await' is not allowed in async function parameters.\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions.\",\n BadGetterArity: \"A 'get' accesor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accesor must have exactly one formal parameter.\",\n BadSetterRestParameter:\n \"A 'set' accesor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: ({\n kind,\n }: {\n kind: \"const\" | \"destructuring\";\n }) => `Missing initializer in ${kind} declaration.`,\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: ({ exportName }: { exportName: string }) =>\n `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString: ({\n localName,\n exportName,\n }: {\n localName: string;\n exportName: string;\n }) =>\n `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'.\",\n\n ForInOfLoopInitializer: ({\n type,\n }: {\n type: \"ForInStatement\" | \"ForOfStatement\";\n }) =>\n `'${\n type === \"ForInStatement\" ? \"for-in\" : \"for-of\"\n }' loop variable declaration may not have an initializer.`,\n\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block.\",\n\n IllegalBreakContinue: ({\n type,\n }: {\n type: \"BreakStatement\" | \"ContinueStatement\";\n }) => `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportBindingIsString: ({ importName }: { importName: string }) =>\n `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ImportCallArgumentTrailingComma:\n \"Trailing comma is disallowed inside import(...) arguments.\",\n ImportCallArity: ({ maxArgumentCount }: { maxArgumentCount: 1 | 2 }) =>\n `\\`import()\\` requires exactly ${\n maxArgumentCount === 1 ? \"one argument\" : \"one or two arguments\"\n }.`,\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n ImportJSONBindingNotDefault:\n \"A JSON module can only be imported with `default`.\",\n IncompatibleRegExpUVFlags:\n \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidCoverInitializedName: \"Invalid shorthand property initializer.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: ({ radix }: { radix: number }) =>\n `Expected number in radix ${radix}.`,\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Escape sequence in keyword ${reservedWord}.`,\n InvalidIdentifier: ({ identifierName }: { identifierName: string }) =>\n `Invalid identifier ${identifierName}.`,\n InvalidLhs: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsBinding: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: ({ unexpected }: { unexpected: string }) =>\n `Unexpected character '${unexpected}'.`,\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: ({\n identifierName,\n }: {\n identifierName: string;\n }) => `Private name #${identifierName} is not defined.`,\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: ({ labelName }: { labelName: string }) =>\n `Label '${labelName}' is already declared.`,\n LetInLexicalBinding:\n \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingPlugin: ({ missingPlugin }: { missingPlugin: [string] }) =>\n `This experimental syntax requires enabling the parser plugin: ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n // FIXME: Would be nice to make this \"missingPlugins\" instead.\n // Also, seems like we can drop the \"(s)\" from the message and just make it \"s\".\n MissingOneOfPlugins: ({ missingPlugin }: { missingPlugin: string[] }) =>\n `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys: ({ key }: { key: string }) =>\n `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ModuleExportNameHasLoneSurrogate: ({\n surrogateCharCode,\n }: {\n surrogateCharCode: number;\n }) =>\n `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(\n 16,\n )}'.`,\n ModuleExportUndefined: ({ localName }: { localName: string }) =>\n `Export '${localName}' is not defined.`,\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar:\n \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor:\n \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n PrivateInExpectedIn: ({ identifierName }: { identifierName: string }) =>\n `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n PrivateNameRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Duplicate private name #${identifierName}.`,\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n StaticPrototype: \"Classes may not have static property named prototype.\",\n SuperNotAllowed:\n \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: ({ keyword }: { keyword: string }) =>\n `Unexpected keyword '${keyword}'.`,\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget:\n \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField: \"Unexpected private name.\",\n UnexpectedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Unexpected reserved word '${reservedWord}'.`,\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: ({\n expected,\n unexpected,\n }: {\n expected?: string | null;\n unexpected?: string | null;\n }) =>\n `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${\n expected ? `, expected \"${expected}\"` : \"\"\n }`,\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport:\n \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: ({\n target,\n onlyValidPropertyName,\n }: {\n target: string;\n onlyValidPropertyName: string;\n }) =>\n `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper:\n \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n VarRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Identifier '${identifierName}' has already been declared.`,\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0.\",\n};\n","export default {\n StrictDelete: \"Deleting local variable in strict mode.\",\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: ({ referenceName }: { referenceName: string }) =>\n `Assigning to '${referenceName}' in strict mode.`,\n\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: ({ bindingName }: { bindingName: string }) =>\n `Binding '${bindingName}' in strict mode.`,\n\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n\n StrictWith: \"'with' in strict mode.\",\n};\n","import toNodeDescription from \"./to-node-description\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n] as const);\n\ntype GetSetMemberType> = T extends Set\n ? M\n : unknown;\n\ntype UnparanthesizedPipeBodyTypes = GetSetMemberType<\n typeof UnparenthesizedPipeBodyDescriptions\n>;\n\nexport default {\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({ token }: { token: string }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({ type }: { type: UnparanthesizedPipeBodyTypes }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n};\n","import { Position } from \"./util/location\";\nimport {\n instantiate,\n ParseErrorCode,\n type ParseErrorCredentials,\n type ToMessage,\n type SyntaxPlugin,\n} from \"./parse-error/credentials\";\nimport type { Undone } from \"./parser/node\";\nimport type { Node } from \"./types\";\n\n// Babel uses \"normal\" SyntaxErrors for it's errors, but adds some extra\n// functionality. This functionality is defined in the\n// `ParseErrorSpecification` interface below. We may choose to change to someday\n// give our errors their own full-blown class, but until then this allow us to\n// keep all the desirable properties of SyntaxErrors (like their name in stack\n// traces, etc.), and also allows us to punt on any publicly facing\n// class-hierarchy decisions until Babel 8.\ninterface ParseErrorSpecification {\n // Look, these *could* be readonly, but then Flow complains when we initially\n // set them. We could do a whole dance and make a special interface that's not\n // readonly for when we create the error, then cast it to the readonly\n // interface for public use, but the previous implementation didn't have them\n // as readonly, so let's just not worry about it for now.\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n missingPlugin?: string | string[];\n loc: Position;\n details: ErrorDetails;\n\n // We should consider removing this as it now just contains the same\n // information as `loc.index`.\n // pos: number;\n}\n\nexport type ParseError = SyntaxError &\n ParseErrorSpecification;\n\n// By `ParseErrorConstructor`, we mean something like the new-less style\n// `ErrorConstructor`[1], since `ParseError`'s are not themselves actually\n// separate classes from `SyntaxError`'s.\n//\n// 1. https://github.com/microsoft/TypeScript/blob/v4.5.5/lib/lib.es5.d.ts#L1027\nexport type ParseErrorConstructor = (a: {\n loc: Position;\n details: ErrorDetails;\n}) => ParseError;\n\nfunction toParseErrorConstructor({\n toMessage,\n ...properties\n}: ParseErrorCredentials): ParseErrorConstructor {\n type ConstructorArgument = {\n loc: Position;\n details: ErrorDetails;\n };\n\n return function constructor({ loc, details }: ConstructorArgument) {\n return instantiate(\n SyntaxError,\n { ...properties, loc },\n {\n clone(\n overrides: {\n loc?: Position;\n details?: ErrorDetails;\n } = {},\n ) {\n const loc = (overrides.loc || {}) as Partial;\n return constructor({\n loc: new Position(\n \"line\" in loc ? loc.line : this.loc.line,\n \"column\" in loc ? loc.column : this.loc.column,\n \"index\" in loc ? loc.index : this.loc.index,\n ),\n details: { ...this.details, ...overrides.details },\n });\n },\n details: { value: details, enumerable: false },\n message: {\n get(this: ConstructorArgument): string {\n return `${toMessage(this.details)} (${this.loc.line}:${\n this.loc.column\n })`;\n },\n set(value: string) {\n Object.defineProperty(this, \"message\", { value });\n },\n },\n pos: { reflect: \"loc.index\", enumerable: true },\n missingPlugin: \"missingPlugin\" in details && {\n reflect: \"details.missingPlugin\",\n enumerable: true,\n },\n },\n ) as ParseError;\n };\n}\n\ntype ParseErrorTemplate =\n | string\n | ToMessage\n | { message: string | ToMessage };\n\ntype ParseErrorTemplates = { [reasonCode: string]: ParseErrorTemplate };\n\n// This is the templated form of `ParseErrorEnum`.\n//\n// Note: We could factor out the return type calculation into something like\n// `ParseErrorConstructor`, and then we could\n// reuse it in the non-templated form of `ParseErrorEnum`, but TypeScript\n// doesn't seem to drill down that far when showing you the computed type of\n// an object in an editor, so we'll leave it inlined for now.\nexport function ParseErrorEnum(a: TemplateStringsArray): <\n T extends ParseErrorTemplates,\n>(\n parseErrorTemplates: T,\n) => {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : {}\n : T[K] extends ToMessage\n ? Parameters[0]\n : {}\n >;\n};\n\nexport function ParseErrorEnum(\n parseErrorTemplates: T,\n syntaxPlugin?: SyntaxPlugin,\n): {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : {}\n : T[K] extends ToMessage\n ? Parameters[0]\n : {}\n >;\n};\n\n// You call `ParseErrorEnum` with a mapping from `ReasonCode`'s to either:\n//\n// 1. a static error message,\n// 2. `toMessage` functions that define additional necessary `details` needed by\n// the `ParseError`, or\n// 3. Objects that contain a `message` of one of the above and overridden `code`\n// and/or `reasonCode`:\n//\n// ParseErrorEnum `optionalSyntaxPlugin` ({\n// ErrorWithStaticMessage: \"message\",\n// ErrorWithDynamicMessage: ({ type } : { type: string }) => `${type}`),\n// ErrorWithOverriddenCodeAndOrReasonCode: {\n// message: ({ type }: { type: string }) => `${type}`),\n// code: ParseErrorCode.SourceTypeModuleError,\n// ...(BABEL_8_BREAKING ? { } : { reasonCode: \"CustomErrorReasonCode\" })\n// }\n// });\n//\nexport function ParseErrorEnum(\n argument: TemplateStringsArray | ParseErrorTemplates,\n syntaxPlugin?: SyntaxPlugin,\n) {\n // If the first parameter is an array, that means we were called with a tagged\n // template literal. Extract the syntaxPlugin from this, and call again in\n // the \"normalized\" form.\n if (Array.isArray(argument)) {\n return (parseErrorTemplates: ParseErrorTemplates) =>\n ParseErrorEnum(parseErrorTemplates, argument[0]);\n }\n\n const ParseErrorConstructors = {} as Record<\n string,\n ParseErrorConstructor\n >;\n\n for (const reasonCode of Object.keys(argument)) {\n const template = (argument as ParseErrorTemplates)[reasonCode];\n const { message, ...rest } =\n typeof template === \"string\"\n ? { message: () => template }\n : typeof template === \"function\"\n ? { message: template }\n : template;\n const toMessage = typeof message === \"string\" ? () => message : message;\n\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor({\n code: ParseErrorCode.SyntaxError,\n reasonCode,\n toMessage,\n ...(syntaxPlugin ? { syntaxPlugin } : {}),\n ...rest,\n });\n }\n\n return ParseErrorConstructors;\n}\n\nexport type RaiseProperties = {\n at: Position | Undone;\n} & ErrorDetails;\n\nimport ModuleErrors from \"./parse-error/module-errors\";\nimport StandardErrors from \"./parse-error/standard-errors\";\nimport StrictModeErrors from \"./parse-error/strict-mode-errors\";\nimport PipelineOperatorErrors from \"./parse-error/pipeline-operator-errors\";\n\nexport const Errors = {\n ...ParseErrorEnum(ModuleErrors),\n ...ParseErrorEnum(StandardErrors),\n ...ParseErrorEnum(StrictModeErrors),\n ...ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors),\n};\n\nexport type { LValAncestor } from \"./parse-error/standard-errors\";\n\nexport * from \"./parse-error/credentials\";\n","import { type TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport * as N from \"../types\";\nimport type { Node as NodeType, NodeBase, File } from \"../types\";\nimport type { Position } from \"../util/location\";\nimport { Errors } from \"../parse-error\";\nimport type { Undone } from \"../parser/node\";\nimport type { BindingTypes } from \"../util/scopeflags\";\n\nconst { defineProperty } = Object;\nconst toUnenumerable = (object: any, key: string) =>\n defineProperty(object, key, { enumerable: false, value: object[key] });\n\nfunction toESTreeLocation(node: any) {\n node.loc.start && toUnenumerable(node.loc.start, \"index\");\n node.loc.end && toUnenumerable(node.loc.end, \"index\");\n\n return node;\n}\n\nexport default (superClass: typeof Parser) =>\n class ESTreeParserMixin extends superClass implements Parser {\n parse(): File {\n const file = toESTreeLocation(super.parse());\n\n if (this.options.tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n\n return file;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseRegExpLiteral({ pattern, flags }): N.EstreeRegExpLiteral {\n let regex: RegExp | null = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt: BigInt | null;\n try {\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal: null = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any) {\n // @ts-expect-error ESTree plugin changes node types\n return this.parseLiteral(value, \"Literal\");\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseStringLiteral(value: any): N.Node {\n return this.estreeParseLiteral(value);\n }\n\n parseNumericLiteral(value: any): any {\n return this.estreeParseLiteral(value);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseNullLiteral(): N.Node {\n return this.estreeParseLiteral(null);\n }\n\n parseBooleanLiteral(value: boolean): N.BooleanLiteral {\n return this.estreeParseLiteral(value);\n }\n\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const directiveLiteral = directive.value;\n\n const stmt = this.startNodeAt(\n directive.start,\n directive.loc.start,\n );\n const expression = this.startNodeAt(\n directiveLiteral.start,\n directiveLiteral.loc.start,\n );\n\n expression.value = directiveLiteral.extra.expressionValue;\n // @ts-expect-error TS2339: Property 'raw' does not exist on type 'Undone '.\n expression.raw = directiveLiteral.extra.raw;\n\n stmt.expression = this.finishNodeAt(\n expression,\n \"Literal\",\n directiveLiteral.loc.end,\n );\n // @ts-expect-error N.Directive.value is not defined\n stmt.directive = directiveLiteral.extra.raw.slice(1, -1);\n\n return this.finishNodeAt(\n stmt,\n \"ExpressionStatement\",\n directive.loc.end,\n ) as N.ExpressionStatement;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(\n node: N.BodilessFunctionOrMethodBase,\n isAsync?: boolean | null,\n ): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n // @ts-expect-error plugin typings\n this.checkDeclaration((node as unknown as N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return (method as any as N.EstreeProperty | N.EstreeMethodDefinition)\n .value.params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n allowDirectives: boolean | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n super.parseBlockBody(\n node,\n allowDirectives,\n topLevel,\n end,\n afterBlockParse,\n );\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n // @ts-expect-error estree plugin typings\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // @ts-expect-error\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parsePrivateName(): any {\n const node = super.parsePrivateName();\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n node = node as any;\n delete node.id;\n // @ts-expect-error mutate AST types\n node.name = name;\n // @ts-expect-error mutate AST types\n node.type = \"PrivateIdentifier\";\n return node as unknown as N.EstreePrivateIdentifier;\n }\n\n isPrivateName(node: N.Node): boolean {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n getPrivateNameSV(node: N.Node): string {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node);\n }\n }\n return node.name;\n }\n\n // @ts-expect-error plugin may override interfaces\n parseLiteral(value: any, type: T[\"type\"]): T {\n const node = super.parseLiteral(value, type);\n // @ts-expect-error mutating AST types\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression?: boolean | null,\n isMethod: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n // @ts-expect-error plugin may override interfaces\n parseMethod<\n T extends N.ClassPrivateMethod | N.ObjectMethod | N.ClassMethod,\n >(\n node: Undone,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope: boolean = false,\n ): N.EstreeMethodDefinition {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n // @ts-expect-error todo(flow->ts)\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n // @ts-expect-error mutate AST types\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // @ts-expect-error\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n node.computed = false;\n }\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone,\n \"MethodDefinition\",\n );\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = super.parseClassProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = super.parseClassPrivateProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): N.ObjectMethod | undefined | null {\n const node: N.EstreeProperty = super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ) as any;\n\n if (node) {\n node.type = \"Property\";\n if ((node as any as N.ClassMethod).kind === \"method\") {\n node.kind = \"init\";\n }\n node.shorthand = false;\n }\n\n return node as any;\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startPos: number | undefined | null,\n startLoc: Position | undefined | null,\n isPattern: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectProperty | undefined | null {\n const node: N.EstreeProperty = super.parseObjectProperty(\n prop,\n startPos,\n startLoc,\n isPattern,\n refExpressionErrors,\n ) as any;\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return node as any;\n }\n\n isValidLVal(\n type: string,\n isUnparenthesizedInAssign: boolean,\n binding: BindingTypes,\n ) {\n return type === \"Property\"\n ? \"value\"\n : super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (node != null && this.isObjectProperty(node)) {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableObjectExpressionProp(\n prop: N.Node,\n isLast: boolean,\n isLHS: boolean,\n ) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n this.raise(Errors.PatternHasAccessor, { at: prop.key });\n } else if (prop.method) {\n this.raise(Errors.PatternHasMethod, { at: prop.key });\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n }\n }\n\n finishCallExpression(\n unfinished: Undone,\n optional: boolean,\n ): T {\n const node = super.finishCallExpression(unfinished, optional);\n\n if (node.callee.type === \"Import\") {\n (node as N.Node as N.EstreeImportExpression).type = \"ImportExpression\";\n (node as N.Node as N.EstreeImportExpression).source = node.arguments[0];\n if (this.hasPlugin(\"importAssertions\")) {\n (node as N.Node as N.EstreeImportExpression).attributes =\n node.arguments[1] ?? null;\n }\n // arguments isn't optional in the type definition\n delete node.arguments;\n // callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(unfinished: Undone) {\n const node = super.parseExport(unfinished);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n // @ts-expect-error mutating AST types\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n // @ts-expect-error mutating AST types\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n // @ts-expect-error mutating AST types\n node.type = \"ExportAllDeclaration\";\n // @ts-expect-error mutating AST types\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n break;\n }\n\n return node as N.AnyExport;\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ) {\n const node = super.parseSubscript(\n base,\n startPos,\n startLoc,\n noCalls,\n state,\n );\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n node.type = node.type.substring(8); // strip Optional prefix\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n node.optional = false;\n }\n\n return node;\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n isOptionalChain(node: N.Node): boolean {\n return node.type === \"ChainExpression\";\n }\n\n // @ts-expect-error override interfaces\n isObjectProperty(node: N.Node): boolean {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n isObjectMethod(node: N.Node): boolean {\n return node.method || node.kind === \"get\" || node.kind === \"set\";\n }\n\n finishNodeAt(\n node: Undone,\n type: T[\"type\"],\n endLoc: Position,\n ): T {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n\n resetStartLocation(node: N.Node, start: number, startLoc: Position) {\n super.resetStartLocation(node, start, startLoc);\n toESTreeLocation(node);\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc: Position = this.state.lastTokEndLoc,\n ): void {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n };\n","// The token context is used in JSX plugin to track\n// jsx tag / jsx text / normal JavaScript expression\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nconst types: {\n [key: string]: TokContext;\n} = {\n brace: new TokContext(\"{\"), // normal JavaScript expression\n j_oTag: new TokContext(\"... \", true), // JSX expressions\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n types.template = new TokContext(\"`\", true);\n}\n\nexport { types };\n","import { types as tc, type TokContext } from \"./context\";\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between 1) binary\n// expression (<) and JSX Tag start (); 2) object literal and JSX\n// texts. It is set on the `updateContext` function in the JSX plugin.\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string;\n beforeExpr?: boolean;\n startsExpr?: boolean;\n rightAssociative?: boolean;\n isLoop?: boolean;\n isAssign?: boolean;\n prefix?: boolean;\n postfix?: boolean;\n binop?: number | null;\n};\n\n// Internally the tokenizer stores token as a number\nexport type TokenType = number;\n\n// The `ExportedTokenType` is exported via `tokTypes` and accessible\n// when `tokens: true` is enabled. Unlike internal token type, it provides\n// metadata of the tokens.\nexport class ExportedTokenType {\n label: string;\n keyword: string | undefined | null;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: number | undefined | null;\n // todo(Babel 8): remove updateContext from exposed token layout\n declare updateContext:\n | ((context: Array) => void)\n | undefined\n | null;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n if (!process.env.BABEL_8_BREAKING) {\n this.updateContext = null;\n }\n }\n}\n\n// A map from keyword/keyword-like string value to the token type\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = createToken(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return createToken(name, { beforeExpr, binop });\n}\n\nlet tokenTypeCounter = -1;\nexport const tokenTypes: ExportedTokenType[] = [];\nconst tokenLabels: string[] = [];\nconst tokenBinops: number[] = [];\nconst tokenBeforeExprs: boolean[] = [];\nconst tokenStartsExprs: boolean[] = [];\nconst tokenPrefixes: boolean[] = [];\n\nfunction createToken(name: string, options: TokenOptions = {}): TokenType {\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n tokenTypes.push(new ExportedTokenType(name, options));\n\n return tokenTypeCounter;\n}\n\nfunction createKeywordLike(\n name: string,\n options: TokenOptions = {},\n): TokenType {\n ++tokenTypeCounter;\n keywords.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n // In the exported token type, we set the label as \"name\" for backward compatibility with Babel 7\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n\n return tokenTypeCounter;\n}\n\n// For performance the token type helpers depend on the following declarations order.\n// When adding new token types, please also check if the token helpers need update.\n\nexport type InternalTokenTypes = {\n [name: string]: TokenType;\n};\n\nexport const tt: InternalTokenTypes = {\n // Punctuation token types.\n bracketL: createToken(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: createToken(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: createToken(\"[|\", { beforeExpr, startsExpr }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", { beforeExpr, startsExpr }),\n braceBarL: createToken(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: createToken(\"#{\", { beforeExpr, startsExpr }),\n braceR: createToken(\"}\"),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", { beforeExpr, startsExpr }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", { beforeExpr }),\n semi: createToken(\";\", { beforeExpr }),\n colon: createToken(\":\", { beforeExpr }),\n doubleColon: createToken(\"::\", { beforeExpr }),\n dot: createToken(\".\"),\n question: createToken(\"?\", { beforeExpr }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", { beforeExpr }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", { beforeExpr }),\n backQuote: createToken(\"`\", { startsExpr }),\n dollarBraceL: createToken(\"${\", { beforeExpr, startsExpr }),\n // start: isTemplate\n templateTail: createToken(\"...`\", { startsExpr }),\n templateNonTail: createToken(\"...${\", { beforeExpr, startsExpr }),\n // end: isTemplate\n at: createToken(\"@\"),\n hash: createToken(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: createToken(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n // start: isAssign\n eq: createToken(\"=\", { beforeExpr, isAssign }),\n assign: createToken(\"_=\", { beforeExpr, isAssign }),\n slashAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // These are only needed to support % and ^ as a Hack-pipe topic token.\n // When the proposal settles on a token, the others can be merged with\n // tt.assign.\n xorAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n moduloAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // end: isAssign\n\n incDec: createToken(\"++/--\", { prefix, postfix, startsExpr }),\n bang: createToken(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: createToken(\"~\", { beforeExpr, prefix, startsExpr }),\n\n // More possible topic tokens.\n // When the proposal settles on a token, at least one of these may be removed.\n doubleCaret: createToken(\"^^\", { startsExpr }),\n doubleAt: createToken(\"@@\", { startsExpr }),\n\n // start: isBinop\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\">/<=/>=\", 7),\n gt: createBinop(\">/<=/>=\", 7),\n relational: createBinop(\">/<=/>=\", 7),\n bitShift: createBinop(\"<>>/>>>\", 8),\n bitShiftL: createBinop(\"<>>/>>>\", 8),\n bitShiftR: createBinop(\"<>>/>>>\", 8),\n plusMin: createToken(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: createToken(\"%\", { binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: createToken(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n // start: isLiteralPropertyName\n // start: isKeyword\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n // end: isBinop\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n // start: isLoop\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _for: createKeyword(\"for\", { isLoop }),\n _while: createKeyword(\"while\", { isLoop }),\n // end: isLoop\n // end: isKeyword\n\n // Primary literals\n // start: isIdentifier\n _as: createKeywordLike(\"as\", { startsExpr }),\n _assert: createKeywordLike(\"assert\", { startsExpr }),\n _async: createKeywordLike(\"async\", { startsExpr }),\n _await: createKeywordLike(\"await\", { startsExpr }),\n _from: createKeywordLike(\"from\", { startsExpr }),\n _get: createKeywordLike(\"get\", { startsExpr }),\n _let: createKeywordLike(\"let\", { startsExpr }),\n _meta: createKeywordLike(\"meta\", { startsExpr }),\n _of: createKeywordLike(\"of\", { startsExpr }),\n _sent: createKeywordLike(\"sent\", { startsExpr }),\n _set: createKeywordLike(\"set\", { startsExpr }),\n _static: createKeywordLike(\"static\", { startsExpr }),\n _yield: createKeywordLike(\"yield\", { startsExpr }),\n\n // Flow and TypeScript Keywordlike\n _asserts: createKeywordLike(\"asserts\", { startsExpr }),\n _checks: createKeywordLike(\"checks\", { startsExpr }),\n _exports: createKeywordLike(\"exports\", { startsExpr }),\n _global: createKeywordLike(\"global\", { startsExpr }),\n _implements: createKeywordLike(\"implements\", { startsExpr }),\n _intrinsic: createKeywordLike(\"intrinsic\", { startsExpr }),\n _infer: createKeywordLike(\"infer\", { startsExpr }),\n _is: createKeywordLike(\"is\", { startsExpr }),\n _mixins: createKeywordLike(\"mixins\", { startsExpr }),\n _proto: createKeywordLike(\"proto\", { startsExpr }),\n _require: createKeywordLike(\"require\", { startsExpr }),\n // start: isTSTypeOperator\n _keyof: createKeywordLike(\"keyof\", { startsExpr }),\n _readonly: createKeywordLike(\"readonly\", { startsExpr }),\n _unique: createKeywordLike(\"unique\", { startsExpr }),\n // end: isTSTypeOperator\n // start: isTSDeclarationStart\n _abstract: createKeywordLike(\"abstract\", { startsExpr }),\n _declare: createKeywordLike(\"declare\", { startsExpr }),\n _enum: createKeywordLike(\"enum\", { startsExpr }),\n _module: createKeywordLike(\"module\", { startsExpr }),\n _namespace: createKeywordLike(\"namespace\", { startsExpr }),\n // start: isFlowInterfaceOrTypeOrOpaque\n _interface: createKeywordLike(\"interface\", { startsExpr }),\n _type: createKeywordLike(\"type\", { startsExpr }),\n // end: isTSDeclarationStart\n _opaque: createKeywordLike(\"opaque\", { startsExpr }),\n // end: isFlowInterfaceOrTypeOrOpaque\n name: createToken(\"name\", { startsExpr }),\n // end: isIdentifier\n\n string: createToken(\"string\", { startsExpr }),\n num: createToken(\"num\", { startsExpr }),\n bigint: createToken(\"bigint\", { startsExpr }),\n decimal: createToken(\"decimal\", { startsExpr }),\n // end: isLiteralPropertyName\n regexp: createToken(\"regexp\", { startsExpr }),\n privateName: createToken(\"#name\", { startsExpr }),\n eof: createToken(\"eof\"),\n\n // jsx plugin\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", { beforeExpr: true }),\n jsxTagStart: createToken(\"jsxTagStart\", { startsExpr: true }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n\n // placeholder plugin\n placeholder: createToken(\"%%\", { startsExpr: true }),\n};\n\nexport function tokenIsIdentifier(token: TokenType): boolean {\n return token >= tt._as && token <= tt.name;\n}\n\nexport function tokenKeywordOrIdentifierIsKeyword(token: TokenType): boolean {\n // we can remove the token >= tt._in check when we\n // know a token is either keyword or identifier\n return token <= tt._while;\n}\n\nexport function tokenIsKeywordOrIdentifier(token: TokenType): boolean {\n return token >= tt._in && token <= tt.name;\n}\n\nexport function tokenIsLiteralPropertyName(token: TokenType): boolean {\n return token >= tt._in && token <= tt.decimal;\n}\n\nexport function tokenComesBeforeExpression(token: TokenType): boolean {\n return tokenBeforeExprs[token];\n}\n\nexport function tokenCanStartExpression(token: TokenType): boolean {\n return tokenStartsExprs[token];\n}\n\nexport function tokenIsAssignment(token: TokenType): boolean {\n return token >= tt.eq && token <= tt.moduloAssign;\n}\n\nexport function tokenIsFlowInterfaceOrTypeOrOpaque(token: TokenType): boolean {\n return token >= tt._interface && token <= tt._opaque;\n}\n\nexport function tokenIsLoop(token: TokenType): boolean {\n return token >= tt._do && token <= tt._while;\n}\n\nexport function tokenIsKeyword(token: TokenType): boolean {\n return token >= tt._in && token <= tt._while;\n}\n\nexport function tokenIsOperator(token: TokenType): boolean {\n return token >= tt.pipeline && token <= tt._instanceof;\n}\n\nexport function tokenIsPostfix(token: TokenType): boolean {\n return token === tt.incDec;\n}\n\nexport function tokenIsPrefix(token: TokenType): boolean {\n return tokenPrefixes[token];\n}\n\nexport function tokenIsTSTypeOperator(token: TokenType): boolean {\n return token >= tt._keyof && token <= tt._unique;\n}\n\nexport function tokenIsTSDeclarationStart(token: TokenType): boolean {\n return token >= tt._abstract && token <= tt._type;\n}\n\nexport function tokenLabelName(token: TokenType): string {\n return tokenLabels[token];\n}\n\nexport function tokenOperatorPrecedence(token: TokenType): number {\n return tokenBinops[token];\n}\n\nexport function tokenIsBinaryOperator(token: TokenType): boolean {\n return tokenBinops[token] !== -1;\n}\n\nexport function tokenIsRightAssociative(token: TokenType): boolean {\n return token === tt.exponent;\n}\n\nexport function tokenIsTemplate(token: TokenType): boolean {\n return token >= tt.templateTail && token <= tt.templateNonTail;\n}\n\nexport function getExportedToken(token: TokenType): ExportedTokenType {\n return tokenTypes[token];\n}\n\nexport function isTokenType(obj: any): boolean {\n return typeof obj === \"number\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n tokenTypes[tt.braceR].updateContext = context => {\n context.pop();\n };\n\n tokenTypes[tt.braceL].updateContext =\n tokenTypes[tt.braceHashL].updateContext =\n tokenTypes[tt.dollarBraceL].updateContext =\n context => {\n context.push(tc.brace);\n };\n\n tokenTypes[tt.backQuote].updateContext = context => {\n if (context[context.length - 1] === tc.template) {\n context.pop();\n } else {\n context.push(tc.template);\n }\n };\n\n tokenTypes[tt.jsxTagStart].updateContext = context => {\n context.push(tc.j_expr, tc.j_oTag);\n };\n}\n","import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [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,68,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,349,41,7,1,79,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,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,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,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,2637,96,16,1070,4050,582,8634,568,8,30,18,78,18,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,8936,3,2,6,2,1,2,290,46,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,1845,30,482,44,11,6,17,0,322,29,19,43,1269,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,4152,8,221,3,5761,15,7472,3104,541,1507,4938];\n/* prettier-ignore */\nconst astralIdentifierCodes = [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,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,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,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,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,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","/* eslint max-len: 0 */\n\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart } from \"@babel/helper-validator-identifier\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(\n current: number,\n next: number,\n next2: number,\n): boolean {\n return (\n current === charCodes.atSign &&\n next === charCodes.atSign &&\n isIdentifierStart(next2)\n );\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n","// Each scope gets a bitset that may contain these flags\n// prettier-ignore\nexport const SCOPE_OTHER = 0b000000000,\n SCOPE_PROGRAM = 0b000000001,\n SCOPE_FUNCTION = 0b000000010,\n SCOPE_ARROW = 0b000000100,\n SCOPE_SIMPLE_CATCH = 0b000001000,\n SCOPE_SUPER = 0b000010000,\n SCOPE_DIRECT_SUPER = 0b000100000,\n SCOPE_CLASS = 0b001000000,\n SCOPE_STATIC_BLOCK = 0b010000000,\n SCOPE_TS_MODULE = 0b100000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;\n\nexport type ScopeFlags =\n | typeof SCOPE_OTHER\n | typeof SCOPE_PROGRAM\n | typeof SCOPE_FUNCTION\n | typeof SCOPE_VAR\n | typeof SCOPE_ARROW\n | typeof SCOPE_SIMPLE_CATCH\n | typeof SCOPE_SUPER\n | typeof SCOPE_DIRECT_SUPER\n | typeof SCOPE_CLASS\n | typeof SCOPE_STATIC_BLOCK;\n\n// These flags are meant to be _only_ used inside the Scope class (or subclasses).\n// prettier-ignore\nexport const BIND_KIND_VALUE = 0b000000_0000_01,\n BIND_KIND_TYPE = 0b000000_0000_10,\n // Used in checkLVal and declareName to determine the type of a binding\n BIND_SCOPE_VAR = 0b000000_0001_00, // Var-style binding\n BIND_SCOPE_LEXICAL = 0b000000_0010_00, // Let- or const-style binding\n BIND_SCOPE_FUNCTION = 0b000000_0100_00, // Function declaration\n BIND_SCOPE_OUTSIDE = 0b000000_1000_00, // Special case for function names as\n // bound inside the function\n // Misc flags\n BIND_FLAGS_NONE = 0b000001_0000_00,\n BIND_FLAGS_CLASS = 0b000010_0000_00,\n BIND_FLAGS_TS_ENUM = 0b000100_0000_00,\n BIND_FLAGS_TS_CONST_ENUM = 0b001000_0000_00,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b010000_0000_00,\n BIND_FLAGS_FLOW_DECLARE_FN = 0b100000_0000_00;\n\n// These flags are meant to be _only_ used by Scope consumers\n// prettier-ignore\n/* = is value? | is type? | scope | misc flags */\nexport const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS ,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0 ,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0 ,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0 ,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS ,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0 ,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n // These bindings don't introduce anything in the scope. They are used for assignments and\n // function expressions IDs.\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE ,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE ,\n\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n\n BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;\n\nexport type BindingTypes =\n | typeof BIND_NONE\n | typeof BIND_OUTSIDE\n | typeof BIND_VAR\n | typeof BIND_LEXICAL\n | typeof BIND_CLASS\n | typeof BIND_FUNCTION\n | typeof BIND_TS_INTERFACE\n | typeof BIND_TS_TYPE\n | typeof BIND_TS_ENUM\n | typeof BIND_TS_AMBIENT\n | typeof BIND_TS_NAMESPACE;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_FLAG_STATIC = 0b1_00,\n CLASS_ELEMENT_KIND_GETTER = 0b0_10,\n CLASS_ELEMENT_KIND_SETTER = 0b0_01,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nexport type ClassElementTypes =\n | typeof CLASS_ELEMENT_STATIC_GETTER\n | typeof CLASS_ELEMENT_STATIC_SETTER\n | typeof CLASS_ELEMENT_INSTANCE_GETTER\n | typeof CLASS_ELEMENT_INSTANCE_SETTER\n | typeof CLASS_ELEMENT_OTHER;\n","import type { Options } from \"../options\";\nimport type State from \"../tokenizer/state\";\nimport type { PluginsMap } from \"./index\";\nimport type ScopeHandler from \"../util/scope\";\nimport type ExpressionScopeHandler from \"../util/expression-scope\";\nimport type ClassScopeHandler from \"../util/class-scope\";\nimport type ProductionParameterHandler from \"../util/production-parameter\";\nimport type { PluginConfig } from \"../typings\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugin’s actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption(plugin: string, name: string) {\n return this.plugins.get(plugin)?.[name];\n }\n}\n","/*:: declare var invariant; */\n\nimport BaseParser from \"./base\";\nimport type { Comment, Node } from \"../types\";\nimport * as charCodes from \"charcodes\";\nimport type { Undone } from \"./node\";\n\n/**\n * A whitespace token containing comments\n * @typedef CommentWhitespace\n * @type {object}\n * @property {number} start - the start of the whitespace token.\n * @property {number} end - the end of the whitespace token.\n * @property {Array} comments - the containing comments\n * @property {Node | null} leadingNode - the immediately preceding AST node of the whitespace token\n * @property {Node | null} trailingNode - the immediately following AST node of the whitespace token\n * @property {Node | null} containingNode - the innermost AST node containing the whitespace\n * with minimal size (|end - start|)\n */\nexport type CommentWhitespace = {\n start: number;\n end: number;\n comments: Array;\n leadingNode: Node | null;\n trailingNode: Node | null;\n containingNode: Node | null;\n};\n\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n *\n * @param {Undone} node\n * @param {Array} comments\n */\nfunction setTrailingComments(node: Undone, comments: Array) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's leadingComments or assign comments to be\n * leadingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n *\n * @param {Undone} node\n * @param {Array} comments\n */\nfunction setLeadingComments(node: Undone, comments: Array) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n *\n * @param {Undone} node\n * @param {Array} comments\n */\nexport function setInnerComments(\n node: Undone,\n comments?: Array,\n) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n *\n * @param {Undone} node\n * @param {Array} elements\n * @param {Array} comments\n */\nfunction adjustInnerComments(\n node: Undone,\n elements: Array,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\n/** @class CommentsParser */\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.comments.push(comment);\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n *\n * @param {Node} node\n * @returns {void}\n * @memberof CommentsParser\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n *\n * @memberof CommentsParser\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const { containingNode: node, start: commentStart } = commentWS;\n if (this.input.charCodeAt(commentStart - 1) === charCodes.comma) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaining commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n *\n * @memberof CommentsParser\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterpret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing */\n // async /* 1 */ function f() {}\n /*\n * the comment whitespace \"* 1 *\" has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark \"* 1 *\" as\n * inner comments. So \"* 1 *\" should be detached from the Identifier node.\n *\n * @param {N.Node} node the last finished AST node _before_ current token\n * @returns\n * @memberof CommentsParser\n */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n /**\n * Attach a node to the comment whitespaces right before/after\n * the given range.\n *\n * This is used to properly attach comments around parenthesized\n * expressions as leading/trailing comments of the inner expression.\n *\n * @param {Node} node\n * @param {number} start\n * @param {number} end\n */\n takeSurroundingComments(node: Node, start: number, end: number) {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n","import * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/y;\n\n// Skip whitespace and single-line comments, including /* no newline here */.\n// After this RegExp matches, its lastIndex points to a line terminator, or\n// the start of multi-line comment (which is effectively a line terminator),\n// or the end of string.\nexport const skipWhiteSpaceToLineBreak = new RegExp(\n // Unfortunately JS doesn't support Perl's atomic /(?>pattern)/ or\n // possessive quantifiers, so we use a trick to prevent backtracking\n // when the look-ahead for line terminator fails.\n \"(?=(\" +\n // Capture the whitespace and comments that should be skipped inside\n // a look-ahead assertion, and then re-match the group as a unit.\n skipWhiteSpaceInLine.source +\n \"))\\\\1\" +\n // Look-ahead for either line terminator, start of multi-line comment,\n // or end of string.\n /(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)/.source,\n \"y\", // sticky\n);\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","import type { Options } from \"../options\";\nimport * as N from \"../types\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location\";\n\nimport { types as ct, type TokContext } from \"./context\";\nimport { tt, type TokenType } from \"./types\";\nimport { Errors, type ParseError } from \"../parse-error\";\n\nexport type DeferredStrictError =\n | typeof Errors.StrictNumericEscape\n | typeof Errors.StrictOctalLiteral;\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number;\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0;\n};\n\nexport default class State {\n strict: boolean;\n curLine: number;\n lineStart: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init({ strictMode, sourceType, startLine, startColumn }: Options): void {\n this.strict =\n strictMode === false\n ? false\n : strictMode === true\n ? true\n : sourceType === \"module\";\n\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);\n }\n\n errors: ParseError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n maybeInArrowParameters: boolean = false;\n inType: boolean = false;\n noAnonFunctionType: boolean = false;\n hasFlowComment: boolean = false;\n isAmbientContext: boolean = false;\n inAbstractClass: boolean = false;\n inDisallowConditionalTypesContext: boolean = false;\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n soloAwait: boolean = false;\n inFSharpPipelineDirectBody: boolean = false;\n\n // Labels in scope.\n labels: Array<{\n kind: \"loop\" | \"switch\" | undefined | null;\n name?: string | null;\n statementStart?: number;\n }> = [];\n\n // Leading decorators. Last element of the stack represents the decorators in current context.\n // Supports nesting of decorators, e.g. @foo(@bar class inner {}) class outer {}\n // where @foo belongs to the outer class and @bar to the inner\n decoratorStack: Array> = [[]];\n\n // Comment store for Program.comments\n comments: Array = [];\n\n // Comment attachment store\n commentStack: Array = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n lastTokStart: number = 0;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array = [ct.brace];\n // Used to track whether a JSX element is allowed to form\n canStartJSXElement: boolean = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n containsEsc: boolean = false;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n curPosition(): Position {\n return new Position(this.curLine, this.pos - this.lineStart, this.pos);\n }\n\n clone(skipArrays?: boolean): State {\n const state = new State();\n const keys = Object.keys(this) as (keyof State)[];\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n let val = this[key];\n\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n // @ts-expect-error\n state[key] = val;\n }\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number;\n value: any;\n type: TokenType;\n start: number;\n end: number;\n context: TokContext[];\n startLoc: Position;\n lastTokEndLoc: Position;\n curLine: number;\n lineStart: number;\n curPosition: () => Position;\n /* Used only in readToken_mult_modulo */\n inType: boolean;\n};\n","import * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let containsInvalid = false;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n let escaped;\n ({\n ch: escaped,\n pos,\n lineStart,\n curLine,\n } = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n ));\n if (escaped === null) {\n containsInvalid = true;\n } else {\n out += escaped;\n }\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return { pos, str: out, containsInvalid, lineStart, curLine };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = input.slice(startPos, pos + 2).match(/^[0-7]+/)!;\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n","/*:: declare var invariant; */\n\nimport type { Options } from \"../options\";\nimport {\n Position,\n SourceLocation,\n createPositionWithColumnOffset,\n} from \"../util/location\";\nimport CommentsParser, { type CommentWhitespace } from \"../parser/comments\";\nimport * as N from \"../types\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types\";\nimport { type TokContext } from \"./context\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n type RaiseProperties,\n} from \"../parse-error\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n} from \"../util/whitespace\";\nimport State from \"./state\";\nimport type { LookaheadState, DeferredStrictError } from \"./state\";\n\nimport {\n readInt,\n readCodePoint,\n readStringContents,\n type IntErrorHandlers,\n type CodePointErrorHandlers,\n type StringContentsErrorHandlers,\n} from \"@babel/helper-string-parser\";\n\nimport type { Plugin } from \"../typings\";\n\nfunction buildPosition(pos: number, lineStart: number, curLine: number) {\n return new Position(curLine, pos - lineStart, pos);\n}\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n // This is only valid when using the regexpUnicodeSets plugin\n charCodes.lowercaseV,\n]);\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default abstract class Tokenizer extends CommentsParser {\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n // TODO\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Whether current token matches given type\n *\n * @param {TokenType} type\n * @returns {boolean}\n * @memberof Tokenizer\n */\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n *\n * @param {State} state\n * @returns {LookaheadState}\n * @memberof Tokenizer\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n *\n * @returns {LookaheadState}\n * @memberof Tokenizer\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // For performance we use a simplified tokenizer state structure\n // @ts-expect-error\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach(([toParseError, at]) =>\n this.raise(toParseError, { at }),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related\n // properties.\n\n nextToken(): void {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n skipBlockComment(): N.CommentBlock | undefined {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(\"*/\", start + 2);\n if (end === -1) {\n // We have to call this again here because startLoc may not be set...\n // This seems to be for performance reasons:\n // https://github.com/babel/babel/commit/acf2a10899f696a8aaf34df78bf9725b5ea7f2da\n throw this.raise(Errors.UnterminatedComment, {\n at: this.state.curPosition(),\n });\n }\n\n this.state.pos = end + 2;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment: N.CommentBlock = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start,\n end: end + 2,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | undefined {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment: N.CommentLine = {\n type: \"CommentLine\",\n value,\n start,\n end,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments = [];\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment();\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (ch === charCodes.dash && !this.inModule) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (ch === charCodes.lessThan && !this.inModule) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // ` isRef(x) ? x.value = y : x = y
+ const { right: rVal, operator } = parent;
+ const rExp = rawExp.slice(rVal.start - 1, rVal.end - 1);
+ const rExpString = stringifyExpression(processExpression(createSimpleExpression(rExp, false), context, false, false, knownIds));
+ return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore\n` : ``} ? ${raw}.value ${operator} ${rExpString} : ${raw}`;
+ }
+ else if (isUpdateArg) {
+ // make id replace parent in the code range so the raw update operator
+ // is removed
+ id.start = parent.start;
+ id.end = parent.end;
+ const { prefix: isPrefix, operator } = parent;
+ const prefix = isPrefix ? operator : ``;
+ const postfix = isPrefix ? `` : operator;
+ // let binding.
+ // x++ --> isRef(a) ? a.value++ : a++
+ return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore\n` : ``} ? ${prefix}${raw}.value${postfix} : ${prefix}${raw}${postfix}`;
+ }
+ else if (isDestructureAssignment) {
+ // TODO
+ // let binding in a destructure assignment - it's very tricky to
+ // handle both possible cases here without altering the original
+ // structure of the code, so we just assume it's not a ref here
+ // for now
+ return raw;
+ }
+ else {
+ return `${context.helperString(UNREF)}(${raw})`;
+ }
+ }
+ else if (type === "props" /* PROPS */) {
+ // use __props which is generated by compileScript so in ts mode
+ // it gets correct type
+ return `__props.${raw}`;
+ }
+ else if (type === "props-aliased" /* PROPS_ALIASED */) {
+ // prop with a different local alias (from defineProps() destructure)
+ return `__props.${bindingMetadata.__propsAliases[raw]}`;
+ }
+ }
+ else {
+ if (type && type.startsWith('setup')) {
+ // setup bindings in non-inline mode
+ return `$setup.${raw}`;
+ }
+ else if (type === "props-aliased" /* PROPS_ALIASED */) {
+ return `$props.${bindingMetadata.__propsAliases[raw]}`;
+ }
+ else if (type) {
+ return `$${type}.${raw}`;
+ }
+ }
+ // fallback to ctx
+ return `_ctx.${raw}`;
+ };
+ // fast path if expression is a simple identifier.
+ const rawExp = node.content;
+ // bail constant on parens (function invocation) and dot (member access)
+ const bailConstant = rawExp.indexOf(`(`) > -1 || rawExp.indexOf('.') > 0;
+ if (isSimpleIdentifier(rawExp)) {
+ const isScopeVarReference = context.identifiers[rawExp];
+ const isAllowedGlobal = shared.isGloballyWhitelisted(rawExp);
+ const isLiteral = isLiteralWhitelisted(rawExp);
+ if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
+ // const bindings exposed from setup can be skipped for patching but
+ // cannot be hoisted to module scope
+ if (bindingMetadata[node.content] === "setup-const" /* SETUP_CONST */) {
+ node.constType = 1 /* CAN_SKIP_PATCH */;
+ }
+ node.content = rewriteIdentifier(rawExp);
+ }
+ else if (!isScopeVarReference) {
+ if (isLiteral) {
+ node.constType = 3 /* CAN_STRINGIFY */;
+ }
+ else {
+ node.constType = 2 /* CAN_HOIST */;
+ }
+ }
+ return node;
+ }
+ let ast;
+ // exp needs to be parsed differently:
+ // 1. Multiple inline statements (v-on, with presence of `;`): parse as raw
+ // exp, but make sure to pad with spaces for consistent ranges
+ // 2. Expressions: wrap with parens (for e.g. object expressions)
+ // 3. Function arguments (v-for, v-slot): place in a function argument position
+ const source = asRawStatements
+ ? ` ${rawExp} `
+ : `(${rawExp})${asParams ? `=>{}` : ``}`;
+ try {
+ ast = parser.parse(source, {
+ plugins: context.expressionPlugins
+ }).program;
+ }
+ catch (e) {
+ context.onError(createCompilerError(44 /* X_INVALID_EXPRESSION */, node.loc, undefined, e.message));
+ return node;
+ }
+ const ids = [];
+ const parentStack = [];
+ const knownIds = Object.create(context.identifiers);
+ walkIdentifiers(ast, (node, parent, _, isReferenced, isLocal) => {
+ if (isStaticPropertyKey(node, parent)) {
+ return;
+ }
+ // v2 wrapped filter call
+ if (node.name.startsWith('_filter_')) {
+ return;
+ }
+ const needPrefix = isReferenced && canPrefix(node);
+ if (needPrefix && !isLocal) {
+ if (isStaticProperty(parent) && parent.shorthand) {
+ node.prefix = `${node.name}: `;
+ }
+ node.name = rewriteIdentifier(node.name, parent, node);
+ ids.push(node);
+ }
+ else {
+ // The identifier is considered constant unless it's pointing to a
+ // local scope variable (a v-for alias, or a v-slot prop)
+ if (!(needPrefix && isLocal) && !bailConstant) {
+ node.isConstant = true;
+ }
+ // also generate sub-expressions for other identifiers for better
+ // source map support. (except for property keys which are static)
+ ids.push(node);
+ }
+ }, true, // invoke on ALL identifiers
+ parentStack, knownIds);
+ // We break up the compound expression into an array of strings and sub
+ // expressions (for identifiers that have been prefixed). In codegen, if
+ // an ExpressionNode has the `.children` property, it will be used instead of
+ // `.content`.
+ const children = [];
+ ids.sort((a, b) => a.start - b.start);
+ ids.forEach((id, i) => {
+ // range is offset by -1 due to the wrapping parens when parsed
+ const start = id.start - 1;
+ const end = id.end - 1;
+ const last = ids[i - 1];
+ const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
+ if (leadingText.length || id.prefix) {
+ children.push(leadingText + (id.prefix || ``));
+ }
+ const source = rawExp.slice(start, end);
+ children.push(createSimpleExpression(id.name, false, {
+ source,
+ start: advancePositionWithClone(node.loc.start, source, start),
+ end: advancePositionWithClone(node.loc.start, source, end)
+ }, id.isConstant ? 3 /* CAN_STRINGIFY */ : 0 /* NOT_CONSTANT */));
+ if (i === ids.length - 1 && end < rawExp.length) {
+ children.push(rawExp.slice(end));
+ }
+ });
+ let ret;
+ if (children.length) {
+ ret = createCompoundExpression(children, node.loc);
+ }
+ else {
+ ret = node;
+ ret.constType = bailConstant
+ ? 0 /* NOT_CONSTANT */
+ : 3 /* CAN_STRINGIFY */;
+ }
+ ret.identifiers = Object.keys(knownIds);
+ return ret;
+}
+function canPrefix(id) {
+ // skip whitelisted globals
+ if (shared.isGloballyWhitelisted(id.name)) {
+ return false;
+ }
+ // special case for webpack compilation
+ if (id.name === 'require') {
+ return false;
+ }
+ return true;
+}
+function stringifyExpression(exp) {
+ if (shared.isString(exp)) {
+ return exp;
+ }
+ else if (exp.type === 4 /* SIMPLE_EXPRESSION */) {
+ return exp.content;
+ }
+ else {
+ return exp.children
+ .map(stringifyExpression)
+ .join('');
+ }
+}
+
+const transformIf = createStructuralDirectiveTransform(/^(if|else|else-if)$/, (node, dir, context) => {
+ return processIf(node, dir, context, (ifNode, branch, isRoot) => {
+ // #1587: We need to dynamically increment the key based on the current
+ // node's sibling nodes, since chained v-if/else branches are
+ // rendered at the same depth
+ const siblings = context.parent.children;
+ let i = siblings.indexOf(ifNode);
+ let key = 0;
+ while (i-- >= 0) {
+ const sibling = siblings[i];
+ if (sibling && sibling.type === 9 /* IF */) {
+ key += sibling.branches.length;
+ }
+ }
+ // Exit callback. Complete the codegenNode when all children have been
+ // transformed.
+ return () => {
+ if (isRoot) {
+ ifNode.codegenNode = createCodegenNodeForBranch(branch, key, context);
+ }
+ else {
+ // attach this branch's codegen node to the v-if root.
+ const parentCondition = getParentCondition(ifNode.codegenNode);
+ parentCondition.alternate = createCodegenNodeForBranch(branch, key + ifNode.branches.length - 1, context);
+ }
+ };
+ });
+});
+// target-agnostic transform used for both Client and SSR
+function processIf(node, dir, context, processCodegen) {
+ if (dir.name !== 'else' &&
+ (!dir.exp || !dir.exp.content.trim())) {
+ const loc = dir.exp ? dir.exp.loc : node.loc;
+ context.onError(createCompilerError(28 /* X_V_IF_NO_EXPRESSION */, dir.loc));
+ dir.exp = createSimpleExpression(`true`, false, loc);
+ }
+ if (context.prefixIdentifiers && dir.exp) {
+ // dir.exp can only be simple expression because vIf transform is applied
+ // before expression transform.
+ dir.exp = processExpression(dir.exp, context);
+ }
+ if (dir.name === 'if') {
+ const branch = createIfBranch(node, dir);
+ const ifNode = {
+ type: 9 /* IF */,
+ loc: node.loc,
+ branches: [branch]
+ };
+ context.replaceNode(ifNode);
+ if (processCodegen) {
+ return processCodegen(ifNode, branch, true);
+ }
+ }
+ else {
+ // locate the adjacent v-if
+ const siblings = context.parent.children;
+ const comments = [];
+ let i = siblings.indexOf(node);
+ while (i-- >= -1) {
+ const sibling = siblings[i];
+ if (sibling && sibling.type === 3 /* COMMENT */) {
+ context.removeNode(sibling);
+ comments.unshift(sibling);
+ continue;
+ }
+ if (sibling &&
+ sibling.type === 2 /* TEXT */ &&
+ !sibling.content.trim().length) {
+ context.removeNode(sibling);
+ continue;
+ }
+ if (sibling && sibling.type === 9 /* IF */) {
+ // Check if v-else was followed by v-else-if
+ if (dir.name === 'else-if' &&
+ sibling.branches[sibling.branches.length - 1].condition === undefined) {
+ context.onError(createCompilerError(30 /* X_V_ELSE_NO_ADJACENT_IF */, node.loc));
+ }
+ // move the node to the if node's branches
+ context.removeNode();
+ const branch = createIfBranch(node, dir);
+ if (comments.length &&
+ // #3619 ignore comments if the v-if is direct child of
+ !(context.parent &&
+ context.parent.type === 1 /* ELEMENT */ &&
+ isBuiltInType(context.parent.tag, 'transition'))) {
+ branch.children = [...comments, ...branch.children];
+ }
+ // check if user is forcing same key on different branches
+ {
+ const key = branch.userKey;
+ if (key) {
+ sibling.branches.forEach(({ userKey }) => {
+ if (isSameKey(userKey, key)) {
+ context.onError(createCompilerError(29 /* X_V_IF_SAME_KEY */, branch.userKey.loc));
+ }
+ });
+ }
+ }
+ sibling.branches.push(branch);
+ const onExit = processCodegen && processCodegen(sibling, branch, false);
+ // since the branch was removed, it will not be traversed.
+ // make sure to traverse here.
+ traverseNode(branch, context);
+ // call on exit
+ if (onExit)
+ onExit();
+ // make sure to reset currentNode after traversal to indicate this
+ // node has been removed.
+ context.currentNode = null;
+ }
+ else {
+ context.onError(createCompilerError(30 /* X_V_ELSE_NO_ADJACENT_IF */, node.loc));
+ }
+ break;
+ }
+ }
+}
+function createIfBranch(node, dir) {
+ return {
+ type: 10 /* IF_BRANCH */,
+ loc: node.loc,
+ condition: dir.name === 'else' ? undefined : dir.exp,
+ children: node.tagType === 3 /* TEMPLATE */ && !findDir(node, 'for')
+ ? node.children
+ : [node],
+ userKey: findProp(node, `key`)
+ };
+}
+function createCodegenNodeForBranch(branch, keyIndex, context) {
+ if (branch.condition) {
+ return createConditionalExpression(branch.condition, createChildrenCodegenNode(branch, keyIndex, context),
+ // make sure to pass in asBlock: true so that the comment node call
+ // closes the current block.
+ createCallExpression(context.helper(CREATE_COMMENT), [
+ '"v-if"' ,
+ 'true'
+ ]));
+ }
+ else {
+ return createChildrenCodegenNode(branch, keyIndex, context);
+ }
+}
+function createChildrenCodegenNode(branch, keyIndex, context) {
+ const { helper } = context;
+ const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2 /* CAN_HOIST */));
+ const { children } = branch;
+ const firstChild = children[0];
+ const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1 /* ELEMENT */;
+ if (needFragmentWrapper) {
+ if (children.length === 1 && firstChild.type === 11 /* FOR */) {
+ // optimize away nested fragments when child is a ForNode
+ const vnodeCall = firstChild.codegenNode;
+ injectProp(vnodeCall, keyProperty, context);
+ return vnodeCall;
+ }
+ else {
+ let patchFlag = 64 /* STABLE_FRAGMENT */;
+ let patchFlagText = shared.PatchFlagNames[64 /* STABLE_FRAGMENT */];
+ // check if the fragment actually contains a single valid child with
+ // the rest being comments
+ if (children.filter(c => c.type !== 3 /* COMMENT */).length === 1) {
+ patchFlag |= 2048 /* DEV_ROOT_FRAGMENT */;
+ patchFlagText += `, ${shared.PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;
+ }
+ return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag + (` /* ${patchFlagText} */` ), undefined, undefined, true, false, false /* isComponent */, branch.loc);
+ }
+ }
+ else {
+ const ret = firstChild.codegenNode;
+ const vnodeCall = getMemoedVNodeCall(ret);
+ // Change createVNode to createBlock.
+ if (vnodeCall.type === 13 /* VNODE_CALL */) {
+ makeBlock(vnodeCall, context);
+ }
+ // inject branch key
+ injectProp(vnodeCall, keyProperty, context);
+ return ret;
+ }
+}
+function isSameKey(a, b) {
+ if (!a || a.type !== b.type) {
+ return false;
+ }
+ if (a.type === 6 /* ATTRIBUTE */) {
+ if (a.value.content !== b.value.content) {
+ return false;
+ }
+ }
+ else {
+ // directive
+ const exp = a.exp;
+ const branchExp = b.exp;
+ if (exp.type !== branchExp.type) {
+ return false;
+ }
+ if (exp.type !== 4 /* SIMPLE_EXPRESSION */ ||
+ exp.isStatic !== branchExp.isStatic ||
+ exp.content !== branchExp.content) {
+ return false;
+ }
+ }
+ return true;
+}
+function getParentCondition(node) {
+ while (true) {
+ if (node.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
+ if (node.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
+ node = node.alternate;
+ }
+ else {
+ return node;
+ }
+ }
+ else if (node.type === 20 /* JS_CACHE_EXPRESSION */) {
+ node = node.value;
+ }
+ }
+}
+
+const transformFor = createStructuralDirectiveTransform('for', (node, dir, context) => {
+ const { helper, removeHelper } = context;
+ return processFor(node, dir, context, forNode => {
+ // create the loop render function expression now, and add the
+ // iterator on exit after all children have been traversed
+ const renderExp = createCallExpression(helper(RENDER_LIST), [
+ forNode.source
+ ]);
+ const isTemplate = isTemplateNode(node);
+ const memo = findDir(node, 'memo');
+ const keyProp = findProp(node, `key`);
+ const keyExp = keyProp &&
+ (keyProp.type === 6 /* ATTRIBUTE */
+ ? createSimpleExpression(keyProp.value.content, true)
+ : keyProp.exp);
+ const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
+ if (isTemplate) {
+ // #2085 / #5288 process :key and v-memo expressions need to be
+ // processed on ``. In this case the node is discarded
+ // and never traversed so its binding expressions won't be processed
+ // by the normal transforms.
+ if (memo) {
+ memo.exp = processExpression(memo.exp, context);
+ }
+ if (keyProperty && keyProp.type !== 6 /* ATTRIBUTE */) {
+ keyProperty.value = processExpression(keyProperty.value, context);
+ }
+ }
+ const isStableFragment = forNode.source.type === 4 /* SIMPLE_EXPRESSION */ &&
+ forNode.source.constType > 0 /* NOT_CONSTANT */;
+ const fragmentFlag = isStableFragment
+ ? 64 /* STABLE_FRAGMENT */
+ : keyProp
+ ? 128 /* KEYED_FRAGMENT */
+ : 256 /* UNKEYED_FRAGMENT */;
+ forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, renderExp, fragmentFlag +
+ (` /* ${shared.PatchFlagNames[fragmentFlag]} */` ), undefined, undefined, true /* isBlock */, !isStableFragment /* disableTracking */, false /* isComponent */, node.loc);
+ return () => {
+ // finish the codegen now that all children have been traversed
+ let childBlock;
+ const { children } = forNode;
+ // check key placement
+ if (isTemplate) {
+ node.children.some(c => {
+ if (c.type === 1 /* ELEMENT */) {
+ const key = findProp(c, 'key');
+ if (key) {
+ context.onError(createCompilerError(33 /* X_V_FOR_TEMPLATE_KEY_PLACEMENT */, key.loc));
+ return true;
+ }
+ }
+ });
+ }
+ const needFragmentWrapper = children.length !== 1 || children[0].type !== 1 /* ELEMENT */;
+ const slotOutlet = isSlotOutlet(node)
+ ? node
+ : isTemplate &&
+ node.children.length === 1 &&
+ isSlotOutlet(node.children[0])
+ ? node.children[0] // api-extractor somehow fails to infer this
+ : null;
+ if (slotOutlet) {
+ // or
+ childBlock = slotOutlet.codegenNode;
+ if (isTemplate && keyProperty) {
+ //
+ // we need to inject the key to the renderSlot() call.
+ // the props for renderSlot is passed as the 3rd argument.
+ injectProp(childBlock, keyProperty, context);
+ }
+ }
+ else if (needFragmentWrapper) {
+ // with text or multi-elements
+ // should generate a fragment block for each loop
+ childBlock = createVNodeCall(context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : undefined, node.children, 64 /* STABLE_FRAGMENT */ +
+ (` /* ${shared.PatchFlagNames[64 /* STABLE_FRAGMENT */]} */`
+ ), undefined, undefined, true, undefined, false /* isComponent */);
+ }
+ else {
+ // Normal element v-for. Directly use the child's codegenNode
+ // but mark it as a block.
+ childBlock = children[0]
+ .codegenNode;
+ if (isTemplate && keyProperty) {
+ injectProp(childBlock, keyProperty, context);
+ }
+ if (childBlock.isBlock !== !isStableFragment) {
+ if (childBlock.isBlock) {
+ // switch from block to vnode
+ removeHelper(OPEN_BLOCK);
+ removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
+ }
+ else {
+ // switch from vnode to block
+ removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
+ }
+ }
+ childBlock.isBlock = !isStableFragment;
+ if (childBlock.isBlock) {
+ helper(OPEN_BLOCK);
+ helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
+ }
+ else {
+ helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
+ }
+ }
+ if (memo) {
+ const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [
+ createSimpleExpression(`_cached`)
+ ]));
+ loop.body = createBlockStatement([
+ createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
+ createCompoundExpression([
+ `if (_cached`,
+ ...(keyExp ? [` && _cached.key === `, keyExp] : []),
+ ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
+ ]),
+ createCompoundExpression([`const _item = `, childBlock]),
+ createSimpleExpression(`_item.memo = _memo`),
+ createSimpleExpression(`return _item`)
+ ]);
+ renderExp.arguments.push(loop, createSimpleExpression(`_cache`), createSimpleExpression(String(context.cached++)));
+ }
+ else {
+ renderExp.arguments.push(createFunctionExpression(createForLoopParams(forNode.parseResult), childBlock, true /* force newline */));
+ }
+ };
+ });
+});
+// target-agnostic transform used for both Client and SSR
+function processFor(node, dir, context, processCodegen) {
+ if (!dir.exp) {
+ context.onError(createCompilerError(31 /* X_V_FOR_NO_EXPRESSION */, dir.loc));
+ return;
+ }
+ const parseResult = parseForExpression(
+ // can only be simple expression because vFor transform is applied
+ // before expression transform.
+ dir.exp, context);
+ if (!parseResult) {
+ context.onError(createCompilerError(32 /* X_V_FOR_MALFORMED_EXPRESSION */, dir.loc));
+ return;
+ }
+ const { addIdentifiers, removeIdentifiers, scopes } = context;
+ const { source, value, key, index } = parseResult;
+ const forNode = {
+ type: 11 /* FOR */,
+ loc: dir.loc,
+ source,
+ valueAlias: value,
+ keyAlias: key,
+ objectIndexAlias: index,
+ parseResult,
+ children: isTemplateNode(node) ? node.children : [node]
+ };
+ context.replaceNode(forNode);
+ // bookkeeping
+ scopes.vFor++;
+ if (context.prefixIdentifiers) {
+ // scope management
+ // inject identifiers to context
+ value && addIdentifiers(value);
+ key && addIdentifiers(key);
+ index && addIdentifiers(index);
+ }
+ const onExit = processCodegen && processCodegen(forNode);
+ return () => {
+ scopes.vFor--;
+ if (context.prefixIdentifiers) {
+ value && removeIdentifiers(value);
+ key && removeIdentifiers(key);
+ index && removeIdentifiers(index);
+ }
+ if (onExit)
+ onExit();
+ };
+}
+const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
+// This regex doesn't cover the case if key or index aliases have destructuring,
+// but those do not make sense in the first place, so this works in practice.
+const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
+const stripParensRE = /^\(|\)$/g;
+function parseForExpression(input, context) {
+ const loc = input.loc;
+ const exp = input.content;
+ const inMatch = exp.match(forAliasRE);
+ if (!inMatch)
+ return;
+ const [, LHS, RHS] = inMatch;
+ const result = {
+ source: createAliasExpression(loc, RHS.trim(), exp.indexOf(RHS, LHS.length)),
+ value: undefined,
+ key: undefined,
+ index: undefined
+ };
+ if (context.prefixIdentifiers) {
+ result.source = processExpression(result.source, context);
+ }
+ let valueContent = LHS.trim().replace(stripParensRE, '').trim();
+ const trimmedOffset = LHS.indexOf(valueContent);
+ const iteratorMatch = valueContent.match(forIteratorRE);
+ if (iteratorMatch) {
+ valueContent = valueContent.replace(forIteratorRE, '').trim();
+ const keyContent = iteratorMatch[1].trim();
+ let keyOffset;
+ if (keyContent) {
+ keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
+ result.key = createAliasExpression(loc, keyContent, keyOffset);
+ if (context.prefixIdentifiers) {
+ result.key = processExpression(result.key, context, true);
+ }
+ }
+ if (iteratorMatch[2]) {
+ const indexContent = iteratorMatch[2].trim();
+ if (indexContent) {
+ result.index = createAliasExpression(loc, indexContent, exp.indexOf(indexContent, result.key
+ ? keyOffset + keyContent.length
+ : trimmedOffset + valueContent.length));
+ if (context.prefixIdentifiers) {
+ result.index = processExpression(result.index, context, true);
+ }
+ }
+ }
+ }
+ if (valueContent) {
+ result.value = createAliasExpression(loc, valueContent, trimmedOffset);
+ if (context.prefixIdentifiers) {
+ result.value = processExpression(result.value, context, true);
+ }
+ }
+ return result;
+}
+function createAliasExpression(range, content, offset) {
+ return createSimpleExpression(content, false, getInnerRange(range, offset, content.length));
+}
+function createForLoopParams({ value, key, index }, memoArgs = []) {
+ return createParamsList([value, key, index, ...memoArgs]);
+}
+function createParamsList(args) {
+ let i = args.length;
+ while (i--) {
+ if (args[i])
+ break;
+ }
+ return args
+ .slice(0, i + 1)
+ .map((arg, i) => arg || createSimpleExpression(`_`.repeat(i + 1), false));
+}
+
+const defaultFallback = createSimpleExpression(`undefined`, false);
+// A NodeTransform that:
+// 1. Tracks scope identifiers for scoped slots so that they don't get prefixed
+// by transformExpression. This is only applied in non-browser builds with
+// { prefixIdentifiers: true }.
+// 2. Track v-slot depths so that we know a slot is inside another slot.
+// Note the exit callback is executed before buildSlots() on the same node,
+// so only nested slots see positive numbers.
+const trackSlotScopes = (node, context) => {
+ if (node.type === 1 /* ELEMENT */ &&
+ (node.tagType === 1 /* COMPONENT */ ||
+ node.tagType === 3 /* TEMPLATE */)) {
+ // We are only checking non-empty v-slot here
+ // since we only care about slots that introduce scope variables.
+ const vSlot = findDir(node, 'slot');
+ if (vSlot) {
+ const slotProps = vSlot.exp;
+ if (context.prefixIdentifiers) {
+ slotProps && context.addIdentifiers(slotProps);
+ }
+ context.scopes.vSlot++;
+ return () => {
+ if (context.prefixIdentifiers) {
+ slotProps && context.removeIdentifiers(slotProps);
+ }
+ context.scopes.vSlot--;
+ };
+ }
+ }
+};
+// A NodeTransform that tracks scope identifiers for scoped slots with v-for.
+// This transform is only applied in non-browser builds with { prefixIdentifiers: true }
+const trackVForSlotScopes = (node, context) => {
+ let vFor;
+ if (isTemplateNode(node) &&
+ node.props.some(isVSlot) &&
+ (vFor = findDir(node, 'for'))) {
+ const result = (vFor.parseResult = parseForExpression(vFor.exp, context));
+ if (result) {
+ const { value, key, index } = result;
+ const { addIdentifiers, removeIdentifiers } = context;
+ value && addIdentifiers(value);
+ key && addIdentifiers(key);
+ index && addIdentifiers(index);
+ return () => {
+ value && removeIdentifiers(value);
+ key && removeIdentifiers(key);
+ index && removeIdentifiers(index);
+ };
+ }
+ }
+};
+const buildClientSlotFn = (props, children, loc) => createFunctionExpression(props, children, false /* newline */, true /* isSlot */, children.length ? children[0].loc : loc);
+// Instead of being a DirectiveTransform, v-slot processing is called during
+// transformElement to build the slots object for a component.
+function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
+ context.helper(WITH_CTX);
+ const { children, loc } = node;
+ const slotsProperties = [];
+ const dynamicSlots = [];
+ // If the slot is inside a v-for or another v-slot, force it to be dynamic
+ // since it likely uses a scope variable.
+ let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
+ // with `prefixIdentifiers: true`, this can be further optimized to make
+ // it dynamic only when the slot actually uses the scope variables.
+ if (!context.ssr && context.prefixIdentifiers) {
+ hasDynamicSlots = hasScopeRef(node, context.identifiers);
+ }
+ // 1. Check for slot with slotProps on component itself.
+ //
+ const onComponentSlot = findDir(node, 'slot', true);
+ if (onComponentSlot) {
+ const { arg, exp } = onComponentSlot;
+ if (arg && !isStaticExp(arg)) {
+ hasDynamicSlots = true;
+ }
+ slotsProperties.push(createObjectProperty(arg || createSimpleExpression('default', true), buildSlotFn(exp, children, loc)));
+ }
+ // 2. Iterate through children and check for template slots
+ //
+ let hasTemplateSlots = false;
+ let hasNamedDefaultSlot = false;
+ const implicitDefaultChildren = [];
+ const seenSlotNames = new Set();
+ for (let i = 0; i < children.length; i++) {
+ const slotElement = children[i];
+ let slotDir;
+ if (!isTemplateNode(slotElement) ||
+ !(slotDir = findDir(slotElement, 'slot', true))) {
+ // not a , skip.
+ if (slotElement.type !== 3 /* COMMENT */) {
+ implicitDefaultChildren.push(slotElement);
+ }
+ continue;
+ }
+ if (onComponentSlot) {
+ // already has on-component slot - this is incorrect usage.
+ context.onError(createCompilerError(37 /* X_V_SLOT_MIXED_SLOT_USAGE */, slotDir.loc));
+ break;
+ }
+ hasTemplateSlots = true;
+ const { children: slotChildren, loc: slotLoc } = slotElement;
+ const { arg: slotName = createSimpleExpression(`default`, true), exp: slotProps, loc: dirLoc } = slotDir;
+ // check if name is dynamic.
+ let staticSlotName;
+ if (isStaticExp(slotName)) {
+ staticSlotName = slotName ? slotName.content : `default`;
+ }
+ else {
+ hasDynamicSlots = true;
+ }
+ const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
+ // check if this slot is conditional (v-if/v-for)
+ let vIf;
+ let vElse;
+ let vFor;
+ if ((vIf = findDir(slotElement, 'if'))) {
+ hasDynamicSlots = true;
+ dynamicSlots.push(createConditionalExpression(vIf.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback));
+ }
+ else if ((vElse = findDir(slotElement, /^else(-if)?$/, true /* allowEmpty */))) {
+ // find adjacent v-if
+ let j = i;
+ let prev;
+ while (j--) {
+ prev = children[j];
+ if (prev.type !== 3 /* COMMENT */) {
+ break;
+ }
+ }
+ if (prev && isTemplateNode(prev) && findDir(prev, 'if')) {
+ // remove node
+ children.splice(i, 1);
+ i--;
+ // attach this slot to previous conditional
+ let conditional = dynamicSlots[dynamicSlots.length - 1];
+ while (conditional.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
+ conditional = conditional.alternate;
+ }
+ conditional.alternate = vElse.exp
+ ? createConditionalExpression(vElse.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback)
+ : buildDynamicSlot(slotName, slotFunction);
+ }
+ else {
+ context.onError(createCompilerError(30 /* X_V_ELSE_NO_ADJACENT_IF */, vElse.loc));
+ }
+ }
+ else if ((vFor = findDir(slotElement, 'for'))) {
+ hasDynamicSlots = true;
+ const parseResult = vFor.parseResult ||
+ parseForExpression(vFor.exp, context);
+ if (parseResult) {
+ // Render the dynamic slots as an array and add it to the createSlot()
+ // args. The runtime knows how to handle it appropriately.
+ dynamicSlots.push(createCallExpression(context.helper(RENDER_LIST), [
+ parseResult.source,
+ createFunctionExpression(createForLoopParams(parseResult), buildDynamicSlot(slotName, slotFunction), true /* force newline */)
+ ]));
+ }
+ else {
+ context.onError(createCompilerError(32 /* X_V_FOR_MALFORMED_EXPRESSION */, vFor.loc));
+ }
+ }
+ else {
+ // check duplicate static names
+ if (staticSlotName) {
+ if (seenSlotNames.has(staticSlotName)) {
+ context.onError(createCompilerError(38 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */, dirLoc));
+ continue;
+ }
+ seenSlotNames.add(staticSlotName);
+ if (staticSlotName === 'default') {
+ hasNamedDefaultSlot = true;
+ }
+ }
+ slotsProperties.push(createObjectProperty(slotName, slotFunction));
+ }
+ }
+ if (!onComponentSlot) {
+ const buildDefaultSlotProperty = (props, children) => {
+ const fn = buildSlotFn(props, children, loc);
+ if (context.compatConfig) {
+ fn.isNonScopedSlot = true;
+ }
+ return createObjectProperty(`default`, fn);
+ };
+ if (!hasTemplateSlots) {
+ // implicit default slot (on component)
+ slotsProperties.push(buildDefaultSlotProperty(undefined, children));
+ }
+ else if (implicitDefaultChildren.length &&
+ // #3766
+ // with whitespace: 'preserve', whitespaces between slots will end up in
+ // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
+ implicitDefaultChildren.some(node => isNonWhitespaceContent(node))) {
+ // implicit default slot (mixed with named slots)
+ if (hasNamedDefaultSlot) {
+ context.onError(createCompilerError(39 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */, implicitDefaultChildren[0].loc));
+ }
+ else {
+ slotsProperties.push(buildDefaultSlotProperty(undefined, implicitDefaultChildren));
+ }
+ }
+ }
+ const slotFlag = hasDynamicSlots
+ ? 2 /* DYNAMIC */
+ : hasForwardedSlots(node.children)
+ ? 3 /* FORWARDED */
+ : 1 /* STABLE */;
+ let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`,
+ // 2 = compiled but dynamic = can skip normalization, but must run diff
+ // 1 = compiled and static = can skip normalization AND diff as optimized
+ createSimpleExpression(slotFlag + (` /* ${shared.slotFlagsText[slotFlag]} */` ), false))), loc);
+ if (dynamicSlots.length) {
+ slots = createCallExpression(context.helper(CREATE_SLOTS), [
+ slots,
+ createArrayExpression(dynamicSlots)
+ ]);
+ }
+ return {
+ slots,
+ hasDynamicSlots
+ };
+}
+function buildDynamicSlot(name, fn) {
+ return createObjectExpression([
+ createObjectProperty(`name`, name),
+ createObjectProperty(`fn`, fn)
+ ]);
+}
+function hasForwardedSlots(children) {
+ for (let i = 0; i < children.length; i++) {
+ const child = children[i];
+ switch (child.type) {
+ case 1 /* ELEMENT */:
+ if (child.tagType === 2 /* SLOT */ ||
+ hasForwardedSlots(child.children)) {
+ return true;
+ }
+ break;
+ case 9 /* IF */:
+ if (hasForwardedSlots(child.branches))
+ return true;
+ break;
+ case 10 /* IF_BRANCH */:
+ case 11 /* FOR */:
+ if (hasForwardedSlots(child.children))
+ return true;
+ break;
+ }
+ }
+ return false;
+}
+function isNonWhitespaceContent(node) {
+ if (node.type !== 2 /* TEXT */ && node.type !== 12 /* TEXT_CALL */)
+ return true;
+ return node.type === 2 /* TEXT */
+ ? !!node.content.trim()
+ : isNonWhitespaceContent(node.content);
+}
+
+// some directive transforms (e.g. v-model) may return a symbol for runtime
+// import, which should be used instead of a resolveDirective call.
+const directiveImportMap = new WeakMap();
+// generate a JavaScript AST for this element's codegen
+const transformElement = (node, context) => {
+ // perform the work on exit, after all child expressions have been
+ // processed and merged.
+ return function postTransformElement() {
+ node = context.currentNode;
+ if (!(node.type === 1 /* ELEMENT */ &&
+ (node.tagType === 0 /* ELEMENT */ ||
+ node.tagType === 1 /* COMPONENT */))) {
+ return;
+ }
+ const { tag, props } = node;
+ const isComponent = node.tagType === 1 /* COMPONENT */;
+ // The goal of the transform is to create a codegenNode implementing the
+ // VNodeCall interface.
+ let vnodeTag = isComponent
+ ? resolveComponentType(node, context)
+ : `"${tag}"`;
+ const isDynamicComponent = shared.isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
+ let vnodeProps;
+ let vnodeChildren;
+ let vnodePatchFlag;
+ let patchFlag = 0;
+ let vnodeDynamicProps;
+ let dynamicPropNames;
+ let vnodeDirectives;
+ let shouldUseBlock =
+ // dynamic component may resolve to plain elements
+ isDynamicComponent ||
+ vnodeTag === TELEPORT ||
+ vnodeTag === SUSPENSE ||
+ (!isComponent &&
+ // and must be forced into blocks so that block
+ // updates inside get proper isSVG flag at runtime. (#639, #643)
+ // This is technically web-specific, but splitting the logic out of core
+ // leads to too much unnecessary complexity.
+ (tag === 'svg' || tag === 'foreignObject'));
+ // props
+ if (props.length > 0) {
+ const propsBuildResult = buildProps(node, context);
+ vnodeProps = propsBuildResult.props;
+ patchFlag = propsBuildResult.patchFlag;
+ dynamicPropNames = propsBuildResult.dynamicPropNames;
+ const directives = propsBuildResult.directives;
+ vnodeDirectives =
+ directives && directives.length
+ ? createArrayExpression(directives.map(dir => buildDirectiveArgs(dir, context)))
+ : undefined;
+ if (propsBuildResult.shouldUseBlock) {
+ shouldUseBlock = true;
+ }
+ }
+ // children
+ if (node.children.length > 0) {
+ if (vnodeTag === KEEP_ALIVE) {
+ // Although a built-in component, we compile KeepAlive with raw children
+ // instead of slot functions so that it can be used inside Transition
+ // or other Transition-wrapping HOCs.
+ // To ensure correct updates with block optimizations, we need to:
+ // 1. Force keep-alive into a block. This avoids its children being
+ // collected by a parent block.
+ shouldUseBlock = true;
+ // 2. Force keep-alive to always be updated, since it uses raw children.
+ patchFlag |= 1024 /* DYNAMIC_SLOTS */;
+ if (node.children.length > 1) {
+ context.onError(createCompilerError(45 /* X_KEEP_ALIVE_INVALID_CHILDREN */, {
+ start: node.children[0].loc.start,
+ end: node.children[node.children.length - 1].loc.end,
+ source: ''
+ }));
+ }
+ }
+ const shouldBuildAsSlots = isComponent &&
+ // Teleport is not a real component and has dedicated runtime handling
+ vnodeTag !== TELEPORT &&
+ // explained above.
+ vnodeTag !== KEEP_ALIVE;
+ if (shouldBuildAsSlots) {
+ const { slots, hasDynamicSlots } = buildSlots(node, context);
+ vnodeChildren = slots;
+ if (hasDynamicSlots) {
+ patchFlag |= 1024 /* DYNAMIC_SLOTS */;
+ }
+ }
+ else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
+ const child = node.children[0];
+ const type = child.type;
+ // check for dynamic text children
+ const hasDynamicTextChild = type === 5 /* INTERPOLATION */ ||
+ type === 8 /* COMPOUND_EXPRESSION */;
+ if (hasDynamicTextChild &&
+ getConstantType(child, context) === 0 /* NOT_CONSTANT */) {
+ patchFlag |= 1 /* TEXT */;
+ }
+ // pass directly if the only child is a text node
+ // (plain / interpolation / expression)
+ if (hasDynamicTextChild || type === 2 /* TEXT */) {
+ vnodeChildren = child;
+ }
+ else {
+ vnodeChildren = node.children;
+ }
+ }
+ else {
+ vnodeChildren = node.children;
+ }
+ }
+ // patchFlag & dynamicPropNames
+ if (patchFlag !== 0) {
+ {
+ if (patchFlag < 0) {
+ // special flags (negative and mutually exclusive)
+ vnodePatchFlag = patchFlag + ` /* ${shared.PatchFlagNames[patchFlag]} */`;
+ }
+ else {
+ // bitwise flags
+ const flagNames = Object.keys(shared.PatchFlagNames)
+ .map(Number)
+ .filter(n => n > 0 && patchFlag & n)
+ .map(n => shared.PatchFlagNames[n])
+ .join(`, `);
+ vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;
+ }
+ }
+ if (dynamicPropNames && dynamicPropNames.length) {
+ vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
+ }
+ }
+ node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, vnodePatchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false /* disableTracking */, isComponent, node.loc);
+ };
+};
+function resolveComponentType(node, context, ssr = false) {
+ let { tag } = node;
+ // 1. dynamic component
+ const isExplicitDynamic = isComponentTag(tag);
+ const isProp = findProp(node, 'is');
+ if (isProp) {
+ if (isExplicitDynamic ||
+ (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context))) {
+ const exp = isProp.type === 6 /* ATTRIBUTE */
+ ? isProp.value && createSimpleExpression(isProp.value.content, true)
+ : isProp.exp;
+ if (exp) {
+ return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
+ exp
+ ]);
+ }
+ }
+ else if (isProp.type === 6 /* ATTRIBUTE */ &&
+ isProp.value.content.startsWith('vue:')) {
+ //
+ // if not , only is value that starts with "vue:" will be
+ // treated as component by the parse phase and reach here, unless it's
+ // compat mode where all is values are considered components
+ tag = isProp.value.content.slice(4);
+ }
+ }
+ // 1.5 v-is (TODO: Deprecate)
+ const isDir = !isExplicitDynamic && findDir(node, 'is');
+ if (isDir && isDir.exp) {
+ return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
+ isDir.exp
+ ]);
+ }
+ // 2. built-in components (Teleport, Transition, KeepAlive, Suspense...)
+ const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);
+ if (builtIn) {
+ // built-ins are simply fallthroughs / have special handling during ssr
+ // so we don't need to import their runtime equivalents
+ if (!ssr)
+ context.helper(builtIn);
+ return builtIn;
+ }
+ // 3. user component (from setup bindings)
+ // this is skipped in browser build since browser builds do not perform
+ // binding analysis.
+ {
+ const fromSetup = resolveSetupReference(tag, context);
+ if (fromSetup) {
+ return fromSetup;
+ }
+ const dotIndex = tag.indexOf('.');
+ if (dotIndex > 0) {
+ const ns = resolveSetupReference(tag.slice(0, dotIndex), context);
+ if (ns) {
+ return ns + tag.slice(dotIndex);
+ }
+ }
+ }
+ // 4. Self referencing component (inferred from filename)
+ if (context.selfName &&
+ shared.capitalize(shared.camelize(tag)) === context.selfName) {
+ context.helper(RESOLVE_COMPONENT);
+ // codegen.ts has special check for __self postfix when generating
+ // component imports, which will pass additional `maybeSelfReference` flag
+ // to `resolveComponent`.
+ context.components.add(tag + `__self`);
+ return toValidAssetId(tag, `component`);
+ }
+ // 5. user component (resolve)
+ context.helper(RESOLVE_COMPONENT);
+ context.components.add(tag);
+ return toValidAssetId(tag, `component`);
+}
+function resolveSetupReference(name, context) {
+ const bindings = context.bindingMetadata;
+ if (!bindings || bindings.__isScriptSetup === false) {
+ return;
+ }
+ const camelName = shared.camelize(name);
+ const PascalName = shared.capitalize(camelName);
+ const checkType = (type) => {
+ if (bindings[name] === type) {
+ return name;
+ }
+ if (bindings[camelName] === type) {
+ return camelName;
+ }
+ if (bindings[PascalName] === type) {
+ return PascalName;
+ }
+ };
+ const fromConst = checkType("setup-const" /* SETUP_CONST */);
+ if (fromConst) {
+ return context.inline
+ ? // in inline mode, const setup bindings (e.g. imports) can be used as-is
+ fromConst
+ : `$setup[${JSON.stringify(fromConst)}]`;
+ }
+ const fromMaybeRef = checkType("setup-let" /* SETUP_LET */) ||
+ checkType("setup-ref" /* SETUP_REF */) ||
+ checkType("setup-maybe-ref" /* SETUP_MAYBE_REF */);
+ if (fromMaybeRef) {
+ return context.inline
+ ? // setup scope bindings that may be refs need to be unrefed
+ `${context.helperString(UNREF)}(${fromMaybeRef})`
+ : `$setup[${JSON.stringify(fromMaybeRef)}]`;
+ }
+}
+function buildProps(node, context, props = node.props, ssr = false) {
+ const { tag, loc: elementLoc, children } = node;
+ const isComponent = node.tagType === 1 /* COMPONENT */;
+ let properties = [];
+ const mergeArgs = [];
+ const runtimeDirectives = [];
+ const hasChildren = children.length > 0;
+ let shouldUseBlock = false;
+ // patchFlag analysis
+ let patchFlag = 0;
+ let hasRef = false;
+ let hasClassBinding = false;
+ let hasStyleBinding = false;
+ let hasHydrationEventBinding = false;
+ let hasDynamicKeys = false;
+ let hasVnodeHook = false;
+ const dynamicPropNames = [];
+ const analyzePatchFlag = ({ key, value }) => {
+ if (isStaticExp(key)) {
+ const name = key.content;
+ const isEventHandler = shared.isOn(name);
+ if (!isComponent &&
+ isEventHandler &&
+ // omit the flag for click handlers because hydration gives click
+ // dedicated fast path.
+ name.toLowerCase() !== 'onclick' &&
+ // omit v-model handlers
+ name !== 'onUpdate:modelValue' &&
+ // omit onVnodeXXX hooks
+ !shared.isReservedProp(name)) {
+ hasHydrationEventBinding = true;
+ }
+ if (isEventHandler && shared.isReservedProp(name)) {
+ hasVnodeHook = true;
+ }
+ if (value.type === 20 /* JS_CACHE_EXPRESSION */ ||
+ ((value.type === 4 /* SIMPLE_EXPRESSION */ ||
+ value.type === 8 /* COMPOUND_EXPRESSION */) &&
+ getConstantType(value, context) > 0)) {
+ // skip if the prop is a cached handler or has constant value
+ return;
+ }
+ if (name === 'ref') {
+ hasRef = true;
+ }
+ else if (name === 'class') {
+ hasClassBinding = true;
+ }
+ else if (name === 'style') {
+ hasStyleBinding = true;
+ }
+ else if (name !== 'key' && !dynamicPropNames.includes(name)) {
+ dynamicPropNames.push(name);
+ }
+ // treat the dynamic class and style binding of the component as dynamic props
+ if (isComponent &&
+ (name === 'class' || name === 'style') &&
+ !dynamicPropNames.includes(name)) {
+ dynamicPropNames.push(name);
+ }
+ }
+ else {
+ hasDynamicKeys = true;
+ }
+ };
+ for (let i = 0; i < props.length; i++) {
+ // static attribute
+ const prop = props[i];
+ if (prop.type === 6 /* ATTRIBUTE */) {
+ const { loc, name, value } = prop;
+ let isStatic = true;
+ if (name === 'ref') {
+ hasRef = true;
+ if (context.scopes.vFor > 0) {
+ properties.push(createObjectProperty(createSimpleExpression('ref_for', true), createSimpleExpression('true')));
+ }
+ // in inline mode there is no setupState object, so we can't use string
+ // keys to set the ref. Instead, we need to transform it to pass the
+ // actual ref instead.
+ if (value &&
+ context.inline &&
+ context.bindingMetadata[value.content]) {
+ isStatic = false;
+ properties.push(createObjectProperty(createSimpleExpression('ref_key', true), createSimpleExpression(value.content, true, value.loc)));
+ }
+ }
+ // skip is on , or is="vue:xxx"
+ if (name === 'is' &&
+ (isComponentTag(tag) ||
+ (value && value.content.startsWith('vue:')) ||
+ (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context)))) {
+ continue;
+ }
+ properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
+ }
+ else {
+ // directives
+ const { name, arg, exp, loc } = prop;
+ const isVBind = name === 'bind';
+ const isVOn = name === 'on';
+ // skip v-slot - it is handled by its dedicated transform.
+ if (name === 'slot') {
+ if (!isComponent) {
+ context.onError(createCompilerError(40 /* X_V_SLOT_MISPLACED */, loc));
+ }
+ continue;
+ }
+ // skip v-once/v-memo - they are handled by dedicated transforms.
+ if (name === 'once' || name === 'memo') {
+ continue;
+ }
+ // skip v-is and :is on
+ if (name === 'is' ||
+ (isVBind &&
+ isStaticArgOf(arg, 'is') &&
+ (isComponentTag(tag) ||
+ (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context))))) {
+ continue;
+ }
+ // skip v-on in SSR compilation
+ if (isVOn && ssr) {
+ continue;
+ }
+ if (
+ // #938: elements with dynamic keys should be forced into blocks
+ (isVBind && isStaticArgOf(arg, 'key')) ||
+ // inline before-update hooks need to force block so that it is invoked
+ // before children
+ (isVOn && hasChildren && isStaticArgOf(arg, 'vue:before-update'))) {
+ shouldUseBlock = true;
+ }
+ if (isVBind && isStaticArgOf(arg, 'ref') && context.scopes.vFor > 0) {
+ properties.push(createObjectProperty(createSimpleExpression('ref_for', true), createSimpleExpression('true')));
+ }
+ // special case for v-bind and v-on with no argument
+ if (!arg && (isVBind || isVOn)) {
+ hasDynamicKeys = true;
+ if (exp) {
+ if (properties.length) {
+ mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
+ properties = [];
+ }
+ if (isVBind) {
+ {
+ // 2.x v-bind object order compat
+ {
+ const hasOverridableKeys = mergeArgs.some(arg => {
+ if (arg.type === 15 /* JS_OBJECT_EXPRESSION */) {
+ return arg.properties.some(({ key }) => {
+ if (key.type !== 4 /* SIMPLE_EXPRESSION */ ||
+ !key.isStatic) {
+ return true;
+ }
+ return (key.content !== 'class' &&
+ key.content !== 'style' &&
+ !shared.isOn(key.content));
+ });
+ }
+ else {
+ // dynamic expression
+ return true;
+ }
+ });
+ if (hasOverridableKeys) {
+ checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */, context, loc);
+ }
+ }
+ if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */, context)) {
+ mergeArgs.unshift(exp);
+ continue;
+ }
+ }
+ mergeArgs.push(exp);
+ }
+ else {
+ // v-on="obj" -> toHandlers(obj)
+ mergeArgs.push({
+ type: 14 /* JS_CALL_EXPRESSION */,
+ loc,
+ callee: context.helper(TO_HANDLERS),
+ arguments: [exp]
+ });
+ }
+ }
+ else {
+ context.onError(createCompilerError(isVBind
+ ? 34 /* X_V_BIND_NO_EXPRESSION */
+ : 35 /* X_V_ON_NO_EXPRESSION */, loc));
+ }
+ continue;
+ }
+ const directiveTransform = context.directiveTransforms[name];
+ if (directiveTransform) {
+ // has built-in directive transform.
+ const { props, needRuntime } = directiveTransform(prop, node, context);
+ !ssr && props.forEach(analyzePatchFlag);
+ properties.push(...props);
+ if (needRuntime) {
+ runtimeDirectives.push(prop);
+ if (shared.isSymbol(needRuntime)) {
+ directiveImportMap.set(prop, needRuntime);
+ }
+ }
+ }
+ else if (!shared.isBuiltInDirective(name)) {
+ // no built-in transform, this is a user custom directive.
+ runtimeDirectives.push(prop);
+ // custom dirs may use beforeUpdate so they need to force blocks
+ // to ensure before-update gets called before children update
+ if (hasChildren) {
+ shouldUseBlock = true;
+ }
+ }
+ }
+ }
+ let propsExpression = undefined;
+ // has v-bind="object" or v-on="object", wrap with mergeProps
+ if (mergeArgs.length) {
+ if (properties.length) {
+ mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
+ }
+ if (mergeArgs.length > 1) {
+ propsExpression = createCallExpression(context.helper(MERGE_PROPS), mergeArgs, elementLoc);
+ }
+ else {
+ // single v-bind with nothing else - no need for a mergeProps call
+ propsExpression = mergeArgs[0];
+ }
+ }
+ else if (properties.length) {
+ propsExpression = createObjectExpression(dedupeProperties(properties), elementLoc);
+ }
+ // patchFlag analysis
+ if (hasDynamicKeys) {
+ patchFlag |= 16 /* FULL_PROPS */;
+ }
+ else {
+ if (hasClassBinding && !isComponent) {
+ patchFlag |= 2 /* CLASS */;
+ }
+ if (hasStyleBinding && !isComponent) {
+ patchFlag |= 4 /* STYLE */;
+ }
+ if (dynamicPropNames.length) {
+ patchFlag |= 8 /* PROPS */;
+ }
+ if (hasHydrationEventBinding) {
+ patchFlag |= 32 /* HYDRATE_EVENTS */;
+ }
+ }
+ if (!shouldUseBlock &&
+ (patchFlag === 0 || patchFlag === 32 /* HYDRATE_EVENTS */) &&
+ (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
+ patchFlag |= 512 /* NEED_PATCH */;
+ }
+ // pre-normalize props, SSR is skipped for now
+ if (!context.inSSR && propsExpression) {
+ switch (propsExpression.type) {
+ case 15 /* JS_OBJECT_EXPRESSION */:
+ // means that there is no v-bind,
+ // but still need to deal with dynamic key binding
+ let classKeyIndex = -1;
+ let styleKeyIndex = -1;
+ let hasDynamicKey = false;
+ for (let i = 0; i < propsExpression.properties.length; i++) {
+ const key = propsExpression.properties[i].key;
+ if (isStaticExp(key)) {
+ if (key.content === 'class') {
+ classKeyIndex = i;
+ }
+ else if (key.content === 'style') {
+ styleKeyIndex = i;
+ }
+ }
+ else if (!key.isHandlerKey) {
+ hasDynamicKey = true;
+ }
+ }
+ const classProp = propsExpression.properties[classKeyIndex];
+ const styleProp = propsExpression.properties[styleKeyIndex];
+ // no dynamic key
+ if (!hasDynamicKey) {
+ if (classProp && !isStaticExp(classProp.value)) {
+ classProp.value = createCallExpression(context.helper(NORMALIZE_CLASS), [classProp.value]);
+ }
+ if (styleProp &&
+ !isStaticExp(styleProp.value) &&
+ // the static style is compiled into an object,
+ // so use `hasStyleBinding` to ensure that it is a dynamic style binding
+ (hasStyleBinding ||
+ // v-bind:style and style both exist,
+ // v-bind:style with static literal object
+ styleProp.value.type === 17 /* JS_ARRAY_EXPRESSION */)) {
+ styleProp.value = createCallExpression(context.helper(NORMALIZE_STYLE), [styleProp.value]);
+ }
+ }
+ else {
+ // dynamic key binding, wrap with `normalizeProps`
+ propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);
+ }
+ break;
+ case 14 /* JS_CALL_EXPRESSION */:
+ // mergeProps call, do nothing
+ break;
+ default:
+ // single v-bind
+ propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [
+ createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [
+ propsExpression
+ ])
+ ]);
+ break;
+ }
+ }
+ return {
+ props: propsExpression,
+ directives: runtimeDirectives,
+ patchFlag,
+ dynamicPropNames,
+ shouldUseBlock
+ };
+}
+// Dedupe props in an object literal.
+// Literal duplicated attributes would have been warned during the parse phase,
+// however, it's possible to encounter duplicated `onXXX` handlers with different
+// modifiers. We also need to merge static and dynamic class / style attributes.
+// - onXXX handlers / style: merge into array
+// - class: merge into single expression with concatenation
+function dedupeProperties(properties) {
+ const knownProps = new Map();
+ const deduped = [];
+ for (let i = 0; i < properties.length; i++) {
+ const prop = properties[i];
+ // dynamic keys are always allowed
+ if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {
+ deduped.push(prop);
+ continue;
+ }
+ const name = prop.key.content;
+ const existing = knownProps.get(name);
+ if (existing) {
+ if (name === 'style' || name === 'class' || shared.isOn(name)) {
+ mergeAsArray(existing, prop);
+ }
+ // unexpected duplicate, should have emitted error during parse
+ }
+ else {
+ knownProps.set(name, prop);
+ deduped.push(prop);
+ }
+ }
+ return deduped;
+}
+function mergeAsArray(existing, incoming) {
+ if (existing.value.type === 17 /* JS_ARRAY_EXPRESSION */) {
+ existing.value.elements.push(incoming.value);
+ }
+ else {
+ existing.value = createArrayExpression([existing.value, incoming.value], existing.loc);
+ }
+}
+function buildDirectiveArgs(dir, context) {
+ const dirArgs = [];
+ const runtime = directiveImportMap.get(dir);
+ if (runtime) {
+ // built-in directive with runtime
+ dirArgs.push(context.helperString(runtime));
+ }
+ else {
+ // user directive.
+ // see if we have directives exposed via
+```
+
+Using unpkg CDN:
+
+```html
+
+```
+
+## Example
+
+### note: CommonJS usage
+In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach:
+
+```js
+const axios = require('axios').default;
+
+// axios. will now provide autocomplete and parameter typings
+```
+
+Performing a `GET` request
+
+```js
+const axios = require('axios').default;
+
+// Make a request for a user with a given ID
+axios.get('/user?ID=12345')
+ .then(function (response) {
+ // handle success
+ console.log(response);
+ })
+ .catch(function (error) {
+ // handle error
+ console.log(error);
+ })
+ .then(function () {
+ // always executed
+ });
+
+// Optionally the request above could also be done as
+axios.get('/user', {
+ params: {
+ ID: 12345
+ }
+ })
+ .then(function (response) {
+ console.log(response);
+ })
+ .catch(function (error) {
+ console.log(error);
+ })
+ .then(function () {
+ // always executed
+ });
+
+// Want to use async/await? Add the `async` keyword to your outer function/method.
+async function getUser() {
+ try {
+ const response = await axios.get('/user?ID=12345');
+ console.log(response);
+ } catch (error) {
+ console.error(error);
+ }
+}
+```
+
+> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet
+> Explorer and older browsers, so use with caution.
+
+Performing a `POST` request
+
+```js
+axios.post('/user', {
+ firstName: 'Fred',
+ lastName: 'Flintstone'
+ })
+ .then(function (response) {
+ console.log(response);
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+```
+
+Performing multiple concurrent requests
+
+```js
+function getUserAccount() {
+ return axios.get('/user/12345');
+}
+
+function getUserPermissions() {
+ return axios.get('/user/12345/permissions');
+}
+
+Promise.all([getUserAccount(), getUserPermissions()])
+ .then(function (results) {
+ const acct = results[0];
+ const perm = results[1];
+ });
+```
+
+## axios API
+
+Requests can be made by passing the relevant config to `axios`.
+
+##### axios(config)
+
+```js
+// Send a POST request
+axios({
+ method: 'post',
+ url: '/user/12345',
+ data: {
+ firstName: 'Fred',
+ lastName: 'Flintstone'
+ }
+});
+```
+
+```js
+// GET request for remote image in node.js
+axios({
+ method: 'get',
+ url: 'http://bit.ly/2mTM3nY',
+ responseType: 'stream'
+})
+ .then(function (response) {
+ response.data.pipe(fs.createWriteStream('ada_lovelace.jpg'))
+ });
+```
+
+##### axios(url[, config])
+
+```js
+// Send a GET request (default method)
+axios('/user/12345');
+```
+
+### Request method aliases
+
+For convenience, aliases have been provided for all common request methods.
+
+##### axios.request(config)
+##### axios.get(url[, config])
+##### axios.delete(url[, config])
+##### axios.head(url[, config])
+##### axios.options(url[, config])
+##### axios.post(url[, data[, config]])
+##### axios.put(url[, data[, config]])
+##### axios.patch(url[, data[, config]])
+
+###### NOTE
+When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config.
+
+### Concurrency (Deprecated)
+Please use `Promise.all` to replace the below functions.
+
+Helper functions for dealing with concurrent requests.
+
+axios.all(iterable)
+axios.spread(callback)
+
+### Creating an instance
+
+You can create a new instance of axios with a custom config.
+
+##### axios.create([config])
+
+```js
+const instance = axios.create({
+ baseURL: 'https://some-domain.com/api/',
+ timeout: 1000,
+ headers: {'X-Custom-Header': 'foobar'}
+});
+```
+
+### Instance methods
+
+The available instance methods are listed below. The specified config will be merged with the instance config.
+
+##### axios#request(config)
+##### axios#get(url[, config])
+##### axios#delete(url[, config])
+##### axios#head(url[, config])
+##### axios#options(url[, config])
+##### axios#post(url[, data[, config]])
+##### axios#put(url[, data[, config]])
+##### axios#patch(url[, data[, config]])
+##### axios#getUri([config])
+
+## Request Config
+
+These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified.
+
+```js
+{
+ // `url` is the server URL that will be used for the request
+ url: '/user',
+
+ // `method` is the request method to be used when making the request
+ method: 'get', // default
+
+ // `baseURL` will be prepended to `url` unless `url` is absolute.
+ // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs
+ // to methods of that instance.
+ baseURL: 'https://some-domain.com/api/',
+
+ // `transformRequest` allows changes to the request data before it is sent to the server
+ // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE'
+ // The last function in the array must return a string or an instance of Buffer, ArrayBuffer,
+ // FormData or Stream
+ // You may modify the headers object.
+ transformRequest: [function (data, headers) {
+ // Do whatever you want to transform the data
+
+ return data;
+ }],
+
+ // `transformResponse` allows changes to the response data to be made before
+ // it is passed to then/catch
+ transformResponse: [function (data) {
+ // Do whatever you want to transform the data
+
+ return data;
+ }],
+
+ // `headers` are custom headers to be sent
+ headers: {'X-Requested-With': 'XMLHttpRequest'},
+
+ // `params` are the URL parameters to be sent with the request
+ // Must be a plain object or a URLSearchParams object
+ params: {
+ ID: 12345
+ },
+
+ // `paramsSerializer` is an optional function in charge of serializing `params`
+ // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/)
+ paramsSerializer: function (params) {
+ return Qs.stringify(params, {arrayFormat: 'brackets'})
+ },
+
+ // `data` is the data to be sent as the request body
+ // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH'
+ // When no `transformRequest` is set, must be of one of the following types:
+ // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams
+ // - Browser only: FormData, File, Blob
+ // - Node only: Stream, Buffer
+ data: {
+ firstName: 'Fred'
+ },
+
+ // syntax alternative to send data into the body
+ // method post
+ // only the value is sent, not the key
+ data: 'Country=Brasil&City=Belo Horizonte',
+
+ // `timeout` specifies the number of milliseconds before the request times out.
+ // If the request takes longer than `timeout`, the request will be aborted.
+ timeout: 1000, // default is `0` (no timeout)
+
+ // `withCredentials` indicates whether or not cross-site Access-Control requests
+ // should be made using credentials
+ withCredentials: false, // default
+
+ // `adapter` allows custom handling of requests which makes testing easier.
+ // Return a promise and supply a valid response (see lib/adapters/README.md).
+ adapter: function (config) {
+ /* ... */
+ },
+
+ // `auth` indicates that HTTP Basic auth should be used, and supplies credentials.
+ // This will set an `Authorization` header, overwriting any existing
+ // `Authorization` custom headers you have set using `headers`.
+ // Please note that only HTTP Basic auth is configurable through this parameter.
+ // For Bearer tokens and such, use `Authorization` custom headers instead.
+ auth: {
+ username: 'janedoe',
+ password: 's00pers3cret'
+ },
+
+ // `responseType` indicates the type of data that the server will respond with
+ // options are: 'arraybuffer', 'document', 'json', 'text', 'stream'
+ // browser only: 'blob'
+ responseType: 'json', // default
+
+ // `responseEncoding` indicates encoding to use for decoding responses (Node.js only)
+ // Note: Ignored for `responseType` of 'stream' or client-side requests
+ responseEncoding: 'utf8', // default
+
+ // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token
+ xsrfCookieName: 'XSRF-TOKEN', // default
+
+ // `xsrfHeaderName` is the name of the http header that carries the xsrf token value
+ xsrfHeaderName: 'X-XSRF-TOKEN', // default
+
+ // `onUploadProgress` allows handling of progress events for uploads
+ // browser only
+ onUploadProgress: function (progressEvent) {
+ // Do whatever you want with the native progress event
+ },
+
+ // `onDownloadProgress` allows handling of progress events for downloads
+ // browser only
+ onDownloadProgress: function (progressEvent) {
+ // Do whatever you want with the native progress event
+ },
+
+ // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js
+ maxContentLength: 2000,
+
+ // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed
+ maxBodyLength: 2000,
+
+ // `validateStatus` defines whether to resolve or reject the promise for a given
+ // HTTP response status code. If `validateStatus` returns `true` (or is set to `null`
+ // or `undefined`), the promise will be resolved; otherwise, the promise will be
+ // rejected.
+ validateStatus: function (status) {
+ return status >= 200 && status < 300; // default
+ },
+
+ // `maxRedirects` defines the maximum number of redirects to follow in node.js.
+ // If set to 0, no redirects will be followed.
+ maxRedirects: 21, // default
+
+ // `beforeRedirect` defines a function that will be called before redirect.
+ // Use this to adjust the request options upon redirecting,
+ // to inspect the latest response headers,
+ // or to cancel the request by throwing an error
+ // If maxRedirects is set to 0, `beforeRedirect` is not used.
+ beforeRedirect: (options, { headers }) => {
+ if (options.hostname === "example.com") {
+ options.auth = "user:password";
+ }
+ };
+
+ // `socketPath` defines a UNIX Socket to be used in node.js.
+ // e.g. '/var/run/docker.sock' to send requests to the docker daemon.
+ // Only either `socketPath` or `proxy` can be specified.
+ // If both are specified, `socketPath` is used.
+ socketPath: null, // default
+
+ // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http
+ // and https requests, respectively, in node.js. This allows options to be added like
+ // `keepAlive` that are not enabled by default.
+ httpAgent: new http.Agent({ keepAlive: true }),
+ httpsAgent: new https.Agent({ keepAlive: true }),
+
+ // `proxy` defines the hostname, port, and protocol of the proxy server.
+ // You can also define your proxy using the conventional `http_proxy` and
+ // `https_proxy` environment variables. If you are using environment variables
+ // for your proxy configuration, you can also define a `no_proxy` environment
+ // variable as a comma-separated list of domains that should not be proxied.
+ // Use `false` to disable proxies, ignoring environment variables.
+ // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and
+ // supplies credentials.
+ // This will set an `Proxy-Authorization` header, overwriting any existing
+ // `Proxy-Authorization` custom headers you have set using `headers`.
+ // If the proxy server uses HTTPS, then you must set the protocol to `https`.
+ proxy: {
+ protocol: 'https',
+ host: '127.0.0.1',
+ port: 9000,
+ auth: {
+ username: 'mikeymike',
+ password: 'rapunz3l'
+ }
+ },
+
+ // `cancelToken` specifies a cancel token that can be used to cancel the request
+ // (see Cancellation section below for details)
+ cancelToken: new CancelToken(function (cancel) {
+ }),
+
+ // an alternative way to cancel Axios requests using AbortController
+ signal: new AbortController().signal,
+
+ // `decompress` indicates whether or not the response body should be decompressed
+ // automatically. If set to `true` will also remove the 'content-encoding' header
+ // from the responses objects of all decompressed responses
+ // - Node only (XHR cannot turn off decompression)
+ decompress: true // default
+
+ // `insecureHTTPParser` boolean.
+ // Indicates where to use an insecure HTTP parser that accepts invalid HTTP headers.
+ // This may allow interoperability with non-conformant HTTP implementations.
+ // Using the insecure parser should be avoided.
+ // see options https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_http_request_url_options_callback
+ // see also https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/#strict-http-header-parsing-none
+ insecureHTTPParser: undefined // default
+
+ // transitional options for backward compatibility that may be removed in the newer versions
+ transitional: {
+ // silent JSON parsing mode
+ // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour)
+ // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json')
+ silentJSONParsing: true, // default value for the current Axios version
+
+ // try to parse the response string as JSON even if `responseType` is not 'json'
+ forcedJSONParsing: true,
+
+ // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts
+ clarifyTimeoutError: false,
+ },
+
+ env: {
+ // The FormData class to be used to automatically serialize the payload into a FormData object
+ FormData: window?.FormData || global?.FormData
+ }
+}
+```
+
+## Response Schema
+
+The response for a request contains the following information.
+
+```js
+{
+ // `data` is the response that was provided by the server
+ data: {},
+
+ // `status` is the HTTP status code from the server response
+ status: 200,
+
+ // `statusText` is the HTTP status message from the server response
+ statusText: 'OK',
+
+ // `headers` the HTTP headers that the server responded with
+ // All header names are lower cased and can be accessed using the bracket notation.
+ // Example: `response.headers['content-type']`
+ headers: {},
+
+ // `config` is the config that was provided to `axios` for the request
+ config: {},
+
+ // `request` is the request that generated this response
+ // It is the last ClientRequest instance in node.js (in redirects)
+ // and an XMLHttpRequest instance in the browser
+ request: {}
+}
+```
+
+When using `then`, you will receive the response as follows:
+
+```js
+axios.get('/user/12345')
+ .then(function (response) {
+ console.log(response.data);
+ console.log(response.status);
+ console.log(response.statusText);
+ console.log(response.headers);
+ console.log(response.config);
+ });
+```
+
+When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section.
+
+## Config Defaults
+
+You can specify config defaults that will be applied to every request.
+
+### Global axios defaults
+
+```js
+axios.defaults.baseURL = 'https://api.example.com';
+
+// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them.
+// See below for an example using Custom instance defaults instead.
+axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
+
+axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
+```
+
+### Custom instance defaults
+
+```js
+// Set config defaults when creating the instance
+const instance = axios.create({
+ baseURL: 'https://api.example.com'
+});
+
+// Alter defaults after instance has been created
+instance.defaults.headers.common['Authorization'] = AUTH_TOKEN;
+```
+
+### Config order of precedence
+
+Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example.
+
+```js
+// Create an instance using the config defaults provided by the library
+// At this point the timeout config value is `0` as is the default for the library
+const instance = axios.create();
+
+// Override timeout default for the library
+// Now all requests using this instance will wait 2.5 seconds before timing out
+instance.defaults.timeout = 2500;
+
+// Override timeout for this request as it's known to take a long time
+instance.get('/longRequest', {
+ timeout: 5000
+});
+```
+
+## Interceptors
+
+You can intercept requests or responses before they are handled by `then` or `catch`.
+
+```js
+// Add a request interceptor
+axios.interceptors.request.use(function (config) {
+ // Do something before request is sent
+ return config;
+ }, function (error) {
+ // Do something with request error
+ return Promise.reject(error);
+ });
+
+// Add a response interceptor
+axios.interceptors.response.use(function (response) {
+ // Any status code that lie within the range of 2xx cause this function to trigger
+ // Do something with response data
+ return response;
+ }, function (error) {
+ // Any status codes that falls outside the range of 2xx cause this function to trigger
+ // Do something with response error
+ return Promise.reject(error);
+ });
+```
+
+If you need to remove an interceptor later you can.
+
+```js
+const myInterceptor = axios.interceptors.request.use(function () {/*...*/});
+axios.interceptors.request.eject(myInterceptor);
+```
+
+You can add interceptors to a custom instance of axios.
+
+```js
+const instance = axios.create();
+instance.interceptors.request.use(function () {/*...*/});
+```
+
+When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay
+in the execution of your axios request when the main thread is blocked (a promise is created under the hood for
+the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag
+to the options object that will tell axios to run the code synchronously and avoid any delays in request execution.
+
+```js
+axios.interceptors.request.use(function (config) {
+ config.headers.test = 'I am only a header!';
+ return config;
+}, null, { synchronous: true });
+```
+
+If you want to execute a particular interceptor based on a runtime check,
+you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return
+of `runWhen` is `false`. The function will be called with the config
+object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an
+asynchronous request interceptor that only needs to run at certain times.
+
+```js
+function onGetCall(config) {
+ return config.method === 'get';
+}
+axios.interceptors.request.use(function (config) {
+ config.headers.test = 'special get headers';
+ return config;
+}, null, { runWhen: onGetCall });
+```
+
+### Multiple Interceptors
+
+Given you add multiple response interceptors
+and when the response was fulfilled
+- then each interceptor is executed
+- then they are executed in the order they were added
+- then only the last interceptor's result is returned
+- then every interceptor receives the result of it's predecessor
+- and when the fulfillment-interceptor throws
+ - then the following fulfillment-interceptor is not called
+ - then the following rejection-interceptor is called
+ - once caught, another following fulfill-interceptor is called again (just like in a promise chain).
+
+Read [the interceptor tests](./test/specs/interceptors.spec.js) for seeing all this in code.
+
+## Handling Errors
+
+```js
+axios.get('/user/12345')
+ .catch(function (error) {
+ if (error.response) {
+ // The request was made and the server responded with a status code
+ // that falls out of the range of 2xx
+ console.log(error.response.data);
+ console.log(error.response.status);
+ console.log(error.response.headers);
+ } else if (error.request) {
+ // The request was made but no response was received
+ // `error.request` is an instance of XMLHttpRequest in the browser and an instance of
+ // http.ClientRequest in node.js
+ console.log(error.request);
+ } else {
+ // Something happened in setting up the request that triggered an Error
+ console.log('Error', error.message);
+ }
+ console.log(error.config);
+ });
+```
+
+Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error.
+
+```js
+axios.get('/user/12345', {
+ validateStatus: function (status) {
+ return status < 500; // Resolve only if the status code is less than 500
+ }
+})
+```
+
+Using `toJSON` you get an object with more information about the HTTP error.
+
+```js
+axios.get('/user/12345')
+ .catch(function (error) {
+ console.log(error.toJSON());
+ });
+```
+
+## Cancellation
+
+### AbortController
+
+Starting from `v0.22.0` Axios supports AbortController to cancel requests in fetch API way:
+
+```js
+const controller = new AbortController();
+
+axios.get('/foo/bar', {
+ signal: controller.signal
+}).then(function(response) {
+ //...
+});
+// cancel the request
+controller.abort()
+```
+
+### CancelToken `👎deprecated`
+
+You can also cancel a request using a *CancelToken*.
+
+> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises).
+
+> This API is deprecated since v0.22.0 and shouldn't be used in new projects
+
+You can create a cancel token using the `CancelToken.source` factory as shown below:
+
+```js
+const CancelToken = axios.CancelToken;
+const source = CancelToken.source();
+
+axios.get('/user/12345', {
+ cancelToken: source.token
+}).catch(function (thrown) {
+ if (axios.isCancel(thrown)) {
+ console.log('Request canceled', thrown.message);
+ } else {
+ // handle error
+ }
+});
+
+axios.post('/user/12345', {
+ name: 'new name'
+}, {
+ cancelToken: source.token
+})
+
+// cancel the request (the message parameter is optional)
+source.cancel('Operation canceled by the user.');
+```
+
+You can also create a cancel token by passing an executor function to the `CancelToken` constructor:
+
+```js
+const CancelToken = axios.CancelToken;
+let cancel;
+
+axios.get('/user/12345', {
+ cancelToken: new CancelToken(function executor(c) {
+ // An executor function receives a cancel function as a parameter
+ cancel = c;
+ })
+});
+
+// cancel the request
+cancel();
+```
+
+> Note: you can cancel several requests with the same cancel token/abort controller.
+> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request.
+
+> During the transition period, you can use both cancellation APIs, even for the same request:
+
+## Using application/x-www-form-urlencoded format
+
+By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options.
+
+### Browser
+
+In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows:
+
+```js
+const params = new URLSearchParams();
+params.append('param1', 'value1');
+params.append('param2', 'value2');
+axios.post('/foo', params);
+```
+
+> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment).
+
+Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library:
+
+```js
+const qs = require('qs');
+axios.post('/foo', qs.stringify({ 'bar': 123 }));
+```
+
+Or in another way (ES6),
+
+```js
+import qs from 'qs';
+const data = { 'bar': 123 };
+const options = {
+ method: 'POST',
+ headers: { 'content-type': 'application/x-www-form-urlencoded' },
+ data: qs.stringify(data),
+ url,
+};
+axios(options);
+```
+
+### Node.js
+
+#### Query string
+
+In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows:
+
+```js
+const querystring = require('querystring');
+axios.post('http://something.com/', querystring.stringify({ foo: 'bar' }));
+```
+
+or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows:
+
+```js
+const url = require('url');
+const params = new url.URLSearchParams({ foo: 'bar' });
+axios.post('http://something.com/', params.toString());
+```
+
+You can also use the [`qs`](https://github.com/ljharb/qs) library.
+
+> NOTE:
+> The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has [known issues](https://github.com/nodejs/node-v0.x-archive/issues/1665) with that use case.
+
+#### Form data
+
+##### 🆕 Automatic serialization
+
+Starting from `v0.27.0`, Axios supports automatic object serialization to a FormData object if the request `Content-Type`
+header is set to `multipart/form-data`.
+
+The following request will submit the data in a FormData format (Browser & Node.js):
+
+```js
+import axios from 'axios';
+
+axios.post('https://httpbin.org/post', {x: 1}, {
+ headers: {
+ 'Content-Type': 'multipart/form-data'
+ }
+}).then(({data})=> console.log(data));
+```
+
+In the `node.js` build, the ([`form-data`](https://github.com/form-data/form-data)) polyfill is used by default.
+
+You can overload the FormData class by setting the `env.FormData` config variable,
+but you probably won't need it in most cases:
+
+```js
+const axios= require('axios');
+var FormData = require('form-data');
+
+axios.post('https://httpbin.org/post', {x: 1, buf: new Buffer(10)}, {
+ headers: {
+ 'Content-Type': 'multipart/form-data'
+ }
+}).then(({data})=> console.log(data));
+```
+
+Axios FormData serializer supports some special endings to perform the following operations:
+
+- `{}` - serialize the value with JSON.stringify
+- `[]` - unwrap the array like object as separate fields with the same key
+
+```js
+const axios= require('axios');
+
+axios.post('https://httpbin.org/post', {
+ 'myObj{}': {x: 1, s: "foo"},
+ 'files[]': document.querySelector('#fileInput').files
+}, {
+ headers: {
+ 'Content-Type': 'multipart/form-data'
+ }
+}).then(({data})=> console.log(data));
+```
+
+Axios supports the following shortcut methods: `postForm`, `putForm`, `patchForm`
+which are just the corresponding http methods with a header preset: `Content-Type`: `multipart/form-data`.
+
+FileList object can be passed directly:
+
+```js
+await axios.postForm('https://httpbin.org/post', document.querySelector('#fileInput').files)
+```
+
+All files will be sent with the same field names: `files[]`;
+
+##### Manual FormData passing
+
+In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows:
+
+```js
+const FormData = require('form-data');
+
+const form = new FormData();
+form.append('my_field', 'my value');
+form.append('my_buffer', new Buffer(10));
+form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
+
+axios.post('https://example.com', form)
+```
+
+## Semver
+
+Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes.
+
+## Promises
+
+axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises).
+If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise).
+
+## TypeScript
+
+axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors.
+
+```typescript
+let user: User = null;
+try {
+ const { data } = await axios.get('/user?ID=12345');
+ user = data.userDetails;
+} catch (error) {
+ if (axios.isAxiosError(error)) {
+ handleAxiosError(error);
+ } else {
+ handleUnexpectedError(error);
+ }
+}
+```
+
+## Online one-click setup
+
+You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online.
+
+[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js)
+
+
+## Resources
+
+* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
+* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md)
+* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md)
+* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md)
+* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md)
+
+## Credits
+
+axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [AngularJS](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of AngularJS.
+
+## License
+
+[MIT](LICENSE)
diff --git a/Fronts/node_modules/axios/SECURITY.md b/Fronts/node_modules/axios/SECURITY.md
new file mode 100644
index 0000000..353df9a
--- /dev/null
+++ b/Fronts/node_modules/axios/SECURITY.md
@@ -0,0 +1,5 @@
+# Security Policy
+
+## Reporting a Vulnerability
+
+Please report security issues to jasonsaayman@gmail.com
diff --git a/Fronts/node_modules/axios/UPGRADE_GUIDE.md b/Fronts/node_modules/axios/UPGRADE_GUIDE.md
new file mode 100644
index 0000000..fdcff1a
--- /dev/null
+++ b/Fronts/node_modules/axios/UPGRADE_GUIDE.md
@@ -0,0 +1,168 @@
+# Upgrade Guide
+
+### 0.18.x -> 0.19.0
+
+#### HTTPS Proxies
+
+Routing through an https proxy now requires setting the `protocol` attribute of the proxy configuration to `https`
+
+### 0.15.x -> 0.16.0
+
+#### `Promise` Type Declarations
+
+The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details.
+
+### 0.13.x -> 0.14.0
+
+#### TypeScript Definitions
+
+The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax.
+
+Please use the following `import` statement to import axios in TypeScript:
+
+```typescript
+import axios from 'axios';
+
+axios.get('/foo')
+ .then(response => console.log(response))
+ .catch(error => console.log(error));
+```
+
+#### `agent` Config Option
+
+The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead.
+
+```js
+{
+ // Define a custom agent for HTTP
+ httpAgent: new http.Agent({ keepAlive: true }),
+ // Define a custom agent for HTTPS
+ httpsAgent: new https.Agent({ keepAlive: true })
+}
+```
+
+#### `progress` Config Option
+
+The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options.
+
+```js
+{
+ // Define a handler for upload progress events
+ onUploadProgress: function (progressEvent) {
+ // ...
+ },
+
+ // Define a handler for download progress events
+ onDownloadProgress: function (progressEvent) {
+ // ...
+ }
+}
+```
+
+### 0.12.x -> 0.13.0
+
+The `0.13.0` release contains several changes to custom adapters and error handling.
+
+#### Error Handling
+
+Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response.
+
+```js
+axios.get('/user/12345')
+ .catch((error) => {
+ console.log(error.message);
+ console.log(error.code); // Not always specified
+ console.log(error.config); // The config that was used to make the request
+ console.log(error.response); // Only available if response was received from the server
+ });
+```
+
+#### Request Adapters
+
+This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter.
+
+1. Response transformer is now called outside of adapter.
+2. Request adapter returns a `Promise`.
+
+This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter.
+
+Previous code:
+
+```js
+function myAdapter(resolve, reject, config) {
+ var response = {
+ data: transformData(
+ responseData,
+ responseHeaders,
+ config.transformResponse
+ ),
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders
+ };
+ settle(resolve, reject, response);
+}
+```
+
+New code:
+
+```js
+function myAdapter(config) {
+ return new Promise(function (resolve, reject) {
+ var response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders
+ };
+ settle(resolve, reject, response);
+ });
+}
+```
+
+See the related commits for more details:
+- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e)
+- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a)
+
+### 0.5.x -> 0.6.0
+
+The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading.
+
+#### ES6 Promise Polyfill
+
+Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it.
+
+```js
+require('es6-promise').polyfill();
+var axios = require('axios');
+```
+
+This will polyfill the global environment, and only needs to be done once.
+
+#### `axios.success`/`axios.error`
+
+The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively.
+
+```js
+axios.get('some/url')
+ .then(function (res) {
+ /* ... */
+ })
+ .catch(function (err) {
+ /* ... */
+ });
+```
+
+#### UMD
+
+Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build.
+
+```js
+// AMD
+require(['bower_components/axios/dist/axios'], function (axios) {
+ /* ... */
+});
+
+// CommonJS
+var axios = require('axios/dist/axios');
+```
diff --git a/Fronts/node_modules/axios/dist/axios.js b/Fronts/node_modules/axios/dist/axios.js
new file mode 100644
index 0000000..7c0b76b
--- /dev/null
+++ b/Fronts/node_modules/axios/dist/axios.js
@@ -0,0 +1,2595 @@
+/* axios v0.27.2 | (c) 2022 by Matt Zabriskie */
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else if(typeof exports === 'object')
+ exports["axios"] = factory();
+ else
+ root["axios"] = factory();
+})(this, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = "./index.js");
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ "./index.js":
+/*!******************!*\
+ !*** ./index.js ***!
+ \******************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js");
+
+/***/ }),
+
+/***/ "./lib/adapters/xhr.js":
+/*!*****************************!*\
+ !*** ./lib/adapters/xhr.js ***!
+ \*****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
+var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js");
+var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js");
+var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js");
+var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js");
+var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js");
+var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js");
+var transitionalDefaults = __webpack_require__(/*! ../defaults/transitional */ "./lib/defaults/transitional.js");
+var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./lib/core/AxiosError.js");
+var CanceledError = __webpack_require__(/*! ../cancel/CanceledError */ "./lib/cancel/CanceledError.js");
+var parseProtocol = __webpack_require__(/*! ../helpers/parseProtocol */ "./lib/helpers/parseProtocol.js");
+
+module.exports = function xhrAdapter(config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ var requestData = config.data;
+ var requestHeaders = config.headers;
+ var responseType = config.responseType;
+ var onCanceled;
+ function done() {
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(onCanceled);
+ }
+
+ if (config.signal) {
+ config.signal.removeEventListener('abort', onCanceled);
+ }
+ }
+
+ if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
+ delete requestHeaders['Content-Type']; // Let the browser set it
+ }
+
+ var request = new XMLHttpRequest();
+
+ // HTTP basic authentication
+ if (config.auth) {
+ var username = config.auth.username || '';
+ var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
+ requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
+ }
+
+ var fullPath = buildFullPath(config.baseURL, config.url);
+
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
+
+ // Set the request timeout in MS
+ request.timeout = config.timeout;
+
+ function onloadend() {
+ if (!request) {
+ return;
+ }
+ // Prepare the response
+ var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
+ var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
+ request.responseText : request.response;
+ var response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config: config,
+ request: request
+ };
+
+ settle(function _resolve(value) {
+ resolve(value);
+ done();
+ }, function _reject(err) {
+ reject(err);
+ done();
+ }, response);
+
+ // Clean up request
+ request = null;
+ }
+
+ if ('onloadend' in request) {
+ // Use onloadend if available
+ request.onloadend = onloadend;
+ } else {
+ // Listen for ready state to emulate onloadend
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
+
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
+ return;
+ }
+ // readystate handler is calling before onerror or ontimeout handlers,
+ // so we should call onloadend on the next 'tick'
+ setTimeout(onloadend);
+ };
+ }
+
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
+
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle low level network errors
+ request.onerror = function handleError() {
+ // Real errors are hidden from us by the browser
+ // onerror should only fire if it's a network error
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
+ var transitional = config.transitional || transitionalDefaults;
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
+ }
+ reject(new AxiosError(
+ timeoutErrorMessage,
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
+ config,
+ request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
+ if (utils.isStandardBrowserEnv()) {
+ // Add xsrf header
+ var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
+ cookies.read(config.xsrfCookieName) :
+ undefined;
+
+ if (xsrfValue) {
+ requestHeaders[config.xsrfHeaderName] = xsrfValue;
+ }
+ }
+
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils.forEach(requestHeaders, function setRequestHeader(val, key) {
+ if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
+ // Remove Content-Type if data is undefined
+ delete requestHeaders[key];
+ } else {
+ // Otherwise add header to the request
+ request.setRequestHeader(key, val);
+ }
+ });
+ }
+
+ // Add withCredentials to request if needed
+ if (!utils.isUndefined(config.withCredentials)) {
+ request.withCredentials = !!config.withCredentials;
+ }
+
+ // Add responseType to request if needed
+ if (responseType && responseType !== 'json') {
+ request.responseType = config.responseType;
+ }
+
+ // Handle progress if needed
+ if (typeof config.onDownloadProgress === 'function') {
+ request.addEventListener('progress', config.onDownloadProgress);
+ }
+
+ // Not all browsers support upload events
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
+ request.upload.addEventListener('progress', config.onUploadProgress);
+ }
+
+ if (config.cancelToken || config.signal) {
+ // Handle cancellation
+ // eslint-disable-next-line func-names
+ onCanceled = function(cancel) {
+ if (!request) {
+ return;
+ }
+ reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
+ request.abort();
+ request = null;
+ };
+
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
+ if (config.signal) {
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
+ }
+ }
+
+ if (!requestData) {
+ requestData = null;
+ }
+
+ var protocol = parseProtocol(fullPath);
+
+ if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
+ return;
+ }
+
+
+ // Send the request
+ request.send(requestData);
+ });
+};
+
+
+/***/ }),
+
+/***/ "./lib/axios.js":
+/*!**********************!*\
+ !*** ./lib/axios.js ***!
+ \**********************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js");
+var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js");
+var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js");
+var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js");
+var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults/index.js");
+
+/**
+ * Create an instance of Axios
+ *
+ * @param {Object} defaultConfig The default config for the instance
+ * @return {Axios} A new instance of Axios
+ */
+function createInstance(defaultConfig) {
+ var context = new Axios(defaultConfig);
+ var instance = bind(Axios.prototype.request, context);
+
+ // Copy axios.prototype to instance
+ utils.extend(instance, Axios.prototype, context);
+
+ // Copy context to instance
+ utils.extend(instance, context);
+
+ // Factory for creating new instances
+ instance.create = function create(instanceConfig) {
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
+ };
+
+ return instance;
+}
+
+// Create the default instance to be exported
+var axios = createInstance(defaults);
+
+// Expose Axios class to allow class inheritance
+axios.Axios = Axios;
+
+// Expose Cancel & CancelToken
+axios.CanceledError = __webpack_require__(/*! ./cancel/CanceledError */ "./lib/cancel/CanceledError.js");
+axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js");
+axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js");
+axios.VERSION = __webpack_require__(/*! ./env/data */ "./lib/env/data.js").version;
+axios.toFormData = __webpack_require__(/*! ./helpers/toFormData */ "./lib/helpers/toFormData.js");
+
+// Expose AxiosError class
+axios.AxiosError = __webpack_require__(/*! ../lib/core/AxiosError */ "./lib/core/AxiosError.js");
+
+// alias for CanceledError for backward compatibility
+axios.Cancel = axios.CanceledError;
+
+// Expose all/spread
+axios.all = function all(promises) {
+ return Promise.all(promises);
+};
+axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js");
+
+// Expose isAxiosError
+axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js");
+
+module.exports = axios;
+
+// Allow use of default import syntax in TypeScript
+module.exports.default = axios;
+
+
+/***/ }),
+
+/***/ "./lib/cancel/CancelToken.js":
+/*!***********************************!*\
+ !*** ./lib/cancel/CancelToken.js ***!
+ \***********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var CanceledError = __webpack_require__(/*! ./CanceledError */ "./lib/cancel/CanceledError.js");
+
+/**
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
+ *
+ * @class
+ * @param {Function} executor The executor function.
+ */
+function CancelToken(executor) {
+ if (typeof executor !== 'function') {
+ throw new TypeError('executor must be a function.');
+ }
+
+ var resolvePromise;
+
+ this.promise = new Promise(function promiseExecutor(resolve) {
+ resolvePromise = resolve;
+ });
+
+ var token = this;
+
+ // eslint-disable-next-line func-names
+ this.promise.then(function(cancel) {
+ if (!token._listeners) return;
+
+ var i;
+ var l = token._listeners.length;
+
+ for (i = 0; i < l; i++) {
+ token._listeners[i](cancel);
+ }
+ token._listeners = null;
+ });
+
+ // eslint-disable-next-line func-names
+ this.promise.then = function(onfulfilled) {
+ var _resolve;
+ // eslint-disable-next-line func-names
+ var promise = new Promise(function(resolve) {
+ token.subscribe(resolve);
+ _resolve = resolve;
+ }).then(onfulfilled);
+
+ promise.cancel = function reject() {
+ token.unsubscribe(_resolve);
+ };
+
+ return promise;
+ };
+
+ executor(function cancel(message) {
+ if (token.reason) {
+ // Cancellation has already been requested
+ return;
+ }
+
+ token.reason = new CanceledError(message);
+ resolvePromise(token.reason);
+ });
+}
+
+/**
+ * Throws a `CanceledError` if cancellation has been requested.
+ */
+CancelToken.prototype.throwIfRequested = function throwIfRequested() {
+ if (this.reason) {
+ throw this.reason;
+ }
+};
+
+/**
+ * Subscribe to the cancel signal
+ */
+
+CancelToken.prototype.subscribe = function subscribe(listener) {
+ if (this.reason) {
+ listener(this.reason);
+ return;
+ }
+
+ if (this._listeners) {
+ this._listeners.push(listener);
+ } else {
+ this._listeners = [listener];
+ }
+};
+
+/**
+ * Unsubscribe from the cancel signal
+ */
+
+CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
+ if (!this._listeners) {
+ return;
+ }
+ var index = this._listeners.indexOf(listener);
+ if (index !== -1) {
+ this._listeners.splice(index, 1);
+ }
+};
+
+/**
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
+ * cancels the `CancelToken`.
+ */
+CancelToken.source = function source() {
+ var cancel;
+ var token = new CancelToken(function executor(c) {
+ cancel = c;
+ });
+ return {
+ token: token,
+ cancel: cancel
+ };
+};
+
+module.exports = CancelToken;
+
+
+/***/ }),
+
+/***/ "./lib/cancel/CanceledError.js":
+/*!*************************************!*\
+ !*** ./lib/cancel/CanceledError.js ***!
+ \*************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./lib/core/AxiosError.js");
+var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js");
+
+/**
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
+ *
+ * @class
+ * @param {string=} message The message.
+ */
+function CanceledError(message) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);
+ this.name = 'CanceledError';
+}
+
+utils.inherits(CanceledError, AxiosError, {
+ __CANCEL__: true
+});
+
+module.exports = CanceledError;
+
+
+/***/ }),
+
+/***/ "./lib/cancel/isCancel.js":
+/*!********************************!*\
+ !*** ./lib/cancel/isCancel.js ***!
+ \********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+module.exports = function isCancel(value) {
+ return !!(value && value.__CANCEL__);
+};
+
+
+/***/ }),
+
+/***/ "./lib/core/Axios.js":
+/*!***************************!*\
+ !*** ./lib/core/Axios.js ***!
+ \***************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
+var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js");
+var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js");
+var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js");
+var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js");
+var buildFullPath = __webpack_require__(/*! ./buildFullPath */ "./lib/core/buildFullPath.js");
+var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js");
+
+var validators = validator.validators;
+/**
+ * Create a new instance of Axios
+ *
+ * @param {Object} instanceConfig The default config for the instance
+ */
+function Axios(instanceConfig) {
+ this.defaults = instanceConfig;
+ this.interceptors = {
+ request: new InterceptorManager(),
+ response: new InterceptorManager()
+ };
+}
+
+/**
+ * Dispatch a request
+ *
+ * @param {Object} config The config specific for this request (merged with this.defaults)
+ */
+Axios.prototype.request = function request(configOrUrl, config) {
+ /*eslint no-param-reassign:0*/
+ // Allow for axios('example/url'[, config]) a la fetch API
+ if (typeof configOrUrl === 'string') {
+ config = config || {};
+ config.url = configOrUrl;
+ } else {
+ config = configOrUrl || {};
+ }
+
+ config = mergeConfig(this.defaults, config);
+
+ // Set config.method
+ if (config.method) {
+ config.method = config.method.toLowerCase();
+ } else if (this.defaults.method) {
+ config.method = this.defaults.method.toLowerCase();
+ } else {
+ config.method = 'get';
+ }
+
+ var transitional = config.transitional;
+
+ if (transitional !== undefined) {
+ validator.assertOptions(transitional, {
+ silentJSONParsing: validators.transitional(validators.boolean),
+ forcedJSONParsing: validators.transitional(validators.boolean),
+ clarifyTimeoutError: validators.transitional(validators.boolean)
+ }, false);
+ }
+
+ // filter out skipped interceptors
+ var requestInterceptorChain = [];
+ var synchronousRequestInterceptors = true;
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
+ return;
+ }
+
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
+
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ var responseInterceptorChain = [];
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ var promise;
+
+ if (!synchronousRequestInterceptors) {
+ var chain = [dispatchRequest, undefined];
+
+ Array.prototype.unshift.apply(chain, requestInterceptorChain);
+ chain = chain.concat(responseInterceptorChain);
+
+ promise = Promise.resolve(config);
+ while (chain.length) {
+ promise = promise.then(chain.shift(), chain.shift());
+ }
+
+ return promise;
+ }
+
+
+ var newConfig = config;
+ while (requestInterceptorChain.length) {
+ var onFulfilled = requestInterceptorChain.shift();
+ var onRejected = requestInterceptorChain.shift();
+ try {
+ newConfig = onFulfilled(newConfig);
+ } catch (error) {
+ onRejected(error);
+ break;
+ }
+ }
+
+ try {
+ promise = dispatchRequest(newConfig);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ while (responseInterceptorChain.length) {
+ promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
+ }
+
+ return promise;
+};
+
+Axios.prototype.getUri = function getUri(config) {
+ config = mergeConfig(this.defaults, config);
+ var fullPath = buildFullPath(config.baseURL, config.url);
+ return buildURL(fullPath, config.params, config.paramsSerializer);
+};
+
+// Provide aliases for supported request methods
+utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function(url, config) {
+ return this.request(mergeConfig(config || {}, {
+ method: method,
+ url: url,
+ data: (config || {}).data
+ }));
+ };
+});
+
+utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ /*eslint func-names:0*/
+
+ function generateHTTPMethod(isForm) {
+ return function httpMethod(url, data, config) {
+ return this.request(mergeConfig(config || {}, {
+ method: method,
+ headers: isForm ? {
+ 'Content-Type': 'multipart/form-data'
+ } : {},
+ url: url,
+ data: data
+ }));
+ };
+ }
+
+ Axios.prototype[method] = generateHTTPMethod();
+
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
+});
+
+module.exports = Axios;
+
+
+/***/ }),
+
+/***/ "./lib/core/AxiosError.js":
+/*!********************************!*\
+ !*** ./lib/core/AxiosError.js ***!
+ \********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js");
+
+/**
+ * Create an Error with the specified message, config, error code, request and response.
+ *
+ * @param {string} message The error message.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [config] The config.
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ * @returns {Error} The created error.
+ */
+function AxiosError(message, code, config, request, response) {
+ Error.call(this);
+ this.message = message;
+ this.name = 'AxiosError';
+ code && (this.code = code);
+ config && (this.config = config);
+ request && (this.request = request);
+ response && (this.response = response);
+}
+
+utils.inherits(AxiosError, Error, {
+ toJSON: function toJSON() {
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: this.config,
+ code: this.code,
+ status: this.response && this.response.status ? this.response.status : null
+ };
+ }
+});
+
+var prototype = AxiosError.prototype;
+var descriptors = {};
+
+[
+ 'ERR_BAD_OPTION_VALUE',
+ 'ERR_BAD_OPTION',
+ 'ECONNABORTED',
+ 'ETIMEDOUT',
+ 'ERR_NETWORK',
+ 'ERR_FR_TOO_MANY_REDIRECTS',
+ 'ERR_DEPRECATED',
+ 'ERR_BAD_RESPONSE',
+ 'ERR_BAD_REQUEST',
+ 'ERR_CANCELED'
+// eslint-disable-next-line func-names
+].forEach(function(code) {
+ descriptors[code] = {value: code};
+});
+
+Object.defineProperties(AxiosError, descriptors);
+Object.defineProperty(prototype, 'isAxiosError', {value: true});
+
+// eslint-disable-next-line func-names
+AxiosError.from = function(error, code, config, request, response, customProps) {
+ var axiosError = Object.create(prototype);
+
+ utils.toFlatObject(error, axiosError, function filter(obj) {
+ return obj !== Error.prototype;
+ });
+
+ AxiosError.call(axiosError, error.message, code, config, request, response);
+
+ axiosError.name = error.name;
+
+ customProps && Object.assign(axiosError, customProps);
+
+ return axiosError;
+};
+
+module.exports = AxiosError;
+
+
+/***/ }),
+
+/***/ "./lib/core/InterceptorManager.js":
+/*!****************************************!*\
+ !*** ./lib/core/InterceptorManager.js ***!
+ \****************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
+
+function InterceptorManager() {
+ this.handlers = [];
+}
+
+/**
+ * Add a new interceptor to the stack
+ *
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
+ *
+ * @return {Number} An ID used to remove interceptor later
+ */
+InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
+ this.handlers.push({
+ fulfilled: fulfilled,
+ rejected: rejected,
+ synchronous: options ? options.synchronous : false,
+ runWhen: options ? options.runWhen : null
+ });
+ return this.handlers.length - 1;
+};
+
+/**
+ * Remove an interceptor from the stack
+ *
+ * @param {Number} id The ID that was returned by `use`
+ */
+InterceptorManager.prototype.eject = function eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
+ }
+};
+
+/**
+ * Iterate over all the registered interceptors
+ *
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
+ */
+InterceptorManager.prototype.forEach = function forEach(fn) {
+ utils.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+};
+
+module.exports = InterceptorManager;
+
+
+/***/ }),
+
+/***/ "./lib/core/buildFullPath.js":
+/*!***********************************!*\
+ !*** ./lib/core/buildFullPath.js ***!
+ \***********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js");
+var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js");
+
+/**
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ * @returns {string} The combined full path
+ */
+module.exports = function buildFullPath(baseURL, requestedURL) {
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+};
+
+
+/***/ }),
+
+/***/ "./lib/core/dispatchRequest.js":
+/*!*************************************!*\
+ !*** ./lib/core/dispatchRequest.js ***!
+ \*************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
+var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js");
+var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js");
+var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults/index.js");
+var CanceledError = __webpack_require__(/*! ../cancel/CanceledError */ "./lib/cancel/CanceledError.js");
+
+/**
+ * Throws a `CanceledError` if cancellation has been requested.
+ */
+function throwIfCancellationRequested(config) {
+ if (config.cancelToken) {
+ config.cancelToken.throwIfRequested();
+ }
+
+ if (config.signal && config.signal.aborted) {
+ throw new CanceledError();
+ }
+}
+
+/**
+ * Dispatch a request to the server using the configured adapter.
+ *
+ * @param {object} config The config that is to be used for the request
+ * @returns {Promise} The Promise to be fulfilled
+ */
+module.exports = function dispatchRequest(config) {
+ throwIfCancellationRequested(config);
+
+ // Ensure headers exist
+ config.headers = config.headers || {};
+
+ // Transform request data
+ config.data = transformData.call(
+ config,
+ config.data,
+ config.headers,
+ config.transformRequest
+ );
+
+ // Flatten headers
+ config.headers = utils.merge(
+ config.headers.common || {},
+ config.headers[config.method] || {},
+ config.headers
+ );
+
+ utils.forEach(
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
+ function cleanHeaderConfig(method) {
+ delete config.headers[method];
+ }
+ );
+
+ var adapter = config.adapter || defaults.adapter;
+
+ return adapter(config).then(function onAdapterResolution(response) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ response.data = transformData.call(
+ config,
+ response.data,
+ response.headers,
+ config.transformResponse
+ );
+
+ return response;
+ }, function onAdapterRejection(reason) {
+ if (!isCancel(reason)) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ if (reason && reason.response) {
+ reason.response.data = transformData.call(
+ config,
+ reason.response.data,
+ reason.response.headers,
+ config.transformResponse
+ );
+ }
+ }
+
+ return Promise.reject(reason);
+ });
+};
+
+
+/***/ }),
+
+/***/ "./lib/core/mergeConfig.js":
+/*!*********************************!*\
+ !*** ./lib/core/mergeConfig.js ***!
+ \*********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js");
+
+/**
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
+ *
+ * @param {Object} config1
+ * @param {Object} config2
+ * @returns {Object} New object resulting from merging config2 to config1
+ */
+module.exports = function mergeConfig(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config2 = config2 || {};
+ var config = {};
+
+ function getMergedValue(target, source) {
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
+ return utils.merge(target, source);
+ } else if (utils.isPlainObject(source)) {
+ return utils.merge({}, source);
+ } else if (utils.isArray(source)) {
+ return source.slice();
+ }
+ return source;
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDeepProperties(prop) {
+ if (!utils.isUndefined(config2[prop])) {
+ return getMergedValue(config1[prop], config2[prop]);
+ } else if (!utils.isUndefined(config1[prop])) {
+ return getMergedValue(undefined, config1[prop]);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function valueFromConfig2(prop) {
+ if (!utils.isUndefined(config2[prop])) {
+ return getMergedValue(undefined, config2[prop]);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function defaultToConfig2(prop) {
+ if (!utils.isUndefined(config2[prop])) {
+ return getMergedValue(undefined, config2[prop]);
+ } else if (!utils.isUndefined(config1[prop])) {
+ return getMergedValue(undefined, config1[prop]);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDirectKeys(prop) {
+ if (prop in config2) {
+ return getMergedValue(config1[prop], config2[prop]);
+ } else if (prop in config1) {
+ return getMergedValue(undefined, config1[prop]);
+ }
+ }
+
+ var mergeMap = {
+ 'url': valueFromConfig2,
+ 'method': valueFromConfig2,
+ 'data': valueFromConfig2,
+ 'baseURL': defaultToConfig2,
+ 'transformRequest': defaultToConfig2,
+ 'transformResponse': defaultToConfig2,
+ 'paramsSerializer': defaultToConfig2,
+ 'timeout': defaultToConfig2,
+ 'timeoutMessage': defaultToConfig2,
+ 'withCredentials': defaultToConfig2,
+ 'adapter': defaultToConfig2,
+ 'responseType': defaultToConfig2,
+ 'xsrfCookieName': defaultToConfig2,
+ 'xsrfHeaderName': defaultToConfig2,
+ 'onUploadProgress': defaultToConfig2,
+ 'onDownloadProgress': defaultToConfig2,
+ 'decompress': defaultToConfig2,
+ 'maxContentLength': defaultToConfig2,
+ 'maxBodyLength': defaultToConfig2,
+ 'beforeRedirect': defaultToConfig2,
+ 'transport': defaultToConfig2,
+ 'httpAgent': defaultToConfig2,
+ 'httpsAgent': defaultToConfig2,
+ 'cancelToken': defaultToConfig2,
+ 'socketPath': defaultToConfig2,
+ 'responseEncoding': defaultToConfig2,
+ 'validateStatus': mergeDirectKeys
+ };
+
+ utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
+ var merge = mergeMap[prop] || mergeDeepProperties;
+ var configValue = merge(prop);
+ (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
+ });
+
+ return config;
+};
+
+
+/***/ }),
+
+/***/ "./lib/core/settle.js":
+/*!****************************!*\
+ !*** ./lib/core/settle.js ***!
+ \****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var AxiosError = __webpack_require__(/*! ./AxiosError */ "./lib/core/AxiosError.js");
+
+/**
+ * Resolve or reject a Promise based on response status.
+ *
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
+ */
+module.exports = function settle(resolve, reject, response) {
+ var validateStatus = response.config.validateStatus;
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(new AxiosError(
+ 'Request failed with status code ' + response.status,
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
+ response.config,
+ response.request,
+ response
+ ));
+ }
+};
+
+
+/***/ }),
+
+/***/ "./lib/core/transformData.js":
+/*!***********************************!*\
+ !*** ./lib/core/transformData.js ***!
+ \***********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
+var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults/index.js");
+
+/**
+ * Transform the data for a request or a response
+ *
+ * @param {Object|String} data The data to be transformed
+ * @param {Array} headers The headers for the request or response
+ * @param {Array|Function} fns A single function or Array of functions
+ * @returns {*} The resulting transformed data
+ */
+module.exports = function transformData(data, headers, fns) {
+ var context = this || defaults;
+ /*eslint no-param-reassign:0*/
+ utils.forEach(fns, function transform(fn) {
+ data = fn.call(context, data, headers);
+ });
+
+ return data;
+};
+
+
+/***/ }),
+
+/***/ "./lib/defaults/index.js":
+/*!*******************************!*\
+ !*** ./lib/defaults/index.js ***!
+ \*******************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js");
+var normalizeHeaderName = __webpack_require__(/*! ../helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js");
+var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./lib/core/AxiosError.js");
+var transitionalDefaults = __webpack_require__(/*! ./transitional */ "./lib/defaults/transitional.js");
+var toFormData = __webpack_require__(/*! ../helpers/toFormData */ "./lib/helpers/toFormData.js");
+
+var DEFAULT_CONTENT_TYPE = {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+};
+
+function setContentTypeIfUnset(headers, value) {
+ if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
+ headers['Content-Type'] = value;
+ }
+}
+
+function getDefaultAdapter() {
+ var adapter;
+ if (typeof XMLHttpRequest !== 'undefined') {
+ // For browsers use XHR adapter
+ adapter = __webpack_require__(/*! ../adapters/xhr */ "./lib/adapters/xhr.js");
+ } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
+ // For node use HTTP adapter
+ adapter = __webpack_require__(/*! ../adapters/http */ "./lib/adapters/xhr.js");
+ }
+ return adapter;
+}
+
+function stringifySafely(rawValue, parser, encoder) {
+ if (utils.isString(rawValue)) {
+ try {
+ (parser || JSON.parse)(rawValue);
+ return utils.trim(rawValue);
+ } catch (e) {
+ if (e.name !== 'SyntaxError') {
+ throw e;
+ }
+ }
+ }
+
+ return (encoder || JSON.stringify)(rawValue);
+}
+
+var defaults = {
+
+ transitional: transitionalDefaults,
+
+ adapter: getDefaultAdapter(),
+
+ transformRequest: [function transformRequest(data, headers) {
+ normalizeHeaderName(headers, 'Accept');
+ normalizeHeaderName(headers, 'Content-Type');
+
+ if (utils.isFormData(data) ||
+ utils.isArrayBuffer(data) ||
+ utils.isBuffer(data) ||
+ utils.isStream(data) ||
+ utils.isFile(data) ||
+ utils.isBlob(data)
+ ) {
+ return data;
+ }
+ if (utils.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils.isURLSearchParams(data)) {
+ setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
+ return data.toString();
+ }
+
+ var isObjectPayload = utils.isObject(data);
+ var contentType = headers && headers['Content-Type'];
+
+ var isFileList;
+
+ if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {
+ var _FormData = this.env && this.env.FormData;
+ return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());
+ } else if (isObjectPayload || contentType === 'application/json') {
+ setContentTypeIfUnset(headers, 'application/json');
+ return stringifySafely(data);
+ }
+
+ return data;
+ }],
+
+ transformResponse: [function transformResponse(data) {
+ var transitional = this.transitional || defaults.transitional;
+ var silentJSONParsing = transitional && transitional.silentJSONParsing;
+ var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+ var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
+
+ if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
+ try {
+ return JSON.parse(data);
+ } catch (e) {
+ if (strictJSONParsing) {
+ if (e.name === 'SyntaxError') {
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
+ }
+ throw e;
+ }
+ }
+ }
+
+ return data;
+ }],
+
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
+
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
+
+ maxContentLength: -1,
+ maxBodyLength: -1,
+
+ env: {
+ FormData: __webpack_require__(/*! ./env/FormData */ "./lib/helpers/null.js")
+ },
+
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ },
+
+ headers: {
+ common: {
+ 'Accept': 'application/json, text/plain, */*'
+ }
+ }
+};
+
+utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
+ defaults.headers[method] = {};
+});
+
+utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
+});
+
+module.exports = defaults;
+
+
+/***/ }),
+
+/***/ "./lib/defaults/transitional.js":
+/*!**************************************!*\
+ !*** ./lib/defaults/transitional.js ***!
+ \**************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+module.exports = {
+ silentJSONParsing: true,
+ forcedJSONParsing: true,
+ clarifyTimeoutError: false
+};
+
+
+/***/ }),
+
+/***/ "./lib/env/data.js":
+/*!*************************!*\
+ !*** ./lib/env/data.js ***!
+ \*************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
+
+module.exports = {
+ "version": "0.27.2"
+};
+
+/***/ }),
+
+/***/ "./lib/helpers/bind.js":
+/*!*****************************!*\
+ !*** ./lib/helpers/bind.js ***!
+ \*****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+module.exports = function bind(fn, thisArg) {
+ return function wrap() {
+ var args = new Array(arguments.length);
+ for (var i = 0; i < args.length; i++) {
+ args[i] = arguments[i];
+ }
+ return fn.apply(thisArg, args);
+ };
+};
+
+
+/***/ }),
+
+/***/ "./lib/helpers/buildURL.js":
+/*!*********************************!*\
+ !*** ./lib/helpers/buildURL.js ***!
+ \*********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
+
+function encode(val) {
+ return encodeURIComponent(val).
+ replace(/%3A/gi, ':').
+ replace(/%24/g, '$').
+ replace(/%2C/gi, ',').
+ replace(/%20/g, '+').
+ replace(/%5B/gi, '[').
+ replace(/%5D/gi, ']');
+}
+
+/**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @returns {string} The formatted url
+ */
+module.exports = function buildURL(url, params, paramsSerializer) {
+ /*eslint no-param-reassign:0*/
+ if (!params) {
+ return url;
+ }
+
+ var serializedParams;
+ if (paramsSerializer) {
+ serializedParams = paramsSerializer(params);
+ } else if (utils.isURLSearchParams(params)) {
+ serializedParams = params.toString();
+ } else {
+ var parts = [];
+
+ utils.forEach(params, function serialize(val, key) {
+ if (val === null || typeof val === 'undefined') {
+ return;
+ }
+
+ if (utils.isArray(val)) {
+ key = key + '[]';
+ } else {
+ val = [val];
+ }
+
+ utils.forEach(val, function parseValue(v) {
+ if (utils.isDate(v)) {
+ v = v.toISOString();
+ } else if (utils.isObject(v)) {
+ v = JSON.stringify(v);
+ }
+ parts.push(encode(key) + '=' + encode(v));
+ });
+ });
+
+ serializedParams = parts.join('&');
+ }
+
+ if (serializedParams) {
+ var hashmarkIndex = url.indexOf('#');
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
+
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
+
+ return url;
+};
+
+
+/***/ }),
+
+/***/ "./lib/helpers/combineURLs.js":
+/*!************************************!*\
+ !*** ./lib/helpers/combineURLs.js ***!
+ \************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ * @returns {string} The combined URL
+ */
+module.exports = function combineURLs(baseURL, relativeURL) {
+ return relativeURL
+ ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
+ : baseURL;
+};
+
+
+/***/ }),
+
+/***/ "./lib/helpers/cookies.js":
+/*!********************************!*\
+ !*** ./lib/helpers/cookies.js ***!
+ \********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
+
+module.exports = (
+ utils.isStandardBrowserEnv() ?
+
+ // Standard browser envs support document.cookie
+ (function standardBrowserEnv() {
+ return {
+ write: function write(name, value, expires, path, domain, secure) {
+ var cookie = [];
+ cookie.push(name + '=' + encodeURIComponent(value));
+
+ if (utils.isNumber(expires)) {
+ cookie.push('expires=' + new Date(expires).toGMTString());
+ }
+
+ if (utils.isString(path)) {
+ cookie.push('path=' + path);
+ }
+
+ if (utils.isString(domain)) {
+ cookie.push('domain=' + domain);
+ }
+
+ if (secure === true) {
+ cookie.push('secure');
+ }
+
+ document.cookie = cookie.join('; ');
+ },
+
+ read: function read(name) {
+ var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
+ return (match ? decodeURIComponent(match[3]) : null);
+ },
+
+ remove: function remove(name) {
+ this.write(name, '', Date.now() - 86400000);
+ }
+ };
+ })() :
+
+ // Non standard browser env (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return {
+ write: function write() {},
+ read: function read() { return null; },
+ remove: function remove() {}
+ };
+ })()
+);
+
+
+/***/ }),
+
+/***/ "./lib/helpers/isAbsoluteURL.js":
+/*!**************************************!*\
+ !*** ./lib/helpers/isAbsoluteURL.js ***!
+ \**************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+module.exports = function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
+};
+
+
+/***/ }),
+
+/***/ "./lib/helpers/isAxiosError.js":
+/*!*************************************!*\
+ !*** ./lib/helpers/isAxiosError.js ***!
+ \*************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
+
+/**
+ * Determines whether the payload is an error thrown by Axios
+ *
+ * @param {*} payload The value to test
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
+ */
+module.exports = function isAxiosError(payload) {
+ return utils.isObject(payload) && (payload.isAxiosError === true);
+};
+
+
+/***/ }),
+
+/***/ "./lib/helpers/isURLSameOrigin.js":
+/*!****************************************!*\
+ !*** ./lib/helpers/isURLSameOrigin.js ***!
+ \****************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
+
+module.exports = (
+ utils.isStandardBrowserEnv() ?
+
+ // Standard browser envs have full support of the APIs needed to test
+ // whether the request URL is of the same origin as current location.
+ (function standardBrowserEnv() {
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
+ var urlParsingNode = document.createElement('a');
+ var originURL;
+
+ /**
+ * Parse a URL to discover it's components
+ *
+ * @param {String} url The URL to be parsed
+ * @returns {Object}
+ */
+ function resolveURL(url) {
+ var href = url;
+
+ if (msie) {
+ // IE needs attribute set twice to normalize properties
+ urlParsingNode.setAttribute('href', href);
+ href = urlParsingNode.href;
+ }
+
+ urlParsingNode.setAttribute('href', href);
+
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
+ return {
+ href: urlParsingNode.href,
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
+ host: urlParsingNode.host,
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
+ hostname: urlParsingNode.hostname,
+ port: urlParsingNode.port,
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
+ urlParsingNode.pathname :
+ '/' + urlParsingNode.pathname
+ };
+ }
+
+ originURL = resolveURL(window.location.href);
+
+ /**
+ * Determine if a URL shares the same origin as the current location
+ *
+ * @param {String} requestURL The URL to test
+ * @returns {boolean} True if URL shares the same origin, otherwise false
+ */
+ return function isURLSameOrigin(requestURL) {
+ var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
+ return (parsed.protocol === originURL.protocol &&
+ parsed.host === originURL.host);
+ };
+ })() :
+
+ // Non standard browser envs (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return function isURLSameOrigin() {
+ return true;
+ };
+ })()
+);
+
+
+/***/ }),
+
+/***/ "./lib/helpers/normalizeHeaderName.js":
+/*!********************************************!*\
+ !*** ./lib/helpers/normalizeHeaderName.js ***!
+ \********************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js");
+
+module.exports = function normalizeHeaderName(headers, normalizedName) {
+ utils.forEach(headers, function processHeader(value, name) {
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
+ headers[normalizedName] = value;
+ delete headers[name];
+ }
+ });
+};
+
+
+/***/ }),
+
+/***/ "./lib/helpers/null.js":
+/*!*****************************!*\
+ !*** ./lib/helpers/null.js ***!
+ \*****************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
+
+// eslint-disable-next-line strict
+module.exports = null;
+
+
+/***/ }),
+
+/***/ "./lib/helpers/parseHeaders.js":
+/*!*************************************!*\
+ !*** ./lib/helpers/parseHeaders.js ***!
+ \*************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
+
+// Headers whose duplicates are ignored by node
+// c.f. https://nodejs.org/api/http.html#http_message_headers
+var ignoreDuplicateOf = [
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
+ 'referer', 'retry-after', 'user-agent'
+];
+
+/**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} headers Headers needing to be parsed
+ * @returns {Object} Headers parsed into an object
+ */
+module.exports = function parseHeaders(headers) {
+ var parsed = {};
+ var key;
+ var val;
+ var i;
+
+ if (!headers) { return parsed; }
+
+ utils.forEach(headers.split('\n'), function parser(line) {
+ i = line.indexOf(':');
+ key = utils.trim(line.substr(0, i)).toLowerCase();
+ val = utils.trim(line.substr(i + 1));
+
+ if (key) {
+ if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
+ return;
+ }
+ if (key === 'set-cookie') {
+ parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ }
+ });
+
+ return parsed;
+};
+
+
+/***/ }),
+
+/***/ "./lib/helpers/parseProtocol.js":
+/*!**************************************!*\
+ !*** ./lib/helpers/parseProtocol.js ***!
+ \**************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+module.exports = function parseProtocol(url) {
+ var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
+ return match && match[1] || '';
+};
+
+
+/***/ }),
+
+/***/ "./lib/helpers/spread.js":
+/*!*******************************!*\
+ !*** ./lib/helpers/spread.js ***!
+ \*******************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/**
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
+ *
+ * Common use case would be to use `Function.prototype.apply`.
+ *
+ * ```js
+ * function f(x, y, z) {}
+ * var args = [1, 2, 3];
+ * f.apply(null, args);
+ * ```
+ *
+ * With `spread` this example can be re-written.
+ *
+ * ```js
+ * spread(function(x, y, z) {})([1, 2, 3]);
+ * ```
+ *
+ * @param {Function} callback
+ * @returns {Function}
+ */
+module.exports = function spread(callback) {
+ return function wrap(arr) {
+ return callback.apply(null, arr);
+ };
+};
+
+
+/***/ }),
+
+/***/ "./lib/helpers/toFormData.js":
+/*!***********************************!*\
+ !*** ./lib/helpers/toFormData.js ***!
+ \***********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js");
+
+/**
+ * Convert a data object to FormData
+ * @param {Object} obj
+ * @param {?Object} [formData]
+ * @returns {Object}
+ **/
+
+function toFormData(obj, formData) {
+ // eslint-disable-next-line no-param-reassign
+ formData = formData || new FormData();
+
+ var stack = [];
+
+ function convertValue(value) {
+ if (value === null) return '';
+
+ if (utils.isDate(value)) {
+ return value.toISOString();
+ }
+
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
+ return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
+ }
+
+ return value;
+ }
+
+ function build(data, parentKey) {
+ if (utils.isPlainObject(data) || utils.isArray(data)) {
+ if (stack.indexOf(data) !== -1) {
+ throw Error('Circular reference detected in ' + parentKey);
+ }
+
+ stack.push(data);
+
+ utils.forEach(data, function each(value, key) {
+ if (utils.isUndefined(value)) return;
+ var fullKey = parentKey ? parentKey + '.' + key : key;
+ var arr;
+
+ if (value && !parentKey && typeof value === 'object') {
+ if (utils.endsWith(key, '{}')) {
+ // eslint-disable-next-line no-param-reassign
+ value = JSON.stringify(value);
+ } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
+ // eslint-disable-next-line func-names
+ arr.forEach(function(el) {
+ !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
+ });
+ return;
+ }
+ }
+
+ build(value, fullKey);
+ });
+
+ stack.pop();
+ } else {
+ formData.append(parentKey, convertValue(data));
+ }
+ }
+
+ build(obj);
+
+ return formData;
+}
+
+module.exports = toFormData;
+
+
+/***/ }),
+
+/***/ "./lib/helpers/validator.js":
+/*!**********************************!*\
+ !*** ./lib/helpers/validator.js ***!
+ \**********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var VERSION = __webpack_require__(/*! ../env/data */ "./lib/env/data.js").version;
+var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./lib/core/AxiosError.js");
+
+var validators = {};
+
+// eslint-disable-next-line func-names
+['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
+ validators[type] = function validator(thing) {
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
+ };
+});
+
+var deprecatedWarnings = {};
+
+/**
+ * Transitional option validator
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
+ * @param {string?} version - deprecated version / removed since version
+ * @param {string?} message - some message with additional info
+ * @returns {function}
+ */
+validators.transitional = function transitional(validator, version, message) {
+ function formatMessage(opt, desc) {
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
+ }
+
+ // eslint-disable-next-line func-names
+ return function(value, opt, opts) {
+ if (validator === false) {
+ throw new AxiosError(
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
+ AxiosError.ERR_DEPRECATED
+ );
+ }
+
+ if (version && !deprecatedWarnings[opt]) {
+ deprecatedWarnings[opt] = true;
+ // eslint-disable-next-line no-console
+ console.warn(
+ formatMessage(
+ opt,
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
+ )
+ );
+ }
+
+ return validator ? validator(value, opt, opts) : true;
+ };
+};
+
+/**
+ * Assert object's properties type
+ * @param {object} options
+ * @param {object} schema
+ * @param {boolean?} allowUnknown
+ */
+
+function assertOptions(options, schema, allowUnknown) {
+ if (typeof options !== 'object') {
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ var keys = Object.keys(options);
+ var i = keys.length;
+ while (i-- > 0) {
+ var opt = keys[i];
+ var validator = schema[opt];
+ if (validator) {
+ var value = options[opt];
+ var result = value === undefined || validator(value, opt, options);
+ if (result !== true) {
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ continue;
+ }
+ if (allowUnknown !== true) {
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
+ }
+ }
+}
+
+module.exports = {
+ assertOptions: assertOptions,
+ validators: validators
+};
+
+
+/***/ }),
+
+/***/ "./lib/utils.js":
+/*!**********************!*\
+ !*** ./lib/utils.js ***!
+ \**********************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js");
+
+// utils is a library of generic helper functions non-specific to axios
+
+var toString = Object.prototype.toString;
+
+// eslint-disable-next-line func-names
+var kindOf = (function(cache) {
+ // eslint-disable-next-line func-names
+ return function(thing) {
+ var str = toString.call(thing);
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
+ };
+})(Object.create(null));
+
+function kindOfTest(type) {
+ type = type.toLowerCase();
+ return function isKindOf(thing) {
+ return kindOf(thing) === type;
+ };
+}
+
+/**
+ * Determine if a value is an Array
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+function isArray(val) {
+ return Array.isArray(val);
+}
+
+/**
+ * Determine if a value is undefined
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+function isUndefined(val) {
+ return typeof val === 'undefined';
+}
+
+/**
+ * Determine if a value is a Buffer
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Buffer, otherwise false
+ */
+function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
+ && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
+}
+
+/**
+ * Determine if a value is an ArrayBuffer
+ *
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
+ */
+var isArrayBuffer = kindOfTest('ArrayBuffer');
+
+
+/**
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
+ */
+function isArrayBufferView(val) {
+ var result;
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
+ }
+ return result;
+}
+
+/**
+ * Determine if a value is a String
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a String, otherwise false
+ */
+function isString(val) {
+ return typeof val === 'string';
+}
+
+/**
+ * Determine if a value is a Number
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+function isNumber(val) {
+ return typeof val === 'number';
+}
+
+/**
+ * Determine if a value is an Object
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an Object, otherwise false
+ */
+function isObject(val) {
+ return val !== null && typeof val === 'object';
+}
+
+/**
+ * Determine if a value is a plain Object
+ *
+ * @param {Object} val The value to test
+ * @return {boolean} True if value is a plain Object, otherwise false
+ */
+function isPlainObject(val) {
+ if (kindOf(val) !== 'object') {
+ return false;
+ }
+
+ var prototype = Object.getPrototypeOf(val);
+ return prototype === null || prototype === Object.prototype;
+}
+
+/**
+ * Determine if a value is a Date
+ *
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+var isDate = kindOfTest('Date');
+
+/**
+ * Determine if a value is a File
+ *
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+var isFile = kindOfTest('File');
+
+/**
+ * Determine if a value is a Blob
+ *
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+var isBlob = kindOfTest('Blob');
+
+/**
+ * Determine if a value is a FileList
+ *
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+var isFileList = kindOfTest('FileList');
+
+/**
+ * Determine if a value is a Function
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+function isFunction(val) {
+ return toString.call(val) === '[object Function]';
+}
+
+/**
+ * Determine if a value is a Stream
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+function isStream(val) {
+ return isObject(val) && isFunction(val.pipe);
+}
+
+/**
+ * Determine if a value is a FormData
+ *
+ * @param {Object} thing The value to test
+ * @returns {boolean} True if value is an FormData, otherwise false
+ */
+function isFormData(thing) {
+ var pattern = '[object FormData]';
+ return thing && (
+ (typeof FormData === 'function' && thing instanceof FormData) ||
+ toString.call(thing) === pattern ||
+ (isFunction(thing.toString) && thing.toString() === pattern)
+ );
+}
+
+/**
+ * Determine if a value is a URLSearchParams object
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+var isURLSearchParams = kindOfTest('URLSearchParams');
+
+/**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ * @returns {String} The String freed of excess whitespace
+ */
+function trim(str) {
+ return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
+}
+
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ */
+function isStandardBrowserEnv() {
+ if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
+ navigator.product === 'NativeScript' ||
+ navigator.product === 'NS')) {
+ return false;
+ }
+ return (
+ typeof window !== 'undefined' &&
+ typeof document !== 'undefined'
+ );
+}
+
+/**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ */
+function forEach(obj, fn) {
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
+ }
+
+ // Force an array if not already something iterable
+ if (typeof obj !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
+ }
+
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (var i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
+ }
+ } else {
+ // Iterate over object keys
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ fn.call(null, obj[key], key, obj);
+ }
+ }
+ }
+}
+
+/**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * var result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ * @returns {Object} Result of all merge properties
+ */
+function merge(/* obj1, obj2, obj3, ... */) {
+ var result = {};
+ function assignValue(val, key) {
+ if (isPlainObject(result[key]) && isPlainObject(val)) {
+ result[key] = merge(result[key], val);
+ } else if (isPlainObject(val)) {
+ result[key] = merge({}, val);
+ } else if (isArray(val)) {
+ result[key] = val.slice();
+ } else {
+ result[key] = val;
+ }
+ }
+
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ forEach(arguments[i], assignValue);
+ }
+ return result;
+}
+
+/**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ * @return {Object} The resulting value of object a
+ */
+function extend(a, b, thisArg) {
+ forEach(b, function assignValue(val, key) {
+ if (thisArg && typeof val === 'function') {
+ a[key] = bind(val, thisArg);
+ } else {
+ a[key] = val;
+ }
+ });
+ return a;
+}
+
+/**
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ *
+ * @param {string} content with BOM
+ * @return {string} content value without BOM
+ */
+function stripBOM(content) {
+ if (content.charCodeAt(0) === 0xFEFF) {
+ content = content.slice(1);
+ }
+ return content;
+}
+
+/**
+ * Inherit the prototype methods from one constructor into another
+ * @param {function} constructor
+ * @param {function} superConstructor
+ * @param {object} [props]
+ * @param {object} [descriptors]
+ */
+
+function inherits(constructor, superConstructor, props, descriptors) {
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
+ constructor.prototype.constructor = constructor;
+ props && Object.assign(constructor.prototype, props);
+}
+
+/**
+ * Resolve object with deep prototype chain to a flat object
+ * @param {Object} sourceObj source object
+ * @param {Object} [destObj]
+ * @param {Function} [filter]
+ * @returns {Object}
+ */
+
+function toFlatObject(sourceObj, destObj, filter) {
+ var props;
+ var i;
+ var prop;
+ var merged = {};
+
+ destObj = destObj || {};
+
+ do {
+ props = Object.getOwnPropertyNames(sourceObj);
+ i = props.length;
+ while (i-- > 0) {
+ prop = props[i];
+ if (!merged[prop]) {
+ destObj[prop] = sourceObj[prop];
+ merged[prop] = true;
+ }
+ }
+ sourceObj = Object.getPrototypeOf(sourceObj);
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
+
+ return destObj;
+}
+
+/*
+ * determines whether a string ends with the characters of a specified string
+ * @param {String} str
+ * @param {String} searchString
+ * @param {Number} [position= 0]
+ * @returns {boolean}
+ */
+function endsWith(str, searchString, position) {
+ str = String(str);
+ if (position === undefined || position > str.length) {
+ position = str.length;
+ }
+ position -= searchString.length;
+ var lastIndex = str.indexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+}
+
+
+/**
+ * Returns new array from array like object
+ * @param {*} [thing]
+ * @returns {Array}
+ */
+function toArray(thing) {
+ if (!thing) return null;
+ var i = thing.length;
+ if (isUndefined(i)) return null;
+ var arr = new Array(i);
+ while (i-- > 0) {
+ arr[i] = thing[i];
+ }
+ return arr;
+}
+
+// eslint-disable-next-line func-names
+var isTypedArray = (function(TypedArray) {
+ // eslint-disable-next-line func-names
+ return function(thing) {
+ return TypedArray && thing instanceof TypedArray;
+ };
+})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
+
+module.exports = {
+ isArray: isArray,
+ isArrayBuffer: isArrayBuffer,
+ isBuffer: isBuffer,
+ isFormData: isFormData,
+ isArrayBufferView: isArrayBufferView,
+ isString: isString,
+ isNumber: isNumber,
+ isObject: isObject,
+ isPlainObject: isPlainObject,
+ isUndefined: isUndefined,
+ isDate: isDate,
+ isFile: isFile,
+ isBlob: isBlob,
+ isFunction: isFunction,
+ isStream: isStream,
+ isURLSearchParams: isURLSearchParams,
+ isStandardBrowserEnv: isStandardBrowserEnv,
+ forEach: forEach,
+ merge: merge,
+ extend: extend,
+ trim: trim,
+ stripBOM: stripBOM,
+ inherits: inherits,
+ toFlatObject: toFlatObject,
+ kindOf: kindOf,
+ kindOfTest: kindOfTest,
+ endsWith: endsWith,
+ toArray: toArray,
+ isTypedArray: isTypedArray,
+ isFileList: isFileList
+};
+
+
+/***/ })
+
+/******/ });
+});
+//# sourceMappingURL=axios.map
\ No newline at end of file
diff --git a/Fronts/node_modules/axios/dist/axios.map b/Fronts/node_modules/axios/dist/axios.map
new file mode 100644
index 0000000..5c24df5
--- /dev/null
+++ b/Fronts/node_modules/axios/dist/axios.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./index.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/cancel/CanceledError.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/AxiosError.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/defaults/index.js","webpack://axios/./lib/defaults/transitional.js","webpack://axios/./lib/env/data.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/isAxiosError.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/helpers/null.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/parseProtocol.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/toFormData.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/utils.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,mCAAa,E;;;;;;;;;;;;ACAzB;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,aAAa,mBAAO,CAAC,8CAAkB;AACvC,cAAc,mBAAO,CAAC,sDAAsB;AAC5C,eAAe,mBAAO,CAAC,wDAAuB;AAC9C,oBAAoB,mBAAO,CAAC,0DAAuB;AACnD,mBAAmB,mBAAO,CAAC,gEAA2B;AACtD,sBAAsB,mBAAO,CAAC,sEAA8B;AAC5D,2BAA2B,mBAAO,CAAC,gEAA0B;AAC7D,iBAAiB,mBAAO,CAAC,oDAAoB;AAC7C,oBAAoB,mBAAO,CAAC,8DAAyB;AACrD,oBAAoB,mBAAO,CAAC,gEAA0B;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;AC7Na;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,WAAW,mBAAO,CAAC,6CAAgB;AACnC,YAAY,mBAAO,CAAC,yCAAc;AAClC,kBAAkB,mBAAO,CAAC,qDAAoB;AAC9C,eAAe,mBAAO,CAAC,2CAAY;;AAEnC;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,sBAAsB,mBAAO,CAAC,6DAAwB;AACtD,oBAAoB,mBAAO,CAAC,yDAAsB;AAClD,iBAAiB,mBAAO,CAAC,mDAAmB;AAC5C,gBAAgB,mBAAO,CAAC,qCAAY;AACpC,mBAAmB,mBAAO,CAAC,yDAAsB;;AAEjD;AACA,mBAAmB,mBAAO,CAAC,wDAAwB;;AAEnD;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,iDAAkB;;AAEzC;AACA,qBAAqB,mBAAO,CAAC,6DAAwB;;AAErD;;AAEA;AACA;;;;;;;;;;;;;AC/Da;;AAEb,oBAAoB,mBAAO,CAAC,sDAAiB;;AAE7C;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,eAAe,OAAO;AACtB;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACtHa;;AAEb,iBAAiB,mBAAO,CAAC,oDAAoB;AAC7C,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACrBa;;AAEb;AACA;AACA;;;;;;;;;;;;;ACJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,sDAAqB;AAC5C,yBAAyB,mBAAO,CAAC,8DAAsB;AACvD,sBAAsB,mBAAO,CAAC,wDAAmB;AACjD,kBAAkB,mBAAO,CAAC,gDAAe;AACzC,oBAAoB,mBAAO,CAAC,oDAAiB;AAC7C,gBAAgB,mBAAO,CAAC,wDAAsB;;AAE9C;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,SAAS,KAAK;AACd;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;;AC/Ja;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,CAAC;;AAED;AACA,kDAAkD,YAAY;;AAE9D;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;;ACrFa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,gEAA0B;AACtD,kBAAkB,mBAAO,CAAC,4DAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,oBAAoB,mBAAO,CAAC,oDAAiB;AAC7C,eAAe,mBAAO,CAAC,oDAAoB;AAC3C,eAAe,mBAAO,CAAC,4CAAa;AACpC,oBAAoB,mBAAO,CAAC,8DAAyB;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACtFa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACnGa;;AAEb,iBAAiB,mBAAO,CAAC,8CAAc;;AAEvC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,4CAAa;;AAEpC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;AAC9B,0BAA0B,mBAAO,CAAC,4EAAgC;AAClE,iBAAiB,mBAAO,CAAC,oDAAoB;AAC7C,2BAA2B,mBAAO,CAAC,sDAAgB;AACnD,iBAAiB,mBAAO,CAAC,0DAAuB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,8CAAiB;AACvC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,+CAAkB;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,sCAAsC,gBAAgB;AACtD,KAAK;AACL;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,cAAc,mBAAO,CAAC,6CAAgB;AACtC,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACjJa;;AAEb;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA;AACA;AACA,E;;;;;;;;;;;;ACFa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C;AAC1C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,+BAA+B,aAAa,EAAE;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACXA;AACA;;;;;;;;;;;;;ACDa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA,wBAAwB,KAAK;AAC7B;AACA;;;;;;;;;;;;;ACLa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa;AACb;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC;AACrC;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA,OAAO;;AAEP;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;;ACvEa;;AAEb,cAAc,mBAAO,CAAC,sCAAa;AACnC,iBAAiB,mBAAO,CAAC,oDAAoB;;AAE7C;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;ACrFa;;AAEb,WAAW,mBAAO,CAAC,6CAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;;;AAGA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4BAA4B;AAC5B,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,WAAW,EAAE;AACb,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"axios.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./index.js\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar transitionalDefaults = require('../defaults/transitional');\nvar AxiosError = require('../core/AxiosError');\nvar CanceledError = require('../cancel/CanceledError');\nvar parseProtocol = require('../helpers/parseProtocol');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n var protocol = parseProtocol(fullPath);\n\n if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = require('./cancel/CanceledError');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\naxios.toFormData = require('./helpers/toFormData');\n\n// Expose AxiosError class\naxios.AxiosError = require('../lib/core/AxiosError');\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar CanceledError = require('./CanceledError');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nvar AxiosError = require('../core/AxiosError');\nvar utils = require('../utils');\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction CanceledError(message) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nmodule.exports = CanceledError;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar buildFullPath = require('./buildFullPath');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n var fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url: url,\n data: data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nvar prototype = AxiosError.prototype;\nvar descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED'\n// eslint-disable-next-line func-names\n].forEach(function(code) {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = function(error, code, config, request, response, customProps) {\n var axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nmodule.exports = AxiosError;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar CanceledError = require('../cancel/CanceledError');\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'beforeRedirect': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","'use strict';\n\nvar AxiosError = require('./AxiosError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar AxiosError = require('../core/AxiosError');\nvar transitionalDefaults = require('./transitional');\nvar toFormData = require('../helpers/toFormData');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n var isObjectPayload = utils.isObject(data);\n var contentType = headers && headers['Content-Type'];\n\n var isFileList;\n\n if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {\n var _FormData = this.env && this.env.FormData;\n return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());\n } else if (isObjectPayload || contentType === 'application/json') {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: require('./env/FormData')\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","module.exports = {\n \"version\": \"0.27.2\"\n};","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","// eslint-disable-next-line strict\nmodule.exports = null;\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nmodule.exports = function parseProtocol(url) {\n var match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Convert a data object to FormData\n * @param {Object} obj\n * @param {?Object} [formData]\n * @returns {Object}\n **/\n\nfunction toFormData(obj, formData) {\n // eslint-disable-next-line no-param-reassign\n formData = formData || new FormData();\n\n var stack = [];\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n function build(data, parentKey) {\n if (utils.isPlainObject(data) || utils.isArray(data)) {\n if (stack.indexOf(data) !== -1) {\n throw Error('Circular reference detected in ' + parentKey);\n }\n\n stack.push(data);\n\n utils.forEach(data, function each(value, key) {\n if (utils.isUndefined(value)) return;\n var fullKey = parentKey ? parentKey + '.' + key : key;\n var arr;\n\n if (value && !parentKey && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {\n // eslint-disable-next-line func-names\n arr.forEach(function(el) {\n !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));\n });\n return;\n }\n }\n\n build(value, fullKey);\n });\n\n stack.pop();\n } else {\n formData.append(parentKey, convertValue(data));\n }\n }\n\n build(obj);\n\n return formData;\n}\n\nmodule.exports = toFormData;\n","'use strict';\n\nvar VERSION = require('../env/data').version;\nvar AxiosError = require('../core/AxiosError');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n// eslint-disable-next-line func-names\nvar kindOf = (function(cache) {\n // eslint-disable-next-line func-names\n return function(thing) {\n var str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n };\n})(Object.create(null));\n\nfunction kindOfTest(type) {\n type = type.toLowerCase();\n return function isKindOf(thing) {\n return kindOf(thing) === type;\n };\n}\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nvar isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nvar isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nvar isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} thing The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(thing) {\n var pattern = '[object FormData]';\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) ||\n toString.call(thing) === pattern ||\n (isFunction(thing.toString) && thing.toString() === pattern)\n );\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nvar isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n */\n\nfunction inherits(constructor, superConstructor, props, descriptors) {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function} [filter]\n * @returns {Object}\n */\n\nfunction toFlatObject(sourceObj, destObj, filter) {\n var props;\n var i;\n var prop;\n var merged = {};\n\n destObj = destObj || {};\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if (!merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = Object.getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/*\n * determines whether a string ends with the characters of a specified string\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n * @returns {boolean}\n */\nfunction endsWith(str, searchString, position) {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n var lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object\n * @param {*} [thing]\n * @returns {Array}\n */\nfunction toArray(thing) {\n if (!thing) return null;\n var i = thing.length;\n if (isUndefined(i)) return null;\n var arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n// eslint-disable-next-line func-names\nvar isTypedArray = (function(TypedArray) {\n // eslint-disable-next-line func-names\n return function(thing) {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM,\n inherits: inherits,\n toFlatObject: toFlatObject,\n kindOf: kindOf,\n kindOfTest: kindOfTest,\n endsWith: endsWith,\n toArray: toArray,\n isTypedArray: isTypedArray,\n isFileList: isFileList\n};\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/Fronts/node_modules/axios/dist/axios.min.js b/Fronts/node_modules/axios/dist/axios.min.js
new file mode 100644
index 0000000..e8e4fc1
--- /dev/null
+++ b/Fronts/node_modules/axios/dist/axios.min.js
@@ -0,0 +1,3 @@
+/* axios v0.27.2 | (c) 2022 by Matt Zabriskie */
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){"use strict";var r,o=n(4),i=Object.prototype.toString,s=(r=Object.create(null),function(e){var t=i.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function a(e){return e=e.toLowerCase(),function(t){return s(t)===e}}function u(e){return Array.isArray(e)}function c(e){return void 0===e}var f=a("ArrayBuffer");function l(e){return null!==e&&"object"==typeof e}function p(e){if("object"!==s(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var d=a("Date"),h=a("File"),m=a("Blob"),v=a("FileList");function y(e){return"[object Function]"===i.call(e)}var g=a("URLSearchParams");function E(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var n=0,r=e.length;n0;)s[i=r[o]]||(t[i]=e[i],s[i]=!0);e=Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;var t=e.length;if(c(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:O,isFileList:v}},function(e,t,n){"use strict";var r=n(0);function o(e,t,n,r,o){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}r.inherits(o,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var i=o.prototype,s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){s[e]={value:e}})),Object.defineProperties(o,s),Object.defineProperty(i,"isAxiosError",{value:!0}),o.from=function(e,t,n,s,a,u){var c=Object.create(i);return r.toFlatObject(e,c,(function(e){return e!==Error.prototype})),o.call(c,e.message,t,n,s,a),c.name=e.name,u&&Object.assign(c,u),c},e.exports=o},function(e,t,n){"use strict";var r=n(1);function o(e){r.call(this,null==e?"canceled":e,r.ERR_CANCELED),this.name="CanceledError"}n(0).inherits(o,r,{__CANCEL__:!0}),e.exports=o},function(e,t,n){"use strict";var r=n(0),o=n(19),i=n(1),s=n(6),a=n(7),u={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var f,l={transitional:s,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(f=n(8)),f),transformRequest:[function(e,t){if(o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e))return e;if(r.isArrayBufferView(e))return e.buffer;if(r.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var n,i=r.isObject(e),s=t&&t["Content-Type"];if((n=r.isFileList(e))||i&&"multipart/form-data"===s){var u=this.env&&this.env.FormData;return a(n?{"files[]":e}:e,u&&new u)}return i||"application/json"===s?(c(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw i.from(e,i.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:n(27)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(u)})),e.exports=l},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},function(e,t){e.exports=null},function(e,t,n){"use strict";var r=n(12).version,o=n(1),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var s={};i.transitional=function(e,t,n){function i(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new o(i(r," has been removed"+(t?" in "+t:"")),o.ERR_DEPRECATED);return t&&!s[r]&&(s[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new o("options must be an object",o.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),i=r.length;i-- >0;){var s=r[i],a=t[s];if(a){var u=e[s],c=void 0===u||a(u,s,e);if(!0!==c)throw new o("option "+s+" must be "+c,o.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new o("Unknown option "+s,o.ERR_BAD_OPTION)}},validators:i}},function(e,t,n){"use strict";var r=n(2);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n */\n\nfunction inherits(constructor, superConstructor, props, descriptors) {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function} [filter]\n * @returns {Object}\n */\n\nfunction toFlatObject(sourceObj, destObj, filter) {\n var props;\n var i;\n var prop;\n var merged = {};\n\n destObj = destObj || {};\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if (!merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = Object.getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/*\n * determines whether a string ends with the characters of a specified string\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n * @returns {boolean}\n */\nfunction endsWith(str, searchString, position) {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n var lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object\n * @param {*} [thing]\n * @returns {Array}\n */\nfunction toArray(thing) {\n if (!thing) return null;\n var i = thing.length;\n if (isUndefined(i)) return null;\n var arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n// eslint-disable-next-line func-names\nvar isTypedArray = (function(TypedArray) {\n // eslint-disable-next-line func-names\n return function(thing) {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM,\n inherits: inherits,\n toFlatObject: toFlatObject,\n kindOf: kindOf,\n kindOfTest: kindOfTest,\n endsWith: endsWith,\n toArray: toArray,\n isTypedArray: isTypedArray,\n isFileList: isFileList\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nvar prototype = AxiosError.prototype;\nvar descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED'\n// eslint-disable-next-line func-names\n].forEach(function(code) {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = function(error, code, config, request, response, customProps) {\n var axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nmodule.exports = AxiosError;\n","'use strict';\n\nvar AxiosError = require('../core/AxiosError');\nvar utils = require('../utils');\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction CanceledError(message) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nmodule.exports = CanceledError;\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar AxiosError = require('../core/AxiosError');\nvar transitionalDefaults = require('./transitional');\nvar toFormData = require('../helpers/toFormData');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n var isObjectPayload = utils.isObject(data);\n var contentType = headers && headers['Content-Type'];\n\n var isFileList;\n\n if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {\n var _FormData = this.env && this.env.FormData;\n return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());\n } else if (isObjectPayload || contentType === 'application/json') {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: require('./env/FormData')\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Convert a data object to FormData\n * @param {Object} obj\n * @param {?Object} [formData]\n * @returns {Object}\n **/\n\nfunction toFormData(obj, formData) {\n // eslint-disable-next-line no-param-reassign\n formData = formData || new FormData();\n\n var stack = [];\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n function build(data, parentKey) {\n if (utils.isPlainObject(data) || utils.isArray(data)) {\n if (stack.indexOf(data) !== -1) {\n throw Error('Circular reference detected in ' + parentKey);\n }\n\n stack.push(data);\n\n utils.forEach(data, function each(value, key) {\n if (utils.isUndefined(value)) return;\n var fullKey = parentKey ? parentKey + '.' + key : key;\n var arr;\n\n if (value && !parentKey && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {\n // eslint-disable-next-line func-names\n arr.forEach(function(el) {\n !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));\n });\n return;\n }\n }\n\n build(value, fullKey);\n });\n\n stack.pop();\n } else {\n formData.append(parentKey, convertValue(data));\n }\n }\n\n build(obj);\n\n return formData;\n}\n\nmodule.exports = toFormData;\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar transitionalDefaults = require('../defaults/transitional');\nvar AxiosError = require('../core/AxiosError');\nvar CanceledError = require('../cancel/CanceledError');\nvar parseProtocol = require('../helpers/parseProtocol');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n var protocol = parseProtocol(fullPath);\n\n if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'beforeRedirect': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","module.exports = {\n \"version\": \"0.27.2\"\n};","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = require('./cancel/CanceledError');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\naxios.toFormData = require('./helpers/toFormData');\n\n// Expose AxiosError class\naxios.AxiosError = require('../lib/core/AxiosError');\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar buildFullPath = require('./buildFullPath');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n var fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url: url,\n data: data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar CanceledError = require('../cancel/CanceledError');\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar AxiosError = require('./AxiosError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nmodule.exports = function parseProtocol(url) {\n var match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n};\n","// eslint-disable-next-line strict\nmodule.exports = null;\n","'use strict';\n\nvar VERSION = require('../env/data').version;\nvar AxiosError = require('../core/AxiosError');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar CanceledError = require('./CanceledError');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/Fronts/node_modules/axios/index.d.ts b/Fronts/node_modules/axios/index.d.ts
new file mode 100644
index 0000000..0b9e1d3
--- /dev/null
+++ b/Fronts/node_modules/axios/index.d.ts
@@ -0,0 +1,254 @@
+// TypeScript Version: 3.0
+export type AxiosRequestHeaders = Record;
+
+export type AxiosResponseHeaders = Record & {
+ "set-cookie"?: string[]
+};
+
+export interface AxiosRequestTransformer {
+ (data: any, headers?: AxiosRequestHeaders): any;
+}
+
+export interface AxiosResponseTransformer {
+ (data: any, headers?: AxiosResponseHeaders): any;
+}
+
+export interface AxiosAdapter {
+ (config: AxiosRequestConfig): AxiosPromise;
+}
+
+export interface AxiosBasicCredentials {
+ username: string;
+ password: string;
+}
+
+export interface AxiosProxyConfig {
+ host: string;
+ port: number;
+ auth?: {
+ username: string;
+ password: string;
+ };
+ protocol?: string;
+}
+
+export type Method =
+ | 'get' | 'GET'
+ | 'delete' | 'DELETE'
+ | 'head' | 'HEAD'
+ | 'options' | 'OPTIONS'
+ | 'post' | 'POST'
+ | 'put' | 'PUT'
+ | 'patch' | 'PATCH'
+ | 'purge' | 'PURGE'
+ | 'link' | 'LINK'
+ | 'unlink' | 'UNLINK';
+
+export type ResponseType =
+ | 'arraybuffer'
+ | 'blob'
+ | 'document'
+ | 'json'
+ | 'text'
+ | 'stream';
+
+ export type responseEncoding =
+ | 'ascii' | 'ASCII'
+ | 'ansi' | 'ANSI'
+ | 'binary' | 'BINARY'
+ | 'base64' | 'BASE64'
+ | 'base64url' | 'BASE64URL'
+ | 'hex' | 'HEX'
+ | 'latin1' | 'LATIN1'
+ | 'ucs-2' | 'UCS-2'
+ | 'ucs2' | 'UCS2'
+ | 'utf-8' | 'UTF-8'
+ | 'utf8' | 'UTF8'
+ | 'utf16le' | 'UTF16LE';
+
+export interface TransitionalOptions {
+ silentJSONParsing?: boolean;
+ forcedJSONParsing?: boolean;
+ clarifyTimeoutError?: boolean;
+}
+
+export interface AxiosRequestConfig {
+ url?: string;
+ method?: Method | string;
+ baseURL?: string;
+ transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
+ transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
+ headers?: AxiosRequestHeaders;
+ params?: any;
+ paramsSerializer?: (params: any) => string;
+ data?: D;
+ timeout?: number;
+ timeoutErrorMessage?: string;
+ withCredentials?: boolean;
+ adapter?: AxiosAdapter;
+ auth?: AxiosBasicCredentials;
+ responseType?: ResponseType;
+ responseEncoding?: responseEncoding | string;
+ xsrfCookieName?: string;
+ xsrfHeaderName?: string;
+ onUploadProgress?: (progressEvent: any) => void;
+ onDownloadProgress?: (progressEvent: any) => void;
+ maxContentLength?: number;
+ validateStatus?: ((status: number) => boolean) | null;
+ maxBodyLength?: number;
+ maxRedirects?: number;
+ beforeRedirect?: (options: Record, responseDetails: {headers: Record}) => void;
+ socketPath?: string | null;
+ httpAgent?: any;
+ httpsAgent?: any;
+ proxy?: AxiosProxyConfig | false;
+ cancelToken?: CancelToken;
+ decompress?: boolean;
+ transitional?: TransitionalOptions;
+ signal?: AbortSignal;
+ insecureHTTPParser?: boolean;
+ env?: {
+ FormData?: new (...args: any[]) => object;
+ };
+}
+
+export interface HeadersDefaults {
+ common: AxiosRequestHeaders;
+ delete: AxiosRequestHeaders;
+ get: AxiosRequestHeaders;
+ head: AxiosRequestHeaders;
+ post: AxiosRequestHeaders;
+ put: AxiosRequestHeaders;
+ patch: AxiosRequestHeaders;
+ options?: AxiosRequestHeaders;
+ purge?: AxiosRequestHeaders;
+ link?: AxiosRequestHeaders;
+ unlink?: AxiosRequestHeaders;
+}
+
+export interface AxiosDefaults extends Omit, 'headers'> {
+ headers: HeadersDefaults;
+}
+
+export interface AxiosResponse {
+ data: T;
+ status: number;
+ statusText: string;
+ headers: AxiosResponseHeaders;
+ config: AxiosRequestConfig;
+ request?: any;
+}
+
+export class AxiosError extends Error {
+ constructor(
+ message?: string,
+ code?: string,
+ config?: AxiosRequestConfig,
+ request?: any,
+ response?: AxiosResponse
+ );
+
+ config: AxiosRequestConfig;
+ code?: string;
+ request?: any;
+ response?: AxiosResponse;
+ isAxiosError: boolean;
+ status?: string;
+ toJSON: () => object;
+ static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
+ static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
+ static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION";
+ static readonly ERR_NETWORK = "ERR_NETWORK";
+ static readonly ERR_DEPRECATED = "ERR_DEPRECATED";
+ static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
+ static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
+ static readonly ERR_CANCELED = "ERR_CANCELED";
+ static readonly ECONNABORTED = "ECONNABORTED";
+ static readonly ETIMEDOUT = "ETIMEDOUT";
+}
+
+export class CanceledError extends AxiosError {
+}
+
+export interface AxiosPromise extends Promise> {
+}
+
+export interface CancelStatic {
+ new (message?: string): Cancel;
+}
+
+export interface Cancel {
+ message: string | undefined;
+}
+
+export interface Canceler {
+ (message?: string): void;
+}
+
+export interface CancelTokenStatic {
+ new (executor: (cancel: Canceler) => void): CancelToken;
+ source(): CancelTokenSource;
+}
+
+export interface CancelToken {
+ promise: Promise;
+ reason?: Cancel;
+ throwIfRequested(): void;
+}
+
+export interface CancelTokenSource {
+ token: CancelToken;
+ cancel: Canceler;
+}
+
+export interface AxiosInterceptorOptions {
+ synchronous?: boolean;
+ runWhen?: (config: AxiosRequestConfig) => boolean;
+}
+
+export interface AxiosInterceptorManager {
+ use(onFulfilled?: (value: V) => T | Promise, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number;
+ eject(id: number): void;
+}
+
+export class Axios {
+ constructor(config?: AxiosRequestConfig);
+ defaults: AxiosDefaults;
+ interceptors: {
+ request: AxiosInterceptorManager;
+ response: AxiosInterceptorManager;
+ };
+ getUri(config?: AxiosRequestConfig): string;
+ request, D = any>(config: AxiosRequestConfig): Promise;
+ get, D = any>(url: string, config?: AxiosRequestConfig): Promise;
+ delete, D = any>(url: string, config?: AxiosRequestConfig): Promise;
+ head, D = any>(url: string, config?: AxiosRequestConfig): Promise;
+ options, D = any>(url: string, config?: AxiosRequestConfig): Promise;
+ post, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise;
+ put, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise;
+ patch, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise;
+ postForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise;
+ putForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise;
+ patchForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise;
+}
+
+export interface AxiosInstance extends Axios {
+ (config: AxiosRequestConfig): AxiosPromise;
+ (url: string, config?: AxiosRequestConfig): AxiosPromise;
+}
+
+export interface AxiosStatic extends AxiosInstance {
+ create(config?: AxiosRequestConfig): AxiosInstance;
+ Cancel: CancelStatic;
+ CancelToken: CancelTokenStatic;
+ Axios: typeof Axios;
+ readonly VERSION: string;
+ isCancel(value: any): boolean;
+ all(values: Array>): Promise;
+ spread(callback: (...args: T[]) => R): (array: T[]) => R;
+ isAxiosError(payload: any): payload is AxiosError;
+}
+
+declare const axios: AxiosStatic;
+
+export default axios;
diff --git a/Fronts/node_modules/axios/index.js b/Fronts/node_modules/axios/index.js
new file mode 100644
index 0000000..79dfd09
--- /dev/null
+++ b/Fronts/node_modules/axios/index.js
@@ -0,0 +1 @@
+module.exports = require('./lib/axios');
\ No newline at end of file
diff --git a/Fronts/node_modules/axios/lib/adapters/README.md b/Fronts/node_modules/axios/lib/adapters/README.md
new file mode 100644
index 0000000..68f1118
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/adapters/README.md
@@ -0,0 +1,37 @@
+# axios // adapters
+
+The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received.
+
+## Example
+
+```js
+var settle = require('./../core/settle');
+
+module.exports = function myAdapter(config) {
+ // At this point:
+ // - config has been merged with defaults
+ // - request transformers have already run
+ // - request interceptors have already run
+
+ // Make the request using config provided
+ // Upon response settle the Promise
+
+ return new Promise(function(resolve, reject) {
+
+ var response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config: config,
+ request: request
+ };
+
+ settle(resolve, reject, response);
+
+ // From here:
+ // - response transformers will run
+ // - response interceptors will run
+ });
+}
+```
diff --git a/Fronts/node_modules/axios/lib/adapters/http.js b/Fronts/node_modules/axios/lib/adapters/http.js
new file mode 100644
index 0000000..04a9aac
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/adapters/http.js
@@ -0,0 +1,424 @@
+'use strict';
+
+var utils = require('./../utils');
+var settle = require('./../core/settle');
+var buildFullPath = require('../core/buildFullPath');
+var buildURL = require('./../helpers/buildURL');
+var http = require('http');
+var https = require('https');
+var httpFollow = require('follow-redirects').http;
+var httpsFollow = require('follow-redirects').https;
+var url = require('url');
+var zlib = require('zlib');
+var VERSION = require('./../env/data').version;
+var transitionalDefaults = require('../defaults/transitional');
+var AxiosError = require('../core/AxiosError');
+var CanceledError = require('../cancel/CanceledError');
+
+var isHttps = /https:?/;
+
+var supportedProtocols = [ 'http:', 'https:', 'file:' ];
+
+/**
+ *
+ * @param {http.ClientRequestArgs} options
+ * @param {AxiosProxyConfig} proxy
+ * @param {string} location
+ */
+function setProxy(options, proxy, location) {
+ options.hostname = proxy.host;
+ options.host = proxy.host;
+ options.port = proxy.port;
+ options.path = location;
+
+ // Basic proxy authorization
+ if (proxy.auth) {
+ var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');
+ options.headers['Proxy-Authorization'] = 'Basic ' + base64;
+ }
+
+ // If a proxy is used, any redirects must also pass through the proxy
+ options.beforeRedirect = function beforeRedirect(redirection) {
+ redirection.headers.host = redirection.host;
+ setProxy(redirection, proxy, redirection.href);
+ };
+}
+
+/*eslint consistent-return:0*/
+module.exports = function httpAdapter(config) {
+ return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
+ var onCanceled;
+ function done() {
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(onCanceled);
+ }
+
+ if (config.signal) {
+ config.signal.removeEventListener('abort', onCanceled);
+ }
+ }
+ var resolve = function resolve(value) {
+ done();
+ resolvePromise(value);
+ };
+ var rejected = false;
+ var reject = function reject(value) {
+ done();
+ rejected = true;
+ rejectPromise(value);
+ };
+ var data = config.data;
+ var headers = config.headers;
+ var headerNames = {};
+
+ Object.keys(headers).forEach(function storeLowerName(name) {
+ headerNames[name.toLowerCase()] = name;
+ });
+
+ // Set User-Agent (required by some servers)
+ // See https://github.com/axios/axios/issues/69
+ if ('user-agent' in headerNames) {
+ // User-Agent is specified; handle case where no UA header is desired
+ if (!headers[headerNames['user-agent']]) {
+ delete headers[headerNames['user-agent']];
+ }
+ // Otherwise, use specified value
+ } else {
+ // Only set header if it hasn't been set in config
+ headers['User-Agent'] = 'axios/' + VERSION;
+ }
+
+ // support for https://www.npmjs.com/package/form-data api
+ if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
+ Object.assign(headers, data.getHeaders());
+ } else if (data && !utils.isStream(data)) {
+ if (Buffer.isBuffer(data)) {
+ // Nothing to do...
+ } else if (utils.isArrayBuffer(data)) {
+ data = Buffer.from(new Uint8Array(data));
+ } else if (utils.isString(data)) {
+ data = Buffer.from(data, 'utf-8');
+ } else {
+ return reject(new AxiosError(
+ 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
+ AxiosError.ERR_BAD_REQUEST,
+ config
+ ));
+ }
+
+ if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
+ return reject(new AxiosError(
+ 'Request body larger than maxBodyLength limit',
+ AxiosError.ERR_BAD_REQUEST,
+ config
+ ));
+ }
+
+ // Add Content-Length header if data exists
+ if (!headerNames['content-length']) {
+ headers['Content-Length'] = data.length;
+ }
+ }
+
+ // HTTP basic authentication
+ var auth = undefined;
+ if (config.auth) {
+ var username = config.auth.username || '';
+ var password = config.auth.password || '';
+ auth = username + ':' + password;
+ }
+
+ // Parse url
+ var fullPath = buildFullPath(config.baseURL, config.url);
+ var parsed = url.parse(fullPath);
+ var protocol = parsed.protocol || supportedProtocols[0];
+
+ if (supportedProtocols.indexOf(protocol) === -1) {
+ return reject(new AxiosError(
+ 'Unsupported protocol ' + protocol,
+ AxiosError.ERR_BAD_REQUEST,
+ config
+ ));
+ }
+
+ if (!auth && parsed.auth) {
+ var urlAuth = parsed.auth.split(':');
+ var urlUsername = urlAuth[0] || '';
+ var urlPassword = urlAuth[1] || '';
+ auth = urlUsername + ':' + urlPassword;
+ }
+
+ if (auth && headerNames.authorization) {
+ delete headers[headerNames.authorization];
+ }
+
+ var isHttpsRequest = isHttps.test(protocol);
+ var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
+
+ try {
+ buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, '');
+ } catch (err) {
+ var customErr = new Error(err.message);
+ customErr.config = config;
+ customErr.url = config.url;
+ customErr.exists = true;
+ reject(customErr);
+ }
+
+ var options = {
+ path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
+ method: config.method.toUpperCase(),
+ headers: headers,
+ agent: agent,
+ agents: { http: config.httpAgent, https: config.httpsAgent },
+ auth: auth
+ };
+
+ if (config.socketPath) {
+ options.socketPath = config.socketPath;
+ } else {
+ options.hostname = parsed.hostname;
+ options.port = parsed.port;
+ }
+
+ var proxy = config.proxy;
+ if (!proxy && proxy !== false) {
+ var proxyEnv = protocol.slice(0, -1) + '_proxy';
+ var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];
+ if (proxyUrl) {
+ var parsedProxyUrl = url.parse(proxyUrl);
+ var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;
+ var shouldProxy = true;
+
+ if (noProxyEnv) {
+ var noProxy = noProxyEnv.split(',').map(function trim(s) {
+ return s.trim();
+ });
+
+ shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {
+ if (!proxyElement) {
+ return false;
+ }
+ if (proxyElement === '*') {
+ return true;
+ }
+ if (proxyElement[0] === '.' &&
+ parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {
+ return true;
+ }
+
+ return parsed.hostname === proxyElement;
+ });
+ }
+
+ if (shouldProxy) {
+ proxy = {
+ host: parsedProxyUrl.hostname,
+ port: parsedProxyUrl.port,
+ protocol: parsedProxyUrl.protocol
+ };
+
+ if (parsedProxyUrl.auth) {
+ var proxyUrlAuth = parsedProxyUrl.auth.split(':');
+ proxy.auth = {
+ username: proxyUrlAuth[0],
+ password: proxyUrlAuth[1]
+ };
+ }
+ }
+ }
+ }
+
+ if (proxy) {
+ options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');
+ setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
+ }
+
+ var transport;
+ var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);
+ if (config.transport) {
+ transport = config.transport;
+ } else if (config.maxRedirects === 0) {
+ transport = isHttpsProxy ? https : http;
+ } else {
+ if (config.maxRedirects) {
+ options.maxRedirects = config.maxRedirects;
+ }
+ if (config.beforeRedirect) {
+ options.beforeRedirect = config.beforeRedirect;
+ }
+ transport = isHttpsProxy ? httpsFollow : httpFollow;
+ }
+
+ if (config.maxBodyLength > -1) {
+ options.maxBodyLength = config.maxBodyLength;
+ }
+
+ if (config.insecureHTTPParser) {
+ options.insecureHTTPParser = config.insecureHTTPParser;
+ }
+
+ // Create the request
+ var req = transport.request(options, function handleResponse(res) {
+ if (req.aborted) return;
+
+ // uncompress the response body transparently if required
+ var stream = res;
+
+ // return the last request in case of redirects
+ var lastRequest = res.req || req;
+
+
+ // if no content, is HEAD request or decompress disabled we should not decompress
+ if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {
+ switch (res.headers['content-encoding']) {
+ /*eslint default-case:0*/
+ case 'gzip':
+ case 'compress':
+ case 'deflate':
+ // add the unzipper to the body stream processing pipeline
+ stream = stream.pipe(zlib.createUnzip());
+
+ // remove the content-encoding in order to not confuse downstream operations
+ delete res.headers['content-encoding'];
+ break;
+ }
+ }
+
+ var response = {
+ status: res.statusCode,
+ statusText: res.statusMessage,
+ headers: res.headers,
+ config: config,
+ request: lastRequest
+ };
+
+ if (config.responseType === 'stream') {
+ response.data = stream;
+ settle(resolve, reject, response);
+ } else {
+ var responseBuffer = [];
+ var totalResponseBytes = 0;
+ stream.on('data', function handleStreamData(chunk) {
+ responseBuffer.push(chunk);
+ totalResponseBytes += chunk.length;
+
+ // make sure the content length is not over the maxContentLength if specified
+ if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
+ // stream.destoy() emit aborted event before calling reject() on Node.js v16
+ rejected = true;
+ stream.destroy();
+ reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
+ AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
+ }
+ });
+
+ stream.on('aborted', function handlerStreamAborted() {
+ if (rejected) {
+ return;
+ }
+ stream.destroy();
+ reject(new AxiosError(
+ 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
+ AxiosError.ERR_BAD_RESPONSE,
+ config,
+ lastRequest
+ ));
+ });
+
+ stream.on('error', function handleStreamError(err) {
+ if (req.aborted) return;
+ reject(AxiosError.from(err, null, config, lastRequest));
+ });
+
+ stream.on('end', function handleStreamEnd() {
+ try {
+ var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
+ if (config.responseType !== 'arraybuffer') {
+ responseData = responseData.toString(config.responseEncoding);
+ if (!config.responseEncoding || config.responseEncoding === 'utf8') {
+ responseData = utils.stripBOM(responseData);
+ }
+ }
+ response.data = responseData;
+ } catch (err) {
+ reject(AxiosError.from(err, null, config, response.request, response));
+ }
+ settle(resolve, reject, response);
+ });
+ }
+ });
+
+ // Handle errors
+ req.on('error', function handleRequestError(err) {
+ // @todo remove
+ // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
+ reject(AxiosError.from(err, null, config, req));
+ });
+
+ // set tcp keep alive to prevent drop connection by peer
+ req.on('socket', function handleRequestSocket(socket) {
+ // default interval of sending ack packet is 1 minute
+ socket.setKeepAlive(true, 1000 * 60);
+ });
+
+ // Handle request timeout
+ if (config.timeout) {
+ // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
+ var timeout = parseInt(config.timeout, 10);
+
+ if (isNaN(timeout)) {
+ reject(new AxiosError(
+ 'error trying to parse `config.timeout` to int',
+ AxiosError.ERR_BAD_OPTION_VALUE,
+ config,
+ req
+ ));
+
+ return;
+ }
+
+ // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
+ // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
+ // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
+ // And then these socket which be hang up will devoring CPU little by little.
+ // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
+ req.setTimeout(timeout, function handleRequestTimeout() {
+ req.abort();
+ var transitional = config.transitional || transitionalDefaults;
+ reject(new AxiosError(
+ 'timeout of ' + timeout + 'ms exceeded',
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
+ config,
+ req
+ ));
+ });
+ }
+
+ if (config.cancelToken || config.signal) {
+ // Handle cancellation
+ // eslint-disable-next-line func-names
+ onCanceled = function(cancel) {
+ if (req.aborted) return;
+
+ req.abort();
+ reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
+ };
+
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
+ if (config.signal) {
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
+ }
+ }
+
+
+ // Send the request
+ if (utils.isStream(data)) {
+ data.on('error', function handleStreamError(err) {
+ reject(AxiosError.from(err, config, null, req));
+ }).pipe(req);
+ } else {
+ req.end(data);
+ }
+ });
+};
diff --git a/Fronts/node_modules/axios/lib/adapters/xhr.js b/Fronts/node_modules/axios/lib/adapters/xhr.js
new file mode 100644
index 0000000..76d7e7a
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/adapters/xhr.js
@@ -0,0 +1,222 @@
+'use strict';
+
+var utils = require('./../utils');
+var settle = require('./../core/settle');
+var cookies = require('./../helpers/cookies');
+var buildURL = require('./../helpers/buildURL');
+var buildFullPath = require('../core/buildFullPath');
+var parseHeaders = require('./../helpers/parseHeaders');
+var isURLSameOrigin = require('./../helpers/isURLSameOrigin');
+var transitionalDefaults = require('../defaults/transitional');
+var AxiosError = require('../core/AxiosError');
+var CanceledError = require('../cancel/CanceledError');
+var parseProtocol = require('../helpers/parseProtocol');
+
+module.exports = function xhrAdapter(config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ var requestData = config.data;
+ var requestHeaders = config.headers;
+ var responseType = config.responseType;
+ var onCanceled;
+ function done() {
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(onCanceled);
+ }
+
+ if (config.signal) {
+ config.signal.removeEventListener('abort', onCanceled);
+ }
+ }
+
+ if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
+ delete requestHeaders['Content-Type']; // Let the browser set it
+ }
+
+ var request = new XMLHttpRequest();
+
+ // HTTP basic authentication
+ if (config.auth) {
+ var username = config.auth.username || '';
+ var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
+ requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
+ }
+
+ var fullPath = buildFullPath(config.baseURL, config.url);
+
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
+
+ // Set the request timeout in MS
+ request.timeout = config.timeout;
+
+ function onloadend() {
+ if (!request) {
+ return;
+ }
+ // Prepare the response
+ var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
+ var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
+ request.responseText : request.response;
+ var response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config: config,
+ request: request
+ };
+
+ settle(function _resolve(value) {
+ resolve(value);
+ done();
+ }, function _reject(err) {
+ reject(err);
+ done();
+ }, response);
+
+ // Clean up request
+ request = null;
+ }
+
+ if ('onloadend' in request) {
+ // Use onloadend if available
+ request.onloadend = onloadend;
+ } else {
+ // Listen for ready state to emulate onloadend
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
+
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
+ return;
+ }
+ // readystate handler is calling before onerror or ontimeout handlers,
+ // so we should call onloadend on the next 'tick'
+ setTimeout(onloadend);
+ };
+ }
+
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
+
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle low level network errors
+ request.onerror = function handleError() {
+ // Real errors are hidden from us by the browser
+ // onerror should only fire if it's a network error
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
+ var transitional = config.transitional || transitionalDefaults;
+ if (config.timeoutErrorMessage) {
+ timeoutErrorMessage = config.timeoutErrorMessage;
+ }
+ reject(new AxiosError(
+ timeoutErrorMessage,
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
+ config,
+ request));
+
+ // Clean up request
+ request = null;
+ };
+
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
+ if (utils.isStandardBrowserEnv()) {
+ // Add xsrf header
+ var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
+ cookies.read(config.xsrfCookieName) :
+ undefined;
+
+ if (xsrfValue) {
+ requestHeaders[config.xsrfHeaderName] = xsrfValue;
+ }
+ }
+
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils.forEach(requestHeaders, function setRequestHeader(val, key) {
+ if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
+ // Remove Content-Type if data is undefined
+ delete requestHeaders[key];
+ } else {
+ // Otherwise add header to the request
+ request.setRequestHeader(key, val);
+ }
+ });
+ }
+
+ // Add withCredentials to request if needed
+ if (!utils.isUndefined(config.withCredentials)) {
+ request.withCredentials = !!config.withCredentials;
+ }
+
+ // Add responseType to request if needed
+ if (responseType && responseType !== 'json') {
+ request.responseType = config.responseType;
+ }
+
+ // Handle progress if needed
+ if (typeof config.onDownloadProgress === 'function') {
+ request.addEventListener('progress', config.onDownloadProgress);
+ }
+
+ // Not all browsers support upload events
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
+ request.upload.addEventListener('progress', config.onUploadProgress);
+ }
+
+ if (config.cancelToken || config.signal) {
+ // Handle cancellation
+ // eslint-disable-next-line func-names
+ onCanceled = function(cancel) {
+ if (!request) {
+ return;
+ }
+ reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
+ request.abort();
+ request = null;
+ };
+
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
+ if (config.signal) {
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
+ }
+ }
+
+ if (!requestData) {
+ requestData = null;
+ }
+
+ var protocol = parseProtocol(fullPath);
+
+ if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
+ return;
+ }
+
+
+ // Send the request
+ request.send(requestData);
+ });
+};
diff --git a/Fronts/node_modules/axios/lib/axios.js b/Fronts/node_modules/axios/lib/axios.js
new file mode 100644
index 0000000..cf6583c
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/axios.js
@@ -0,0 +1,64 @@
+'use strict';
+
+var utils = require('./utils');
+var bind = require('./helpers/bind');
+var Axios = require('./core/Axios');
+var mergeConfig = require('./core/mergeConfig');
+var defaults = require('./defaults');
+
+/**
+ * Create an instance of Axios
+ *
+ * @param {Object} defaultConfig The default config for the instance
+ * @return {Axios} A new instance of Axios
+ */
+function createInstance(defaultConfig) {
+ var context = new Axios(defaultConfig);
+ var instance = bind(Axios.prototype.request, context);
+
+ // Copy axios.prototype to instance
+ utils.extend(instance, Axios.prototype, context);
+
+ // Copy context to instance
+ utils.extend(instance, context);
+
+ // Factory for creating new instances
+ instance.create = function create(instanceConfig) {
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
+ };
+
+ return instance;
+}
+
+// Create the default instance to be exported
+var axios = createInstance(defaults);
+
+// Expose Axios class to allow class inheritance
+axios.Axios = Axios;
+
+// Expose Cancel & CancelToken
+axios.CanceledError = require('./cancel/CanceledError');
+axios.CancelToken = require('./cancel/CancelToken');
+axios.isCancel = require('./cancel/isCancel');
+axios.VERSION = require('./env/data').version;
+axios.toFormData = require('./helpers/toFormData');
+
+// Expose AxiosError class
+axios.AxiosError = require('../lib/core/AxiosError');
+
+// alias for CanceledError for backward compatibility
+axios.Cancel = axios.CanceledError;
+
+// Expose all/spread
+axios.all = function all(promises) {
+ return Promise.all(promises);
+};
+axios.spread = require('./helpers/spread');
+
+// Expose isAxiosError
+axios.isAxiosError = require('./helpers/isAxiosError');
+
+module.exports = axios;
+
+// Allow use of default import syntax in TypeScript
+module.exports.default = axios;
diff --git a/Fronts/node_modules/axios/lib/cancel/CancelToken.js b/Fronts/node_modules/axios/lib/cancel/CancelToken.js
new file mode 100644
index 0000000..ee7989f
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/cancel/CancelToken.js
@@ -0,0 +1,119 @@
+'use strict';
+
+var CanceledError = require('./CanceledError');
+
+/**
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
+ *
+ * @class
+ * @param {Function} executor The executor function.
+ */
+function CancelToken(executor) {
+ if (typeof executor !== 'function') {
+ throw new TypeError('executor must be a function.');
+ }
+
+ var resolvePromise;
+
+ this.promise = new Promise(function promiseExecutor(resolve) {
+ resolvePromise = resolve;
+ });
+
+ var token = this;
+
+ // eslint-disable-next-line func-names
+ this.promise.then(function(cancel) {
+ if (!token._listeners) return;
+
+ var i;
+ var l = token._listeners.length;
+
+ for (i = 0; i < l; i++) {
+ token._listeners[i](cancel);
+ }
+ token._listeners = null;
+ });
+
+ // eslint-disable-next-line func-names
+ this.promise.then = function(onfulfilled) {
+ var _resolve;
+ // eslint-disable-next-line func-names
+ var promise = new Promise(function(resolve) {
+ token.subscribe(resolve);
+ _resolve = resolve;
+ }).then(onfulfilled);
+
+ promise.cancel = function reject() {
+ token.unsubscribe(_resolve);
+ };
+
+ return promise;
+ };
+
+ executor(function cancel(message) {
+ if (token.reason) {
+ // Cancellation has already been requested
+ return;
+ }
+
+ token.reason = new CanceledError(message);
+ resolvePromise(token.reason);
+ });
+}
+
+/**
+ * Throws a `CanceledError` if cancellation has been requested.
+ */
+CancelToken.prototype.throwIfRequested = function throwIfRequested() {
+ if (this.reason) {
+ throw this.reason;
+ }
+};
+
+/**
+ * Subscribe to the cancel signal
+ */
+
+CancelToken.prototype.subscribe = function subscribe(listener) {
+ if (this.reason) {
+ listener(this.reason);
+ return;
+ }
+
+ if (this._listeners) {
+ this._listeners.push(listener);
+ } else {
+ this._listeners = [listener];
+ }
+};
+
+/**
+ * Unsubscribe from the cancel signal
+ */
+
+CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
+ if (!this._listeners) {
+ return;
+ }
+ var index = this._listeners.indexOf(listener);
+ if (index !== -1) {
+ this._listeners.splice(index, 1);
+ }
+};
+
+/**
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
+ * cancels the `CancelToken`.
+ */
+CancelToken.source = function source() {
+ var cancel;
+ var token = new CancelToken(function executor(c) {
+ cancel = c;
+ });
+ return {
+ token: token,
+ cancel: cancel
+ };
+};
+
+module.exports = CancelToken;
diff --git a/Fronts/node_modules/axios/lib/cancel/CanceledError.js b/Fronts/node_modules/axios/lib/cancel/CanceledError.js
new file mode 100644
index 0000000..b7ceb02
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/cancel/CanceledError.js
@@ -0,0 +1,22 @@
+'use strict';
+
+var AxiosError = require('../core/AxiosError');
+var utils = require('../utils');
+
+/**
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
+ *
+ * @class
+ * @param {string=} message The message.
+ */
+function CanceledError(message) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);
+ this.name = 'CanceledError';
+}
+
+utils.inherits(CanceledError, AxiosError, {
+ __CANCEL__: true
+});
+
+module.exports = CanceledError;
diff --git a/Fronts/node_modules/axios/lib/cancel/isCancel.js b/Fronts/node_modules/axios/lib/cancel/isCancel.js
new file mode 100644
index 0000000..051f3ae
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/cancel/isCancel.js
@@ -0,0 +1,5 @@
+'use strict';
+
+module.exports = function isCancel(value) {
+ return !!(value && value.__CANCEL__);
+};
diff --git a/Fronts/node_modules/axios/lib/core/Axios.js b/Fronts/node_modules/axios/lib/core/Axios.js
new file mode 100644
index 0000000..3a79171
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/core/Axios.js
@@ -0,0 +1,160 @@
+'use strict';
+
+var utils = require('./../utils');
+var buildURL = require('../helpers/buildURL');
+var InterceptorManager = require('./InterceptorManager');
+var dispatchRequest = require('./dispatchRequest');
+var mergeConfig = require('./mergeConfig');
+var buildFullPath = require('./buildFullPath');
+var validator = require('../helpers/validator');
+
+var validators = validator.validators;
+/**
+ * Create a new instance of Axios
+ *
+ * @param {Object} instanceConfig The default config for the instance
+ */
+function Axios(instanceConfig) {
+ this.defaults = instanceConfig;
+ this.interceptors = {
+ request: new InterceptorManager(),
+ response: new InterceptorManager()
+ };
+}
+
+/**
+ * Dispatch a request
+ *
+ * @param {Object} config The config specific for this request (merged with this.defaults)
+ */
+Axios.prototype.request = function request(configOrUrl, config) {
+ /*eslint no-param-reassign:0*/
+ // Allow for axios('example/url'[, config]) a la fetch API
+ if (typeof configOrUrl === 'string') {
+ config = config || {};
+ config.url = configOrUrl;
+ } else {
+ config = configOrUrl || {};
+ }
+
+ config = mergeConfig(this.defaults, config);
+
+ // Set config.method
+ if (config.method) {
+ config.method = config.method.toLowerCase();
+ } else if (this.defaults.method) {
+ config.method = this.defaults.method.toLowerCase();
+ } else {
+ config.method = 'get';
+ }
+
+ var transitional = config.transitional;
+
+ if (transitional !== undefined) {
+ validator.assertOptions(transitional, {
+ silentJSONParsing: validators.transitional(validators.boolean),
+ forcedJSONParsing: validators.transitional(validators.boolean),
+ clarifyTimeoutError: validators.transitional(validators.boolean)
+ }, false);
+ }
+
+ // filter out skipped interceptors
+ var requestInterceptorChain = [];
+ var synchronousRequestInterceptors = true;
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
+ return;
+ }
+
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
+
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ var responseInterceptorChain = [];
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
+ });
+
+ var promise;
+
+ if (!synchronousRequestInterceptors) {
+ var chain = [dispatchRequest, undefined];
+
+ Array.prototype.unshift.apply(chain, requestInterceptorChain);
+ chain = chain.concat(responseInterceptorChain);
+
+ promise = Promise.resolve(config);
+ while (chain.length) {
+ promise = promise.then(chain.shift(), chain.shift());
+ }
+
+ return promise;
+ }
+
+
+ var newConfig = config;
+ while (requestInterceptorChain.length) {
+ var onFulfilled = requestInterceptorChain.shift();
+ var onRejected = requestInterceptorChain.shift();
+ try {
+ newConfig = onFulfilled(newConfig);
+ } catch (error) {
+ onRejected(error);
+ break;
+ }
+ }
+
+ try {
+ promise = dispatchRequest(newConfig);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ while (responseInterceptorChain.length) {
+ promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
+ }
+
+ return promise;
+};
+
+Axios.prototype.getUri = function getUri(config) {
+ config = mergeConfig(this.defaults, config);
+ var fullPath = buildFullPath(config.baseURL, config.url);
+ return buildURL(fullPath, config.params, config.paramsSerializer);
+};
+
+// Provide aliases for supported request methods
+utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function(url, config) {
+ return this.request(mergeConfig(config || {}, {
+ method: method,
+ url: url,
+ data: (config || {}).data
+ }));
+ };
+});
+
+utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ /*eslint func-names:0*/
+
+ function generateHTTPMethod(isForm) {
+ return function httpMethod(url, data, config) {
+ return this.request(mergeConfig(config || {}, {
+ method: method,
+ headers: isForm ? {
+ 'Content-Type': 'multipart/form-data'
+ } : {},
+ url: url,
+ data: data
+ }));
+ };
+ }
+
+ Axios.prototype[method] = generateHTTPMethod();
+
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
+});
+
+module.exports = Axios;
diff --git a/Fronts/node_modules/axios/lib/core/AxiosError.js b/Fronts/node_modules/axios/lib/core/AxiosError.js
new file mode 100644
index 0000000..52c806a
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/core/AxiosError.js
@@ -0,0 +1,86 @@
+'use strict';
+
+var utils = require('../utils');
+
+/**
+ * Create an Error with the specified message, config, error code, request and response.
+ *
+ * @param {string} message The error message.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [config] The config.
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ * @returns {Error} The created error.
+ */
+function AxiosError(message, code, config, request, response) {
+ Error.call(this);
+ this.message = message;
+ this.name = 'AxiosError';
+ code && (this.code = code);
+ config && (this.config = config);
+ request && (this.request = request);
+ response && (this.response = response);
+}
+
+utils.inherits(AxiosError, Error, {
+ toJSON: function toJSON() {
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: this.config,
+ code: this.code,
+ status: this.response && this.response.status ? this.response.status : null
+ };
+ }
+});
+
+var prototype = AxiosError.prototype;
+var descriptors = {};
+
+[
+ 'ERR_BAD_OPTION_VALUE',
+ 'ERR_BAD_OPTION',
+ 'ECONNABORTED',
+ 'ETIMEDOUT',
+ 'ERR_NETWORK',
+ 'ERR_FR_TOO_MANY_REDIRECTS',
+ 'ERR_DEPRECATED',
+ 'ERR_BAD_RESPONSE',
+ 'ERR_BAD_REQUEST',
+ 'ERR_CANCELED'
+// eslint-disable-next-line func-names
+].forEach(function(code) {
+ descriptors[code] = {value: code};
+});
+
+Object.defineProperties(AxiosError, descriptors);
+Object.defineProperty(prototype, 'isAxiosError', {value: true});
+
+// eslint-disable-next-line func-names
+AxiosError.from = function(error, code, config, request, response, customProps) {
+ var axiosError = Object.create(prototype);
+
+ utils.toFlatObject(error, axiosError, function filter(obj) {
+ return obj !== Error.prototype;
+ });
+
+ AxiosError.call(axiosError, error.message, code, config, request, response);
+
+ axiosError.name = error.name;
+
+ customProps && Object.assign(axiosError, customProps);
+
+ return axiosError;
+};
+
+module.exports = AxiosError;
diff --git a/Fronts/node_modules/axios/lib/core/InterceptorManager.js b/Fronts/node_modules/axios/lib/core/InterceptorManager.js
new file mode 100644
index 0000000..900f448
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/core/InterceptorManager.js
@@ -0,0 +1,54 @@
+'use strict';
+
+var utils = require('./../utils');
+
+function InterceptorManager() {
+ this.handlers = [];
+}
+
+/**
+ * Add a new interceptor to the stack
+ *
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
+ *
+ * @return {Number} An ID used to remove interceptor later
+ */
+InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
+ this.handlers.push({
+ fulfilled: fulfilled,
+ rejected: rejected,
+ synchronous: options ? options.synchronous : false,
+ runWhen: options ? options.runWhen : null
+ });
+ return this.handlers.length - 1;
+};
+
+/**
+ * Remove an interceptor from the stack
+ *
+ * @param {Number} id The ID that was returned by `use`
+ */
+InterceptorManager.prototype.eject = function eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
+ }
+};
+
+/**
+ * Iterate over all the registered interceptors
+ *
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
+ */
+InterceptorManager.prototype.forEach = function forEach(fn) {
+ utils.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+};
+
+module.exports = InterceptorManager;
diff --git a/Fronts/node_modules/axios/lib/core/README.md b/Fronts/node_modules/axios/lib/core/README.md
new file mode 100644
index 0000000..84559ce
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/core/README.md
@@ -0,0 +1,8 @@
+# axios // core
+
+The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are:
+
+- Dispatching requests
+ - Requests sent via `adapters/` (see lib/adapters/README.md)
+- Managing interceptors
+- Handling config
diff --git a/Fronts/node_modules/axios/lib/core/buildFullPath.js b/Fronts/node_modules/axios/lib/core/buildFullPath.js
new file mode 100644
index 0000000..00b2b05
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/core/buildFullPath.js
@@ -0,0 +1,20 @@
+'use strict';
+
+var isAbsoluteURL = require('../helpers/isAbsoluteURL');
+var combineURLs = require('../helpers/combineURLs');
+
+/**
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ * @returns {string} The combined full path
+ */
+module.exports = function buildFullPath(baseURL, requestedURL) {
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+};
diff --git a/Fronts/node_modules/axios/lib/core/dispatchRequest.js b/Fronts/node_modules/axios/lib/core/dispatchRequest.js
new file mode 100644
index 0000000..fa1ad95
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/core/dispatchRequest.js
@@ -0,0 +1,87 @@
+'use strict';
+
+var utils = require('./../utils');
+var transformData = require('./transformData');
+var isCancel = require('../cancel/isCancel');
+var defaults = require('../defaults');
+var CanceledError = require('../cancel/CanceledError');
+
+/**
+ * Throws a `CanceledError` if cancellation has been requested.
+ */
+function throwIfCancellationRequested(config) {
+ if (config.cancelToken) {
+ config.cancelToken.throwIfRequested();
+ }
+
+ if (config.signal && config.signal.aborted) {
+ throw new CanceledError();
+ }
+}
+
+/**
+ * Dispatch a request to the server using the configured adapter.
+ *
+ * @param {object} config The config that is to be used for the request
+ * @returns {Promise} The Promise to be fulfilled
+ */
+module.exports = function dispatchRequest(config) {
+ throwIfCancellationRequested(config);
+
+ // Ensure headers exist
+ config.headers = config.headers || {};
+
+ // Transform request data
+ config.data = transformData.call(
+ config,
+ config.data,
+ config.headers,
+ config.transformRequest
+ );
+
+ // Flatten headers
+ config.headers = utils.merge(
+ config.headers.common || {},
+ config.headers[config.method] || {},
+ config.headers
+ );
+
+ utils.forEach(
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
+ function cleanHeaderConfig(method) {
+ delete config.headers[method];
+ }
+ );
+
+ var adapter = config.adapter || defaults.adapter;
+
+ return adapter(config).then(function onAdapterResolution(response) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ response.data = transformData.call(
+ config,
+ response.data,
+ response.headers,
+ config.transformResponse
+ );
+
+ return response;
+ }, function onAdapterRejection(reason) {
+ if (!isCancel(reason)) {
+ throwIfCancellationRequested(config);
+
+ // Transform response data
+ if (reason && reason.response) {
+ reason.response.data = transformData.call(
+ config,
+ reason.response.data,
+ reason.response.headers,
+ config.transformResponse
+ );
+ }
+ }
+
+ return Promise.reject(reason);
+ });
+};
diff --git a/Fronts/node_modules/axios/lib/core/mergeConfig.js b/Fronts/node_modules/axios/lib/core/mergeConfig.js
new file mode 100644
index 0000000..eb7aa39
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/core/mergeConfig.js
@@ -0,0 +1,100 @@
+'use strict';
+
+var utils = require('../utils');
+
+/**
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
+ *
+ * @param {Object} config1
+ * @param {Object} config2
+ * @returns {Object} New object resulting from merging config2 to config1
+ */
+module.exports = function mergeConfig(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config2 = config2 || {};
+ var config = {};
+
+ function getMergedValue(target, source) {
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
+ return utils.merge(target, source);
+ } else if (utils.isPlainObject(source)) {
+ return utils.merge({}, source);
+ } else if (utils.isArray(source)) {
+ return source.slice();
+ }
+ return source;
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDeepProperties(prop) {
+ if (!utils.isUndefined(config2[prop])) {
+ return getMergedValue(config1[prop], config2[prop]);
+ } else if (!utils.isUndefined(config1[prop])) {
+ return getMergedValue(undefined, config1[prop]);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function valueFromConfig2(prop) {
+ if (!utils.isUndefined(config2[prop])) {
+ return getMergedValue(undefined, config2[prop]);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function defaultToConfig2(prop) {
+ if (!utils.isUndefined(config2[prop])) {
+ return getMergedValue(undefined, config2[prop]);
+ } else if (!utils.isUndefined(config1[prop])) {
+ return getMergedValue(undefined, config1[prop]);
+ }
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDirectKeys(prop) {
+ if (prop in config2) {
+ return getMergedValue(config1[prop], config2[prop]);
+ } else if (prop in config1) {
+ return getMergedValue(undefined, config1[prop]);
+ }
+ }
+
+ var mergeMap = {
+ 'url': valueFromConfig2,
+ 'method': valueFromConfig2,
+ 'data': valueFromConfig2,
+ 'baseURL': defaultToConfig2,
+ 'transformRequest': defaultToConfig2,
+ 'transformResponse': defaultToConfig2,
+ 'paramsSerializer': defaultToConfig2,
+ 'timeout': defaultToConfig2,
+ 'timeoutMessage': defaultToConfig2,
+ 'withCredentials': defaultToConfig2,
+ 'adapter': defaultToConfig2,
+ 'responseType': defaultToConfig2,
+ 'xsrfCookieName': defaultToConfig2,
+ 'xsrfHeaderName': defaultToConfig2,
+ 'onUploadProgress': defaultToConfig2,
+ 'onDownloadProgress': defaultToConfig2,
+ 'decompress': defaultToConfig2,
+ 'maxContentLength': defaultToConfig2,
+ 'maxBodyLength': defaultToConfig2,
+ 'beforeRedirect': defaultToConfig2,
+ 'transport': defaultToConfig2,
+ 'httpAgent': defaultToConfig2,
+ 'httpsAgent': defaultToConfig2,
+ 'cancelToken': defaultToConfig2,
+ 'socketPath': defaultToConfig2,
+ 'responseEncoding': defaultToConfig2,
+ 'validateStatus': mergeDirectKeys
+ };
+
+ utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
+ var merge = mergeMap[prop] || mergeDeepProperties;
+ var configValue = merge(prop);
+ (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
+ });
+
+ return config;
+};
diff --git a/Fronts/node_modules/axios/lib/core/settle.js b/Fronts/node_modules/axios/lib/core/settle.js
new file mode 100644
index 0000000..bbb9afa
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/core/settle.js
@@ -0,0 +1,25 @@
+'use strict';
+
+var AxiosError = require('./AxiosError');
+
+/**
+ * Resolve or reject a Promise based on response status.
+ *
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
+ */
+module.exports = function settle(resolve, reject, response) {
+ var validateStatus = response.config.validateStatus;
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(new AxiosError(
+ 'Request failed with status code ' + response.status,
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
+ response.config,
+ response.request,
+ response
+ ));
+ }
+};
diff --git a/Fronts/node_modules/axios/lib/core/transformData.js b/Fronts/node_modules/axios/lib/core/transformData.js
new file mode 100644
index 0000000..82ee7dd
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/core/transformData.js
@@ -0,0 +1,22 @@
+'use strict';
+
+var utils = require('./../utils');
+var defaults = require('../defaults');
+
+/**
+ * Transform the data for a request or a response
+ *
+ * @param {Object|String} data The data to be transformed
+ * @param {Array} headers The headers for the request or response
+ * @param {Array|Function} fns A single function or Array of functions
+ * @returns {*} The resulting transformed data
+ */
+module.exports = function transformData(data, headers, fns) {
+ var context = this || defaults;
+ /*eslint no-param-reassign:0*/
+ utils.forEach(fns, function transform(fn) {
+ data = fn.call(context, data, headers);
+ });
+
+ return data;
+};
diff --git a/Fronts/node_modules/axios/lib/defaults/env/FormData.js b/Fronts/node_modules/axios/lib/defaults/env/FormData.js
new file mode 100644
index 0000000..a8e6bdf
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/defaults/env/FormData.js
@@ -0,0 +1,2 @@
+// eslint-disable-next-line strict
+module.exports = require('form-data');
diff --git a/Fronts/node_modules/axios/lib/defaults/index.js b/Fronts/node_modules/axios/lib/defaults/index.js
new file mode 100644
index 0000000..9199818
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/defaults/index.js
@@ -0,0 +1,146 @@
+'use strict';
+
+var utils = require('../utils');
+var normalizeHeaderName = require('../helpers/normalizeHeaderName');
+var AxiosError = require('../core/AxiosError');
+var transitionalDefaults = require('./transitional');
+var toFormData = require('../helpers/toFormData');
+
+var DEFAULT_CONTENT_TYPE = {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+};
+
+function setContentTypeIfUnset(headers, value) {
+ if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
+ headers['Content-Type'] = value;
+ }
+}
+
+function getDefaultAdapter() {
+ var adapter;
+ if (typeof XMLHttpRequest !== 'undefined') {
+ // For browsers use XHR adapter
+ adapter = require('../adapters/xhr');
+ } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
+ // For node use HTTP adapter
+ adapter = require('../adapters/http');
+ }
+ return adapter;
+}
+
+function stringifySafely(rawValue, parser, encoder) {
+ if (utils.isString(rawValue)) {
+ try {
+ (parser || JSON.parse)(rawValue);
+ return utils.trim(rawValue);
+ } catch (e) {
+ if (e.name !== 'SyntaxError') {
+ throw e;
+ }
+ }
+ }
+
+ return (encoder || JSON.stringify)(rawValue);
+}
+
+var defaults = {
+
+ transitional: transitionalDefaults,
+
+ adapter: getDefaultAdapter(),
+
+ transformRequest: [function transformRequest(data, headers) {
+ normalizeHeaderName(headers, 'Accept');
+ normalizeHeaderName(headers, 'Content-Type');
+
+ if (utils.isFormData(data) ||
+ utils.isArrayBuffer(data) ||
+ utils.isBuffer(data) ||
+ utils.isStream(data) ||
+ utils.isFile(data) ||
+ utils.isBlob(data)
+ ) {
+ return data;
+ }
+ if (utils.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils.isURLSearchParams(data)) {
+ setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
+ return data.toString();
+ }
+
+ var isObjectPayload = utils.isObject(data);
+ var contentType = headers && headers['Content-Type'];
+
+ var isFileList;
+
+ if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {
+ var _FormData = this.env && this.env.FormData;
+ return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());
+ } else if (isObjectPayload || contentType === 'application/json') {
+ setContentTypeIfUnset(headers, 'application/json');
+ return stringifySafely(data);
+ }
+
+ return data;
+ }],
+
+ transformResponse: [function transformResponse(data) {
+ var transitional = this.transitional || defaults.transitional;
+ var silentJSONParsing = transitional && transitional.silentJSONParsing;
+ var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+ var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
+
+ if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
+ try {
+ return JSON.parse(data);
+ } catch (e) {
+ if (strictJSONParsing) {
+ if (e.name === 'SyntaxError') {
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
+ }
+ throw e;
+ }
+ }
+ }
+
+ return data;
+ }],
+
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
+
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
+
+ maxContentLength: -1,
+ maxBodyLength: -1,
+
+ env: {
+ FormData: require('./env/FormData')
+ },
+
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ },
+
+ headers: {
+ common: {
+ 'Accept': 'application/json, text/plain, */*'
+ }
+ }
+};
+
+utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
+ defaults.headers[method] = {};
+});
+
+utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
+});
+
+module.exports = defaults;
diff --git a/Fronts/node_modules/axios/lib/defaults/transitional.js b/Fronts/node_modules/axios/lib/defaults/transitional.js
new file mode 100644
index 0000000..601dd7e
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/defaults/transitional.js
@@ -0,0 +1,7 @@
+'use strict';
+
+module.exports = {
+ silentJSONParsing: true,
+ forcedJSONParsing: true,
+ clarifyTimeoutError: false
+};
diff --git a/Fronts/node_modules/axios/lib/env/README.md b/Fronts/node_modules/axios/lib/env/README.md
new file mode 100644
index 0000000..b41baff
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/env/README.md
@@ -0,0 +1,3 @@
+# axios // env
+
+The `data.js` file is updated automatically when the package version is upgrading. Please do not edit it manually.
diff --git a/Fronts/node_modules/axios/lib/env/data.js b/Fronts/node_modules/axios/lib/env/data.js
new file mode 100644
index 0000000..62f7a0e
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/env/data.js
@@ -0,0 +1,3 @@
+module.exports = {
+ "version": "0.27.2"
+};
\ No newline at end of file
diff --git a/Fronts/node_modules/axios/lib/helpers/README.md b/Fronts/node_modules/axios/lib/helpers/README.md
new file mode 100644
index 0000000..4ae3419
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/README.md
@@ -0,0 +1,7 @@
+# axios // helpers
+
+The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like:
+
+- Browser polyfills
+- Managing cookies
+- Parsing HTTP headers
diff --git a/Fronts/node_modules/axios/lib/helpers/bind.js b/Fronts/node_modules/axios/lib/helpers/bind.js
new file mode 100644
index 0000000..6147c60
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/bind.js
@@ -0,0 +1,11 @@
+'use strict';
+
+module.exports = function bind(fn, thisArg) {
+ return function wrap() {
+ var args = new Array(arguments.length);
+ for (var i = 0; i < args.length; i++) {
+ args[i] = arguments[i];
+ }
+ return fn.apply(thisArg, args);
+ };
+};
diff --git a/Fronts/node_modules/axios/lib/helpers/buildURL.js b/Fronts/node_modules/axios/lib/helpers/buildURL.js
new file mode 100644
index 0000000..31595c3
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/buildURL.js
@@ -0,0 +1,70 @@
+'use strict';
+
+var utils = require('./../utils');
+
+function encode(val) {
+ return encodeURIComponent(val).
+ replace(/%3A/gi, ':').
+ replace(/%24/g, '$').
+ replace(/%2C/gi, ',').
+ replace(/%20/g, '+').
+ replace(/%5B/gi, '[').
+ replace(/%5D/gi, ']');
+}
+
+/**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @returns {string} The formatted url
+ */
+module.exports = function buildURL(url, params, paramsSerializer) {
+ /*eslint no-param-reassign:0*/
+ if (!params) {
+ return url;
+ }
+
+ var serializedParams;
+ if (paramsSerializer) {
+ serializedParams = paramsSerializer(params);
+ } else if (utils.isURLSearchParams(params)) {
+ serializedParams = params.toString();
+ } else {
+ var parts = [];
+
+ utils.forEach(params, function serialize(val, key) {
+ if (val === null || typeof val === 'undefined') {
+ return;
+ }
+
+ if (utils.isArray(val)) {
+ key = key + '[]';
+ } else {
+ val = [val];
+ }
+
+ utils.forEach(val, function parseValue(v) {
+ if (utils.isDate(v)) {
+ v = v.toISOString();
+ } else if (utils.isObject(v)) {
+ v = JSON.stringify(v);
+ }
+ parts.push(encode(key) + '=' + encode(v));
+ });
+ });
+
+ serializedParams = parts.join('&');
+ }
+
+ if (serializedParams) {
+ var hashmarkIndex = url.indexOf('#');
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
+
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
+
+ return url;
+};
diff --git a/Fronts/node_modules/axios/lib/helpers/combineURLs.js b/Fronts/node_modules/axios/lib/helpers/combineURLs.js
new file mode 100644
index 0000000..f1b58a5
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/combineURLs.js
@@ -0,0 +1,14 @@
+'use strict';
+
+/**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ * @returns {string} The combined URL
+ */
+module.exports = function combineURLs(baseURL, relativeURL) {
+ return relativeURL
+ ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
+ : baseURL;
+};
diff --git a/Fronts/node_modules/axios/lib/helpers/cookies.js b/Fronts/node_modules/axios/lib/helpers/cookies.js
new file mode 100644
index 0000000..5a8a666
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/cookies.js
@@ -0,0 +1,53 @@
+'use strict';
+
+var utils = require('./../utils');
+
+module.exports = (
+ utils.isStandardBrowserEnv() ?
+
+ // Standard browser envs support document.cookie
+ (function standardBrowserEnv() {
+ return {
+ write: function write(name, value, expires, path, domain, secure) {
+ var cookie = [];
+ cookie.push(name + '=' + encodeURIComponent(value));
+
+ if (utils.isNumber(expires)) {
+ cookie.push('expires=' + new Date(expires).toGMTString());
+ }
+
+ if (utils.isString(path)) {
+ cookie.push('path=' + path);
+ }
+
+ if (utils.isString(domain)) {
+ cookie.push('domain=' + domain);
+ }
+
+ if (secure === true) {
+ cookie.push('secure');
+ }
+
+ document.cookie = cookie.join('; ');
+ },
+
+ read: function read(name) {
+ var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
+ return (match ? decodeURIComponent(match[3]) : null);
+ },
+
+ remove: function remove(name) {
+ this.write(name, '', Date.now() - 86400000);
+ }
+ };
+ })() :
+
+ // Non standard browser env (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return {
+ write: function write() {},
+ read: function read() { return null; },
+ remove: function remove() {}
+ };
+ })()
+);
diff --git a/Fronts/node_modules/axios/lib/helpers/deprecatedMethod.js b/Fronts/node_modules/axios/lib/helpers/deprecatedMethod.js
new file mode 100644
index 0000000..ed40965
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/deprecatedMethod.js
@@ -0,0 +1,24 @@
+'use strict';
+
+/*eslint no-console:0*/
+
+/**
+ * Supply a warning to the developer that a method they are using
+ * has been deprecated.
+ *
+ * @param {string} method The name of the deprecated method
+ * @param {string} [instead] The alternate method to use if applicable
+ * @param {string} [docs] The documentation URL to get further details
+ */
+module.exports = function deprecatedMethod(method, instead, docs) {
+ try {
+ console.warn(
+ 'DEPRECATED method `' + method + '`.' +
+ (instead ? ' Use `' + instead + '` instead.' : '') +
+ ' This method will be removed in a future release.');
+
+ if (docs) {
+ console.warn('For more information about usage see ' + docs);
+ }
+ } catch (e) { /* Ignore */ }
+};
diff --git a/Fronts/node_modules/axios/lib/helpers/isAbsoluteURL.js b/Fronts/node_modules/axios/lib/helpers/isAbsoluteURL.js
new file mode 100644
index 0000000..43fea78
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/isAbsoluteURL.js
@@ -0,0 +1,14 @@
+'use strict';
+
+/**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+module.exports = function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
+};
diff --git a/Fronts/node_modules/axios/lib/helpers/isAxiosError.js b/Fronts/node_modules/axios/lib/helpers/isAxiosError.js
new file mode 100644
index 0000000..a037bec
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/isAxiosError.js
@@ -0,0 +1,13 @@
+'use strict';
+
+var utils = require('./../utils');
+
+/**
+ * Determines whether the payload is an error thrown by Axios
+ *
+ * @param {*} payload The value to test
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
+ */
+module.exports = function isAxiosError(payload) {
+ return utils.isObject(payload) && (payload.isAxiosError === true);
+};
diff --git a/Fronts/node_modules/axios/lib/helpers/isURLSameOrigin.js b/Fronts/node_modules/axios/lib/helpers/isURLSameOrigin.js
new file mode 100644
index 0000000..f1d89ad
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/isURLSameOrigin.js
@@ -0,0 +1,68 @@
+'use strict';
+
+var utils = require('./../utils');
+
+module.exports = (
+ utils.isStandardBrowserEnv() ?
+
+ // Standard browser envs have full support of the APIs needed to test
+ // whether the request URL is of the same origin as current location.
+ (function standardBrowserEnv() {
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
+ var urlParsingNode = document.createElement('a');
+ var originURL;
+
+ /**
+ * Parse a URL to discover it's components
+ *
+ * @param {String} url The URL to be parsed
+ * @returns {Object}
+ */
+ function resolveURL(url) {
+ var href = url;
+
+ if (msie) {
+ // IE needs attribute set twice to normalize properties
+ urlParsingNode.setAttribute('href', href);
+ href = urlParsingNode.href;
+ }
+
+ urlParsingNode.setAttribute('href', href);
+
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
+ return {
+ href: urlParsingNode.href,
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
+ host: urlParsingNode.host,
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
+ hostname: urlParsingNode.hostname,
+ port: urlParsingNode.port,
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
+ urlParsingNode.pathname :
+ '/' + urlParsingNode.pathname
+ };
+ }
+
+ originURL = resolveURL(window.location.href);
+
+ /**
+ * Determine if a URL shares the same origin as the current location
+ *
+ * @param {String} requestURL The URL to test
+ * @returns {boolean} True if URL shares the same origin, otherwise false
+ */
+ return function isURLSameOrigin(requestURL) {
+ var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
+ return (parsed.protocol === originURL.protocol &&
+ parsed.host === originURL.host);
+ };
+ })() :
+
+ // Non standard browser envs (web workers, react-native) lack needed support.
+ (function nonStandardBrowserEnv() {
+ return function isURLSameOrigin() {
+ return true;
+ };
+ })()
+);
diff --git a/Fronts/node_modules/axios/lib/helpers/normalizeHeaderName.js b/Fronts/node_modules/axios/lib/helpers/normalizeHeaderName.js
new file mode 100644
index 0000000..738c9fe
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/normalizeHeaderName.js
@@ -0,0 +1,12 @@
+'use strict';
+
+var utils = require('../utils');
+
+module.exports = function normalizeHeaderName(headers, normalizedName) {
+ utils.forEach(headers, function processHeader(value, name) {
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
+ headers[normalizedName] = value;
+ delete headers[name];
+ }
+ });
+};
diff --git a/Fronts/node_modules/axios/lib/helpers/null.js b/Fronts/node_modules/axios/lib/helpers/null.js
new file mode 100644
index 0000000..859bace
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/null.js
@@ -0,0 +1,2 @@
+// eslint-disable-next-line strict
+module.exports = null;
diff --git a/Fronts/node_modules/axios/lib/helpers/parseHeaders.js b/Fronts/node_modules/axios/lib/helpers/parseHeaders.js
new file mode 100644
index 0000000..8af2cc7
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/parseHeaders.js
@@ -0,0 +1,53 @@
+'use strict';
+
+var utils = require('./../utils');
+
+// Headers whose duplicates are ignored by node
+// c.f. https://nodejs.org/api/http.html#http_message_headers
+var ignoreDuplicateOf = [
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
+ 'referer', 'retry-after', 'user-agent'
+];
+
+/**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} headers Headers needing to be parsed
+ * @returns {Object} Headers parsed into an object
+ */
+module.exports = function parseHeaders(headers) {
+ var parsed = {};
+ var key;
+ var val;
+ var i;
+
+ if (!headers) { return parsed; }
+
+ utils.forEach(headers.split('\n'), function parser(line) {
+ i = line.indexOf(':');
+ key = utils.trim(line.substr(0, i)).toLowerCase();
+ val = utils.trim(line.substr(i + 1));
+
+ if (key) {
+ if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
+ return;
+ }
+ if (key === 'set-cookie') {
+ parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ }
+ });
+
+ return parsed;
+};
diff --git a/Fronts/node_modules/axios/lib/helpers/parseProtocol.js b/Fronts/node_modules/axios/lib/helpers/parseProtocol.js
new file mode 100644
index 0000000..10f3f02
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/parseProtocol.js
@@ -0,0 +1,6 @@
+'use strict';
+
+module.exports = function parseProtocol(url) {
+ var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
+ return match && match[1] || '';
+};
diff --git a/Fronts/node_modules/axios/lib/helpers/spread.js b/Fronts/node_modules/axios/lib/helpers/spread.js
new file mode 100644
index 0000000..25e3cdd
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/spread.js
@@ -0,0 +1,27 @@
+'use strict';
+
+/**
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
+ *
+ * Common use case would be to use `Function.prototype.apply`.
+ *
+ * ```js
+ * function f(x, y, z) {}
+ * var args = [1, 2, 3];
+ * f.apply(null, args);
+ * ```
+ *
+ * With `spread` this example can be re-written.
+ *
+ * ```js
+ * spread(function(x, y, z) {})([1, 2, 3]);
+ * ```
+ *
+ * @param {Function} callback
+ * @returns {Function}
+ */
+module.exports = function spread(callback) {
+ return function wrap(arr) {
+ return callback.apply(null, arr);
+ };
+};
diff --git a/Fronts/node_modules/axios/lib/helpers/toFormData.js b/Fronts/node_modules/axios/lib/helpers/toFormData.js
new file mode 100644
index 0000000..5e3cc0f
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/toFormData.js
@@ -0,0 +1,72 @@
+'use strict';
+
+var utils = require('../utils');
+
+/**
+ * Convert a data object to FormData
+ * @param {Object} obj
+ * @param {?Object} [formData]
+ * @returns {Object}
+ **/
+
+function toFormData(obj, formData) {
+ // eslint-disable-next-line no-param-reassign
+ formData = formData || new FormData();
+
+ var stack = [];
+
+ function convertValue(value) {
+ if (value === null) return '';
+
+ if (utils.isDate(value)) {
+ return value.toISOString();
+ }
+
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
+ return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
+ }
+
+ return value;
+ }
+
+ function build(data, parentKey) {
+ if (utils.isPlainObject(data) || utils.isArray(data)) {
+ if (stack.indexOf(data) !== -1) {
+ throw Error('Circular reference detected in ' + parentKey);
+ }
+
+ stack.push(data);
+
+ utils.forEach(data, function each(value, key) {
+ if (utils.isUndefined(value)) return;
+ var fullKey = parentKey ? parentKey + '.' + key : key;
+ var arr;
+
+ if (value && !parentKey && typeof value === 'object') {
+ if (utils.endsWith(key, '{}')) {
+ // eslint-disable-next-line no-param-reassign
+ value = JSON.stringify(value);
+ } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
+ // eslint-disable-next-line func-names
+ arr.forEach(function(el) {
+ !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
+ });
+ return;
+ }
+ }
+
+ build(value, fullKey);
+ });
+
+ stack.pop();
+ } else {
+ formData.append(parentKey, convertValue(data));
+ }
+ }
+
+ build(obj);
+
+ return formData;
+}
+
+module.exports = toFormData;
diff --git a/Fronts/node_modules/axios/lib/helpers/validator.js b/Fronts/node_modules/axios/lib/helpers/validator.js
new file mode 100644
index 0000000..8095b90
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/helpers/validator.js
@@ -0,0 +1,86 @@
+'use strict';
+
+var VERSION = require('../env/data').version;
+var AxiosError = require('../core/AxiosError');
+
+var validators = {};
+
+// eslint-disable-next-line func-names
+['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
+ validators[type] = function validator(thing) {
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
+ };
+});
+
+var deprecatedWarnings = {};
+
+/**
+ * Transitional option validator
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
+ * @param {string?} version - deprecated version / removed since version
+ * @param {string?} message - some message with additional info
+ * @returns {function}
+ */
+validators.transitional = function transitional(validator, version, message) {
+ function formatMessage(opt, desc) {
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
+ }
+
+ // eslint-disable-next-line func-names
+ return function(value, opt, opts) {
+ if (validator === false) {
+ throw new AxiosError(
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
+ AxiosError.ERR_DEPRECATED
+ );
+ }
+
+ if (version && !deprecatedWarnings[opt]) {
+ deprecatedWarnings[opt] = true;
+ // eslint-disable-next-line no-console
+ console.warn(
+ formatMessage(
+ opt,
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
+ )
+ );
+ }
+
+ return validator ? validator(value, opt, opts) : true;
+ };
+};
+
+/**
+ * Assert object's properties type
+ * @param {object} options
+ * @param {object} schema
+ * @param {boolean?} allowUnknown
+ */
+
+function assertOptions(options, schema, allowUnknown) {
+ if (typeof options !== 'object') {
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ var keys = Object.keys(options);
+ var i = keys.length;
+ while (i-- > 0) {
+ var opt = keys[i];
+ var validator = schema[opt];
+ if (validator) {
+ var value = options[opt];
+ var result = value === undefined || validator(value, opt, options);
+ if (result !== true) {
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ continue;
+ }
+ if (allowUnknown !== true) {
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
+ }
+ }
+}
+
+module.exports = {
+ assertOptions: assertOptions,
+ validators: validators
+};
diff --git a/Fronts/node_modules/axios/lib/utils.js b/Fronts/node_modules/axios/lib/utils.js
new file mode 100644
index 0000000..18de154
--- /dev/null
+++ b/Fronts/node_modules/axios/lib/utils.js
@@ -0,0 +1,470 @@
+'use strict';
+
+var bind = require('./helpers/bind');
+
+// utils is a library of generic helper functions non-specific to axios
+
+var toString = Object.prototype.toString;
+
+// eslint-disable-next-line func-names
+var kindOf = (function(cache) {
+ // eslint-disable-next-line func-names
+ return function(thing) {
+ var str = toString.call(thing);
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
+ };
+})(Object.create(null));
+
+function kindOfTest(type) {
+ type = type.toLowerCase();
+ return function isKindOf(thing) {
+ return kindOf(thing) === type;
+ };
+}
+
+/**
+ * Determine if a value is an Array
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+function isArray(val) {
+ return Array.isArray(val);
+}
+
+/**
+ * Determine if a value is undefined
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+function isUndefined(val) {
+ return typeof val === 'undefined';
+}
+
+/**
+ * Determine if a value is a Buffer
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Buffer, otherwise false
+ */
+function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
+ && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
+}
+
+/**
+ * Determine if a value is an ArrayBuffer
+ *
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
+ */
+var isArrayBuffer = kindOfTest('ArrayBuffer');
+
+
+/**
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
+ */
+function isArrayBufferView(val) {
+ var result;
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
+ }
+ return result;
+}
+
+/**
+ * Determine if a value is a String
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a String, otherwise false
+ */
+function isString(val) {
+ return typeof val === 'string';
+}
+
+/**
+ * Determine if a value is a Number
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+function isNumber(val) {
+ return typeof val === 'number';
+}
+
+/**
+ * Determine if a value is an Object
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is an Object, otherwise false
+ */
+function isObject(val) {
+ return val !== null && typeof val === 'object';
+}
+
+/**
+ * Determine if a value is a plain Object
+ *
+ * @param {Object} val The value to test
+ * @return {boolean} True if value is a plain Object, otherwise false
+ */
+function isPlainObject(val) {
+ if (kindOf(val) !== 'object') {
+ return false;
+ }
+
+ var prototype = Object.getPrototypeOf(val);
+ return prototype === null || prototype === Object.prototype;
+}
+
+/**
+ * Determine if a value is a Date
+ *
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+var isDate = kindOfTest('Date');
+
+/**
+ * Determine if a value is a File
+ *
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+var isFile = kindOfTest('File');
+
+/**
+ * Determine if a value is a Blob
+ *
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+var isBlob = kindOfTest('Blob');
+
+/**
+ * Determine if a value is a FileList
+ *
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+var isFileList = kindOfTest('FileList');
+
+/**
+ * Determine if a value is a Function
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+function isFunction(val) {
+ return toString.call(val) === '[object Function]';
+}
+
+/**
+ * Determine if a value is a Stream
+ *
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+function isStream(val) {
+ return isObject(val) && isFunction(val.pipe);
+}
+
+/**
+ * Determine if a value is a FormData
+ *
+ * @param {Object} thing The value to test
+ * @returns {boolean} True if value is an FormData, otherwise false
+ */
+function isFormData(thing) {
+ var pattern = '[object FormData]';
+ return thing && (
+ (typeof FormData === 'function' && thing instanceof FormData) ||
+ toString.call(thing) === pattern ||
+ (isFunction(thing.toString) && thing.toString() === pattern)
+ );
+}
+
+/**
+ * Determine if a value is a URLSearchParams object
+ * @function
+ * @param {Object} val The value to test
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+var isURLSearchParams = kindOfTest('URLSearchParams');
+
+/**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ * @returns {String} The String freed of excess whitespace
+ */
+function trim(str) {
+ return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
+}
+
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ */
+function isStandardBrowserEnv() {
+ if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
+ navigator.product === 'NativeScript' ||
+ navigator.product === 'NS')) {
+ return false;
+ }
+ return (
+ typeof window !== 'undefined' &&
+ typeof document !== 'undefined'
+ );
+}
+
+/**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ */
+function forEach(obj, fn) {
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
+ }
+
+ // Force an array if not already something iterable
+ if (typeof obj !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
+ }
+
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (var i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
+ }
+ } else {
+ // Iterate over object keys
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ fn.call(null, obj[key], key, obj);
+ }
+ }
+ }
+}
+
+/**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * var result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ * @returns {Object} Result of all merge properties
+ */
+function merge(/* obj1, obj2, obj3, ... */) {
+ var result = {};
+ function assignValue(val, key) {
+ if (isPlainObject(result[key]) && isPlainObject(val)) {
+ result[key] = merge(result[key], val);
+ } else if (isPlainObject(val)) {
+ result[key] = merge({}, val);
+ } else if (isArray(val)) {
+ result[key] = val.slice();
+ } else {
+ result[key] = val;
+ }
+ }
+
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ forEach(arguments[i], assignValue);
+ }
+ return result;
+}
+
+/**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ * @return {Object} The resulting value of object a
+ */
+function extend(a, b, thisArg) {
+ forEach(b, function assignValue(val, key) {
+ if (thisArg && typeof val === 'function') {
+ a[key] = bind(val, thisArg);
+ } else {
+ a[key] = val;
+ }
+ });
+ return a;
+}
+
+/**
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ *
+ * @param {string} content with BOM
+ * @return {string} content value without BOM
+ */
+function stripBOM(content) {
+ if (content.charCodeAt(0) === 0xFEFF) {
+ content = content.slice(1);
+ }
+ return content;
+}
+
+/**
+ * Inherit the prototype methods from one constructor into another
+ * @param {function} constructor
+ * @param {function} superConstructor
+ * @param {object} [props]
+ * @param {object} [descriptors]
+ */
+
+function inherits(constructor, superConstructor, props, descriptors) {
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
+ constructor.prototype.constructor = constructor;
+ props && Object.assign(constructor.prototype, props);
+}
+
+/**
+ * Resolve object with deep prototype chain to a flat object
+ * @param {Object} sourceObj source object
+ * @param {Object} [destObj]
+ * @param {Function} [filter]
+ * @returns {Object}
+ */
+
+function toFlatObject(sourceObj, destObj, filter) {
+ var props;
+ var i;
+ var prop;
+ var merged = {};
+
+ destObj = destObj || {};
+
+ do {
+ props = Object.getOwnPropertyNames(sourceObj);
+ i = props.length;
+ while (i-- > 0) {
+ prop = props[i];
+ if (!merged[prop]) {
+ destObj[prop] = sourceObj[prop];
+ merged[prop] = true;
+ }
+ }
+ sourceObj = Object.getPrototypeOf(sourceObj);
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
+
+ return destObj;
+}
+
+/*
+ * determines whether a string ends with the characters of a specified string
+ * @param {String} str
+ * @param {String} searchString
+ * @param {Number} [position= 0]
+ * @returns {boolean}
+ */
+function endsWith(str, searchString, position) {
+ str = String(str);
+ if (position === undefined || position > str.length) {
+ position = str.length;
+ }
+ position -= searchString.length;
+ var lastIndex = str.indexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+}
+
+
+/**
+ * Returns new array from array like object
+ * @param {*} [thing]
+ * @returns {Array}
+ */
+function toArray(thing) {
+ if (!thing) return null;
+ var i = thing.length;
+ if (isUndefined(i)) return null;
+ var arr = new Array(i);
+ while (i-- > 0) {
+ arr[i] = thing[i];
+ }
+ return arr;
+}
+
+// eslint-disable-next-line func-names
+var isTypedArray = (function(TypedArray) {
+ // eslint-disable-next-line func-names
+ return function(thing) {
+ return TypedArray && thing instanceof TypedArray;
+ };
+})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
+
+module.exports = {
+ isArray: isArray,
+ isArrayBuffer: isArrayBuffer,
+ isBuffer: isBuffer,
+ isFormData: isFormData,
+ isArrayBufferView: isArrayBufferView,
+ isString: isString,
+ isNumber: isNumber,
+ isObject: isObject,
+ isPlainObject: isPlainObject,
+ isUndefined: isUndefined,
+ isDate: isDate,
+ isFile: isFile,
+ isBlob: isBlob,
+ isFunction: isFunction,
+ isStream: isStream,
+ isURLSearchParams: isURLSearchParams,
+ isStandardBrowserEnv: isStandardBrowserEnv,
+ forEach: forEach,
+ merge: merge,
+ extend: extend,
+ trim: trim,
+ stripBOM: stripBOM,
+ inherits: inherits,
+ toFlatObject: toFlatObject,
+ kindOf: kindOf,
+ kindOfTest: kindOfTest,
+ endsWith: endsWith,
+ toArray: toArray,
+ isTypedArray: isTypedArray,
+ isFileList: isFileList
+};
diff --git a/Fronts/node_modules/axios/package.json b/Fronts/node_modules/axios/package.json
new file mode 100644
index 0000000..ffd98e6
--- /dev/null
+++ b/Fronts/node_modules/axios/package.json
@@ -0,0 +1,87 @@
+{
+ "name": "axios",
+ "version": "0.27.2",
+ "description": "Promise based HTTP client for the browser and node.js",
+ "main": "index.js",
+ "types": "index.d.ts",
+ "scripts": {
+ "test": "grunt test && dtslint",
+ "start": "node ./sandbox/server.js",
+ "preversion": "grunt version && npm test",
+ "build": "NODE_ENV=production grunt build",
+ "examples": "node ./examples/server.js",
+ "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
+ "fix": "eslint --fix lib/**/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/axios/axios.git"
+ },
+ "keywords": [
+ "xhr",
+ "http",
+ "ajax",
+ "promise",
+ "node"
+ ],
+ "author": "Matt Zabriskie",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/axios/axios/issues"
+ },
+ "homepage": "https://axios-http.com",
+ "devDependencies": {
+ "abortcontroller-polyfill": "^1.7.3",
+ "coveralls": "^3.1.1",
+ "dtslint": "^4.2.1",
+ "es6-promise": "^4.2.8",
+ "formidable": "^2.0.1",
+ "grunt": "^1.4.1",
+ "grunt-banner": "^0.6.0",
+ "grunt-cli": "^1.4.3",
+ "grunt-contrib-clean": "^2.0.0",
+ "grunt-contrib-watch": "^1.1.0",
+ "grunt-eslint": "^24.0.0",
+ "grunt-karma": "^4.0.2",
+ "grunt-mocha-test": "^0.13.3",
+ "grunt-webpack": "^5.0.0",
+ "istanbul-instrumenter-loader": "^3.0.1",
+ "jasmine-core": "^2.4.1",
+ "karma": "^6.3.17",
+ "karma-chrome-launcher": "^3.1.1",
+ "karma-firefox-launcher": "^2.1.2",
+ "karma-jasmine": "^1.1.1",
+ "karma-jasmine-ajax": "^0.1.13",
+ "karma-safari-launcher": "^1.0.0",
+ "karma-sauce-launcher": "^4.3.6",
+ "karma-sinon": "^1.0.5",
+ "karma-sourcemap-loader": "^0.3.8",
+ "karma-webpack": "^4.0.2",
+ "load-grunt-tasks": "^5.1.0",
+ "minimist": "^1.2.6",
+ "mocha": "^8.2.1",
+ "sinon": "^4.5.0",
+ "terser-webpack-plugin": "^4.2.3",
+ "typescript": "^4.6.3",
+ "url-search-params": "^0.10.0",
+ "webpack": "^4.44.2",
+ "webpack-dev-server": "^3.11.0"
+ },
+ "browser": {
+ "./lib/adapters/http.js": "./lib/adapters/xhr.js",
+ "./lib/defaults/env/FormData.js": "./lib/helpers/null.js"
+ },
+ "jsdelivr": "dist/axios.min.js",
+ "unpkg": "dist/axios.min.js",
+ "typings": "./index.d.ts",
+ "dependencies": {
+ "follow-redirects": "^1.14.9",
+ "form-data": "^4.0.0"
+ },
+ "bundlesize": [
+ {
+ "path": "./dist/axios.min.js",
+ "threshold": "5kB"
+ }
+ ]
+}
diff --git a/Fronts/node_modules/axios/tsconfig.json b/Fronts/node_modules/axios/tsconfig.json
new file mode 100644
index 0000000..6665188
--- /dev/null
+++ b/Fronts/node_modules/axios/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "compilerOptions": {
+ "module": "es2015",
+ "lib": ["dom", "es2015"],
+ "types": [],
+ "moduleResolution": "node",
+ "strict": true,
+ "noEmit": true,
+ "baseUrl": ".",
+ "paths": {
+ "axios": ["."]
+ }
+ }
+}
diff --git a/Fronts/node_modules/axios/tslint.json b/Fronts/node_modules/axios/tslint.json
new file mode 100644
index 0000000..3ec44a7
--- /dev/null
+++ b/Fronts/node_modules/axios/tslint.json
@@ -0,0 +1,6 @@
+{
+ "extends": "dtslint/dtslint.json",
+ "rules": {
+ "no-unnecessary-generics": false
+ }
+}
diff --git a/Fronts/node_modules/combined-stream/License b/Fronts/node_modules/combined-stream/License
new file mode 100644
index 0000000..4804b7a
--- /dev/null
+++ b/Fronts/node_modules/combined-stream/License
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Debuggable Limited
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Fronts/node_modules/combined-stream/Readme.md b/Fronts/node_modules/combined-stream/Readme.md
new file mode 100644
index 0000000..9e367b5
--- /dev/null
+++ b/Fronts/node_modules/combined-stream/Readme.md
@@ -0,0 +1,138 @@
+# combined-stream
+
+A stream that emits multiple other streams one after another.
+
+**NB** Currently `combined-stream` works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with `combined-stream`.
+
+- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module.
+
+- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another.
+
+## Installation
+
+``` bash
+npm install combined-stream
+```
+
+## Usage
+
+Here is a simple example that shows how you can use combined-stream to combine
+two files into one:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create();
+combinedStream.append(fs.createReadStream('file1.txt'));
+combinedStream.append(fs.createReadStream('file2.txt'));
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+While the example above works great, it will pause all source streams until
+they are needed. If you don't want that to happen, you can set `pauseStreams`
+to `false`:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create({pauseStreams: false});
+combinedStream.append(fs.createReadStream('file1.txt'));
+combinedStream.append(fs.createReadStream('file2.txt'));
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+However, what if you don't have all the source streams yet, or you don't want
+to allocate the resources (file descriptors, memory, etc.) for them right away?
+Well, in that case you can simply provide a callback that supplies the stream
+by calling a `next()` function:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create();
+combinedStream.append(function(next) {
+ next(fs.createReadStream('file1.txt'));
+});
+combinedStream.append(function(next) {
+ next(fs.createReadStream('file2.txt'));
+});
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+## API
+
+### CombinedStream.create([options])
+
+Returns a new combined stream object. Available options are:
+
+* `maxDataSize`
+* `pauseStreams`
+
+The effect of those options is described below.
+
+### combinedStream.pauseStreams = `true`
+
+Whether to apply back pressure to the underlaying streams. If set to `false`,
+the underlaying streams will never be paused. If set to `true`, the
+underlaying streams will be paused right after being appended, as well as when
+`delayedStream.pipe()` wants to throttle.
+
+### combinedStream.maxDataSize = `2 * 1024 * 1024`
+
+The maximum amount of bytes (or characters) to buffer for all source streams.
+If this value is exceeded, `combinedStream` emits an `'error'` event.
+
+### combinedStream.dataSize = `0`
+
+The amount of bytes (or characters) currently buffered by `combinedStream`.
+
+### combinedStream.append(stream)
+
+Appends the given `stream` to the combinedStream object. If `pauseStreams` is
+set to `true, this stream will also be paused right away.
+
+`streams` can also be a function that takes one parameter called `next`. `next`
+is a function that must be invoked in order to provide the `next` stream, see
+example above.
+
+Regardless of how the `stream` is appended, combined-stream always attaches an
+`'error'` listener to it, so you don't have to do that manually.
+
+Special case: `stream` can also be a String or Buffer.
+
+### combinedStream.write(data)
+
+You should not call this, `combinedStream` takes care of piping the appended
+streams into itself for you.
+
+### combinedStream.resume()
+
+Causes `combinedStream` to start drain the streams it manages. The function is
+idempotent, and also emits a `'resume'` event each time which usually goes to
+the stream that is currently being drained.
+
+### combinedStream.pause();
+
+If `combinedStream.pauseStreams` is set to `false`, this does nothing.
+Otherwise a `'pause'` event is emitted, this goes to the stream that is
+currently being drained, so you can use it to apply back pressure.
+
+### combinedStream.end();
+
+Sets `combinedStream.writable` to false, emits an `'end'` event, and removes
+all streams from the queue.
+
+### combinedStream.destroy();
+
+Same as `combinedStream.end()`, except it emits a `'close'` event instead of
+`'end'`.
+
+## License
+
+combined-stream is licensed under the MIT license.
diff --git a/Fronts/node_modules/combined-stream/lib/combined_stream.js b/Fronts/node_modules/combined-stream/lib/combined_stream.js
new file mode 100644
index 0000000..125f097
--- /dev/null
+++ b/Fronts/node_modules/combined-stream/lib/combined_stream.js
@@ -0,0 +1,208 @@
+var util = require('util');
+var Stream = require('stream').Stream;
+var DelayedStream = require('delayed-stream');
+
+module.exports = CombinedStream;
+function CombinedStream() {
+ this.writable = false;
+ this.readable = true;
+ this.dataSize = 0;
+ this.maxDataSize = 2 * 1024 * 1024;
+ this.pauseStreams = true;
+
+ this._released = false;
+ this._streams = [];
+ this._currentStream = null;
+ this._insideLoop = false;
+ this._pendingNext = false;
+}
+util.inherits(CombinedStream, Stream);
+
+CombinedStream.create = function(options) {
+ var combinedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ combinedStream[option] = options[option];
+ }
+
+ return combinedStream;
+};
+
+CombinedStream.isStreamLike = function(stream) {
+ return (typeof stream !== 'function')
+ && (typeof stream !== 'string')
+ && (typeof stream !== 'boolean')
+ && (typeof stream !== 'number')
+ && (!Buffer.isBuffer(stream));
+};
+
+CombinedStream.prototype.append = function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+
+ if (isStreamLike) {
+ if (!(stream instanceof DelayedStream)) {
+ var newStream = DelayedStream.create(stream, {
+ maxDataSize: Infinity,
+ pauseStream: this.pauseStreams,
+ });
+ stream.on('data', this._checkDataSize.bind(this));
+ stream = newStream;
+ }
+
+ this._handleErrors(stream);
+
+ if (this.pauseStreams) {
+ stream.pause();
+ }
+ }
+
+ this._streams.push(stream);
+ return this;
+};
+
+CombinedStream.prototype.pipe = function(dest, options) {
+ Stream.prototype.pipe.call(this, dest, options);
+ this.resume();
+ return dest;
+};
+
+CombinedStream.prototype._getNext = function() {
+ this._currentStream = null;
+
+ if (this._insideLoop) {
+ this._pendingNext = true;
+ return; // defer call
+ }
+
+ this._insideLoop = true;
+ try {
+ do {
+ this._pendingNext = false;
+ this._realGetNext();
+ } while (this._pendingNext);
+ } finally {
+ this._insideLoop = false;
+ }
+};
+
+CombinedStream.prototype._realGetNext = function() {
+ var stream = this._streams.shift();
+
+
+ if (typeof stream == 'undefined') {
+ this.end();
+ return;
+ }
+
+ if (typeof stream !== 'function') {
+ this._pipeNext(stream);
+ return;
+ }
+
+ var getStream = stream;
+ getStream(function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('data', this._checkDataSize.bind(this));
+ this._handleErrors(stream);
+ }
+
+ this._pipeNext(stream);
+ }.bind(this));
+};
+
+CombinedStream.prototype._pipeNext = function(stream) {
+ this._currentStream = stream;
+
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('end', this._getNext.bind(this));
+ stream.pipe(this, {end: false});
+ return;
+ }
+
+ var value = stream;
+ this.write(value);
+ this._getNext();
+};
+
+CombinedStream.prototype._handleErrors = function(stream) {
+ var self = this;
+ stream.on('error', function(err) {
+ self._emitError(err);
+ });
+};
+
+CombinedStream.prototype.write = function(data) {
+ this.emit('data', data);
+};
+
+CombinedStream.prototype.pause = function() {
+ if (!this.pauseStreams) {
+ return;
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
+ this.emit('pause');
+};
+
+CombinedStream.prototype.resume = function() {
+ if (!this._released) {
+ this._released = true;
+ this.writable = true;
+ this._getNext();
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
+ this.emit('resume');
+};
+
+CombinedStream.prototype.end = function() {
+ this._reset();
+ this.emit('end');
+};
+
+CombinedStream.prototype.destroy = function() {
+ this._reset();
+ this.emit('close');
+};
+
+CombinedStream.prototype._reset = function() {
+ this.writable = false;
+ this._streams = [];
+ this._currentStream = null;
+};
+
+CombinedStream.prototype._checkDataSize = function() {
+ this._updateDataSize();
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
+ this._emitError(new Error(message));
+};
+
+CombinedStream.prototype._updateDataSize = function() {
+ this.dataSize = 0;
+
+ var self = this;
+ this._streams.forEach(function(stream) {
+ if (!stream.dataSize) {
+ return;
+ }
+
+ self.dataSize += stream.dataSize;
+ });
+
+ if (this._currentStream && this._currentStream.dataSize) {
+ this.dataSize += this._currentStream.dataSize;
+ }
+};
+
+CombinedStream.prototype._emitError = function(err) {
+ this._reset();
+ this.emit('error', err);
+};
diff --git a/Fronts/node_modules/combined-stream/package.json b/Fronts/node_modules/combined-stream/package.json
new file mode 100644
index 0000000..6982b6d
--- /dev/null
+++ b/Fronts/node_modules/combined-stream/package.json
@@ -0,0 +1,25 @@
+{
+ "author": "Felix Geisendörfer (http://debuggable.com/)",
+ "name": "combined-stream",
+ "description": "A stream that emits multiple other streams one after another.",
+ "version": "1.0.8",
+ "homepage": "https://github.com/felixge/node-combined-stream",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/felixge/node-combined-stream.git"
+ },
+ "main": "./lib/combined_stream",
+ "scripts": {
+ "test": "node test/run.js"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "devDependencies": {
+ "far": "~0.0.7"
+ },
+ "license": "MIT"
+}
diff --git a/Fronts/node_modules/combined-stream/yarn.lock b/Fronts/node_modules/combined-stream/yarn.lock
new file mode 100644
index 0000000..7edf418
--- /dev/null
+++ b/Fronts/node_modules/combined-stream/yarn.lock
@@ -0,0 +1,17 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+delayed-stream@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
+
+far@~0.0.7:
+ version "0.0.7"
+ resolved "https://registry.yarnpkg.com/far/-/far-0.0.7.tgz#01c1fd362bcd26ce9cf161af3938aa34619f79a7"
+ dependencies:
+ oop "0.0.3"
+
+oop@0.0.3:
+ version "0.0.3"
+ resolved "https://registry.yarnpkg.com/oop/-/oop-0.0.3.tgz#70fa405a5650891a194fdc82ca68dad6dabf4401"
diff --git a/Fronts/node_modules/csstype/LICENSE b/Fronts/node_modules/csstype/LICENSE
new file mode 100644
index 0000000..ac06f62
--- /dev/null
+++ b/Fronts/node_modules/csstype/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2017-2018 Fredrik Nicol
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Fronts/node_modules/csstype/README.md b/Fronts/node_modules/csstype/README.md
new file mode 100644
index 0000000..f04f48a
--- /dev/null
+++ b/Fronts/node_modules/csstype/README.md
@@ -0,0 +1,220 @@
+# CSSType
+
+[![npm](https://img.shields.io/npm/v/csstype.svg)](https://www.npmjs.com/package/csstype)
+
+TypeScript and Flow definitions for CSS, generated by [data from MDN](https://github.com/mdn/data). It provides autocompletion and type checking for CSS properties and values.
+
+```ts
+import * as CSS from 'csstype';
+
+const style: CSS.Properties = {
+ colour: 'white', // Type error on property
+ textAlign: 'middle', // Type error on value
+};
+```
+
+## Getting started
+
+```sh
+$ npm install csstype
+$ # or
+$ yarn add csstype
+```
+
+## Table of content
+
+- [Style types](#style-types)
+- [At-rule types](#at-rule-types)
+- [Pseudo types](#pseudo-types)
+- [Usage](#usage)
+- [What should I do when I get type errors?](#what-should-i-do-when-i-get-type-errors)
+- [Version 2.0](#version-20)
+- [Contributing](#contributing)
+ - [Commands](#commands)
+
+## Style types
+
+Properties are categorized in different uses and in several technical variations to provide typings that suits as many as possible.
+
+All interfaces has one optional generic argument to define length. It defaults to `string | 0` because `0` is the only [length where the unit identifier is optional](https://drafts.csswg.org/css-values-3/#lengths). You can specify this, e.g. `string | number`, for platforms and libraries that accepts any numeric value as length with a specific unit.
+
+| | Default | `Hyphen` | `Fallback` | `HyphenFallback` |
+| -------------- | -------------------- | -------------------------- | ---------------------------- | ---------------------------------- |
+| **All** | `Properties` | `PropertiesHyphen` | `PropertiesFallback` | `PropertiesHyphenFallback` |
+| **`Standard`** | `StandardProperties` | `StandardPropertiesHyphen` | `StandardPropertiesFallback` | `StandardPropertiesHyphenFallback` |
+| **`Vendor`** | `VendorProperties` | `VendorPropertiesHyphen` | `VendorPropertiesFallback` | `VendorPropertiesHyphenFallback` |
+| **`Obsolete`** | `ObsoleteProperties` | `ObsoletePropertiesHyphen` | `ObsoletePropertiesFallback` | `ObsoletePropertiesHyphenFallback` |
+| **`Svg`** | `SvgProperties` | `SvgPropertiesHyphen` | `SvgPropertiesFallback` | `SvgPropertiesHyphenFallback` |
+
+Categories:
+
+- **All** - Includes `Standard`, `Vendor`, `Obsolete` and `Svg`
+- **`Standard`** - Current properties and extends subcategories `StandardLonghand` and `StandardShorthand` _(e.g. `StandardShorthandProperties`)_
+- **`Vendor`** - Vendor prefixed properties and extends subcategories `VendorLonghand` and `VendorShorthand` _(e.g. `VendorShorthandProperties`)_
+- **`Obsolete`** - Removed or deprecated properties
+- **`Svg`** - SVG-specific properties
+
+Variations:
+
+- **Default** - JavaScript (camel) cased property names
+- **`Hyphen`** - CSS (kebab) cased property names
+- **`Fallback`** - Also accepts array of values e.g. `string | string[]`
+
+## At-rule types
+
+At-rule interfaces with descriptors.
+
+| | Default | `Hyphen` | `Fallback` | `HyphenFallback` |
+| -------------------- | -------------- | -------------------- | ---------------------- | ---------------------------- |
+| **`@counter-style`** | `CounterStyle` | `CounterStyleHyphen` | `CounterStyleFallback` | `CounterStyleHyphenFallback` |
+| **`@font-face`** | `FontFace` | `FontFaceHyphen` | `FontFaceFallback` | `FontFaceHyphenFallback` |
+| **`@page`** | `Page` | `PageHyphen` | `PageFallback` | `PageHyphenFallback` |
+| **`@viewport`** | `Viewport` | `ViewportHyphen` | `ViewportFallback` | `ViewportHyphenFallback` |
+
+## Pseudo types
+
+String literals of pseudo classes and pseudo elements
+
+- `Pseudos`
+
+ Extends:
+
+ - `AdvancedPseudos`
+
+ Function-like pseudos e.g. `:not(:first-child)`. The string literal contains the value excluding the parenthesis: `:not`. These are separated because they require an argument that results in infinite number of variations.
+
+ - `SimplePseudos`
+
+ Plain pseudos e.g. `:hover` that can only be **one** variation.
+
+## Usage
+
+Length defaults to `string | 0`. But it's possible to override it using generics.
+
+```ts
+import * as CSS from 'csstype';
+
+const style: CSS.Properties = {
+ padding: 10,
+ margin: '1rem',
+};
+```
+
+In some cases, like for CSS-in-JS libraries, an array of values is a way to provide fallback values in CSS. Using `CSS.PropertiesFallback` instead of `CSS.Properties` will add the possibility to use any property value as an array of values.
+
+```ts
+import * as CSS from 'csstype';
+
+const style: CSS.PropertiesFallback = {
+ display: ['-webkit-flex', 'flex'],
+ color: 'white',
+};
+```
+
+There's even string literals for pseudo selectors and elements.
+
+```ts
+import * as CSS from 'csstype';
+
+const pseudos: { [P in CSS.SimplePseudos]?: CSS.Properties } = {
+ ':hover': {
+ display: 'flex',
+ },
+};
+```
+
+Hyphen cased (kebab cased) properties are provided in `CSS.PropertiesHyphen` and `CSS.PropertiesHyphenFallback`. It's not **not** added by default in `CSS.Properties`. To allow both of them, you can simply extend with `CSS.PropertiesHyphen` or/and `CSS.PropertiesHyphenFallback`.
+
+```ts
+import * as CSS from 'csstype';
+
+interface Style extends CSS.Properties, CSS.PropertiesHyphen {}
+
+const style: Style = {
+ 'flex-grow': 1,
+ 'flex-shrink': 0,
+ 'font-weight': 'normal',
+ backgroundColor: 'white',
+};
+```
+
+## What should I do when I get type errors?
+
+The goal is to have as perfect types as possible and we're trying to do our best. But with CSS Custom Properties, the CSS specification changing frequently and vendors implementing their own specifications with new releases sometimes causes type errors even if it should work. Here's some steps you could take to get it fixed:
+
+_If you're using CSS Custom Properties you can step directly to step 3._
+
+1. **First of all, make sure you're doing it right.** A type error could also indicate that you're not :wink:
+
+ - Some CSS specs that some vendors has implemented could have been officially rejected or haven't yet received any official acceptance and are therefor not included
+ - If you're using TypeScript, [type widening](https://blog.mariusschulz.com/2017/02/04/typescript-2-1-literal-type-widening) could be the reason you get `Type 'string' is not assignable to...` errors
+
+2. **Have a look in [issues](https://github.com/frenic/csstype/issues) to see if an issue already has been filed. If not, create a new one.** To help us out, please refer to any information you have found.
+3. Fix the issue locally with **TypeScript** (Flow further down):
+
+ - The recommended way is to use **module augmentation**. Here's a few examples:
+
+ ```ts
+ // My css.d.ts file
+ import * as CSS from 'csstype';
+
+ declare module 'csstype' {
+ interface Properties {
+ // Add a missing property
+ WebkitRocketLauncher?: string;
+
+ // Add a CSS Custom Property
+ '--theme-color'?: 'black' | 'white';
+
+ // ...or allow any other property
+ [index: string]: any;
+ }
+ }
+ ```
+
+ - The alternative way is to use **type assertion**. Here's a few examples:
+
+ ```ts
+ const style: CSS.Properties = {
+ // Add a missing property
+ ['WebkitRocketLauncher' as any]: 'launching',
+
+ // Add a CSS Custom Property
+ ['--theme-color' as any]: 'black',
+ };
+ ```
+
+ Fix the issue locally with **Flow**:
+
+ - Use **type assertion**. Here's a few examples:
+
+ ```js
+ const style: $Exact> = {
+ // Add a missing property
+ [('WebkitRocketLauncher': any)]: 'launching',
+
+ // Add a CSS Custom Property
+ [('--theme-color': any)]: 'black',
+ };
+ ```
+
+## Version 2.0
+
+The casing of CSS vendor properties are changed matching the casing of prefixes in Javascript. So all of them are capitalized except for `ms`.
+
+- `msOverflowStyle` is still `msOverflowStyle`
+- `mozAppearance` is now `MozAppearance`
+- `webkitOverflowScrolling` is now `WebkitOverflowScrolling`
+
+More info: https://www.andismith.com/blogs/2012/02/modernizr-prefixed/
+
+## Contributing
+
+**Never modify `index.d.ts` and `index.js.flow` directly. They are generated automatically and committed so that we can easily follow any change it results in.** Therefor it's important that you run `$ git config merge.ours.driver true` after you've forked and cloned. That setting prevents merge conflicts when doing rebase.
+
+### Commands
+
+- `yarn build` Generates typings and type checks them
+- `yarn watch` Runs build on each save
+- `yarn test` Runs the tests
+- `yarn lazy` Type checks, lints and formats everything
diff --git a/Fronts/node_modules/csstype/index.d.ts b/Fronts/node_modules/csstype/index.d.ts
new file mode 100644
index 0000000..6d427fa
--- /dev/null
+++ b/Fronts/node_modules/csstype/index.d.ts
@@ -0,0 +1,38372 @@
+export interface StandardLonghandProperties {
+ /**
+ * The **`accent-color`** CSS property sets the color of the elements accent. An accent appears in elements such as ` ` of `type="checkbox"`, or `type="radio"`.
+ *
+ * **Syntax**: `auto | `
+ *
+ * **Initial value**: `auto`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **93** | **92** | **15.4** | **93** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/accent-color
+ */
+ accentColor?: AccentColorProperty;
+ /**
+ * The CSS **`align-content`** property sets how the browser distributes space between and around content items along the cross-axis of a flexbox container, and the main-axis of a grid container.
+ *
+ * **Syntax**: `normal | | | ? `
+ *
+ * **Initial value**: `normal`
+ *
+ * ---
+ *
+ * _Supported in Flex Layout_
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :------: | :-----: | :-----: | :----: | :----: |
+ * | **29** | **28** | **9** | **12** | **11** |
+ * | 21 _-x-_ | | 7 _-x-_ | | |
+ *
+ * ---
+ *
+ * _Supported in Grid Layout_
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **57** | **52** | **10.1** | **16** | No |
+ *
+ * ---
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/align-content
+ */
+ alignContent?: AlignContentProperty;
+ /**
+ * The CSS **`align-items`** property sets the `align-self` value on all direct children as a group. The align-self property sets the alignment of an item within its containing block. In Flexbox it controls the alignment of items on the Cross Axis, in Grid Layout it controls the alignment of items on the Block Axis within their grid area.
+ *
+ * **Syntax**: `normal | stretch | | [ ? ]`
+ *
+ * **Initial value**: `normal`
+ *
+ * ---
+ *
+ * _Supported in Flex Layout_
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :------: | :-----: | :-----: | :----: | :----: |
+ * | **52** | **20** | **9** | **12** | **11** |
+ * | 21 _-x-_ | | 7 _-x-_ | | |
+ *
+ * ---
+ *
+ * _Supported in Grid Layout_
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **57** | **52** | **10.1** | **16** | No |
+ *
+ * ---
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/align-items
+ */
+ alignItems?: AlignItemsProperty;
+ /**
+ * The **`align-self`** CSS property aligns flex items of the current flex line overriding the `align-items` value. If any of the item's cross-axis margin is set to `auto`, then `align-self` is ignored. In Grid layout `align-self` aligns the item inside the grid area.
+ *
+ * **Syntax**: `auto | normal | stretch | | ? `
+ *
+ * **Initial value**: `auto`
+ *
+ * ---
+ *
+ * _Supported in Flex Layout_
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :------: | :-----: | :-----: | :----: | :----: |
+ * | **36** | **20** | **9** | **12** | **11** |
+ * | 21 _-x-_ | | 7 _-x-_ | | |
+ *
+ * ---
+ *
+ * _Supported in Grid Layout_
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :----------: |
+ * | **57** | **52** | **10.1** | **16** | **10** _-x-_ |
+ *
+ * ---
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/align-self
+ */
+ alignSelf?: AlignSelfProperty;
+ /**
+ * The **`align-tracks`** CSS property sets the alignment in the masonry axis for grid containers that have masonry in their block axis.
+ *
+ * **Syntax**: `[ normal | | | ? ]#`
+ *
+ * **Initial value**: `normal`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :--: | :-: |
+ * | No | n/a | No | No | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/align-tracks
+ */
+ alignTracks?: AlignTracksProperty;
+ /**
+ * The **`animation-delay`** CSS property sets when an animation starts. The animation can start later, immediately from its beginning, or immediately and partway through the animation.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `0s`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :----: |
+ * | **43** | **16** | **9** | **12** | **10** |
+ * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/animation-delay
+ */
+ animationDelay?: GlobalsString;
+ /**
+ * The **`animation-direction`** CSS property sets whether an animation should play forwards, backwards, or alternating back and forth.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `normal`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :----: |
+ * | **43** | **16** | **9** | **12** | **10** |
+ * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/animation-direction
+ */
+ animationDirection?: AnimationDirectionProperty;
+ /**
+ * The **`animation-duration`** CSS property sets the length of time that an animation takes to complete one cycle.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `0s`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :----: |
+ * | **43** | **16** | **9** | **12** | **10** |
+ * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/animation-duration
+ */
+ animationDuration?: GlobalsString;
+ /**
+ * The **`animation-fill-mode`** CSS property sets how a CSS animation applies styles to its target before and after its execution.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :----: |
+ * | **43** | **16** | **9** | **12** | **10** |
+ * | 3 _-x-_ | 5 _-x-_ | 5 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/animation-fill-mode
+ */
+ animationFillMode?: AnimationFillModeProperty;
+ /**
+ * The **`animation-iteration-count`** CSS property sets the number of times an animation cycle should be played before stopping.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `1`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :----: |
+ * | **43** | **16** | **9** | **12** | **10** |
+ * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/animation-iteration-count
+ */
+ animationIterationCount?: AnimationIterationCountProperty;
+ /**
+ * The **`animation-name`** CSS property sets one or more animations to apply to an element. Each name is an `@keyframes` at-rule that sets the property values for the animation sequence.
+ *
+ * **Syntax**: `[ none | ]#`
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :----: |
+ * | **43** | **16** | **9** | **12** | **10** |
+ * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/animation-name
+ */
+ animationName?: AnimationNameProperty;
+ /**
+ * The **`animation-play-state`** CSS property sets whether an animation is running or paused.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `running`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :----: |
+ * | **43** | **16** | **9** | **12** | **10** |
+ * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/animation-play-state
+ */
+ animationPlayState?: AnimationPlayStateProperty;
+ /**
+ * The **`animation-timeline`** CSS property specifies the names of one or more `@scroll-timeline` at-rules describing the scroll animations to apply to the element.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `auto`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :--: | :-: |
+ * | No | n/a | No | No | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/animation-timeline
+ */
+ animationTimeline?: AnimationTimelineProperty;
+ /**
+ * The `**animation-timing-function**` CSS property sets how an animation progresses through the duration of each cycle.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `ease`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :----: |
+ * | **43** | **16** | **9** | **12** | **10** |
+ * | 3 _-x-_ | 5 _-x-_ | 4 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/animation-timing-function
+ */
+ animationTimingFunction?: AnimationTimingFunctionProperty;
+ /**
+ * The **`-moz-appearance`** CSS property is used in Gecko (Firefox) to display an element using platform-native styling based on the operating system's theme.
+ *
+ * **Syntax**: `none | auto | textfield | menulist-button | `
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :------: | :------: | :-: |
+ * | **84** | **80** | **15.4** | **84** | No |
+ * | 1 _-x-_ | 1 _-x-_ | 3 _-x-_ | 12 _-x-_ | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/appearance
+ */
+ appearance?: AppearanceProperty;
+ /**
+ * The **`aspect-ratio`** CSS property sets a _**preferred aspect ratio**_ for the box, which will be used in the calculation of auto sizes and some other layout functions.
+ *
+ * **Syntax**: `auto | `
+ *
+ * **Initial value**: `auto`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :-: |
+ * | **88** | **89** | **15** | **88** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/aspect-ratio
+ */
+ aspectRatio?: AspectRatioProperty;
+ /**
+ * The **`backdrop-filter`** CSS property lets you apply graphical effects such as blurring or color shifting to the area behind an element. Because it applies to everything _behind_ the element, to see the effect you must make the element or its background at least partially transparent.
+ *
+ * **Syntax**: `none | `
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :---------: | :----: | :-: |
+ * | **76** | n/a | **9** _-x-_ | **17** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/backdrop-filter
+ */
+ backdropFilter?: BackdropFilterProperty;
+ /**
+ * The **`backface-visibility`** CSS property sets whether the back face of an element is visible when turned towards the user.
+ *
+ * **Syntax**: `visible | hidden`
+ *
+ * **Initial value**: `visible`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :------: | :------: | :-------: | :----: | :----: |
+ * | **36** | **16** | **15.4** | **12** | **10** |
+ * | 12 _-x-_ | 10 _-x-_ | 5.1 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/backface-visibility
+ */
+ backfaceVisibility?: BackfaceVisibilityProperty;
+ /**
+ * The **`background-attachment`** CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `scroll`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **1** | **1** | **12** | **4** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/background-attachment
+ */
+ backgroundAttachment?: BackgroundAttachmentProperty;
+ /**
+ * The **`background-blend-mode`** CSS property sets how an element's background images should blend with each other and with the element's background color.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `normal`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :-: |
+ * | **35** | **30** | **8** | **79** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/background-blend-mode
+ */
+ backgroundBlendMode?: BackgroundBlendModeProperty;
+ /**
+ * The **`background-clip`** CSS property sets whether an element's background `` or `` extends underneath its border.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `border-box`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :-----: | :----: | :---: |
+ * | **1** | **4** | **14** | **12** | **9** |
+ * | | | 3 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/background-clip
+ */
+ backgroundClip?: BackgroundClipProperty;
+ /**
+ * The **`background-color`** CSS property sets the background color of an element.
+ *
+ * **Syntax**: ``
+ *
+ * **Initial value**: `transparent`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **1** | **1** | **12** | **4** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/background-color
+ */
+ backgroundColor?: BackgroundColorProperty;
+ /**
+ * The **`background-image`** CSS property sets one or more background images on an element.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **1** | **1** | **12** | **4** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/background-image
+ */
+ backgroundImage?: BackgroundImageProperty;
+ /**
+ * The **`background-origin`** CSS property sets the _background positioning area_. In other words, it sets the origin position of an image set with the `background-image` property.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `padding-box`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **4** | **3** | **12** | **9** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/background-origin
+ */
+ backgroundOrigin?: BackgroundOriginProperty;
+ /**
+ * The **`background-position-x`** CSS property sets the initial horizontal position for each background image. The position is relative to the position layer set by `background-origin`.
+ *
+ * **Syntax**: `[ center | [ [ left | right | x-start | x-end ]? ? ]! ]#`
+ *
+ * **Initial value**: `0%`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **49** | **1** | **12** | **6** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/background-position-x
+ */
+ backgroundPositionX?: BackgroundPositionXProperty;
+ /**
+ * The **`background-position-y`** CSS property sets the initial vertical position, relative to the background position layer defined by `background-origin`, for each defined background image.
+ *
+ * **Syntax**: `[ center | [ [ top | bottom | y-start | y-end ]? ? ]! ]#`
+ *
+ * **Initial value**: `0%`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **49** | **1** | **12** | **6** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/background-position-y
+ */
+ backgroundPositionY?: BackgroundPositionYProperty;
+ /**
+ * The **`background-repeat`** CSS property sets how background images are repeated. A background image can be repeated along the horizontal and vertical axes, or not repeated at all.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `repeat`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **1** | **1** | **12** | **4** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/background-repeat
+ */
+ backgroundRepeat?: BackgroundRepeatProperty;
+ /**
+ * The **`background-size`** CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space.
+ *
+ * **Syntax**: `#`
+ *
+ * **Initial value**: `auto auto`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :---: |
+ * | **3** | **4** | **5** | **12** | **9** |
+ * | 1 _-x-_ | | 3 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/background-size
+ */
+ backgroundSize?: BackgroundSizeProperty;
+ /**
+ * **Syntax**: `clip | ellipsis | `
+ *
+ * **Initial value**: `clip`
+ */
+ blockOverflow?: BlockOverflowProperty;
+ /**
+ * The **`block-size`** CSS property defines the horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the `width` or the `height` property, depending on the value of `writing-mode`.
+ *
+ * **Syntax**: `<'width'>`
+ *
+ * **Initial value**: `auto`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **57** | **41** | **12.1** | **79** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/block-size
+ */
+ blockSize?: BlockSizeProperty;
+ /**
+ * The **`border-block-color`** CSS property defines the color of the logical block borders of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color` and `border-bottom-color`, or `border-right-color` and `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-color'>{1,2}`
+ *
+ * **Initial value**: `currentcolor`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **87** | **66** | **14.1** | **87** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-block-color
+ */
+ borderBlockColor?: BorderBlockColorProperty;
+ /**
+ * The **`border-block-end-color`** CSS property defines the color of the logical block-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-color'>`
+ *
+ * **Initial value**: `currentcolor`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end-color
+ */
+ borderBlockEndColor?: BorderBlockEndColorProperty;
+ /**
+ * The **`border-block-end-style`** CSS property defines the style of the logical block end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-style'>`
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end-style
+ */
+ borderBlockEndStyle?: BorderBlockEndStyleProperty;
+ /**
+ * The **`border-block-end-width`** CSS property defines the width of the logical block-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-width'>`
+ *
+ * **Initial value**: `medium`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-block-end-width
+ */
+ borderBlockEndWidth?: BorderBlockEndWidthProperty;
+ /**
+ * The **`border-block-start-color`** CSS property defines the color of the logical block-start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-color'>`
+ *
+ * **Initial value**: `currentcolor`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start-color
+ */
+ borderBlockStartColor?: BorderBlockStartColorProperty;
+ /**
+ * The **`border-block-start-style`** CSS property defines the style of the logical block start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-style'>`
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start-style
+ */
+ borderBlockStartStyle?: BorderBlockStartStyleProperty;
+ /**
+ * The **`border-block-start-width`** CSS property defines the width of the logical block-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-width'>`
+ *
+ * **Initial value**: `medium`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-block-start-width
+ */
+ borderBlockStartWidth?: BorderBlockStartWidthProperty;
+ /**
+ * The **`border-block-style`** CSS property defines the style of the logical block borders of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style` and `border-bottom-style`, or `border-left-style` and `border-right-style` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-style'>`
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **87** | **66** | **14.1** | **87** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-block-style
+ */
+ borderBlockStyle?: BorderBlockStyleProperty;
+ /**
+ * The **`border-block-width`** CSS property defines the width of the logical block borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width` and `border-bottom-width`, or `border-left-width`, and `border-right-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-width'>`
+ *
+ * **Initial value**: `medium`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **87** | **66** | **14.1** | **87** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-block-width
+ */
+ borderBlockWidth?: BorderBlockWidthProperty;
+ /**
+ * The **`border-bottom-color`** CSS property sets the color of an element's bottom border. It can also be set with the shorthand CSS properties `border-color` or `border-bottom`.
+ *
+ * **Syntax**: `<'border-top-color'>`
+ *
+ * **Initial value**: `currentcolor`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **1** | **1** | **12** | **4** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-color
+ */
+ borderBottomColor?: BorderBottomColorProperty;
+ /**
+ * The **`border-bottom-left-radius`** CSS property rounds the bottom-left corner of an element.
+ *
+ * **Syntax**: `{1,2}`
+ *
+ * **Initial value**: `0`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :---: |
+ * | **4** | **4** | **5** | **12** | **9** |
+ * | 1 _-x-_ | | 3 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-left-radius
+ */
+ borderBottomLeftRadius?: BorderBottomLeftRadiusProperty;
+ /**
+ * The **`border-bottom-right-radius`** CSS property rounds the bottom-right corner of an element.
+ *
+ * **Syntax**: `{1,2}`
+ *
+ * **Initial value**: `0`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :-----: | :-----: | :-----: | :----: | :---: |
+ * | **4** | **4** | **5** | **12** | **9** |
+ * | 1 _-x-_ | | 3 _-x-_ | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-right-radius
+ */
+ borderBottomRightRadius?: BorderBottomRightRadiusProperty;
+ /**
+ * The **`border-bottom-style`** CSS property sets the line style of an element's bottom `border`.
+ *
+ * **Syntax**: ``
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :-----: |
+ * | **1** | **1** | **1** | **12** | **5.5** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-style
+ */
+ borderBottomStyle?: BorderBottomStyleProperty;
+ /**
+ * The **`border-bottom-width`** CSS property sets the width of the bottom border of a box.
+ *
+ * **Syntax**: ``
+ *
+ * **Initial value**: `medium`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **1** | **1** | **12** | **4** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-width
+ */
+ borderBottomWidth?: BorderBottomWidthProperty;
+ /**
+ * The **`border-collapse`** CSS property sets whether cells inside a `` have shared or separate borders.
+ *
+ * **Syntax**: `collapse | separate`
+ *
+ * **Initial value**: `separate`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :-----: | :----: | :---: |
+ * | **1** | **1** | **1.2** | **12** | **5** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-collapse
+ */
+ borderCollapse?: BorderCollapseProperty;
+ /**
+ * The **`border-end-end-radius`** CSS property defines a logical border radius on an element, which maps to a physical border radius that depends on on the element's `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `{1,2}`
+ *
+ * **Initial value**: `0`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :-: |
+ * | **89** | **66** | **15** | **89** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-end-end-radius
+ */
+ borderEndEndRadius?: BorderEndEndRadiusProperty;
+ /**
+ * The **`border-end-start-radius`** CSS property defines a logical border radius on an element, which maps to a physical border radius depending on the element's `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `{1,2}`
+ *
+ * **Initial value**: `0`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :-: |
+ * | **89** | **66** | **15** | **89** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-end-start-radius
+ */
+ borderEndStartRadius?: BorderEndStartRadiusProperty;
+ /**
+ * The **`border-image-outset`** CSS property sets the distance by which an element's border image is set out from its border box.
+ *
+ * **Syntax**: `[ | ]{1,4}`
+ *
+ * **Initial value**: `0`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :----: |
+ * | **15** | **15** | **6** | **12** | **11** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-image-outset
+ */
+ borderImageOutset?: BorderImageOutsetProperty;
+ /**
+ * The **`border-image-repeat`** CSS property defines how the edge regions of a source image are adjusted to fit the dimensions of an element's border image.
+ *
+ * **Syntax**: `[ stretch | repeat | round | space ]{1,2}`
+ *
+ * **Initial value**: `stretch`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :----: |
+ * | **15** | **15** | **6** | **12** | **11** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-image-repeat
+ */
+ borderImageRepeat?: BorderImageRepeatProperty;
+ /**
+ * The **`border-image-slice`** CSS property divides the image specified by `border-image-source` into regions. These regions form the components of an element's border image.
+ *
+ * **Syntax**: `{1,4} && fill?`
+ *
+ * **Initial value**: `100%`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :----: |
+ * | **15** | **15** | **6** | **12** | **11** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-image-slice
+ */
+ borderImageSlice?: BorderImageSliceProperty;
+ /**
+ * The **`border-image-source`** CSS property sets the source image used to create an element's border image.
+ *
+ * **Syntax**: `none | `
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :----: |
+ * | **15** | **15** | **6** | **12** | **11** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-image-source
+ */
+ borderImageSource?: BorderImageSourceProperty;
+ /**
+ * The **`border-image-width`** CSS property sets the width of an element's border image.
+ *
+ * **Syntax**: `[ | | auto ]{1,4}`
+ *
+ * **Initial value**: `1`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :----: |
+ * | **15** | **13** | **6** | **12** | **11** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-image-width
+ */
+ borderImageWidth?: BorderImageWidthProperty;
+ /**
+ * The **`border-inline-color`** CSS property defines the color of the logical inline borders of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color` and `border-bottom-color`, or `border-right-color` and `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-color'>{1,2}`
+ *
+ * **Initial value**: `currentcolor`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **87** | **66** | **14.1** | **87** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-color
+ */
+ borderInlineColor?: BorderInlineColorProperty;
+ /**
+ * The **`border-inline-end-color`** CSS property defines the color of the logical inline-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-color'>`
+ *
+ * **Initial value**: `currentcolor`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-------------------------: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ * | | 3 _(-moz-border-end-color)_ | | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end-color
+ */
+ borderInlineEndColor?: BorderInlineEndColorProperty;
+ /**
+ * The **`border-inline-end-style`** CSS property defines the style of the logical inline end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-style'>`
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-------------------------: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ * | | 3 _(-moz-border-end-style)_ | | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end-style
+ */
+ borderInlineEndStyle?: BorderInlineEndStyleProperty;
+ /**
+ * The **`border-inline-end-width`** CSS property defines the width of the logical inline-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-width'>`
+ *
+ * **Initial value**: `medium`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-------------------------: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ * | | 3 _(-moz-border-end-width)_ | | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-end-width
+ */
+ borderInlineEndWidth?: BorderInlineEndWidthProperty;
+ /**
+ * The **`border-inline-start-color`** CSS property defines the color of the logical inline start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-color`, `border-right-color`, `border-bottom-color`, or `border-left-color` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-color'>`
+ *
+ * **Initial value**: `currentcolor`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :---------------------------: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ * | | 3 _(-moz-border-start-color)_ | | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start-color
+ */
+ borderInlineStartColor?: BorderInlineStartColorProperty;
+ /**
+ * The **`border-inline-start-style`** CSS property defines the style of the logical inline start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style`, `border-right-style`, `border-bottom-style`, or `border-left-style` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-style'>`
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :---------------------------: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ * | | 3 _(-moz-border-start-style)_ | | | |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start-style
+ */
+ borderInlineStartStyle?: BorderInlineStartStyleProperty;
+ /**
+ * The **`border-inline-start-width`** CSS property defines the width of the logical inline-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width`, `border-right-width`, `border-bottom-width`, or `border-left-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-width'>`
+ *
+ * **Initial value**: `medium`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **69** | **41** | **12.1** | **79** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-start-width
+ */
+ borderInlineStartWidth?: BorderInlineStartWidthProperty;
+ /**
+ * The **`border-inline-style`** CSS property defines the style of the logical inline borders of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-style` and `border-bottom-style`, or `border-left-style` and `border-right-style` properties depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-style'>`
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **87** | **66** | **14.1** | **87** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-style
+ */
+ borderInlineStyle?: BorderInlineStyleProperty;
+ /**
+ * The **`border-inline-width`** CSS property defines the width of the logical inline borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the `border-top-width` and `border-bottom-width`, or `border-left-width`, and `border-right-width` property depending on the values defined for `writing-mode`, `direction`, and `text-orientation`.
+ *
+ * **Syntax**: `<'border-top-width'>`
+ *
+ * **Initial value**: `medium`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :------: | :----: | :-: |
+ * | **87** | **66** | **14.1** | **87** | No |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-inline-width
+ */
+ borderInlineWidth?: BorderInlineWidthProperty;
+ /**
+ * The **`border-left-color`** CSS property sets the color of an element's left border. It can also be set with the shorthand CSS properties `border-color` or `border-left`.
+ *
+ * **Syntax**: ``
+ *
+ * **Initial value**: `currentcolor`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **1** | **1** | **12** | **4** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-left-color
+ */
+ borderLeftColor?: BorderLeftColorProperty;
+ /**
+ * The **`border-left-style`** CSS property sets the line style of an element's left `border`.
+ *
+ * **Syntax**: ``
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :-----: |
+ * | **1** | **1** | **1** | **12** | **5.5** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-left-style
+ */
+ borderLeftStyle?: BorderLeftStyleProperty;
+ /**
+ * The **`border-left-width`** CSS property sets the width of the left border of an element.
+ *
+ * **Syntax**: ``
+ *
+ * **Initial value**: `medium`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **1** | **1** | **12** | **4** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-left-width
+ */
+ borderLeftWidth?: BorderLeftWidthProperty;
+ /**
+ * The **`border-right-color`** CSS property sets the color of an element's right border. It can also be set with the shorthand CSS properties `border-color` or `border-right`.
+ *
+ * **Syntax**: ``
+ *
+ * **Initial value**: `currentcolor`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :---: |
+ * | **1** | **1** | **1** | **12** | **4** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-right-color
+ */
+ borderRightColor?: BorderRightColorProperty;
+ /**
+ * The **`border-right-style`** CSS property sets the line style of an element's right `border`.
+ *
+ * **Syntax**: ``
+ *
+ * **Initial value**: `none`
+ *
+ * | Chrome | Firefox | Safari | Edge | IE |
+ * | :----: | :-----: | :----: | :----: | :-----: |
+ * | **1** | **1** | **1** | **12** | **5.5** |
+ *
+ * @see https://developer.mozilla.org/docs/Web/CSS/border-right-style
+ */
+ borderRightStyle?: BorderRightStyleProperty;
+ /**
+ * The **`border-right-width`** CSS property sets the width of the right border of an element.
+ *
+ * **Syntax**: `