summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhimself65 <himself65@outlook.com>2020-04-25 23:47:53 +0800
committerhimself65 <himself65@outlook.com>2020-04-28 18:05:55 +0800
commit039c5e4b893071ab8857794ea421481b87fb31eb (patch)
tree7044668f2db198f0b53f1727946d04cf3854c9b8
parent307c67be175b8fe7d9dd9e1b5ed55d928b73d66d (diff)
downloadnode-new-039c5e4b893071ab8857794ea421481b87fb31eb.tar.gz
tools: update ESLint to 7.0.0-rc.0
PR-URL: https://github.com/nodejs/node/pull/33062 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
-rw-r--r--tools/node_modules/eslint/README.md14
-rwxr-xr-xtools/node_modules/eslint/bin/eslint.js192
-rw-r--r--tools/node_modules/eslint/lib/api.js2
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js12
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/cli-engine.js97
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/config-array-factory.js4
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/config-array/config-array.js2
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js8
-rw-r--r--tools/node_modules/eslint/lib/cli.js276
-rw-r--r--tools/node_modules/eslint/lib/eslint/eslint.js656
-rw-r--r--tools/node_modules/eslint/lib/eslint/index.js7
-rw-r--r--tools/node_modules/eslint/lib/init/autoconfig.js8
-rw-r--r--tools/node_modules/eslint/lib/init/config-initializer.js6
-rw-r--r--tools/node_modules/eslint/lib/init/source-code-utils.js4
-rw-r--r--tools/node_modules/eslint/lib/options.js1
-rw-r--r--tools/node_modules/eslint/lib/rule-tester/rule-tester.js7
-rw-r--r--tools/node_modules/eslint/lib/rules/array-callback-return.js21
-rw-r--r--tools/node_modules/eslint/lib/rules/callback-return.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/comma-style.js11
-rw-r--r--tools/node_modules/eslint/lib/rules/func-call-spacing.js7
-rw-r--r--tools/node_modules/eslint/lib/rules/getter-return.js14
-rw-r--r--tools/node_modules/eslint/lib/rules/global-require.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/handle-callback-err.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/key-spacing.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/new-cap.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/newline-per-chained-call.js9
-rw-r--r--tools/node_modules/eslint/lib/rules/no-buffer-constructor.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/no-empty-function.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-extra-parens.js6
-rw-r--r--tools/node_modules/eslint/lib/rules/no-inner-declarations.js70
-rw-r--r--tools/node_modules/eslint/lib/rules/no-lone-blocks.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-mixed-requires.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/no-new-object.js18
-rw-r--r--tools/node_modules/eslint/lib/rules/no-new-require.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/no-path-concat.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/no-process-env.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/no-process-exit.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/no-restricted-modules.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/no-sync.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js34
-rw-r--r--tools/node_modules/eslint/lib/rules/no-useless-concat.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/space-before-function-paren.js7
-rw-r--r--tools/node_modules/eslint/lib/rules/yoda.js152
-rw-r--r--tools/node_modules/eslint/lib/shared/relative-module-resolver.js1
-rw-r--r--tools/node_modules/eslint/lib/shared/types.js7
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/identifier.js2
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json4
-rw-r--r--tools/node_modules/eslint/node_modules/ajv/README.md47
-rw-r--r--tools/node_modules/eslint/node_modules/ajv/dist/ajv.min.js4
-rw-r--r--tools/node_modules/eslint/node_modules/ajv/package.json12
-rw-r--r--tools/node_modules/eslint/node_modules/chalk/package.json17
-rw-r--r--tools/node_modules/eslint/node_modules/chalk/readme.md16
-rw-r--r--tools/node_modules/eslint/node_modules/chalk/source/index.js19
-rw-r--r--tools/node_modules/eslint/node_modules/chalk/source/templates.js6
-rw-r--r--tools/node_modules/eslint/node_modules/cli-width/index.js50
-rw-r--r--tools/node_modules/eslint/node_modules/cli-width/package.json18
-rw-r--r--tools/node_modules/eslint/node_modules/cross-spawn/README.md8
-rw-r--r--tools/node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js2
-rw-r--r--tools/node_modules/eslint/node_modules/cross-spawn/package.json8
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.js5919
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.min.js2
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/dist/esquery.js8233
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/dist/esquery.min.js2
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/estraverse.js18
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json2
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/package.json24
-rw-r--r--tools/node_modules/eslint/node_modules/flatted/README.md13
-rw-r--r--tools/node_modules/eslint/node_modules/flatted/cjs/index.js2
-rw-r--r--tools/node_modules/eslint/node_modules/flatted/esm/index.js2
-rw-r--r--tools/node_modules/eslint/node_modules/flatted/index.js2
-rw-r--r--tools/node_modules/eslint/node_modules/flatted/package.json18
-rw-r--r--tools/node_modules/eslint/node_modules/is-promise/index.js1
-rw-r--r--tools/node_modules/eslint/node_modules/is-promise/package.json14
-rw-r--r--tools/node_modules/eslint/node_modules/is-promise/readme.md12
-rw-r--r--tools/node_modules/eslint/node_modules/levn/README.md2
-rw-r--r--tools/node_modules/eslint/node_modules/levn/lib/cast.js39
-rw-r--r--tools/node_modules/eslint/node_modules/levn/lib/coerce.js285
-rw-r--r--tools/node_modules/eslint/node_modules/levn/lib/index.js4
-rw-r--r--tools/node_modules/eslint/node_modules/levn/lib/parse-string.js4
-rw-r--r--tools/node_modules/eslint/node_modules/levn/lib/parse.js102
-rw-r--r--tools/node_modules/eslint/node_modules/levn/package.json11
-rw-r--r--tools/node_modules/eslint/node_modules/mkdirp/index.js4
-rw-r--r--tools/node_modules/eslint/node_modules/mkdirp/package.json4
-rw-r--r--tools/node_modules/eslint/node_modules/mkdirp/readme.markdown4
-rw-r--r--tools/node_modules/eslint/node_modules/optionator/README.md2
-rw-r--r--tools/node_modules/eslint/node_modules/optionator/lib/index.js2
-rw-r--r--tools/node_modules/eslint/node_modules/optionator/package.json19
-rw-r--r--tools/node_modules/eslint/node_modules/prelude-ls/lib/Func.js12
-rw-r--r--tools/node_modules/eslint/node_modules/prelude-ls/lib/List.js54
-rw-r--r--tools/node_modules/eslint/node_modules/prelude-ls/lib/Num.js4
-rw-r--r--tools/node_modules/eslint/node_modules/prelude-ls/lib/Obj.js2
-rw-r--r--tools/node_modules/eslint/node_modules/prelude-ls/lib/Str.js2
-rw-r--r--tools/node_modules/eslint/node_modules/prelude-ls/lib/index.js4
-rw-r--r--tools/node_modules/eslint/node_modules/prelude-ls/package.json20
-rw-r--r--tools/node_modules/eslint/node_modules/regexpp/index.js1112
-rw-r--r--tools/node_modules/eslint/node_modules/regexpp/index.mjs1112
-rw-r--r--tools/node_modules/eslint/node_modules/regexpp/package.json5
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/README.md36
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/_esm2015/README.md36
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/_esm2015/internal/observable/dom/fetch.js29
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/_esm2015/internal/util/pipe.js6
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/_esm5/README.md36
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/observable/dom/fetch.js31
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/util/pipe.js8
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/bundles/rxjs.umd.js40
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/bundles/rxjs.umd.min.js302
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/internal/observable/dom/fetch.js29
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/internal/util/pipe.js6
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/package.json2
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/src/README.md36
-rw-r--r--tools/node_modules/eslint/node_modules/semver/README.md58
-rw-r--r--tools/node_modules/eslint/node_modules/semver/classes/range.js87
-rw-r--r--tools/node_modules/eslint/node_modules/semver/index.js2
-rw-r--r--tools/node_modules/eslint/node_modules/semver/internal/re.js3
-rw-r--r--tools/node_modules/eslint/node_modules/semver/package.json14
-rw-r--r--tools/node_modules/eslint/node_modules/strip-json-comments/index.js4
-rw-r--r--tools/node_modules/eslint/node_modules/strip-json-comments/package.json2
-rw-r--r--tools/node_modules/eslint/node_modules/strip-json-comments/readme.md14
-rw-r--r--tools/node_modules/eslint/node_modules/tslib/README.md24
-rw-r--r--tools/node_modules/eslint/node_modules/tslib/tslib.es6.js30
-rw-r--r--tools/node_modules/eslint/node_modules/tslib/tslib.js54
-rw-r--r--tools/node_modules/eslint/node_modules/type-check/README.md6
-rw-r--r--tools/node_modules/eslint/node_modules/type-check/lib/check.js44
-rw-r--r--tools/node_modules/eslint/node_modules/type-check/lib/index.js4
-rw-r--r--tools/node_modules/eslint/node_modules/type-check/lib/parse-type.js10
-rw-r--r--tools/node_modules/eslint/node_modules/type-check/package.json11
-rw-r--r--tools/node_modules/eslint/package.json43
127 files changed, 10918 insertions, 9082 deletions
diff --git a/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md
index da75b5c149..0a802b0c25 100644
--- a/tools/node_modules/eslint/README.md
+++ b/tools/node_modules/eslint/README.md
@@ -214,6 +214,11 @@ The people who review and implement new features.
<img src="https://github.com/aladdin-add.png?s=75" width="75" height="75"><br />
薛定谔的猫
</a>
+</td><td align="center" valign="top" width="11%">
+<a href="https://github.com/mdjermanovic">
+<img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75"><br />
+Milos Djermanovic
+</a>
</td></tr></tbody></table>
@@ -233,11 +238,6 @@ Pig Fang
<img src="https://github.com/yeonjuan.png?s=75" width="75" height="75"><br />
YeonJuan
</a>
-</td><td align="center" valign="top" width="11%">
-<a href="https://github.com/mdjermanovic">
-<img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75"><br />
-Milos Djermanovic
-</a>
</td></tr></tbody></table>
@@ -250,9 +250,9 @@ The following companies, organizations, and individuals support ESLint's ongoing
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->
<h3>Gold Sponsors</h3>
-<p><a href="https://www.shopify.com"><img src="https://images.opencollective.com/shopify/eeb91aa/logo.png" alt="Shopify" height="96"></a> <a href="http://engineering.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://magiclab.co/?utm_source=eslint"><img src="https://images.opencollective.com/magiclab/bbf6345/logo.png" alt="MagicLab" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a></p><h3>Silver Sponsors</h3>
+<p><a href="https://www.shopify.com"><img src="https://images.opencollective.com/shopify/eeb91aa/logo.png" alt="Shopify" height="96"></a> <a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://www.ampproject.org/"><img src="https://images.opencollective.com/amp/c8a3b25/logo.png" alt="AMP Project" height="64"></a></p><h3>Bronze Sponsors</h3>
-<p><a href="https://www.kasinot.fi"><img src="https://images.opencollective.com/kasinot-fi/e09aa2e/logo.png" alt="Kasinot.fi" height="32"></a> <a href="https://www.pelisivut.com"><img src="https://images.opencollective.com/pelisivut/04f08f2/logo.png" alt="Pelisivut" height="32"></a> <a href="https://www.nettikasinot.org"><img src="https://images.opencollective.com/nettikasinot-org/bbd887f/logo.png" alt="Nettikasinot.org" height="32"></a> <a href="https://www.bonus.com.de/freispiele"><img src="https://images.opencollective.com/bonusfinder-deutschland/646169e/logo.png" alt="BonusFinder Deutschland" height="32"></a> <a href="https://medium.com/@niksundin/best-web-design-companies-1872e445775f"><img src="https://images.opencollective.com/top-web-design-agencies/d92d747/logo.png" alt="Top Web Design Agencies" height="32"></a> <a href="https://www.bugsnag.com/platforms?utm_source=Open Collective&utm_medium=Website&utm_content=open-source&utm_campaign=2019-community&utm_term="><img src="https://images.opencollective.com/bugsnag-stability-monitoring/c2cef36/logo.png" alt="Bugsnag Stability Monitoring" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/cd682f7/logo.png" alt="Mixpanel" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/0b37d14/logo.png" alt="Free Icons by Icons8" height="32"></a> <a href="https://uxplanet.org/top-ui-ux-design-agencies-user-experience-firms-8c54697e290"><img src="https://images.opencollective.com/ui-ux-design-agencies/cae5dfe/logo.png" alt="UI UX Design Agencies" height="32"></a> <a href="https://clay.global"><img src="https://images.opencollective.com/clayglobal/2468f34/logo.png" alt="clay" height="32"></a> <a href="https://discordapp.com"><img src="https://images.opencollective.com/discordapp/7e3d9a9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://tekhattan.com"><img src="https://images.opencollective.com/tekhattan/bc73c28/logo.png" alt="TekHattan" height="32"></a> <a href="https://www.marfeel.com/"><img src="https://images.opencollective.com/marfeel/4b88e30/logo.png" alt="Marfeel" height="32"></a> <a href="http://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a></p>
+<p><a href="https://www.casinotop.com/"><img src="https://images.opencollective.com/casinotop-com/10fd95b/logo.png" alt="CasinoTop.com" height="32"></a> <a href="https://www.casinotopp.net/"><img src="https://images.opencollective.com/casino-topp/1dd399a/logo.png" alt="Casino Topp" height="32"></a> <a href="https://writersperhour.com/urgent-essay-writing-service"><img src="https://images.opencollective.com/writersperhour/5787d4b/logo.png" alt="Writers Per Hour" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://cooltechzone.com/netflix-vpn"><img src="https://images.opencollective.com/vpn-netflix/4850160/logo.png" alt="vpn netflix" height="32"></a> <a href="https://www.kasinot.fi"><img src="https://images.opencollective.com/kasinot-fi/e09aa2e/logo.png" alt="Kasinot.fi" height="32"></a> <a href="https://www.pelisivut.com"><img src="https://images.opencollective.com/pelisivut/04f08f2/logo.png" alt="Pelisivut" height="32"></a> <a href="https://www.nettikasinot.org"><img src="https://images.opencollective.com/nettikasinot-org/bbd887f/logo.png" alt="Nettikasinot.org" height="32"></a> <a href="https://www.bonus.com.de/freispiele"><img src="https://images.opencollective.com/bonusfinder-deutschland/646169e/logo.png" alt="BonusFinder Deutschland" height="32"></a> <a href="https://medium.com/@niksundin/best-web-design-companies-1872e445775f"><img src="https://images.opencollective.com/top-web-design-agencies/d92d747/logo.png" alt="Top Web Design Agencies" height="32"></a> <a href="https://www.bugsnag.com/platforms?utm_source=Open Collective&utm_medium=Website&utm_content=open-source&utm_campaign=2019-community&utm_term="><img src="https://images.opencollective.com/bugsnag-stability-monitoring/c2cef36/logo.png" alt="Bugsnag Stability Monitoring" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/cd682f7/logo.png" alt="Mixpanel" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/0b37d14/logo.png" alt="Free Icons by Icons8" height="32"></a> <a href="https://uxplanet.org/top-ui-ux-design-agencies-user-experience-firms-8c54697e290"><img src="https://images.opencollective.com/ui-ux-design-agencies/cae5dfe/logo.png" alt="UI UX Design Agencies" height="32"></a> <a href="https://clay.global"><img src="https://images.opencollective.com/clayglobal/2468f34/logo.png" alt="clay" height="32"></a> <a href="https://discordapp.com"><img src="https://images.opencollective.com/discordapp/7e3d9a9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://tekhattan.com"><img src="https://images.opencollective.com/tekhattan/bc73c28/logo.png" alt="TekHattan" height="32"></a> <a href="https://www.marfeel.com/"><img src="https://images.opencollective.com/marfeel/4b88e30/logo.png" alt="Marfeel" height="32"></a> <a href="http://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a></p>
<!--sponsorsend-->
## <a name="technology-sponsors"></a>Technology Sponsors
diff --git a/tools/node_modules/eslint/bin/eslint.js b/tools/node_modules/eslint/bin/eslint.js
index a9f51f1d7d..75b4131486 100755
--- a/tools/node_modules/eslint/bin/eslint.js
+++ b/tools/node_modules/eslint/bin/eslint.js
@@ -12,97 +12,135 @@
// to use V8's code cache to speed up instantiation time
require("v8-compile-cache");
-//------------------------------------------------------------------------------
-// Helpers
-//------------------------------------------------------------------------------
-
-const useStdIn = process.argv.includes("--stdin"),
- init = process.argv.includes("--init"),
- debug = process.argv.includes("--debug");
-
// must do this initialization *before* other requires in order to work
-if (debug) {
+if (process.argv.includes("--debug")) {
require("debug").enable("eslint:*,-eslint:code-path");
}
//------------------------------------------------------------------------------
-// Requirements
+// Helpers
//------------------------------------------------------------------------------
-// now we can safely include the other modules that use debug
-const path = require("path"),
- fs = require("fs"),
- cli = require("../lib/cli");
-
-//------------------------------------------------------------------------------
-// Execution
-//------------------------------------------------------------------------------
+/**
+ * Read data from stdin til the end.
+ *
+ * Note: See
+ * - https://github.com/nodejs/node/blob/master/doc/api/process.md#processstdin
+ * - https://github.com/nodejs/node/blob/master/doc/api/process.md#a-note-on-process-io
+ * - https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-01/msg00419.html
+ * - https://github.com/nodejs/node/issues/7439 (historical)
+ *
+ * On Windows using `fs.readFileSync(STDIN_FILE_DESCRIPTOR, "utf8")` seems
+ * to read 4096 bytes before blocking and never drains to read further data.
+ *
+ * The investigation on the Emacs thread indicates:
+ *
+ * > Emacs on MS-Windows uses pipes to communicate with subprocesses; a
+ * > pipe on Windows has a 4K buffer. So as soon as Emacs writes more than
+ * > 4096 bytes to the pipe, the pipe becomes full, and Emacs then waits for
+ * > the subprocess to read its end of the pipe, at which time Emacs will
+ * > write the rest of the stuff.
+ * @returns {Promise<string>} The read text.
+ */
+function readStdin() {
+ return new Promise((resolve, reject) => {
+ let content = "";
+ let chunk = "";
+
+ process.stdin
+ .setEncoding("utf8")
+ .on("readable", () => {
+ while ((chunk = process.stdin.read()) !== null) {
+ content += chunk;
+ }
+ })
+ .on("end", () => resolve(content))
+ .on("error", reject);
+ });
+}
-process.once("uncaughtException", err => {
+/**
+ * Get the error message of a given value.
+ * @param {any} error The value to get.
+ * @returns {string} The error message.
+ */
+function getErrorMessage(error) {
- // lazy load
+ // Lazy loading because those are used only if error happened.
+ const fs = require("fs");
+ const path = require("path");
+ const util = require("util");
const lodash = require("lodash");
- if (typeof err.messageTemplate === "string" && err.messageTemplate.length > 0) {
- const template = lodash.template(fs.readFileSync(path.resolve(__dirname, `../messages/${err.messageTemplate}.txt`), "utf-8"));
- const pkg = require("../package.json");
+ // Foolproof -- thirdparty module might throw non-object.
+ if (typeof error !== "object" || error === null) {
+ return String(error);
+ }
+
+ // Use templates if `error.messageTemplate` is present.
+ if (typeof error.messageTemplate === "string") {
+ try {
+ const templateFilePath = path.resolve(
+ __dirname,
+ `../messages/${error.messageTemplate}.txt`
+ );
+
+ // Use sync API because Node.js should exit at this tick.
+ const templateText = fs.readFileSync(templateFilePath, "utf-8");
+ const template = lodash.template(templateText);
+
+ return template(error.messageData || {});
+ } catch {
+
+ // Ignore template error then fallback to use `error.stack`.
+ }
+ }
- console.error("\nOops! Something went wrong! :(");
- console.error(`\nESLint: ${pkg.version}.\n\n${template(err.messageData || {})}`);
- } else {
- console.error(err.stack);
+ // Use the stacktrace if it's an error object.
+ if (typeof error.stack === "string") {
+ return error.stack;
}
+ // Otherwise, dump the object.
+ return util.format("%o", error);
+}
+
+/**
+ * Catch and report unexpected error.
+ * @param {any} error The thrown error object.
+ * @returns {void}
+ */
+function onFatalError(error) {
process.exitCode = 2;
-});
-
-if (useStdIn) {
-
- /*
- * Note: See
- * - https://github.com/nodejs/node/blob/master/doc/api/process.md#processstdin
- * - https://github.com/nodejs/node/blob/master/doc/api/process.md#a-note-on-process-io
- * - https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-01/msg00419.html
- * - https://github.com/nodejs/node/issues/7439 (historical)
- *
- * On Windows using `fs.readFileSync(STDIN_FILE_DESCRIPTOR, "utf8")` seems
- * to read 4096 bytes before blocking and never drains to read further data.
- *
- * The investigation on the Emacs thread indicates:
- *
- * > Emacs on MS-Windows uses pipes to communicate with subprocesses; a
- * > pipe on Windows has a 4K buffer. So as soon as Emacs writes more than
- * > 4096 bytes to the pipe, the pipe becomes full, and Emacs then waits for
- * > the subprocess to read its end of the pipe, at which time Emacs will
- * > write the rest of the stuff.
- *
- * Using the nodejs code example for reading from stdin.
- */
- let contents = "",
- chunk = "";
-
- process.stdin.setEncoding("utf8");
- process.stdin.on("readable", () => {
-
- // Use a loop to make sure we read all available data.
- while ((chunk = process.stdin.read()) !== null) {
- contents += chunk;
- }
- });
- process.stdin.on("end", () => {
- process.exitCode = cli.execute(process.argv, contents, "utf8");
- });
-} else if (init) {
- const configInit = require("../lib/init/config-initializer");
-
- configInit.initializeConfig().then(() => {
- process.exitCode = 0;
- }).catch(err => {
- process.exitCode = 1;
- console.error(err.message);
- console.error(err.stack);
- });
-} else {
- process.exitCode = cli.execute(process.argv);
+ const { version } = require("../package.json");
+ const message = getErrorMessage(error);
+
+ console.error(`
+Oops! Something went wrong! :(
+
+ESLint: ${version}
+
+${message}`);
}
+
+//------------------------------------------------------------------------------
+// Execution
+//------------------------------------------------------------------------------
+
+(async function main() {
+ process.on("uncaughtException", onFatalError);
+ process.on("unhandledRejection", onFatalError);
+
+ // Call the config initializer if `--init` is present.
+ if (process.argv.includes("--init")) {
+ await require("../lib/init/config-initializer").initializeConfig();
+ return;
+ }
+
+ // Otherwise, call the CLI.
+ process.exitCode = await require("../lib/cli").execute(
+ process.argv,
+ process.argv.includes("--stdin") ? await readStdin() : null
+ );
+}()).catch(onFatalError);
diff --git a/tools/node_modules/eslint/lib/api.js b/tools/node_modules/eslint/lib/api.js
index 40a5cc9fa5..e4b6643b44 100644
--- a/tools/node_modules/eslint/lib/api.js
+++ b/tools/node_modules/eslint/lib/api.js
@@ -6,6 +6,7 @@
"use strict";
const { CLIEngine } = require("./cli-engine");
+const { ESLint } = require("./eslint");
const { Linter } = require("./linter");
const { RuleTester } = require("./rule-tester");
const { SourceCode } = require("./source-code");
@@ -13,6 +14,7 @@ const { SourceCode } = require("./source-code");
module.exports = {
Linter,
CLIEngine,
+ ESLint,
RuleTester,
SourceCode
};
diff --git a/tools/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js b/tools/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js
index b53f67bd9d..f54605c4db 100644
--- a/tools/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js
+++ b/tools/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js
@@ -280,6 +280,18 @@ class CascadingConfigArrayFactory {
}
/**
+ * Set the config data to override all configs.
+ * Require to call `clearCache()` method after this method is called.
+ * @param {ConfigData} configData The config data to override all configs.
+ * @returns {void}
+ */
+ setOverrideConfig(configData) {
+ const slots = internalSlotsMap.get(this);
+
+ slots.cliConfigData = configData;
+ }
+
+ /**
* Clear config cache.
* @returns {void}
*/
diff --git a/tools/node_modules/eslint/lib/cli-engine/cli-engine.js b/tools/node_modules/eslint/lib/cli-engine/cli-engine.js
index 72d1fa4d5d..b6aa995bee 100644
--- a/tools/node_modules/eslint/lib/cli-engine/cli-engine.js
+++ b/tools/node_modules/eslint/lib/cli-engine/cli-engine.js
@@ -39,6 +39,7 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]);
// For VSCode IntelliSense
/** @typedef {import("../shared/types").ConfigData} ConfigData */
+/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */
/** @typedef {import("../shared/types").LintMessage} LintMessage */
/** @typedef {import("../shared/types").ParserOptions} ParserOptions */
/** @typedef {import("../shared/types").Plugin} Plugin */
@@ -50,29 +51,29 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]);
/**
* The options to configure a CLI engine with.
* @typedef {Object} CLIEngineOptions
- * @property {boolean} allowInlineConfig Enable or disable inline configuration comments.
- * @property {ConfigData} baseConfig Base config object, extended by all configs used with this CLIEngine instance
- * @property {boolean} cache Enable result caching.
- * @property {string} cacheLocation The cache file to use instead of .eslintcache.
- * @property {string} configFile The configuration file to use.
- * @property {string} cwd The value to use for the current working directory.
- * @property {string[]} envs An array of environments to load.
- * @property {string[]|null} extensions An array of file extensions to check.
- * @property {boolean|Function} fix Execute in autofix mode. If a function, should return a boolean.
- * @property {string[]} fixTypes Array of rule types to apply fixes for.
- * @property {string[]} globals An array of global variables to declare.
- * @property {boolean} ignore False disables use of .eslintignore.
- * @property {string} ignorePath The ignore file to use instead of .eslintignore.
- * @property {string|string[]} ignorePattern One or more glob patterns to ignore.
- * @property {boolean} useEslintrc False disables looking for .eslintrc
- * @property {string} parser The name of the parser to use.
- * @property {ParserOptions} parserOptions An object of parserOption settings to use.
- * @property {string[]} plugins An array of plugins to load.
- * @property {Record<string,RuleConf>} rules An object of rules to use.
- * @property {string[]} rulePaths An array of directories to load custom rules from.
- * @property {boolean} reportUnusedDisableDirectives `true` adds reports for unused eslint-disable directives
- * @property {boolean} globInputPaths Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file.
- * @property {string} resolvePluginsRelativeTo The folder where plugins should be resolved from, defaulting to the CWD
+ * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments.
+ * @property {ConfigData} [baseConfig] Base config object, extended by all configs used with this CLIEngine instance
+ * @property {boolean} [cache] Enable result caching.
+ * @property {string} [cacheLocation] The cache file to use instead of .eslintcache.
+ * @property {string} [configFile] The configuration file to use.
+ * @property {string} [cwd] The value to use for the current working directory.
+ * @property {string[]} [envs] An array of environments to load.
+ * @property {string[]|null} [extensions] An array of file extensions to check.
+ * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean.
+ * @property {string[]} [fixTypes] Array of rule types to apply fixes for.
+ * @property {string[]} [globals] An array of global variables to declare.
+ * @property {boolean} [ignore] False disables use of .eslintignore.
+ * @property {string} [ignorePath] The ignore file to use instead of .eslintignore.
+ * @property {string|string[]} [ignorePattern] One or more glob patterns to ignore.
+ * @property {boolean} [useEslintrc] False disables looking for .eslintrc
+ * @property {string} [parser] The name of the parser to use.
+ * @property {ParserOptions} [parserOptions] An object of parserOption settings to use.
+ * @property {string[]} [plugins] An array of plugins to load.
+ * @property {Record<string,RuleConf>} [rules] An object of rules to use.
+ * @property {string[]} [rulePaths] An array of directories to load custom rules from.
+ * @property {boolean} [reportUnusedDisableDirectives] `true` adds reports for unused eslint-disable directives
+ * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file.
+ * @property {string} [resolvePluginsRelativeTo] The folder where plugins should be resolved from, defaulting to the CWD
*/
/**
@@ -89,13 +90,6 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]);
*/
/**
- * Information of deprecated rules.
- * @typedef {Object} DeprecatedRuleInfo
- * @property {string} ruleId The rule ID.
- * @property {string[]} replacedBy The rule IDs that replace this deprecated rule.
- */
-
-/**
* Linting results.
* @typedef {Object} LintReport
* @property {LintResult[]} results All of the result.
@@ -821,16 +815,22 @@ class CLIEngine {
lintResultCache.reconcile();
}
- // Collect used deprecated rules.
- const usedDeprecatedRules = Array.from(
- iterateRuleDeprecationWarnings(lastConfigArrays)
- );
-
debug(`Linting complete in: ${Date.now() - startTime}ms`);
+ let usedDeprecatedRules;
+
return {
results,
...calculateStatsPerRun(results),
- usedDeprecatedRules
+
+ // Initialize it lazily because CLI and `ESLint` API don't use it.
+ get usedDeprecatedRules() {
+ if (!usedDeprecatedRules) {
+ usedDeprecatedRules = Array.from(
+ iterateRuleDeprecationWarnings(lastConfigArrays)
+ );
+ }
+ return usedDeprecatedRules;
+ }
};
}
@@ -858,9 +858,9 @@ class CLIEngine {
const startTime = Date.now();
const resolvedFilename = filename && path.resolve(cwd, filename);
+
// Clear the last used config arrays.
lastConfigArrays.length = 0;
-
if (resolvedFilename && this.isPathIgnored(resolvedFilename)) {
if (warnIgnored) {
results.push(createIgnoreResult(resolvedFilename, cwd));
@@ -892,16 +892,22 @@ class CLIEngine {
}));
}
- // Collect used deprecated rules.
- const usedDeprecatedRules = Array.from(
- iterateRuleDeprecationWarnings(lastConfigArrays)
- );
-
debug(`Linting complete in: ${Date.now() - startTime}ms`);
+ let usedDeprecatedRules;
+
return {
results,
...calculateStatsPerRun(results),
- usedDeprecatedRules
+
+ // Initialize it lazily because CLI and `ESLint` API don't use it.
+ get usedDeprecatedRules() {
+ if (!usedDeprecatedRules) {
+ usedDeprecatedRules = Array.from(
+ iterateRuleDeprecationWarnings(lastConfigArrays)
+ );
+ }
+ return usedDeprecatedRules;
+ }
};
}
@@ -955,11 +961,10 @@ class CLIEngine {
}
/**
- * Returns the formatter representing the given format or null if no formatter
- * with the given name can be found.
+ * Returns the formatter representing the given format or null if the `format` is not a string.
* @param {string} [format] The name of the format to load or the path to a
* custom formatter.
- * @returns {Function} The formatter function or null if not found.
+ * @returns {(Function|null)} The formatter function or null if the `format` is not a string.
*/
getFormatter(format) {
diff --git a/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js b/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js
index b1429af6ad..fa3fdb3bed 100644
--- a/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js
+++ b/tools/node_modules/eslint/lib/cli-engine/config-array-factory.js
@@ -817,7 +817,7 @@ class ConfigArrayFactory {
if (configData) {
return this._normalizeConfigData(configData, {
...ctx,
- filePath: plugin.filePath,
+ filePath: plugin.filePath || ctx.filePath,
name: `${ctx.name} » plugin:${plugin.id}/${configName}`
});
}
@@ -978,7 +978,7 @@ class ConfigArrayFactory {
if (plugin) {
return new ConfigDependency({
definition: normalizePlugin(plugin),
- filePath: ctx.filePath,
+ filePath: "", // It's unknown where the plugin came from.
id,
importerName: ctx.name,
importerPath: ctx.filePath
diff --git a/tools/node_modules/eslint/lib/cli-engine/config-array/config-array.js b/tools/node_modules/eslint/lib/cli-engine/config-array/config-array.js
index b3434198b1..42a7362737 100644
--- a/tools/node_modules/eslint/lib/cli-engine/config-array/config-array.js
+++ b/tools/node_modules/eslint/lib/cli-engine/config-array/config-array.js
@@ -107,7 +107,7 @@ function getMatchedIndices(elements, filePath) {
for (let i = elements.length - 1; i >= 0; --i) {
const element = elements[i];
- if (!element.criteria || element.criteria.test(filePath)) {
+ if (!element.criteria || (filePath && element.criteria.test(filePath))) {
indices.push(i);
}
}
diff --git a/tools/node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js b/tools/node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js
index 92690b9f8a..6eaec4258e 100644
--- a/tools/node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js
+++ b/tools/node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js
@@ -71,7 +71,13 @@ function getCommonAncestorPath(sourcePaths) {
}
}
- return result || path.sep;
+ let resolvedResult = result || path.sep;
+
+ // if Windows common ancestor is root of drive must have trailing slash to be absolute.
+ if (resolvedResult && resolvedResult.endsWith(":") && process.platform === "win32") {
+ resolvedResult += path.sep;
+ }
+ return resolvedResult;
}
/**
diff --git a/tools/node_modules/eslint/lib/cli.js b/tools/node_modules/eslint/lib/cli.js
index 815ce68c22..ce11878008 100644
--- a/tools/node_modules/eslint/lib/cli.js
+++ b/tools/node_modules/eslint/lib/cli.js
@@ -17,105 +17,176 @@
const fs = require("fs"),
path = require("path"),
- { CLIEngine } = require("./cli-engine"),
- options = require("./options"),
+ { promisify } = require("util"),
+ { ESLint } = require("./eslint"),
+ CLIOptions = require("./options"),
log = require("./shared/logging"),
RuntimeInfo = require("./shared/runtime-info");
const debug = require("debug")("eslint:cli");
//------------------------------------------------------------------------------
+// Types
+//------------------------------------------------------------------------------
+
+/** @typedef {import("./eslint/eslint").ESLintOptions} ESLintOptions */
+/** @typedef {import("./eslint/eslint").LintMessage} LintMessage */
+/** @typedef {import("./eslint/eslint").LintResult} LintResult */
+
+//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
+const mkdir = promisify(fs.mkdir);
+const stat = promisify(fs.stat);
+const writeFile = promisify(fs.writeFile);
+
/**
* Predicate function for whether or not to apply fixes in quiet mode.
* If a message is a warning, do not apply a fix.
- * @param {LintResult} lintResult The lint result.
+ * @param {LintMessage} message The lint result.
* @returns {boolean} True if the lint message is an error (and thus should be
* autofixed), false otherwise.
*/
-function quietFixPredicate(lintResult) {
- return lintResult.severity === 2;
+function quietFixPredicate(message) {
+ return message.severity === 2;
}
/**
* Translates the CLI options into the options expected by the CLIEngine.
* @param {Object} cliOptions The CLI options to translate.
- * @returns {CLIEngineOptions} The options object for the CLIEngine.
+ * @returns {ESLintOptions} The options object for the CLIEngine.
* @private
*/
-function translateOptions(cliOptions) {
+function translateOptions({
+ cache,
+ cacheFile,
+ cacheLocation,
+ config,
+ env,
+ errorOnUnmatchedPattern,
+ eslintrc,
+ ext,
+ fix,
+ fixDryRun,
+ fixType,
+ global,
+ ignore,
+ ignorePath,
+ ignorePattern,
+ inlineConfig,
+ parser,
+ parserOptions,
+ plugin,
+ quiet,
+ reportUnusedDisableDirectives,
+ resolvePluginsRelativeTo,
+ rule,
+ rulesdir
+}) {
return {
- envs: cliOptions.env,
- extensions: cliOptions.ext,
- rules: cliOptions.rule,
- plugins: cliOptions.plugin,
- globals: cliOptions.global,
- ignore: cliOptions.ignore,
- ignorePath: cliOptions.ignorePath,
- ignorePattern: cliOptions.ignorePattern,
- configFile: cliOptions.config,
- rulePaths: cliOptions.rulesdir,
- useEslintrc: cliOptions.eslintrc,
- parser: cliOptions.parser,
- parserOptions: cliOptions.parserOptions,
- cache: cliOptions.cache,
- cacheFile: cliOptions.cacheFile,
- cacheLocation: cliOptions.cacheLocation,
- fix: (cliOptions.fix || cliOptions.fixDryRun) && (cliOptions.quiet ? quietFixPredicate : true),
- fixTypes: cliOptions.fixType,
- allowInlineConfig: cliOptions.inlineConfig,
- reportUnusedDisableDirectives: cliOptions.reportUnusedDisableDirectives,
- resolvePluginsRelativeTo: cliOptions.resolvePluginsRelativeTo,
- errorOnUnmatchedPattern: cliOptions.errorOnUnmatchedPattern
+ allowInlineConfig: inlineConfig,
+ cache,
+ cacheLocation: cacheLocation || cacheFile,
+ errorOnUnmatchedPattern,
+ extensions: ext,
+ fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true),
+ fixTypes: fixType,
+ ignore,
+ ignorePath,
+ overrideConfig: {
+ env: env && env.reduce((obj, name) => {
+ obj[name] = true;
+ return obj;
+ }, {}),
+ globals: global && global.reduce((obj, name) => {
+ if (name.endsWith(":true")) {
+ obj[name.slice(0, -5)] = "writable";
+ } else {
+ obj[name] = "readonly";
+ }
+ return obj;
+ }, {}),
+ ignorePatterns: ignorePattern,
+ parser,
+ parserOptions,
+ plugins: plugin,
+ rules: rule
+ },
+ overrideConfigFile: config,
+ reportUnusedDisableDirectives: reportUnusedDisableDirectives ? "error" : void 0,
+ resolvePluginsRelativeTo,
+ rulePaths: rulesdir,
+ useEslintrc: eslintrc
};
}
/**
+ * Count error messages.
+ * @param {LintResult[]} results The lint results.
+ * @returns {{errorCount:number;warningCount:number}} The number of error messages.
+ */
+function countErrors(results) {
+ let errorCount = 0;
+ let warningCount = 0;
+
+ for (const result of results) {
+ errorCount += result.errorCount;
+ warningCount += result.warningCount;
+ }
+
+ return { errorCount, warningCount };
+}
+
+/**
+ * Check if a given file path is a directory or not.
+ * @param {string} filePath The path to a file to check.
+ * @returns {Promise<boolean>} `true` if the given path is a directory.
+ */
+async function isDirectory(filePath) {
+ try {
+ return (await stat(filePath)).isDirectory();
+ } catch (error) {
+ if (error.code === "ENOENT" || error.code === "ENOTDIR") {
+ return false;
+ }
+ throw error;
+ }
+}
+
+/**
* Outputs the results of the linting.
- * @param {CLIEngine} engine The CLIEngine to use.
+ * @param {ESLint} engine The ESLint instance to use.
* @param {LintResult[]} results The results to print.
* @param {string} format The name of the formatter to use or the path to the formatter.
* @param {string} outputFile The path for the output file.
- * @returns {boolean} True if the printing succeeds, false if not.
+ * @returns {Promise<boolean>} True if the printing succeeds, false if not.
* @private
*/
-function printResults(engine, results, format, outputFile) {
+async function printResults(engine, results, format, outputFile) {
let formatter;
- let rulesMeta;
try {
- formatter = engine.getFormatter(format);
+ formatter = await engine.loadFormatter(format);
} catch (e) {
log.error(e.message);
return false;
}
- const output = formatter(results, {
- get rulesMeta() {
- if (!rulesMeta) {
- rulesMeta = {};
- for (const [ruleId, rule] of engine.getRules()) {
- rulesMeta[ruleId] = rule.meta;
- }
- }
- return rulesMeta;
- }
- });
+ const output = formatter.format(results);
if (output) {
if (outputFile) {
const filePath = path.resolve(process.cwd(), outputFile);
- if (fs.existsSync(filePath) && fs.statSync(filePath).isDirectory()) {
+ if (await isDirectory(filePath)) {
log.error("Cannot write to output file path, it is a directory: %s", outputFile);
return false;
}
try {
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
- fs.writeFileSync(filePath, output);
+ await mkdir(path.dirname(filePath), { recursive: true });
+ await writeFile(filePath, output);
} catch (ex) {
log.error("There was a problem writing the output file:\n%s", ex);
return false;
@@ -126,7 +197,6 @@ function printResults(engine, results, format, outputFile) {
}
return true;
-
}
//------------------------------------------------------------------------------
@@ -143,28 +213,33 @@ const cli = {
* Executes the CLI based on an array of arguments that is passed in.
* @param {string|Array|Object} args The arguments to process.
* @param {string} [text] The text to lint (used for TTY).
- * @returns {int} The exit code for the operation.
+ * @returns {Promise<number>} The exit code for the operation.
*/
- execute(args, text) {
+ async execute(args, text) {
if (Array.isArray(args)) {
debug("CLI args: %o", args.slice(2));
}
-
- let currentOptions;
+ let options;
try {
- currentOptions = options.parse(args);
+ options = CLIOptions.parse(args);
} catch (error) {
log.error(error.message);
return 2;
}
- const files = currentOptions._;
+ const files = options._;
const useStdin = typeof text === "string";
- if (currentOptions.version) {
+ if (options.help) {
+ log.info(CLIOptions.generateHelp());
+ return 0;
+ }
+ if (options.version) {
log.info(RuntimeInfo.version());
- } else if (currentOptions.envInfo) {
+ return 0;
+ }
+ if (options.envInfo) {
try {
log.info(RuntimeInfo.environment());
return 0;
@@ -172,7 +247,9 @@ const cli = {
log.error(err.message);
return 2;
}
- } else if (currentOptions.printConfig) {
+ }
+
+ if (options.printConfig) {
if (files.length) {
log.error("The --print-config option must be used with exactly one file name.");
return 2;
@@ -182,58 +259,67 @@ const cli = {
return 2;
}
- const engine = new CLIEngine(translateOptions(currentOptions));
- const fileConfig = engine.getConfigForFile(currentOptions.printConfig);
+ const engine = new ESLint(translateOptions(options));
+ const fileConfig =
+ await engine.calculateConfigForFile(options.printConfig);
log.info(JSON.stringify(fileConfig, null, " "));
return 0;
- } else if (currentOptions.help || (!files.length && !useStdin)) {
- log.info(options.generateHelp());
- } else {
- debug(`Running on ${useStdin ? "text" : "files"}`);
-
- if (currentOptions.fix && currentOptions.fixDryRun) {
- log.error("The --fix option and the --fix-dry-run option cannot be used together.");
- return 2;
- }
+ }
- if (useStdin && currentOptions.fix) {
- log.error("The --fix option is not available for piped-in code; use --fix-dry-run instead.");
- return 2;
- }
+ debug(`Running on ${useStdin ? "text" : "files"}`);
- if (currentOptions.fixType && !currentOptions.fix && !currentOptions.fixDryRun) {
- log.error("The --fix-type option requires either --fix or --fix-dry-run.");
- return 2;
- }
+ if (options.fix && options.fixDryRun) {
+ log.error("The --fix option and the --fix-dry-run option cannot be used together.");
+ return 2;
+ }
+ if (useStdin && options.fix) {
+ log.error("The --fix option is not available for piped-in code; use --fix-dry-run instead.");
+ return 2;
+ }
+ if (options.fixType && !options.fix && !options.fixDryRun) {
+ log.error("The --fix-type option requires either --fix or --fix-dry-run.");
+ return 2;
+ }
- const engine = new CLIEngine(translateOptions(currentOptions));
- const report = useStdin ? engine.executeOnText(text, currentOptions.stdinFilename, true) : engine.executeOnFiles(files);
+ const engine = new ESLint(translateOptions(options));
+ let results;
- if (currentOptions.fix) {
- debug("Fix mode enabled - applying fixes");
- CLIEngine.outputFixes(report);
- }
+ if (useStdin) {
+ results = await engine.lintText(text, {
+ filePath: options.stdinFilename,
+ warnIgnored: true
+ });
+ } else {
+ results = await engine.lintFiles(files);
+ }
- if (currentOptions.quiet) {
- debug("Quiet mode enabled - filtering out warnings");
- report.results = CLIEngine.getErrorResults(report.results);
- }
+ if (options.fix) {
+ debug("Fix mode enabled - applying fixes");
+ await ESLint.outputFixes(results);
+ }
- if (printResults(engine, report.results, currentOptions.format, currentOptions.outputFile)) {
- const tooManyWarnings = currentOptions.maxWarnings >= 0 && report.warningCount > currentOptions.maxWarnings;
+ if (options.quiet) {
+ debug("Quiet mode enabled - filtering out warnings");
+ results = ESLint.getErrorResults(results);
+ }
- if (!report.errorCount && tooManyWarnings) {
- log.error("ESLint found too many warnings (maximum: %s).", currentOptions.maxWarnings);
- }
+ if (await printResults(engine, results, options.format, options.outputFile)) {
+ const { errorCount, warningCount } = countErrors(results);
+ const tooManyWarnings =
+ options.maxWarnings >= 0 && warningCount > options.maxWarnings;
- return (report.errorCount || tooManyWarnings) ? 1 : 0;
+ if (!errorCount && tooManyWarnings) {
+ log.error(
+ "ESLint found too many warnings (maximum: %s).",
+ options.maxWarnings
+ );
}
- return 2;
+ return (errorCount || tooManyWarnings) ? 1 : 0;
}
- return 0;
+ return 2;
}
};
diff --git a/tools/node_modules/eslint/lib/eslint/eslint.js b/tools/node_modules/eslint/lib/eslint/eslint.js
new file mode 100644
index 0000000000..d195aab09f
--- /dev/null
+++ b/tools/node_modules/eslint/lib/eslint/eslint.js
@@ -0,0 +1,656 @@
+/**
+ * @fileoverview Main API Class
+ * @author Kai Cataldo
+ * @author Toru Nagashima
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const path = require("path");
+const fs = require("fs");
+const { promisify } = require("util");
+const { CLIEngine, getCLIEngineInternalSlots } = require("../cli-engine/cli-engine");
+const BuiltinRules = require("../rules");
+const { getRuleSeverity } = require("../shared/config-ops");
+const { version } = require("../../package.json");
+
+//------------------------------------------------------------------------------
+// Typedefs
+//------------------------------------------------------------------------------
+
+/** @typedef {import("../cli-engine/cli-engine").LintReport} CLIEngineLintReport */
+/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */
+/** @typedef {import("../shared/types").ConfigData} ConfigData */
+/** @typedef {import("../shared/types").LintMessage} LintMessage */
+/** @typedef {import("../shared/types").Plugin} Plugin */
+/** @typedef {import("../shared/types").Rule} Rule */
+/** @typedef {import("./load-formatter").Formatter} Formatter */
+
+/**
+ * The options with which to configure the ESLint instance.
+ * @typedef {Object} ESLintOptions
+ * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments.
+ * @property {ConfigData} [baseConfig] Base config object, extended by all configs used with this instance
+ * @property {boolean} [cache] Enable result caching.
+ * @property {string} [cacheLocation] The cache file to use instead of .eslintcache.
+ * @property {string} [cwd] The value to use for the current working directory.
+ * @property {boolean} [errorOnUnmatchedPattern] If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`.
+ * @property {string[]} [extensions] An array of file extensions to check.
+ * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean.
+ * @property {string[]} [fixTypes] Array of rule types to apply fixes for.
+ * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file.
+ * @property {boolean} [ignore] False disables use of .eslintignore.
+ * @property {string} [ignorePath] The ignore file to use instead of .eslintignore.
+ * @property {ConfigData} [overrideConfig] Override config object, overrides all configs used with this instance
+ * @property {string} [overrideConfigFile] The configuration file to use.
+ * @property {Record<string,Plugin>} [plugins] An array of plugin implementations.
+ * @property {"error" | "warn" | "off"} [reportUnusedDisableDirectives] the severity to report unused eslint-disable directives.
+ * @property {string} [resolvePluginsRelativeTo] The folder where plugins should be resolved from, defaulting to the CWD.
+ * @property {string[]} [rulePaths] An array of directories to load custom rules from.
+ * @property {boolean} [useEslintrc] False disables looking for .eslintrc.* files.
+ */
+
+/**
+ * A rules metadata object.
+ * @typedef {Object} RulesMeta
+ * @property {string} id The plugin ID.
+ * @property {Object} definition The plugin definition.
+ */
+
+/**
+ * A linting result.
+ * @typedef {Object} LintResult
+ * @property {string} filePath The path to the file that was linted.
+ * @property {LintMessage[]} messages All of the messages for the result.
+ * @property {number} errorCount Number of errors for the result.
+ * @property {number} warningCount Number of warnings for the result.
+ * @property {number} fixableErrorCount Number of fixable errors for the result.
+ * @property {number} fixableWarningCount Number of fixable warnings for the result.
+ * @property {string} [source] The source code of the file that was linted.
+ * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible.
+ * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules.
+ */
+
+/**
+ * Private members for the `ESLint` instance.
+ * @typedef {Object} ESLintPrivateMembers
+ * @property {CLIEngine} cliEngine The wrapped CLIEngine instance.
+ * @property {ESLintOptions} options The options used to instantiate the ESLint instance.
+ */
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+const writeFile = promisify(fs.writeFile);
+
+/**
+ * The map with which to store private class members.
+ * @type {WeakMap<ESLint, ESLintPrivateMembers>}
+ */
+const privateMembersMap = new WeakMap();
+
+/**
+ * Check if a given value is a non-empty string or not.
+ * @param {any} x The value to check.
+ * @returns {boolean} `true` if `x` is a non-empty string.
+ */
+function isNonEmptyString(x) {
+ return typeof x === "string" && x.trim() !== "";
+}
+
+/**
+ * Check if a given value is an array of non-empty stringss or not.
+ * @param {any} x The value to check.
+ * @returns {boolean} `true` if `x` is an array of non-empty stringss.
+ */
+function isArrayOfNonEmptyString(x) {
+ return Array.isArray(x) && x.every(isNonEmptyString);
+}
+
+/**
+ * Check if a given value is a valid fix type or not.
+ * @param {any} x The value to check.
+ * @returns {boolean} `true` if `x` is valid fix type.
+ */
+function isFixType(x) {
+ return x === "problem" || x === "suggestion" || x === "layout";
+}
+
+/**
+ * Check if a given value is an array of fix types or not.
+ * @param {any} x The value to check.
+ * @returns {boolean} `true` if `x` is an array of fix types.
+ */
+function isFixTypeArray(x) {
+ return Array.isArray(x) && x.every(isFixType);
+}
+
+/**
+ * The error for invalid options.
+ */
+class ESLintInvalidOptionsError extends Error {
+ constructor(messages) {
+ super(`Invalid Options:\n- ${messages.join("\n- ")}`);
+ this.code = "ESLINT_INVALID_OPTIONS";
+ Error.captureStackTrace(this, ESLintInvalidOptionsError);
+ }
+}
+
+/**
+ * Validates and normalizes options for the wrapped CLIEngine instance.
+ * @param {ESLintOptions} options The options to process.
+ * @returns {ESLintOptions} The normalized options.
+ */
+function processOptions({
+ allowInlineConfig = true, // ← we cannot use `overrideConfig.noInlineConfig` instead because `allowInlineConfig` has side-effect that suppress warnings that show inline configs are ignored.
+ baseConfig = null,
+ cache = false,
+ cacheLocation = ".eslintcache",
+ cwd = process.cwd(),
+ errorOnUnmatchedPattern = true,
+ extensions = null, // ← should be null by default because if it's an array then it suppresses RFC20 feature.
+ fix = false,
+ fixTypes = null, // ← should be null by default because if it's an array then it suppresses rules that don't have the `meta.type` property.
+ globInputPaths = true,
+ ignore = true,
+ ignorePath = null, // ← should be null by default because if it's a string then it may throw ENOENT.
+ overrideConfig = null,
+ overrideConfigFile = null,
+ plugins = {},
+ reportUnusedDisableDirectives = null, // ← should be null by default because if it's a string then it overrides the 'reportUnusedDisableDirectives' setting in config files. And we cannot use `overrideConfig.reportUnusedDisableDirectives` instead because we cannot configure the `error` severity with that.
+ resolvePluginsRelativeTo = null, // ← should be null by default because if it's a string then it suppresses RFC47 feature.
+ rulePaths = [],
+ useEslintrc = true,
+ ...unknownOptions
+}) {
+ const errors = [];
+ const unknownOptionKeys = Object.keys(unknownOptions);
+
+ if (unknownOptionKeys.length >= 1) {
+ errors.push(`Unknown options: ${unknownOptionKeys.join(", ")}`);
+ if (unknownOptionKeys.includes("cacheFile")) {
+ errors.push("'cacheFile' has been removed. Please use the 'cacheLocation' option instead.");
+ }
+ if (unknownOptionKeys.includes("configFile")) {
+ errors.push("'configFile' has been removed. Please use the 'overrideConfigFile' option instead.");
+ }
+ if (unknownOptionKeys.includes("envs")) {
+ errors.push("'envs' has been removed. Please use the 'overrideConfig.env' option instead.");
+ }
+ if (unknownOptionKeys.includes("globals")) {
+ errors.push("'globals' has been removed. Please use the 'overrideConfig.globals' option instead.");
+ }
+ if (unknownOptionKeys.includes("ignorePattern")) {
+ errors.push("'ignorePattern' has been removed. Please use the 'overrideConfig.ignorePatterns' option instead.");
+ }
+ if (unknownOptionKeys.includes("parser")) {
+ errors.push("'parser' has been removed. Please use the 'overrideConfig.parser' option instead.");
+ }
+ if (unknownOptionKeys.includes("parserOptions")) {
+ errors.push("'parserOptions' has been removed. Please use the 'overrideConfig.parserOptions' option instead.");
+ }
+ if (unknownOptionKeys.includes("rules")) {
+ errors.push("'rules' has been removed. Please use the 'overrideConfig.rules' option instead.");
+ }
+ }
+ if (typeof allowInlineConfig !== "boolean") {
+ errors.push("'allowInlineConfig' must be a boolean.");
+ }
+ if (typeof baseConfig !== "object") {
+ errors.push("'baseConfig' must be an object or null.");
+ }
+ if (typeof cache !== "boolean") {
+ errors.push("'cache' must be a boolean.");
+ }
+ if (!isNonEmptyString(cacheLocation)) {
+ errors.push("'cacheLocation' must be a non-empty string.");
+ }
+ if (!isNonEmptyString(cwd) || !path.isAbsolute(cwd)) {
+ errors.push("'cwd' must be an absolute path.");
+ }
+ if (typeof errorOnUnmatchedPattern !== "boolean") {
+ errors.push("'errorOnUnmatchedPattern' must be a boolean.");
+ }
+ if (!isArrayOfNonEmptyString(extensions) && extensions !== null) {
+ errors.push("'extensions' must be an array of non-empty strings or null.");
+ }
+ if (typeof fix !== "boolean" && typeof fix !== "function") {
+ errors.push("'fix' must be a boolean or a function.");
+ }
+ if (fixTypes !== null && !isFixTypeArray(fixTypes)) {
+ errors.push("'fixTypes' must be an array of any of \"problem\", \"suggestion\", and \"layout\".");
+ }
+ if (typeof globInputPaths !== "boolean") {
+ errors.push("'globInputPaths' must be a boolean.");
+ }
+ if (typeof ignore !== "boolean") {
+ errors.push("'ignore' must be a boolean.");
+ }
+ if (!isNonEmptyString(ignorePath) && ignorePath !== null) {
+ errors.push("'ignorePath' must be a non-empty string or null.");
+ }
+ if (typeof overrideConfig !== "object") {
+ errors.push("'overrideConfig' must be an object or null.");
+ }
+ if (!isNonEmptyString(overrideConfigFile) && overrideConfigFile !== null) {
+ errors.push("'overrideConfigFile' must be a non-empty string or null.");
+ }
+ if (typeof plugins !== "object") {
+ errors.push("'plugins' must be an object or null.");
+ } else if (plugins !== null && Object.keys(plugins).includes("")) {
+ errors.push("'plugins' must not include an empty string.");
+ }
+ if (Array.isArray(plugins)) {
+ errors.push("'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead.");
+ }
+ if (
+ reportUnusedDisableDirectives !== "error" &&
+ reportUnusedDisableDirectives !== "warn" &&
+ reportUnusedDisableDirectives !== "off" &&
+ reportUnusedDisableDirectives !== null
+ ) {
+ errors.push("'reportUnusedDisableDirectives' must be any of \"error\", \"warn\", \"off\", and null.");
+ }
+ if (
+ !isNonEmptyString(resolvePluginsRelativeTo) &&
+ resolvePluginsRelativeTo !== null
+ ) {
+ errors.push("'resolvePluginsRelativeTo' must be a non-empty string or null.");
+ }
+ if (!isArrayOfNonEmptyString(rulePaths)) {
+ errors.push("'rulePaths' must be an array of non-empty strings.");
+ }
+ if (typeof useEslintrc !== "boolean") {
+ errors.push("'useElintrc' must be a boolean.");
+ }
+
+ if (errors.length > 0) {
+ throw new ESLintInvalidOptionsError(errors);
+ }
+
+ return {
+ allowInlineConfig,
+ baseConfig,
+ cache,
+ cacheLocation,
+ configFile: overrideConfigFile,
+ cwd,
+ errorOnUnmatchedPattern,
+ extensions,
+ fix,
+ fixTypes,
+ globInputPaths,
+ ignore,
+ ignorePath,
+ reportUnusedDisableDirectives,
+ resolvePluginsRelativeTo,
+ rulePaths,
+ useEslintrc
+ };
+}
+
+/**
+ * Check if a value has one or more properties and that value is not undefined.
+ * @param {any} obj The value to check.
+ * @returns {boolean} `true` if `obj` has one or more properties that that value is not undefined.
+ */
+function hasDefinedProperty(obj) {
+ if (typeof obj === "object" && obj !== null) {
+ for (const key in obj) {
+ if (typeof obj[key] !== "undefined") {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+/**
+ * Create rulesMeta object.
+ * @param {Map<string,Rule>} rules a map of rules from which to generate the object.
+ * @returns {Object} metadata for all enabled rules.
+ */
+function createRulesMeta(rules) {
+ return Array.from(rules).reduce((retVal, [id, rule]) => {
+ retVal[id] = rule.meta;
+ return retVal;
+ }, {});
+}
+
+/** @type {WeakMap<ExtractedConfig, DeprecatedRuleInfo[]>} */
+const usedDeprecatedRulesCache = new WeakMap();
+
+/**
+ * Create used deprecated rule list.
+ * @param {CLIEngine} cliEngine The CLIEngine instance.
+ * @param {string} maybeFilePath The absolute path to a lint target file or `"<text>"`.
+ * @returns {DeprecatedRuleInfo[]} The used deprecated rule list.
+ */
+function getOrFindUsedDeprecatedRules(cliEngine, maybeFilePath) {
+ const {
+ configArrayFactory,
+ options: { cwd }
+ } = getCLIEngineInternalSlots(cliEngine);
+ const filePath = path.isAbsolute(maybeFilePath)
+ ? maybeFilePath
+ : path.join(cwd, "__placeholder__.js");
+ const configArray = configArrayFactory.getConfigArrayForFile(filePath);
+ const config = configArray.extractConfig(filePath);
+
+ // Most files use the same config, so cache it.
+ if (!usedDeprecatedRulesCache.has(config)) {
+ const pluginRules = configArray.pluginRules;
+ const retv = [];
+
+ for (const [ruleId, ruleConf] of Object.entries(config.rules)) {
+ if (getRuleSeverity(ruleConf) === 0) {
+ continue;
+ }
+ const rule = pluginRules.get(ruleId) || BuiltinRules.get(ruleId);
+ const meta = rule && rule.meta;
+
+ if (meta && meta.deprecated) {
+ retv.push({ ruleId, replacedBy: meta.replacedBy || [] });
+ }
+ }
+
+ usedDeprecatedRulesCache.set(config, Object.freeze(retv));
+ }
+
+ return usedDeprecatedRulesCache.get(config);
+}
+
+/**
+ * Processes the linting results generated by a CLIEngine linting report to
+ * match the ESLint class's API.
+ * @param {CLIEngine} cliEngine The CLIEngine instance.
+ * @param {CLIEngineLintReport} report The CLIEngine linting report to process.
+ * @returns {LintResult[]} The processed linting results.
+ */
+function processCLIEngineLintReport(cliEngine, { results }) {
+ const descriptor = {
+ configurable: true,
+ enumerable: true,
+ get() {
+ return getOrFindUsedDeprecatedRules(cliEngine, this.filePath);
+ }
+ };
+
+ for (const result of results) {
+ Object.defineProperty(result, "usedDeprecatedRules", descriptor);
+ }
+
+ return results;
+}
+
+/**
+ * An Array.prototype.sort() compatible compare function to order results by their file path.
+ * @param {LintResult} a The first lint result.
+ * @param {LintResult} b The second lint result.
+ * @returns {number} An integer representing the order in which the two results should occur.
+ */
+function compareResultsByFilePath(a, b) {
+ if (a.filePath < b.filePath) {
+ return -1;
+ }
+
+ if (a.filePath > b.filePath) {
+ return 1;
+ }
+
+ return 0;
+}
+
+class ESLint {
+
+ /**
+ * Creates a new instance of the main ESLint API.
+ * @param {ESLintOptions} options The options for this instance.
+ */
+ constructor(options = {}) {
+ const processedOptions = processOptions(options);
+ const cliEngine = new CLIEngine(processedOptions);
+ const {
+ additionalPluginPool,
+ configArrayFactory,
+ lastConfigArrays
+ } = getCLIEngineInternalSlots(cliEngine);
+ let updated = false;
+
+ /*
+ * Address `plugins` to add plugin implementations.
+ * Operate the `additionalPluginPool` internal slot directly to avoid
+ * using `addPlugin(id, plugin)` method that resets cache everytime.
+ */
+ if (options.plugins) {
+ for (const [id, plugin] of Object.entries(options.plugins)) {
+ additionalPluginPool.set(id, plugin);
+ updated = true;
+ }
+ }
+
+ /*
+ * Address `overrideConfig` to set override config.
+ * Operate the `configArrayFactory` internal slot directly because this
+ * functionality doesn't exist as the public API of CLIEngine.
+ */
+ if (hasDefinedProperty(options.overrideConfig)) {
+ configArrayFactory.setOverrideConfig(options.overrideConfig);
+ updated = true;
+ }
+
+ // Update caches.
+ if (updated) {
+ configArrayFactory.clearCache();
+ lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile();
+ }
+
+ // Initialize private properties.
+ privateMembersMap.set(this, {
+ cliEngine,
+ options: processedOptions
+ });
+ }
+
+ /**
+ * The version text.
+ * @type {string}
+ */
+ static get version() {
+ return version;
+ }
+
+ /**
+ * Outputs fixes from the given results to files.
+ * @param {LintResult[]} results The lint results.
+ * @returns {Promise<void>} Returns a promise that is used to track side effects.
+ */
+ static async outputFixes(results) {
+ if (!Array.isArray(results)) {
+ throw new Error("'results' must be an array");
+ }
+
+ await Promise.all(
+ results
+ .filter(result => {
+ if (typeof result !== "object" || result === null) {
+ throw new Error("'results' must include only objects");
+ }
+ return (
+ typeof result.output === "string" &&
+ path.isAbsolute(result.filePath)
+ );
+ })
+ .map(r => writeFile(r.filePath, r.output))
+ );
+ }
+
+ /**
+ * Returns results that only contains errors.
+ * @param {LintResult[]} results The results to filter.
+ * @returns {LintResult[]} The filtered results.
+ */
+ static getErrorResults(results) {
+ return CLIEngine.getErrorResults(results);
+ }
+
+ /**
+ * Executes the current configuration on an array of file and directory names.
+ * @param {string[]} patterns An array of file and directory names.
+ * @returns {Promise<LintResult[]>} The results of linting the file patterns given.
+ */
+ async lintFiles(patterns) {
+ if (!isNonEmptyString(patterns) && !isArrayOfNonEmptyString(patterns)) {
+ throw new Error("'patterns' must be a non-empty string or an array of non-empty strings");
+ }
+ const { cliEngine } = privateMembersMap.get(this);
+
+ return processCLIEngineLintReport(
+ cliEngine,
+ cliEngine.executeOnFiles(patterns)
+ );
+ }
+
+ /**
+ * Executes the current configuration on text.
+ * @param {string} code A string of JavaScript code to lint.
+ * @param {Object} [options] The options.
+ * @param {string} [options.filePath] The path to the file of the source code.
+ * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path.
+ * @returns {Promise<LintResult[]>} The results of linting the string of code given.
+ */
+ async lintText(code, options = {}) {
+ if (typeof code !== "string") {
+ throw new Error("'code' must be a string");
+ }
+ if (typeof options !== "object") {
+ throw new Error("'options' must be an object, null, or undefined");
+ }
+ const {
+ filePath,
+ warnIgnored = false,
+ ...unknownOptions
+ } = options || {};
+
+ for (const key of Object.keys(unknownOptions)) {
+ throw new Error(`'options' must not include the unknown option '${key}'`);
+ }
+ if (filePath !== void 0 && !isNonEmptyString(filePath)) {
+ throw new Error("'options.filePath' must be a non-empty string or undefined");
+ }
+ if (typeof warnIgnored !== "boolean") {
+ throw new Error("'options.warnIgnored' must be a boolean or undefined");
+ }
+
+ const { cliEngine } = privateMembersMap.get(this);
+
+ return processCLIEngineLintReport(
+ cliEngine,
+ cliEngine.executeOnText(code, filePath, warnIgnored)
+ );
+ }
+
+ /**
+ * Returns the formatter representing the given formatter name.
+ * @param {string} [name] The name of the formattter to load.
+ * The following values are allowed:
+ * - `undefined` ... Load `stylish` builtin formatter.
+ * - A builtin formatter name ... Load the builtin formatter.
+ * - A thirdparty formatter name:
+ * - `foo` → `eslint-formatter-foo`
+ * - `@foo` → `@foo/eslint-formatter`
+ * - `@foo/bar` → `@foo/eslint-formatter-bar`
+ * - A file path ... Load the file.
+ * @returns {Promise<Formatter>} A promise resolving to the formatter object.
+ * This promise will be rejected if the given formatter was not found or not
+ * a function.
+ */
+ async loadFormatter(name = "stylish") {
+ if (typeof name !== "string") {
+ throw new Error("'name' must be a string");
+ }
+
+ const { cliEngine } = privateMembersMap.get(this);
+ const formatter = cliEngine.getFormatter(name);
+
+ if (typeof formatter !== "function") {
+ throw new Error(`Formatter must be a function, but got a ${typeof formatter}.`);
+ }
+
+ return {
+
+ /**
+ * The main formatter method.
+ * @param {LintResults[]} results The lint results to format.
+ * @returns {string} The formatted lint results.
+ */
+ format(results) {
+ let rulesMeta = null;
+
+ results.sort(compareResultsByFilePath);
+
+ return formatter(results, {
+ get rulesMeta() {
+ if (!rulesMeta) {
+ rulesMeta = createRulesMeta(cliEngine.getRules());
+ }
+
+ return rulesMeta;
+ }
+ });
+ }
+ };
+ }
+
+ /**
+ * Returns a configuration object for the given file based on the CLI options.
+ * This is the same logic used by the ESLint CLI executable to determine
+ * configuration for each file it processes.
+ * @param {string} filePath The path of the file to retrieve a config object for.
+ * @returns {Promise<ConfigData>} A configuration object for the file.
+ */
+ async calculateConfigForFile(filePath) {
+ if (!isNonEmptyString(filePath)) {
+ throw new Error("'filePath' must be a non-empty string");
+ }
+ const { cliEngine } = privateMembersMap.get(this);
+
+ return cliEngine.getConfigForFile(filePath);
+ }
+
+ /**
+ * Checks if a given path is ignored by ESLint.
+ * @param {string} filePath The path of the file to check.
+ * @returns {Promise<boolean>} Whether or not the given path is ignored.
+ */
+ async isPathIgnored(filePath) {
+ if (!isNonEmptyString(filePath)) {
+ throw new Error("'filePath' must be a non-empty string");
+ }
+ const { cliEngine } = privateMembersMap.get(this);
+
+ return cliEngine.isPathIgnored(filePath);
+ }
+}
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+module.exports = {
+ ESLint,
+
+ /**
+ * Get the private class members of a given ESLint instance for tests.
+ * @param {ESLint} instance The ESLint instance to get.
+ * @returns {ESLintPrivateMembers} The instance's private class members.
+ */
+ getESLintPrivateMembers(instance) {
+ return privateMembersMap.get(instance);
+ }
+};
diff --git a/tools/node_modules/eslint/lib/eslint/index.js b/tools/node_modules/eslint/lib/eslint/index.js
new file mode 100644
index 0000000000..c9185ee0eb
--- /dev/null
+++ b/tools/node_modules/eslint/lib/eslint/index.js
@@ -0,0 +1,7 @@
+"use strict";
+
+const { ESLint } = require("./eslint");
+
+module.exports = {
+ ESLint
+};
diff --git a/tools/node_modules/eslint/lib/init/autoconfig.js b/tools/node_modules/eslint/lib/init/autoconfig.js
index 64be3d2a84..2b0aa12ac1 100644
--- a/tools/node_modules/eslint/lib/init/autoconfig.js
+++ b/tools/node_modules/eslint/lib/init/autoconfig.js
@@ -301,7 +301,7 @@ class Registry {
ruleSetIdx += 1;
if (cb) {
- cb(totalFilesLinting); // eslint-disable-line callback-return
+ cb(totalFilesLinting); // eslint-disable-line node/callback-return
}
});
@@ -316,10 +316,10 @@ class Registry {
/**
* Extract rule configuration into eslint:recommended where possible.
*
- * This will return a new config with `"extends": "eslint:recommended"` and
+ * This will return a new config with `["extends": [ ..., "eslint:recommended"]` and
* only the rules which have configurations different from the recommended config.
* @param {Object} config config object
- * @returns {Object} config object using `"extends": "eslint:recommended"`
+ * @returns {Object} config object using `"extends": ["eslint:recommended"]`
*/
function extendFromRecommended(config) {
const newConfig = Object.assign({}, config);
@@ -333,7 +333,7 @@ function extendFromRecommended(config) {
delete newConfig.rules[ruleId];
}
});
- newConfig.extends = RECOMMENDED_CONFIG_NAME;
+ newConfig.extends.unshift(RECOMMENDED_CONFIG_NAME);
return newConfig;
}
diff --git a/tools/node_modules/eslint/lib/init/config-initializer.js b/tools/node_modules/eslint/lib/init/config-initializer.js
index 28dfad194a..70f0a250ad 100644
--- a/tools/node_modules/eslint/lib/init/config-initializer.js
+++ b/tools/node_modules/eslint/lib/init/config-initializer.js
@@ -15,6 +15,7 @@ const util = require("util"),
inquirer = require("inquirer"),
ProgressBar = require("progress"),
semver = require("semver"),
+ espree = require("espree"),
recConfig = require("../../conf/eslint-recommended"),
ConfigOps = require("../shared/config-ops"),
log = require("../shared/logging"),
@@ -31,8 +32,6 @@ const debug = require("debug")("eslint:config-initializer");
// Private
//------------------------------------------------------------------------------
-const DEFAULT_ECMA_VERSION = 2018;
-
/* istanbul ignore next: hard to test fs function */
/**
* Create .eslintrc file in the current working directory
@@ -265,8 +264,7 @@ function processAnswers(answers) {
extends: []
};
- // set the latest ECMAScript version
- config.parserOptions.ecmaVersion = DEFAULT_ECMA_VERSION;
+ config.parserOptions.ecmaVersion = espree.latestEcmaVersion;
config.env.es6 = true;
config.globals = {
Atomics: "readonly",
diff --git a/tools/node_modules/eslint/lib/init/source-code-utils.js b/tools/node_modules/eslint/lib/init/source-code-utils.js
index dfc170a65c..dca6541d1e 100644
--- a/tools/node_modules/eslint/lib/init/source-code-utils.js
+++ b/tools/node_modules/eslint/lib/init/source-code-utils.js
@@ -23,7 +23,7 @@ const { CLIEngine } = require("../cli-engine");
* TODO1: Expose the API that enumerates target files.
* TODO2: Extract the creation logic of `SourceCode` from `Linter` class.
*/
-const { getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); // eslint-disable-line no-restricted-modules
+const { getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); // eslint-disable-line node/no-restricted-require
const debug = require("debug")("eslint:source-code-utils");
@@ -97,7 +97,7 @@ function getSourceCodeOfFiles(patterns, options, callback) {
sourceCodes[filename] = sourceCode;
}
if (callback) {
- callback(filenames.length); // eslint-disable-line callback-return
+ callback(filenames.length); // eslint-disable-line node/callback-return
}
});
diff --git a/tools/node_modules/eslint/lib/options.js b/tools/node_modules/eslint/lib/options.js
index 98dc04b6eb..1681f1dbd1 100644
--- a/tools/node_modules/eslint/lib/options.js
+++ b/tools/node_modules/eslint/lib/options.js
@@ -46,7 +46,6 @@ module.exports = optionator({
{
option: "ext",
type: "[String]",
- default: ".js",
description: "Specify JavaScript file extensions"
},
{
diff --git a/tools/node_modules/eslint/lib/rule-tester/rule-tester.js b/tools/node_modules/eslint/lib/rule-tester/rule-tester.js
index 1c1737152c..77df1def89 100644
--- a/tools/node_modules/eslint/lib/rule-tester/rule-tester.js
+++ b/tools/node_modules/eslint/lib/rule-tester/rule-tester.js
@@ -563,7 +563,12 @@ class RuleTester {
output = SourceCodeFixer.applyFixes(code, messages).output;
const errorMessageInFix = linter.verify(output, config, filename).find(m => m.fatal);
- assert(!errorMessageInFix, `A fatal parsing error occurred in autofix: ${errorMessageInFix && errorMessageInFix.message}`);
+ assert(!errorMessageInFix, [
+ "A fatal parsing error occurred in autofix.",
+ `Error: ${errorMessageInFix && errorMessageInFix.message}`,
+ "Autofix output:",
+ output
+ ].join("\n"));
} else {
output = code;
}
diff --git a/tools/node_modules/eslint/lib/rules/array-callback-return.js b/tools/node_modules/eslint/lib/rules/array-callback-return.js
index eb38965024..62ba7b72d8 100644
--- a/tools/node_modules/eslint/lib/rules/array-callback-return.js
+++ b/tools/node_modules/eslint/lib/rules/array-callback-return.js
@@ -30,22 +30,6 @@ function isReachable(segment) {
}
/**
- * Gets a readable location.
- *
- * - FunctionExpression -> the function name or `function` keyword.
- * - ArrowFunctionExpression -> `=>` token.
- * @param {ASTNode} node A function node to get.
- * @param {SourceCode} sourceCode A source code to get tokens.
- * @returns {ASTNode|Token} The node or the token of a location.
- */
-function getLocation(node, sourceCode) {
- if (node.type === "ArrowFunctionExpression") {
- return sourceCode.getTokenBefore(node.body);
- }
- return node.id || node;
-}
-
-/**
* Checks a given node is a MemberExpression node which has the specified name's
* property.
* @param {ASTNode} node A node to check.
@@ -179,6 +163,7 @@ module.exports = {
create(context) {
const options = context.options[0] || { allowImplicit: false, checkForEach: false };
+ const sourceCode = context.getSourceCode();
let funcInfo = {
arrayMethodName: null,
@@ -217,12 +202,12 @@ module.exports = {
}
if (messageId) {
- let name = astUtils.getFunctionNameWithKind(funcInfo.node);
+ let name = astUtils.getFunctionNameWithKind(node);
name = messageId === "expectedNoReturnValue" ? lodash.upperFirst(name) : name;
context.report({
node,
- loc: getLocation(node, context.getSourceCode()).loc.start,
+ loc: astUtils.getFunctionHeadLoc(node, sourceCode),
messageId,
data: { name }
});
diff --git a/tools/node_modules/eslint/lib/rules/callback-return.js b/tools/node_modules/eslint/lib/rules/callback-return.js
index c5263cde46..5df792d436 100644
--- a/tools/node_modules/eslint/lib/rules/callback-return.js
+++ b/tools/node_modules/eslint/lib/rules/callback-return.js
@@ -10,6 +10,10 @@
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/callback-return"],
+
type: "suggestion",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/comma-style.js b/tools/node_modules/eslint/lib/rules/comma-style.js
index bc22f05dd3..f1a23d63b7 100644
--- a/tools/node_modules/eslint/lib/rules/comma-style.js
+++ b/tools/node_modules/eslint/lib/rules/comma-style.js
@@ -146,10 +146,7 @@ module.exports = {
// lone comma
context.report({
node: reportItem,
- loc: {
- line: commaToken.loc.end.line,
- column: commaToken.loc.start.column
- },
+ loc: commaToken.loc,
messageId: "unexpectedLineBeforeAndAfterComma",
fix: getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken)
});
@@ -158,6 +155,7 @@ module.exports = {
context.report({
node: reportItem,
+ loc: commaToken.loc,
messageId: "expectedCommaFirst",
fix: getFixerFunction(style, previousItemToken, commaToken, currentItemToken)
});
@@ -166,10 +164,7 @@ module.exports = {
context.report({
node: reportItem,
- loc: {
- line: commaToken.loc.end.line,
- column: commaToken.loc.end.column
- },
+ loc: commaToken.loc,
messageId: "expectedCommaLast",
fix: getFixerFunction(style, previousItemToken, commaToken, currentItemToken)
});
diff --git a/tools/node_modules/eslint/lib/rules/func-call-spacing.js b/tools/node_modules/eslint/lib/rules/func-call-spacing.js
index e2edd4282d..dccdd0a40c 100644
--- a/tools/node_modules/eslint/lib/rules/func-call-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/func-call-spacing.js
@@ -63,7 +63,8 @@ module.exports = {
},
messages: {
- unexpected: "Unexpected newline between function name and paren.",
+ unexpectedWhitespace: "Unexpected whitespace between function name and paren.",
+ unexpectedNewline: "Unexpected newline between function name and paren.",
missing: "Missing space between function name and paren."
}
},
@@ -116,7 +117,7 @@ module.exports = {
context.report({
node,
loc: leftToken.loc.start,
- messageId: "unexpected",
+ messageId: "unexpectedWhitespace",
fix(fixer) {
/*
@@ -143,7 +144,7 @@ module.exports = {
context.report({
node,
loc: leftToken.loc.start,
- messageId: "unexpected",
+ messageId: "unexpectedNewline",
fix(fixer) {
return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " ");
}
diff --git a/tools/node_modules/eslint/lib/rules/getter-return.js b/tools/node_modules/eslint/lib/rules/getter-return.js
index e1468a5b19..c54ebfb4ff 100644
--- a/tools/node_modules/eslint/lib/rules/getter-return.js
+++ b/tools/node_modules/eslint/lib/rules/getter-return.js
@@ -25,17 +25,6 @@ function isReachable(segment) {
return segment.reachable;
}
-/**
- * Gets a readable location.
- *
- * - FunctionExpression -> the function name or `function` keyword.
- * @param {ASTNode} node A function node to get.
- * @returns {ASTNode|Token} The node or the token of a location.
- */
-function getId(node) {
- return node.id || node;
-}
-
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -75,6 +64,7 @@ module.exports = {
create(context) {
const options = context.options[0] || { allowImplicit: false };
+ const sourceCode = context.getSourceCode();
let funcInfo = {
upper: null,
@@ -99,7 +89,7 @@ module.exports = {
) {
context.report({
node,
- loc: getId(node).loc.start,
+ loc: astUtils.getFunctionHeadLoc(node, sourceCode),
messageId: funcInfo.hasReturn ? "expectedAlways" : "expected",
data: {
name: astUtils.getFunctionNameWithKind(funcInfo.node)
diff --git a/tools/node_modules/eslint/lib/rules/global-require.js b/tools/node_modules/eslint/lib/rules/global-require.js
index 4af3a6a466..9bd073b885 100644
--- a/tools/node_modules/eslint/lib/rules/global-require.js
+++ b/tools/node_modules/eslint/lib/rules/global-require.js
@@ -48,6 +48,10 @@ function isShadowed(scope, node) {
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/global-require"],
+
type: "suggestion",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/handle-callback-err.js b/tools/node_modules/eslint/lib/rules/handle-callback-err.js
index 640946699e..8ad63bbd53 100644
--- a/tools/node_modules/eslint/lib/rules/handle-callback-err.js
+++ b/tools/node_modules/eslint/lib/rules/handle-callback-err.js
@@ -11,6 +11,10 @@
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/handle-callback-err"],
+
type: "suggestion",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/key-spacing.js b/tools/node_modules/eslint/lib/rules/key-spacing.js
index c405043794..57abb00b06 100644
--- a/tools/node_modules/eslint/lib/rules/key-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/key-spacing.js
@@ -45,7 +45,7 @@ function isSingleLine(node) {
/**
* Checks whether the properties on a single line.
* @param {ASTNode[]} properties List of Property AST nodes.
- * @returns {boolean} True if all properies is on a single line.
+ * @returns {boolean} True if all properties is on a single line.
*/
function isSingleLineProperties(properties) {
const [firstProp] = properties,
diff --git a/tools/node_modules/eslint/lib/rules/new-cap.js b/tools/node_modules/eslint/lib/rules/new-cap.js
index 7cce968c5a..0faf45efb9 100644
--- a/tools/node_modules/eslint/lib/rules/new-cap.js
+++ b/tools/node_modules/eslint/lib/rules/new-cap.js
@@ -235,7 +235,7 @@ module.exports = {
callee = callee.property;
}
- context.report({ node, loc: callee.loc.start, messageId });
+ context.report({ node, loc: callee.loc, messageId });
}
//--------------------------------------------------------------------------
diff --git a/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js b/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js
index 8ad88386c0..4254fec185 100644
--- a/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js
+++ b/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js
@@ -90,16 +90,19 @@ module.exports = {
}
if (depth > ignoreChainWithDepth && astUtils.isTokenOnSameLine(callee.object, callee.property)) {
+ const firstTokenAfterObject = sourceCode.getTokenAfter(callee.object, astUtils.isNotClosingParenToken);
+
context.report({
node: callee.property,
- loc: callee.property.loc.start,
+ loc: {
+ start: firstTokenAfterObject.loc.start,
+ end: callee.loc.end
+ },
messageId: "expected",
data: {
callee: getPropertyText(callee)
},
fix(fixer) {
- const firstTokenAfterObject = sourceCode.getTokenAfter(callee.object, astUtils.isNotClosingParenToken);
-
return fixer.insertTextBefore(firstTokenAfterObject, "\n");
}
});
diff --git a/tools/node_modules/eslint/lib/rules/no-buffer-constructor.js b/tools/node_modules/eslint/lib/rules/no-buffer-constructor.js
index bf4c8891ad..5dce047b92 100644
--- a/tools/node_modules/eslint/lib/rules/no-buffer-constructor.js
+++ b/tools/node_modules/eslint/lib/rules/no-buffer-constructor.js
@@ -10,6 +10,10 @@
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/no-deprecated-api"],
+
type: "problem",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/no-empty-function.js b/tools/node_modules/eslint/lib/rules/no-empty-function.js
index c74321158b..c512f8cd5f 100644
--- a/tools/node_modules/eslint/lib/rules/no-empty-function.js
+++ b/tools/node_modules/eslint/lib/rules/no-empty-function.js
@@ -151,7 +151,7 @@ module.exports = {
) {
context.report({
node,
- loc: node.body.loc.start,
+ loc: node.body.loc,
messageId: "unexpected",
data: { name }
});
diff --git a/tools/node_modules/eslint/lib/rules/no-extra-parens.js b/tools/node_modules/eslint/lib/rules/no-extra-parens.js
index a3dd5bab69..7cbb7522eb 100644
--- a/tools/node_modules/eslint/lib/rules/no-extra-parens.js
+++ b/tools/node_modules/eslint/lib/rules/no-extra-parens.js
@@ -560,7 +560,11 @@ module.exports = {
tokensToIgnore.add(secondToken);
}
- if (hasExcessParens(node)) {
+ const hasExtraParens = node.parent.type === "ExportDefaultDeclaration"
+ ? hasExcessParensWithPrecedence(node, PRECEDENCE_OF_ASSIGNMENT_EXPR)
+ : hasExcessParens(node);
+
+ if (hasExtraParens) {
report(node);
}
}
diff --git a/tools/node_modules/eslint/lib/rules/no-inner-declarations.js b/tools/node_modules/eslint/lib/rules/no-inner-declarations.js
index e1c29e0a3b..0768bc6114 100644
--- a/tools/node_modules/eslint/lib/rules/no-inner-declarations.js
+++ b/tools/node_modules/eslint/lib/rules/no-inner-declarations.js
@@ -6,9 +6,18 @@
"use strict";
//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const astUtils = require("./utils/ast-utils");
+
+//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
+const validParent = new Set(["Program", "ExportNamedDeclaration", "ExportDefaultDeclaration"]);
+const validBlockStatementParent = new Set(["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]);
+
module.exports = {
meta: {
type: "problem",
@@ -34,53 +43,36 @@ module.exports = {
create(context) {
/**
- * Find the nearest Program or Function ancestor node.
- * @returns {Object} Ancestor's type and distance from node.
- */
- function nearestBody() {
- const ancestors = context.getAncestors();
- let ancestor = ancestors.pop(),
- generation = 1;
-
- while (ancestor && ["Program", "FunctionDeclaration",
- "FunctionExpression", "ArrowFunctionExpression"
- ].indexOf(ancestor.type) < 0) {
- generation += 1;
- ancestor = ancestors.pop();
- }
-
- return {
-
- // Type of containing ancestor
- type: ancestor.type,
-
- // Separation between ancestor and node
- distance: generation
- };
- }
-
- /**
* Ensure that a given node is at a program or function body's root.
* @param {ASTNode} node Declaration node to check.
* @returns {void}
*/
function check(node) {
- const body = nearestBody(),
- valid = ((body.type === "Program" && body.distance === 1) ||
- body.distance === 2);
-
- if (!valid) {
- context.report({
- node,
- messageId: "moveDeclToRoot",
- data: {
- type: (node.type === "FunctionDeclaration" ? "function" : "variable"),
- body: (body.type === "Program" ? "program" : "function body")
- }
- });
+ const parent = node.parent;
+
+ if (
+ parent.type === "BlockStatement" && validBlockStatementParent.has(parent.parent.type)
+ ) {
+ return;
+ }
+
+ if (validParent.has(parent.type)) {
+ return;
}
+
+ const upperFunction = astUtils.getUpperFunction(parent);
+
+ context.report({
+ node,
+ messageId: "moveDeclToRoot",
+ data: {
+ type: (node.type === "FunctionDeclaration" ? "function" : "variable"),
+ body: (upperFunction === null ? "program" : "function body")
+ }
+ });
}
+
return {
FunctionDeclaration: check,
diff --git a/tools/node_modules/eslint/lib/rules/no-lone-blocks.js b/tools/node_modules/eslint/lib/rules/no-lone-blocks.js
index d7069887b8..290784b82e 100644
--- a/tools/node_modules/eslint/lib/rules/no-lone-blocks.js
+++ b/tools/node_modules/eslint/lib/rules/no-lone-blocks.js
@@ -49,7 +49,7 @@ module.exports = {
}
/**
- * Checks for any ocurrence of a BlockStatement in a place where lists of statements can appear
+ * Checks for any occurrence of a BlockStatement in a place where lists of statements can appear
* @param {ASTNode} node The node to check
* @returns {boolean} True if the node is a lone block.
*/
diff --git a/tools/node_modules/eslint/lib/rules/no-mixed-requires.js b/tools/node_modules/eslint/lib/rules/no-mixed-requires.js
index 8e988e32c2..bfe9b7aa97 100644
--- a/tools/node_modules/eslint/lib/rules/no-mixed-requires.js
+++ b/tools/node_modules/eslint/lib/rules/no-mixed-requires.js
@@ -11,6 +11,10 @@
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/no-mixed-requires"],
+
type: "suggestion",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/no-new-object.js b/tools/node_modules/eslint/lib/rules/no-new-object.js
index f3e99c9bd1..e9f915db5e 100644
--- a/tools/node_modules/eslint/lib/rules/no-new-object.js
+++ b/tools/node_modules/eslint/lib/rules/no-new-object.js
@@ -6,6 +6,12 @@
"use strict";
//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const astUtils = require("./utils/ast-utils");
+
+//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -28,10 +34,17 @@ module.exports = {
},
create(context) {
-
return {
-
NewExpression(node) {
+ const variable = astUtils.getVariableByName(
+ context.getScope(),
+ node.callee.name
+ );
+
+ if (variable && variable.identifiers.length > 0) {
+ return;
+ }
+
if (node.callee.name === "Object") {
context.report({
node,
@@ -40,6 +53,5 @@ module.exports = {
}
}
};
-
}
};
diff --git a/tools/node_modules/eslint/lib/rules/no-new-require.js b/tools/node_modules/eslint/lib/rules/no-new-require.js
index df12a424e3..7f81e83fd7 100644
--- a/tools/node_modules/eslint/lib/rules/no-new-require.js
+++ b/tools/node_modules/eslint/lib/rules/no-new-require.js
@@ -11,6 +11,10 @@
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/no-new-require"],
+
type: "suggestion",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/no-path-concat.js b/tools/node_modules/eslint/lib/rules/no-path-concat.js
index 9fa8b852fe..77a03a7f95 100644
--- a/tools/node_modules/eslint/lib/rules/no-path-concat.js
+++ b/tools/node_modules/eslint/lib/rules/no-path-concat.js
@@ -10,6 +10,10 @@
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/no-path-concat"],
+
type: "suggestion",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/no-process-env.js b/tools/node_modules/eslint/lib/rules/no-process-env.js
index 0f8d7f8a33..24bb9f9971 100644
--- a/tools/node_modules/eslint/lib/rules/no-process-env.js
+++ b/tools/node_modules/eslint/lib/rules/no-process-env.js
@@ -10,6 +10,10 @@
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/no-process-env"],
+
type: "suggestion",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/no-process-exit.js b/tools/node_modules/eslint/lib/rules/no-process-exit.js
index 29871660cc..9c70ea8808 100644
--- a/tools/node_modules/eslint/lib/rules/no-process-exit.js
+++ b/tools/node_modules/eslint/lib/rules/no-process-exit.js
@@ -10,6 +10,10 @@
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/no-process-exit"],
+
type: "suggestion",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-modules.js b/tools/node_modules/eslint/lib/rules/no-restricted-modules.js
index abd8d5cbe2..61834ceeb4 100644
--- a/tools/node_modules/eslint/lib/rules/no-restricted-modules.js
+++ b/tools/node_modules/eslint/lib/rules/no-restricted-modules.js
@@ -40,6 +40,10 @@ const arrayOfStringsOrObjects = {
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/no-restricted-require"],
+
type: "suggestion",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/no-sync.js b/tools/node_modules/eslint/lib/rules/no-sync.js
index d811105963..9790d1f94b 100644
--- a/tools/node_modules/eslint/lib/rules/no-sync.js
+++ b/tools/node_modules/eslint/lib/rules/no-sync.js
@@ -13,6 +13,10 @@
module.exports = {
meta: {
+ deprecated: true,
+
+ replacedBy: ["node/no-sync"],
+
type: "suggestion",
docs: {
diff --git a/tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js b/tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js
index eb72008a29..b5ec20de4b 100644
--- a/tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js
+++ b/tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js
@@ -53,7 +53,11 @@ module.exports = {
const nodeExpressionEnd = sourceCode.getTokenBefore(openParen);
if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) {
- context.report({ node, loc: openParen.loc.start, messageId, data: { char: openParen.value } });
+ context.report({
+ node,
+ loc: openParen.loc,
+ messageId
+ });
}
}
@@ -71,18 +75,24 @@ module.exports = {
},
TaggedTemplateExpression(node) {
- if (node.tag.loc.end.line === node.quasi.loc.start.line) {
- return;
- }
-
- // handle generics type parameters on template tags
- const tokenBefore = sourceCode.getTokenBefore(node.quasi);
-
- if (tokenBefore.loc.end.line === node.quasi.loc.start.line) {
- return;
+ const { quasi } = node;
+
+ // handles common tags, parenthesized tags, and typescript's generic type arguments
+ const tokenBefore = sourceCode.getTokenBefore(quasi);
+
+ if (tokenBefore.loc.end.line !== quasi.loc.start.line) {
+ context.report({
+ node,
+ loc: {
+ start: quasi.loc.start,
+ end: {
+ line: quasi.loc.start.line,
+ column: quasi.loc.start.column + 1
+ }
+ },
+ messageId: "taggedTemplate"
+ });
}
-
- context.report({ node, loc: node.loc.start, messageId: "taggedTemplate" });
},
CallExpression(node) {
diff --git a/tools/node_modules/eslint/lib/rules/no-useless-concat.js b/tools/node_modules/eslint/lib/rules/no-useless-concat.js
index aa46742abd..cfc60c8fb5 100644
--- a/tools/node_modules/eslint/lib/rules/no-useless-concat.js
+++ b/tools/node_modules/eslint/lib/rules/no-useless-concat.js
@@ -105,7 +105,7 @@ module.exports = {
context.report({
node,
- loc: operatorToken.loc.start,
+ loc: operatorToken.loc,
messageId: "unexpectedConcat"
});
}
diff --git a/tools/node_modules/eslint/lib/rules/space-before-function-paren.js b/tools/node_modules/eslint/lib/rules/space-before-function-paren.js
index af609c2e7c..1021a110cf 100644
--- a/tools/node_modules/eslint/lib/rules/space-before-function-paren.js
+++ b/tools/node_modules/eslint/lib/rules/space-before-function-paren.js
@@ -127,7 +127,10 @@ module.exports = {
if (hasSpacing && functionConfig === "never") {
context.report({
node,
- loc: leftToken.loc.end,
+ loc: {
+ start: leftToken.loc.end,
+ end: rightToken.loc.start
+ },
messageId: "unexpectedSpace",
fix(fixer) {
const comments = sourceCode.getCommentsBefore(rightToken);
@@ -145,7 +148,7 @@ module.exports = {
} else if (!hasSpacing && functionConfig === "always") {
context.report({
node,
- loc: leftToken.loc.end,
+ loc: rightToken.loc,
messageId: "missingSpace",
fix: fixer => fixer.insertTextAfter(leftToken, " ")
});
diff --git a/tools/node_modules/eslint/lib/rules/yoda.js b/tools/node_modules/eslint/lib/rules/yoda.js
index c4ff3f8193..f1159e5255 100644
--- a/tools/node_modules/eslint/lib/rules/yoda.js
+++ b/tools/node_modules/eslint/lib/rules/yoda.js
@@ -20,7 +20,7 @@ const astUtils = require("./utils/ast-utils");
* @returns {boolean} Whether or not it is a comparison operator.
*/
function isComparisonOperator(operator) {
- return (/^(==|===|!=|!==|<|>|<=|>=)$/u).test(operator);
+ return /^(==|===|!=|!==|<|>|<=|>=)$/u.test(operator);
}
/**
@@ -29,7 +29,7 @@ function isComparisonOperator(operator) {
* @returns {boolean} Whether or not it is an equality operator.
*/
function isEqualityOperator(operator) {
- return (/^(==|===)$/u).test(operator);
+ return /^(==|===)$/u.test(operator);
}
/**
@@ -50,10 +50,12 @@ function isRangeTestOperator(operator) {
* real literal and should be treated as such.
*/
function isNegativeNumericLiteral(node) {
- return (node.type === "UnaryExpression" &&
+ return (
+ node.type === "UnaryExpression" &&
node.operator === "-" &&
node.prefix &&
- astUtils.isNumericLiteral(node.argument));
+ astUtils.isNumericLiteral(node.argument)
+ );
}
/**
@@ -71,25 +73,21 @@ function isStaticTemplateLiteral(node) {
* @returns {boolean} True if the node should be treated as a single Literal node.
*/
function looksLikeLiteral(node) {
- return isNegativeNumericLiteral(node) ||
- isStaticTemplateLiteral(node);
+ return isNegativeNumericLiteral(node) || isStaticTemplateLiteral(node);
}
/**
* Attempts to derive a Literal node from nodes that are treated like literals.
* @param {ASTNode} node Node to normalize.
- * @param {number} [defaultValue] The default value to be returned if the node
- * is not a Literal.
* @returns {ASTNode} One of the following options.
* 1. The original node if the node is already a Literal
* 2. A normalized Literal node with the negative number as the value if the
* node represents a negative number literal.
* 3. A normalized Literal node with the string as the value if the node is
* a Template Literal without expression.
- * 4. The Literal node which has the `defaultValue` argument if it exists.
- * 5. Otherwise `null`.
+ * 4. Otherwise `null`.
*/
-function getNormalizedLiteral(node, defaultValue) {
+function getNormalizedLiteral(node) {
if (node.type === "Literal") {
return node;
}
@@ -110,14 +108,6 @@ function getNormalizedLiteral(node, defaultValue) {
};
}
- if (defaultValue) {
- return {
- type: "Literal",
- value: defaultValue,
- raw: String(defaultValue)
- };
- }
-
return null;
}
@@ -183,7 +173,7 @@ module.exports = {
type: "suggestion",
docs: {
- description: "require or disallow \"Yoda\" conditions",
+ description: 'require or disallow "Yoda" conditions',
category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/yoda"
@@ -211,16 +201,19 @@ module.exports = {
fixable: "code",
messages: {
- expected: "Expected literal to be on the {{expectedSide}} side of {{operator}}."
+ expected:
+ "Expected literal to be on the {{expectedSide}} side of {{operator}}."
}
},
create(context) {
// Default to "never" (!always) if no option
- const always = (context.options[0] === "always");
- const exceptRange = (context.options[1] && context.options[1].exceptRange);
- const onlyEquality = (context.options[1] && context.options[1].onlyEquality);
+ const always = context.options[0] === "always";
+ const exceptRange =
+ context.options[1] && context.options[1].exceptRange;
+ const onlyEquality =
+ context.options[1] && context.options[1].onlyEquality;
const sourceCode = context.getSourceCode();
@@ -243,13 +236,23 @@ module.exports = {
* @returns {boolean} Whether node is a "between" range test.
*/
function isBetweenTest() {
- let leftLiteral, rightLiteral;
+ if (node.operator === "&&" && same(left.right, right.left)) {
+ const leftLiteral = getNormalizedLiteral(left.left);
+ const rightLiteral = getNormalizedLiteral(right.right);
+
+ if (leftLiteral === null && rightLiteral === null) {
+ return false;
+ }
- return (node.operator === "&&" &&
- (leftLiteral = getNormalizedLiteral(left.left)) &&
- (rightLiteral = getNormalizedLiteral(right.right, Number.POSITIVE_INFINITY)) &&
- leftLiteral.value <= rightLiteral.value &&
- same(left.right, right.left));
+ if (rightLiteral === null || leftLiteral === null) {
+ return true;
+ }
+
+ if (leftLiteral.value <= rightLiteral.value) {
+ return true;
+ }
+ }
+ return false;
}
/**
@@ -257,13 +260,24 @@ module.exports = {
* @returns {boolean} Whether node is an "outside" range test.
*/
function isOutsideTest() {
- let leftLiteral, rightLiteral;
+ if (node.operator === "||" && same(left.left, right.right)) {
+ const leftLiteral = getNormalizedLiteral(left.right);
+ const rightLiteral = getNormalizedLiteral(right.left);
+
+ if (leftLiteral === null && rightLiteral === null) {
+ return false;
+ }
+
+ if (rightLiteral === null || leftLiteral === null) {
+ return true;
+ }
+
+ if (leftLiteral.value <= rightLiteral.value) {
+ return true;
+ }
+ }
- return (node.operator === "||" &&
- (leftLiteral = getNormalizedLiteral(left.right, Number.NEGATIVE_INFINITY)) &&
- (rightLiteral = getNormalizedLiteral(right.left)) &&
- leftLiteral.value <= rightLiteral.value &&
- same(left.left, right.right));
+ return false;
}
/**
@@ -276,13 +290,15 @@ module.exports = {
return astUtils.isParenthesised(sourceCode, node);
}
- return (node.type === "LogicalExpression" &&
+ return (
+ node.type === "LogicalExpression" &&
left.type === "BinaryExpression" &&
right.type === "BinaryExpression" &&
isRangeTestOperator(left.operator) &&
isRangeTestOperator(right.operator) &&
(isBetweenTest() || isOutsideTest()) &&
- isParenWrapped());
+ isParenWrapped()
+ );
}
const OPERATOR_FLIP_MAP = {
@@ -303,21 +319,52 @@ module.exports = {
*/
function getFlippedString(node) {
const tokenBefore = sourceCode.getTokenBefore(node);
- const operatorToken = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator);
- const textBeforeOperator = sourceCode.getText().slice(sourceCode.getTokenBefore(operatorToken).range[1], operatorToken.range[0]);
- const textAfterOperator = sourceCode.getText().slice(operatorToken.range[1], sourceCode.getTokenAfter(operatorToken).range[0]);
- const leftText = sourceCode.getText().slice(node.range[0], sourceCode.getTokenBefore(operatorToken).range[1]);
+ const operatorToken = sourceCode.getFirstTokenBetween(
+ node.left,
+ node.right,
+ token => token.value === node.operator
+ );
+ const textBeforeOperator = sourceCode
+ .getText()
+ .slice(
+ sourceCode.getTokenBefore(operatorToken).range[1],
+ operatorToken.range[0]
+ );
+ const textAfterOperator = sourceCode
+ .getText()
+ .slice(
+ operatorToken.range[1],
+ sourceCode.getTokenAfter(operatorToken).range[0]
+ );
+ const leftText = sourceCode
+ .getText()
+ .slice(
+ node.range[0],
+ sourceCode.getTokenBefore(operatorToken).range[1]
+ );
const firstRightToken = sourceCode.getTokenAfter(operatorToken);
- const rightText = sourceCode.getText().slice(firstRightToken.range[0], node.range[1]);
+ const rightText = sourceCode
+ .getText()
+ .slice(firstRightToken.range[0], node.range[1]);
let prefix = "";
- if (tokenBefore && tokenBefore.range[1] === node.range[0] &&
- !astUtils.canTokensBeAdjacent(tokenBefore, firstRightToken)) {
+ if (
+ tokenBefore &&
+ tokenBefore.range[1] === node.range[0] &&
+ !astUtils.canTokensBeAdjacent(tokenBefore, firstRightToken)
+ ) {
prefix = " ";
}
- return prefix + rightText + textBeforeOperator + OPERATOR_FLIP_MAP[operatorToken.value] + textAfterOperator + leftText;
+ return (
+ prefix +
+ rightText +
+ textBeforeOperator +
+ OPERATOR_FLIP_MAP[operatorToken.value] +
+ textAfterOperator +
+ leftText
+ );
}
//--------------------------------------------------------------------------
@@ -331,8 +378,12 @@ module.exports = {
// If `expectedLiteral` is not a literal, and `expectedNonLiteral` is a literal, raise an error.
if (
- (expectedNonLiteral.type === "Literal" || looksLikeLiteral(expectedNonLiteral)) &&
- !(expectedLiteral.type === "Literal" || looksLikeLiteral(expectedLiteral)) &&
+ (expectedNonLiteral.type === "Literal" ||
+ looksLikeLiteral(expectedNonLiteral)) &&
+ !(
+ expectedLiteral.type === "Literal" ||
+ looksLikeLiteral(expectedLiteral)
+ ) &&
!(!isEqualityOperator(node.operator) && onlyEquality) &&
isComparisonOperator(node.operator) &&
!(exceptRange && isRangeTest(context.getAncestors().pop()))
@@ -344,12 +395,11 @@ module.exports = {
operator: node.operator,
expectedSide: always ? "left" : "right"
},
- fix: fixer => fixer.replaceText(node, getFlippedString(node))
+ fix: fixer =>
+ fixer.replaceText(node, getFlippedString(node))
});
}
-
}
};
-
}
};
diff --git a/tools/node_modules/eslint/lib/shared/relative-module-resolver.js b/tools/node_modules/eslint/lib/shared/relative-module-resolver.js
index fa6cca7236..80335c5cfc 100644
--- a/tools/node_modules/eslint/lib/shared/relative-module-resolver.js
+++ b/tools/node_modules/eslint/lib/shared/relative-module-resolver.js
@@ -11,6 +11,7 @@ const Module = require("module");
* `Module.createRequire` is added in v12.2.0. It supports URL as well.
* We only support the case where the argument is a filepath, not a URL.
*/
+// eslint-disable-next-line node/no-unsupported-features/node-builtins, node/no-deprecated-api
const createRequire = Module.createRequire || Module.createRequireFromPath;
module.exports = {
diff --git a/tools/node_modules/eslint/lib/shared/types.js b/tools/node_modules/eslint/lib/shared/types.js
index bf37327fa2..bbd95d1b37 100644
--- a/tools/node_modules/eslint/lib/shared/types.js
+++ b/tools/node_modules/eslint/lib/shared/types.js
@@ -141,3 +141,10 @@ module.exports = {};
* @property {Record<string, Processor>} [processors] The definition of plugin processors.
* @property {Record<string, Function | Rule>} [rules] The definition of plugin rules.
*/
+
+/**
+ * Information of deprecated rules.
+ * @typedef {Object} DeprecatedRuleInfo
+ * @property {string} ruleId The rule ID.
+ * @property {string[]} replacedBy The rule IDs that replace this deprecated rule.
+ */
diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/identifier.js
index 92043ce663..51ec76370c 100644
--- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/identifier.js
+++ b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/identifier.js
@@ -73,5 +73,5 @@ function isIdentifierName(name) {
}
}
- return true;
+ return !isFirst;
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json
index bdc69e6c6f..da8c4e12d4 100644
--- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json
+++ b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json
@@ -7,7 +7,7 @@
"unicode-13.0.0": "^0.8.0"
},
"exports": "./lib/index.js",
- "gitHead": "8d5e422be27251cfaadf8dd2536b31b4a5024b02",
+ "gitHead": "5b97e77e030cf3853a147fdff81844ea4026219d",
"license": "MIT",
"main": "./lib/index.js",
"name": "@babel/helper-validator-identifier",
@@ -18,5 +18,5 @@
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-validator-identifier"
},
- "version": "7.9.0"
+ "version": "7.9.5"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/ajv/README.md b/tools/node_modules/eslint/node_modules/ajv/README.md
index 9bd1f57187..e13fdec293 100644
--- a/tools/node_modules/eslint/node_modules/ajv/README.md
+++ b/tools/node_modules/eslint/node_modules/ajv/README.md
@@ -8,8 +8,49 @@ The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/
[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv)
[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv)
[![Coverage Status](https://coveralls.io/repos/epoberezkin/ajv/badge.svg?branch=master&service=github)](https://coveralls.io/github/epoberezkin/ajv?branch=master)
-[![Greenkeeper badge](https://badges.greenkeeper.io/epoberezkin/ajv.svg)](https://greenkeeper.io/)
[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)
+[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin)
+
+## Please [sponsor Ajv](https://github.com/sponsors/epoberezkin)
+
+Dear Ajv users! ❤️
+
+I ask you to support the development of Ajv with donations. 🙏
+
+Since 2015 Ajv has become widely used, thanks to your help and contributions:
+
+- **90** contributors 🏗
+- **5,000** dependent npm packages ⚙️
+- **7,000** github stars, from GitHub users [all over the world](https://www.google.com/maps/d/u/0/viewer?mid=1MGRV8ciFUGIbO1l0EKFWNJGYE7iSkDxP&ll=-3.81666561775622e-14%2C4.821737100000007&z=2) ⭐️
+- **5,000,000** dependent repositories on GitHub 🚀
+- **120,000,000** npm downloads per month! 💯
+
+Your donations will fund futher development - small and large improvements, support of the next versions of JSON Schema specification, and, possibly, the code should be migrated to TypeScript to make it more maintainable.
+
+I will greatly appreciate anything you can help with to make it happen:
+
+- a **personal** donation - from $2 ☕️
+- your **company** donation - from $10 🍔
+- a **sponsorship** to get promoted on Ajv or related packages - from $50 💰
+- an **introduction** to a sponsor who would benefit from the promotion on Ajv page 🤝
+
+| Please [make donations via my GitHub sponsors page](https://github.com/sponsors/epoberezkin)<br>‼️ **GitHub will DOUBLE them** ‼️ |
+|---|
+
+#### Open Collective sponsors
+
+<a href="https://opencollective.com/ajv"><img src="https://opencollective.com/ajv/individuals.svg?width=890"></a>
+
+<a href="https://opencollective.com/ajv/organization/0/website"><img src="https://opencollective.com/ajv/organization/0/avatar.svg"></a>
+<a href="https://opencollective.com/ajv/organization/1/website"><img src="https://opencollective.com/ajv/organization/1/avatar.svg"></a>
+<a href="https://opencollective.com/ajv/organization/2/website"><img src="https://opencollective.com/ajv/organization/2/avatar.svg"></a>
+<a href="https://opencollective.com/ajv/organization/3/website"><img src="https://opencollective.com/ajv/organization/3/avatar.svg"></a>
+<a href="https://opencollective.com/ajv/organization/4/website"><img src="https://opencollective.com/ajv/organization/4/avatar.svg"></a>
+<a href="https://opencollective.com/ajv/organization/5/website"><img src="https://opencollective.com/ajv/organization/5/avatar.svg"></a>
+<a href="https://opencollective.com/ajv/organization/6/website"><img src="https://opencollective.com/ajv/organization/6/avatar.svg"></a>
+<a href="https://opencollective.com/ajv/organization/7/website"><img src="https://opencollective.com/ajv/organization/7/avatar.svg"></a>
+<a href="https://opencollective.com/ajv/organization/8/website"><img src="https://opencollective.com/ajv/organization/8/avatar.svg"></a>
+<a href="https://opencollective.com/ajv/organization/9/website"><img src="https://opencollective.com/ajv/organization/9/avatar.svg"></a>
## Using version 6
@@ -273,7 +314,7 @@ The following formats are implemented for string validation with "format" keywor
__Please note__: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. Ajv does not implement these formats. If you create Ajv plugin that implements them please make a PR to mention this plugin here.
-There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `uri-reference`, `email`, and `hostname`. See [Options](#options) for details.
+There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `uri-reference`, and `email`. See [Options](#options) for details.
You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method.
@@ -1340,7 +1381,7 @@ If you have published a useful plugin please submit a PR to add it to the next s
- [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) - plugin with custom validation keywords (select, typeof, etc.)
- [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) - plugin with keywords $merge and $patch
- [ajv-pack](https://github.com/epoberezkin/ajv-pack) - produces a compact module exporting validation functions
-
+- [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - format validators for draft2019 that aren't already included in ajv (ie. `idn-hostname`, `idn-email`, `iri`, `iri-reference` and `duration`).
## Some packages using Ajv
diff --git a/tools/node_modules/eslint/node_modules/ajv/dist/ajv.min.js b/tools/node_modules/eslint/node_modules/ajv/dist/ajv.min.js
index 157af21a92..1c72a75ecf 100644
--- a/tools/node_modules/eslint/node_modules/ajv/dist/ajv.min.js
+++ b/tools/node_modules/eslint/node_modules/ajv/dist/ajv.min.js
@@ -1,3 +1,3 @@
-/* ajv 6.12.0: Another JSON Schema Validator */
-!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Ajv=e()}}(function(){return function o(i,n,l){function c(r,e){if(!n[r]){if(!i[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(u)return u(r,!0);var a=new Error("Cannot find module '"+r+"'");throw a.code="MODULE_NOT_FOUND",a}var s=n[r]={exports:{}};i[r][0].call(s.exports,function(e){return c(i[r][1][e]||e)},s,s.exports,o,i,n,l)}return n[r].exports}for(var u="function"==typeof require&&require,e=0;e<l.length;e++)c(l[e]);return c}({1:[function(e,r,t){"use strict";var a=r.exports=function(){this._cache={}};a.prototype.put=function(e,r){this._cache[e]=r},a.prototype.get=function(e){return this._cache[e]},a.prototype.del=function(e){delete this._cache[e]},a.prototype.clear=function(){this._cache={}}},{}],2:[function(e,r,t){"use strict";var s=e("./error_classes").MissingRef;r.exports=function t(r,i,a){var n=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof i&&(a=i,i=void 0);var e=l(r).then(function(){var e=n._addSchema(r,void 0,i);return e.validate||c(e)});a&&e.then(function(e){a(null,e)},a);return e;function l(e){var r=e.$schema;return r&&!n.getSchema(r)?t.call(n,{$ref:r},!0):Promise.resolve()}function c(o){try{return n._compile(o)}catch(e){if(e instanceof s)return r(e);throw e}function r(e){var r=e.missingSchema;if(s(r))throw new Error("Schema "+r+" is loaded but "+e.missingRef+" cannot be resolved");var t=n._loadingSchemas[r];return t||(t=n._loadingSchemas[r]=n._opts.loadSchema(r)).then(a,a),t.then(function(e){if(!s(r))return l(e).then(function(){s(r)||n.addSchema(e,r,void 0,i)})}).then(function(){return c(o)});function a(){delete n._loadingSchemas[r]}function s(e){return n._refs[e]||n._schemas[e]}}}}},{"./error_classes":3}],3:[function(e,r,t){"use strict";var a=e("./resolve");function s(e,r,t){this.message=t||s.message(e,r),this.missingRef=a.url(e,r),this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e}r.exports={Validation:o(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:o(s)},s.message=function(e,r){return"can't resolve reference "+r+" from id "+e}},{"./resolve":6}],4:[function(e,r,t){"use strict";var a=e("./util"),o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31],n=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,s=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,l=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,c=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,f=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return a.copy(m[e="full"==e?"full":"fast"])}function v(e){var r=e.match(o);if(!r)return!1;var t,a=+r[2],s=+r[3];return 1<=a&&a<=12&&1<=s&&s<=(2!=a||((t=+r[1])%4!=0||t%100==0&&t%400!=0)?i[a]:29)}function y(e,r){var t=e.match(n);if(!t)return!1;var a=t[1],s=t[2],o=t[3];return(a<=23&&s<=59&&o<=59||23==a&&59==s&&60==o)&&(!r||t[5])}(r.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":f,"relative-json-pointer":p},m.full={date:v,time:y,"date-time":function(e){var r=e.split(g);return 2==r.length&&v(r[0])&&y(r[1],!0)},uri:function(e){return P.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":f,"relative-json-pointer":p};var g=/t|\s/i;var P=/\/|:/;var E=/[^\\]\\Z/;function w(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){"use strict";var j=e("./resolve"),O=e("./util"),I=e("./error_classes"),A=e("fast-json-stable-stringify"),C=e("../dotjs/validate"),k=O.ucs2length,L=e("fast-deep-equal"),z=I.Validation;function T(e,r,t){var a=s.call(this,e,r,t);return 0<=a?{index:a,compiling:!0}:{index:a=this._compilations.length,compiling:!(this._compilations[a]={schema:e,root:r,baseId:t})}}function q(e,r,t){var a=s.call(this,e,r,t);0<=a&&this._compilations.splice(a,1)}function s(e,r,t){for(var a=0;a<this._compilations.length;a++){var s=this._compilations[a];if(s.schema==e&&s.root==r&&s.baseId==t)return a}return-1}function N(e,r){return"var pattern"+e+" = new RegExp("+O.toQuotedString(r[e])+");"}function Q(e){return"var default"+e+" = defaults["+e+"];"}function U(e,r){return void 0===r[e]?"":"var refVal"+e+" = refVal["+e+"];"}function V(e){return"var customRule"+e+" = customRules["+e+"];"}function H(e,r){if(!e.length)return"";for(var t="",a=0;a<e.length;a++)t+=r(a,e);return t}r.exports=function c(e,u,h,r){var f=this,p=this._opts,d=[void 0],m={},v=[],t={},y=[],a={},g=[];u=u||{schema:e,refVal:d,refs:m};var s=T.call(this,e,u,r);var o=this._compilations[s.index];if(s.compiling)return o.callValidate=l;var P=this._formats;var E=this.RULES;try{var i=w(e,u,h,r);o.validate=i;var n=o.callValidate;return n&&(n.schema=i.schema,n.errors=null,n.refs=i.refs,n.refVal=i.refVal,n.root=i.root,n.$async=i.$async,p.sourceCode&&(n.source=i.source)),i}finally{q.call(this,e,u,r)}function l(){var e=o.validate,r=e.apply(this,arguments);return l.errors=e.errors,r}function w(e,r,t,a){var s=!r||r&&r.schema==e;if(r.schema!=u.schema)return c.call(f,e,r,t,a);var o,i=!0===e.$async,n=C({isTop:!0,schema:e,isRoot:s,baseId:a,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:I.MissingRef,RULES:E,validate:C,util:O,resolve:j,resolveRef:b,usePattern:$,useDefault:R,useCustomRule:D,opts:p,formats:P,logger:f.logger,self:f});n=H(d,U)+H(v,N)+H(y,Q)+H(g,V)+n,p.processCode&&(n=p.processCode(n));try{var l=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",n);o=l(f,E,P,u,d,y,g,L,k,z),d[0]=o}catch(e){throw f.logger.error("Error compiling schema, function code:",n),e}return o.schema=e,o.errors=null,o.refs=m,o.refVal=d,o.root=s?o:r,i&&(o.$async=!0),!0===p.sourceCode&&(o.source={code:n,patterns:v,defaults:y}),o}function b(e,r,t){r=j.url(e,r);var a,s,o=m[r];if(void 0!==o)return x(a=d[o],s="refVal["+o+"]");if(!t&&u.refs){var i=u.refs[r];if(void 0!==i)return s=S(r,a=u.refVal[i]),x(a,s)}s=S(r);var n=j.call(f,w,u,r);if(void 0===n){var l=h&&h[r];l&&(n=j.inlineRef(l,p.inlineRefs)?l:c.call(f,l,u,h,e))}if(void 0!==n)return F(r,n),x(n,s);_(r)}function S(e,r){var t=d.length;return d[t]=r,"refVal"+(m[e]=t)}function _(e){delete m[e]}function F(e,r){var t=m[e];d[t]=r}function x(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&!!e.$async}}function $(e){var r=t[e];return void 0===r&&(r=t[e]=v.length,v[r]=e),"pattern"+r}function R(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return O.toQuotedString(e);case"object":if(null===e)return"null";var r=A(e),t=a[r];return void 0===t&&(t=a[r]=y.length,y[t]=e),"default"+t}}function D(e,r,t,a){if(!1!==f._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(t,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));var o=e.definition.validateSchema;if(o){var i=o(r);if(!i){var n="keyword schema is invalid: "+f.errorsText(o.errors);if("log"!=f._opts.validateSchema)throw new Error(n);f.logger.error(n)}}}var l,c=e.definition.compile,u=e.definition.inline,h=e.definition.macro;if(c)l=c.call(f,r,t,a);else if(h)l=h.call(f,r,t,a),!1!==p.validateSchema&&f.validateSchema(l,!0);else if(u)l=u.call(f,a,e.keyword,r,t);else if(!(l=e.definition.validate))return;if(void 0===l)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var d=g.length;return{code:"customRule"+d,validate:g[d]=l}}}},{"../dotjs/validate":38,"./error_classes":3,"./resolve":6,"./util":10,"fast-deep-equal":42,"fast-json-stable-stringify":43}],6:[function(e,r,t){"use strict";var m=e("uri-js"),v=e("fast-deep-equal"),y=e("./util"),l=e("./schema_obj"),a=e("json-schema-traverse");function c(e,r,t){var a=this._refs[t];if("string"==typeof a){if(!this._refs[a])return c.call(this,e,r,a);a=this._refs[a]}if((a=a||this._schemas[t])instanceof l)return d(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var s,o,i,n=u.call(this,r,t);return n&&(s=n.schema,r=n.root,i=n.baseId),s instanceof l?o=s.validate||e.call(this,s.schema,r,void 0,i):void 0!==s&&(o=d(s,this._opts.inlineRefs)?s:e.call(this,s,r,void 0,i)),o}function u(e,r){var t=m.parse(r),a=f(t),s=g(this._getId(e.schema));if(0===Object.keys(e.schema).length||a!==s){var o=P(a),i=this._refs[o];if("string"==typeof i)return function(e,r,t){var a=u.call(this,e,r);if(a){var s=a.schema,o=a.baseId;e=a.root;var i=this._getId(s);return i&&(o=p(o,i)),n.call(this,t,o,s,e)}}.call(this,e,i,t);if(i instanceof l)i.validate||this._compile(i),e=i;else{if(!((i=this._schemas[o])instanceof l))return;if(i.validate||this._compile(i),o==P(r))return{schema:i,root:e,baseId:s};e=i}if(!e.schema)return;s=g(this._getId(e.schema))}return n.call(this,t,s,e.schema,e)}(r.exports=c).normalizeId=P,c.fullPath=g,c.url=p,c.ids=function(e){var r=P(this._getId(e)),h={"":r},d={"":g(r,!1)},f={},p=this;return a(e,{allKeys:!0},function(e,r,t,a,s,o,i){if(""!==r){var n=p._getId(e),l=h[a],c=d[a]+"/"+s;if(void 0!==i&&(c+="/"+("number"==typeof i?i:y.escapeFragment(i))),"string"==typeof n){n=l=P(l?m.resolve(l,n):n);var u=p._refs[n];if("string"==typeof u&&(u=p._refs[u]),u&&u.schema){if(!v(e,u.schema))throw new Error('id "'+n+'" resolves to more than one schema')}else if(n!=P(c))if("#"==n[0]){if(f[n]&&!v(e,f[n]))throw new Error('id "'+n+'" resolves to more than one schema');f[n]=e}else p._refs[n]=c}h[r]=l,d[r]=c}}),f},c.inlineRef=d,c.schema=u;var h=y.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function n(e,r,t,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var s=e.fragment.split("/"),o=1;o<s.length;o++){var i=s[o];if(i){if(void 0===(t=t[i=y.unescapeFragment(i)]))break;var n;if(!h[i]&&((n=this._getId(t))&&(r=p(r,n)),t.$ref)){var l=p(r,t.$ref),c=u.call(this,a,l);c&&(t=c.schema,a=c.root,r=c.baseId)}}}return void 0!==t&&t!==a.schema?{schema:t,root:a,baseId:r}:void 0}}var i=y.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function d(e,r){return!1!==r&&(void 0===r||!0===r?function e(r){var t;if(Array.isArray(r)){for(var a=0;a<r.length;a++)if("object"==typeof(t=r[a])&&!e(t))return!1}else for(var s in r){if("$ref"==s)return!1;if("object"==typeof(t=r[s])&&!e(t))return!1}return!0}(e):r?function e(r){var t,a=0;if(Array.isArray(r)){for(var s=0;s<r.length;s++)if("object"==typeof(t=r[s])&&(a+=e(t)),a==1/0)return 1/0}else for(var o in r){if("$ref"==o)return 1/0;if(i[o])a++;else if("object"==typeof(t=r[o])&&(a+=e(t)+1),a==1/0)return 1/0}return a}(e)<=r:void 0)}function g(e,r){return!1!==r&&(e=P(e)),f(m.parse(e))}function f(e){return m.serialize(e).split("#")[0]+"#"}var s=/#\/?$/;function P(e){return e?e.replace(s,""):""}function p(e,r){return r=P(r),m.resolve(e,r)}},{"./schema_obj":8,"./util":10,"fast-deep-equal":42,"json-schema-traverse":44,"uri-js":45}],7:[function(e,r,t){"use strict";var o=e("../dotjs"),i=e("./util").toHash;r.exports=function(){var a=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],s=["type","$comment"];return a.all=i(s),a.types=i(["number","integer","string","array","object","boolean","null"]),a.forEach(function(e){e.rules=e.rules.map(function(e){var r;if("object"==typeof e){var t=Object.keys(e)[0];r=e[t],e=t,r.forEach(function(e){s.push(e),a.all[e]=!0})}return s.push(e),a.all[e]={keyword:e,code:o[e],implements:r}}),a.all.$comment={keyword:"$comment",code:o.$comment},e.type&&(a.types[e.type]=e)}),a.keywords=i(s.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),a.custom={},a}},{"../dotjs":27,"./util":10}],8:[function(e,r,t){"use strict";var a=e("./util");r.exports=function(e){a.copy(e,this)}},{"./util":10}],9:[function(e,r,t){"use strict";r.exports=function(e){for(var r,t=0,a=e.length,s=0;s<a;)t++,55296<=(r=e.charCodeAt(s++))&&r<=56319&&s<a&&56320==(64512&(r=e.charCodeAt(s)))&&s++;return t}},{}],10:[function(e,r,t){"use strict";function o(e,r,t){var a=t?" !== ":" === ",s=t?" || ":" && ",o=t?"!":"",i=t?"":"!";switch(e){case"null":return r+a+"null";case"array":return o+"Array.isArray("+r+")";case"object":return"("+o+r+s+"typeof "+r+a+'"object"'+s+i+"Array.isArray("+r+"))";case"integer":return"(typeof "+r+a+'"number"'+s+i+"("+r+" % 1)"+s+r+a+r+")";default:return"typeof "+r+a+'"'+e+'"'}}r.exports={copy:function(e,r){for(var t in r=r||{},e)r[t]=e[t];return r},checkDataType:o,checkDataTypes:function(e,r){switch(e.length){case 1:return o(e[0],r,!0);default:var t="",a=n(e);for(var s in a.array&&a.object&&(t=a.null?"(":"(!"+r+" || ",t+="typeof "+r+' !== "object")',delete a.null,delete a.array,delete a.object),a.number&&delete a.integer,a)t+=(t?" && ":"")+o(s,r,!0);return t}},coerceToTypes:function(e,r){if(Array.isArray(r)){for(var t=[],a=0;a<r.length;a++){var s=r[a];i[s]?t[t.length]=s:"array"===e&&"array"===s&&(t[t.length]=s)}if(t.length)return t}else{if(i[r])return[r];if("array"===e&&"array"===r)return["array"]}},toHash:n,getProperty:h,escapeQuotes:l,equal:e("fast-deep-equal"),ucs2length:e("./ucs2length"),varOccurences:function(e,r){r+="[^0-9]";var t=e.match(new RegExp(r,"g"));return t?t.length:0},varReplace:function(e,r,t){return r+="([^0-9])",t=t.replace(/\$/g,"$$$$"),e.replace(new RegExp(r,"g"),t+"$1")},cleanUpCode:function(e){return e.replace(c,"").replace(u,"").replace(d,"if (!($1))")},finalCleanUpCode:function(e,r){var t=e.match(f);t&&2==t.length&&(e=r?e.replace(m,"").replace(g,P):e.replace(p,"").replace(v,y));return(t=e.match(E))&&3===t.length?e.replace(w,""):e},schemaHasRules:function(e,r){if("boolean"==typeof e)return!e;for(var t in e)if(r[t])return!0},schemaHasRulesExcept:function(e,r,t){if("boolean"==typeof e)return!e&&"not"!=t;for(var a in e)if(a!=t&&r[a])return!0},schemaUnknownRules:function(e,r){if("boolean"==typeof e)return;for(var t in e)if(!r[t])return t},toQuotedString:b,getPathExpr:function(e,r,t,a){return F(e,t?"'/' + "+r+(a?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):a?"'[' + "+r+" + ']'":"'[\\'' + "+r+" + '\\']'")},getPath:function(e,r,t){var a=b(t?"/"+x(r):h(r));return F(e,a)},getData:function(e,r,t){var a,s,o,i;if(""===e)return"rootData";if("/"==e[0]){if(!S.test(e))throw new Error("Invalid JSON-pointer: "+e);s=e,o="rootData"}else{if(!(i=e.match(_)))throw new Error("Invalid JSON-pointer: "+e);if(a=+i[1],"#"==(s=i[2])){if(r<=a)throw new Error("Cannot access property/index "+a+" levels up, current level is "+r);return t[r-a]}if(r<a)throw new Error("Cannot access data "+a+" levels up, current level is "+r);if(o="data"+(r-a||""),!s)return o}for(var n=o,l=s.split("/"),c=0;c<l.length;c++){var u=l[c];u&&(o+=h($(u)),n+=" && "+o)}return n},unescapeFragment:function(e){return $(decodeURIComponent(e))},unescapeJsonPointer:$,escapeFragment:function(e){return encodeURIComponent(x(e))},escapeJsonPointer:x};var i=n(["string","number","integer","boolean","null"]);function n(e){for(var r={},t=0;t<e.length;t++)r[e[t]]=!0;return r}var a=/^[a-z$_][a-z$_0-9]*$/i,s=/'|\\/g;function h(e){return"number"==typeof e?"["+e+"]":a.test(e)?"."+e:"['"+l(e)+"']"}function l(e){return e.replace(s,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}var c=/else\s*{\s*}/g,u=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,d=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;var f=/[^v.]errors/g,p=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,m=/var errors = 0;|var vErrors = null;/g,v="return errors === 0;",y="validate.errors = null; return true;",g=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,P="return data;",E=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,w=/if \(rootData === undefined\) rootData = data;/;function b(e){return"'"+l(e)+"'"}var S=/^\/(?:[^~]|~0|~1)*$/,_=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function F(e,r){return'""'==e?r:(e+" + "+r).replace(/' \+ '/g,"")}function x(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function $(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},{"./ucs2length":9,"fast-deep-equal":42}],11:[function(e,r,t){"use strict";var l=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];r.exports=function(e,r){for(var t=0;t<r.length;t++){e=JSON.parse(JSON.stringify(e));var a,s=r[t].split("/"),o=e;for(a=1;a<s.length;a++)o=o[s[a]];for(a=0;a<l.length;a++){var i=l[a],n=o[i];n&&(o[i]={anyOf:[n,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]})}}return e}},{}],12:[function(e,r,t){"use strict";var a=e("./refs/json-schema-draft-07.json");r.exports={$id:"https://github.com/epoberezkin/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:a.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:a.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},{"./refs/json-schema-draft-07.json":41}],13:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i;var d="maximum"==r,f=d?"exclusiveMaximum":"exclusiveMinimum",p=e.schema[f],m=e.opts.$data&&p&&p.$data,v=d?"<":">",y=d?">":"<",g=void 0;if(m){var P=e.util.getData(p.$data,o,e.dataPathArr),E="exclusive"+s,w="exclType"+s,b="exclIsNumber"+s,S="' + "+(x="op"+s)+" + '";a+=" var schemaExcl"+s+" = "+P+"; ";var _;g=f;(_=_||[]).push(a+=" var "+E+"; var "+w+" = typeof "+(P="schemaExcl"+s)+"; if ("+w+" != 'boolean' && "+w+" != 'undefined' && "+w+" != 'number') { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(g||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var F=a;a=_.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+F+"]); ":" validate.errors = ["+F+"]; return false; ":" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),a+=" "+w+" == 'number' ? ( ("+E+" = "+t+" === undefined || "+P+" "+v+"= "+t+") ? "+u+" "+y+"= "+P+" : "+u+" "+y+" "+t+" ) : ( ("+E+" = "+P+" === true) ? "+u+" "+y+"= "+t+" : "+u+" "+y+" "+t+" ) || "+u+" !== "+u+") { var op"+s+" = "+E+" ? '"+v+"' : '"+v+"='; ",void 0===i&&(l=e.errSchemaPath+"/"+(g=f),t=P,h=m)}else{S=v;if((b="number"==typeof p)&&h){var x="'"+S+"'";a+=" if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),a+=" ( "+t+" === undefined || "+p+" "+v+"= "+t+" ? "+u+" "+y+"= "+p+" : "+u+" "+y+" "+t+" ) || "+u+" !== "+u+") { "}else{b&&void 0===i?(E=!0,l=e.errSchemaPath+"/"+(g=f),t=p,y+="="):(b&&(t=Math[d?"min":"max"](p,i)),p===(!b||t)?(E=!0,l=e.errSchemaPath+"/"+(g=f),y+="="):(E=!1,S+="="));x="'"+S+"'";a+=" if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),a+=" "+u+" "+y+" "+t+" || "+u+" !== "+u+") { "}}g=g||r,(_=_||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(g||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+x+", limit: "+t+", exclusive: "+E+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be "+S+" ",a+=h?"' + "+t:t+"'"),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";F=a;return a=_.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+F+"]); ":" validate.errors = ["+F+"]; return false; ":" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(a+=" else { "),a}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,a+="if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || ");var d=r,f=f||[];f.push(a+=" "+u+".length "+("maxItems"==r?">":"<")+" "+t+") { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+t+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxItems"==r?"more":"fewer",a+=" than ",a+=h?"' + "+t+" + '":""+i,a+=" items' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var p=a;return a=f.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,a+="if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),a+=!1===e.opts.unicode?" "+u+".length ":" ucs2length("+u+") ";var d=r,f=f||[];f.push(a+=" "+("maxLength"==r?">":"<")+" "+t+") { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+t+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be ",a+="maxLength"==r?"longer":"shorter",a+=" than ",a+=h?"' + "+t+" + '":""+i,a+=" characters' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var p=a;return a=f.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,a+="if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || ");var d=r,f=f||[];f.push(a+=" Object.keys("+u+").length "+("maxProperties"==r?">":"<")+" "+t+") { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+t+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxProperties"==r?"more":"fewer",a+=" than ",a+=h?"' + "+t+" + '":""+i,a+=" properties' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var p=a;return a=f.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.schema[r],s=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,n=e.util.copy(e),l="";n.level++;var c="valid"+n.level,u=n.baseId,h=!0,d=a;if(d)for(var f,p=-1,m=d.length-1;p<m;)f=d[p+=1],(e.opts.strictKeywords?"object"==typeof f&&0<Object.keys(f).length:e.util.schemaHasRules(f,e.RULES.all))&&(h=!1,n.schema=f,n.schemaPath=s+"["+p+"]",n.errSchemaPath=o+"/"+p,t+=" "+e.validate(n)+" ",n.baseId=u,i&&(t+=" if ("+c+") { ",l+="}"));return i&&(t+=h?" if (true) { ":" "+l.slice(0,-1)+" "),t=e.util.cleanUpCode(t)}},{}],18:[function(e,r,t){"use strict";r.exports=function(r,e){var t=" ",a=r.level,s=r.dataLevel,o=r.schema[e],i=r.schemaPath+r.util.getProperty(e),n=r.errSchemaPath+"/"+e,l=!r.opts.allErrors,c="data"+(s||""),u="valid"+a,h="errs__"+a,d=r.util.copy(r),f="";d.level++;var p="valid"+d.level;if(o.every(function(e){return r.opts.strictKeywords?"object"==typeof e&&0<Object.keys(e).length:r.util.schemaHasRules(e,r.RULES.all)})){var m=d.baseId;t+=" var "+h+" = errors; var "+u+" = false; ";var v=r.compositeRule;r.compositeRule=d.compositeRule=!0;var y=o;if(y)for(var g,P=-1,E=y.length-1;P<E;)g=y[P+=1],d.schema=g,d.schemaPath=i+"["+P+"]",d.errSchemaPath=n+"/"+P,t+=" "+r.validate(d)+" ",d.baseId=m,t+=" "+u+" = "+u+" || "+p+"; if (!"+u+") { ",f+="}";r.compositeRule=d.compositeRule=v,t+=" "+f+" if (!"+u+") { var err = ",!1!==r.createErrors?(t+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(n)+" , params: {} ",!1!==r.opts.messages&&(t+=" , message: 'should match some schema in anyOf' "),r.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!r.compositeRule&&l&&(t+=r.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),t+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",r.opts.allErrors&&(t+=" } "),t=r.util.cleanUpCode(t)}else l&&(t+=" if (true) { ");return t}},{}],19:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.errSchemaPath+"/"+r,s=e.util.toQuotedString(e.schema[r]);return!0===e.opts.$comment?t+=" console.log("+s+");":"function"==typeof e.opts.$comment&&(t+=" self._opts.$comment("+s+", "+e.util.toQuotedString(a)+", validate.root.schema);"),t}},{}],20:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h=e.opts.$data&&o&&o.$data;h&&(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; "),h||(t+=" var schema"+a+" = validate.schema"+i+";");var d=d||[];d.push(t+="var "+u+" = equal("+c+", schema"+a+"); if (!"+u+") { "),t="",!1!==e.createErrors?(t+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { allowedValue: schema"+a+" } ",!1!==e.opts.messages&&(t+=" , message: 'should be equal to constant' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t;return t=d.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" }",l&&(t+=" else { "),t}},{}],21:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h="errs__"+a,d=e.util.copy(e);d.level++;var f="valid"+d.level,p="i"+a,m=d.dataLevel=e.dataLevel+1,v="data"+m,y=e.baseId,g=e.opts.strictKeywords?"object"==typeof o&&0<Object.keys(o).length:e.util.schemaHasRules(o,e.RULES.all);if(t+="var "+h+" = errors;var "+u+";",g){var P=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=o,d.schemaPath=i,d.errSchemaPath=n,t+=" var "+f+" = false; for (var "+p+" = 0; "+p+" < "+c+".length; "+p+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers,!0);var E=c+"["+p+"]";d.dataPathArr[m]=p;var w=e.validate(d);d.baseId=y,e.util.varOccurences(w,v)<2?t+=" "+e.util.varReplace(w,v,E)+" ":t+=" var "+v+" = "+E+"; "+w+" ",t+=" if ("+f+") break; } ",e.compositeRule=d.compositeRule=P,t+=" if (!"+f+") {"}else t+=" if ("+c+".length == 0) {";var b=b||[];b.push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: {} ",!1!==e.opts.messages&&(t+=" , message: 'should contain a valid item' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var S=t;return t=b.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { ",g&&(t+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(t+=" } "),t=e.util.cleanUpCode(t)}},{}],22:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,h="data"+(i||""),d="valid"+o,f="errs__"+o,p=e.opts.$data&&n&&n.$data;a=p?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n;var m,v,y,g,P,E=this,w="definition"+o,b=E.definition,S="";if(p&&b.$data){var _=b.validateSchema;s+=" var "+w+" = RULES.custom['"+r+"'].definition; var "+(P="keywordValidate"+o)+" = "+w+".validate;"}else{if(!(g=e.useCustomRule(E,n,e.schema,e)))return;a="validate.schema"+l,P=g.code,m=b.compile,v=b.inline,y=b.macro}var F=P+".errors",x="i"+o,$="ruleErr"+o,R=b.async;if(R&&!e.async)throw new Error("async keyword in sync schema");if(v||y||(s+=F+" = null;"),s+="var "+f+" = errors;var "+d+";",p&&b.$data&&(S+="}",s+=" if ("+a+" === undefined) { "+d+" = true; } else { ",_&&(S+="}",s+=" "+d+" = "+w+".validateSchema("+a+"); if ("+d+") { ")),v)s+=b.statements?" "+g.validate+" ":" "+d+" = "+g.validate+"; ";else if(y){var D=e.util.copy(e);S="";D.level++;var j="valid"+D.level;D.schema=g.validate,D.schemaPath="";var O=e.compositeRule;e.compositeRule=D.compositeRule=!0;var I=e.validate(D).replace(/validate\.schema/g,P);e.compositeRule=D.compositeRule=O,s+=" "+I}else{(L=L||[]).push(s),s="",s+=" "+P+".call( ",s+=e.opts.passContext?"this":"self",s+=m||!1===b.schema?" , "+h+" ":" , "+a+" , "+h+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath);var A=i?"data"+(i-1||""):"parentData",C=i?e.dataPathArr[i]:"parentDataProperty",k=s+=" , "+A+" , "+C+" , rootData ) ";s=L.pop(),!1===b.errors?(s+=" "+d+" = ",R&&(s+="await "),s+=k+"; "):s+=R?" var "+(F="customErrors"+o)+" = null; try { "+d+" = await "+k+"; } catch (e) { "+d+" = false; if (e instanceof ValidationError) "+F+" = e.errors; else throw e; } ":" "+F+" = null; "+d+" = "+k+"; "}if(b.modifying&&(s+=" if ("+A+") "+h+" = "+A+"["+C+"];"),s+=""+S,b.valid)u&&(s+=" if (true) { ");else{var L;s+=" if ( ",void 0===b.valid?(s+=" !",s+=y?""+j:d):s+=" "+!b.valid+" ",t=E.keyword,(L=L||[]).push(s+=") { "),(L=L||[]).push(s=""),s="",!1!==e.createErrors?(s+=" { keyword: '"+(t||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+E.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+E.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var z=s;s=L.pop();var T=s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+z+"]); ":" validate.errors = ["+z+"]; return false; ":" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";s=L.pop(),v?b.errors?"full"!=b.errors&&(s+=" for (var "+x+"="+f+"; "+x+"<errors; "+x+"++) { var "+$+" = vErrors["+x+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+$+".schemaPath === undefined) { "+$+'.schemaPath = "'+c+'"; } ',e.opts.verbose&&(s+=" "+$+".schema = "+a+"; "+$+".data = "+h+"; "),s+=" } "):!1===b.errors?s+=" "+T+" ":(s+=" if ("+f+" == errors) { "+T+" } else { for (var "+x+"="+f+"; "+x+"<errors; "+x+"++) { var "+$+" = vErrors["+x+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+$+".schemaPath === undefined) { "+$+'.schemaPath = "'+c+'"; } ',e.opts.verbose&&(s+=" "+$+".schema = "+a+"; "+$+".data = "+h+"; "),s+=" } } "):y?(s+=" var err = ",!1!==e.createErrors?(s+=" { keyword: '"+(t||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+E.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+E.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(s+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; ")):!1===b.errors?s+=" "+T+" ":(s+=" if (Array.isArray("+F+")) { if (vErrors === null) vErrors = "+F+"; else vErrors = vErrors.concat("+F+"); errors = vErrors.length; for (var "+x+"="+f+"; "+x+"<errors; "+x+"++) { var "+$+" = vErrors["+x+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; "+$+'.schemaPath = "'+c+'"; ',e.opts.verbose&&(s+=" "+$+".schema = "+a+"; "+$+".data = "+h+"; "),s+=" } } else { "+T+" } "),s+=" } ",u&&(s+=" else { ")}return s}},{}],23:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e),d="";h.level++;var f="valid"+h.level,p={},m={},v=e.opts.ownProperties;for(E in o){var y=o[E],g=Array.isArray(y)?m:p;g[E]=y}t+="var "+u+" = errors;";var P=e.errorPath;for(var E in t+="var missing"+a+";",m)if((g=m[E]).length){if(t+=" if ( "+c+e.util.getProperty(E)+" !== undefined ",v&&(t+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(E)+"') "),l){t+=" && ( ";var w=g;if(w)for(var b=-1,S=w.length-1;b<S;){D=w[b+=1],b&&(t+=" || "),t+=" ( ( "+(A=c+(I=e.util.getProperty(D)))+" === undefined ",v&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(D)+"') "),t+=") && (missing"+a+" = "+e.util.toQuotedString(e.opts.jsonPointers?D:I)+") ) "}t+=")) { ";var _="missing"+a,F="' + "+_+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(P,_,!0):P+" + "+_);var x=x||[];x.push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { property: '"+e.util.escapeQuotes(E)+"', missingProperty: '"+F+"', depsCount: "+g.length+", deps: '"+e.util.escapeQuotes(1==g.length?g[0]:g.join(", "))+"' } ",!1!==e.opts.messages&&(t+=" , message: 'should have ",t+=1==g.length?"property "+e.util.escapeQuotes(g[0]):"properties "+e.util.escapeQuotes(g.join(", ")),t+=" when property "+e.util.escapeQuotes(E)+" is present' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var $=t;t=x.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+$+"]); ":" validate.errors = ["+$+"]; return false; ":" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{t+=" ) { ";var R=g;if(R)for(var D,j=-1,O=R.length-1;j<O;){D=R[j+=1];var I=e.util.getProperty(D),A=(F=e.util.escapeQuotes(D),c+I);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(P,D,e.opts.jsonPointers)),t+=" if ( "+A+" === undefined ",v&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(D)+"') "),t+=") { var err = ",!1!==e.createErrors?(t+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { property: '"+e.util.escapeQuotes(E)+"', missingProperty: '"+F+"', depsCount: "+g.length+", deps: '"+e.util.escapeQuotes(1==g.length?g[0]:g.join(", "))+"' } ",!1!==e.opts.messages&&(t+=" , message: 'should have ",t+=1==g.length?"property "+e.util.escapeQuotes(g[0]):"properties "+e.util.escapeQuotes(g.join(", ")),t+=" when property "+e.util.escapeQuotes(E)+" is present' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}t+=" } ",l&&(d+="}",t+=" else { ")}e.errorPath=P;var C=h.baseId;for(var E in p){y=p[E];(e.opts.strictKeywords?"object"==typeof y&&0<Object.keys(y).length:e.util.schemaHasRules(y,e.RULES.all))&&(t+=" "+f+" = true; if ( "+c+e.util.getProperty(E)+" !== undefined ",v&&(t+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(E)+"') "),t+=") { ",h.schema=y,h.schemaPath=i+e.util.getProperty(E),h.errSchemaPath=n+"/"+e.util.escapeFragment(E),t+=" "+e.validate(h)+" ",h.baseId=C,t+=" } ",l&&(t+=" if ("+f+") { ",d+="}"))}return l&&(t+=" "+d+" if ("+u+" == errors) {"),t=e.util.cleanUpCode(t)}},{}],24:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h=e.opts.$data&&o&&o.$data;h&&(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ");var d="i"+a,f="schema"+a;h||(t+=" var "+f+" = validate.schema"+i+";"),t+="var "+u+";",h&&(t+=" if (schema"+a+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+a+")) "+u+" = false; else {"),t+=u+" = false;for (var "+d+"=0; "+d+"<"+f+".length; "+d+"++) if (equal("+c+", "+f+"["+d+"])) { "+u+" = true; break; }",h&&(t+=" } ");var p=p||[];p.push(t+=" if (!"+u+") { "),t="",!1!==e.createErrors?(t+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { allowedValues: schema"+a+" } ",!1!==e.opts.messages&&(t+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var m=t;return t=p.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" }",l&&(t+=" else { "),t}},{}],25:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||"");if(!1===e.opts.format)return c&&(a+=" if (true) { "),a;var h,d=e.opts.$data&&i&&i.$data;h=d?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i;var f=e.opts.unknownFormats,p=Array.isArray(f);if(d){a+=" var "+(m="format"+s)+" = formats["+h+"]; var "+(v="isObject"+s)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(y="formatType"+s)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+s+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",d&&(a+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),a+=" (","ignore"!=f&&(a+=" ("+h+" && !"+m+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+h+") == -1 "),a+=") || "),a+=" ("+m+" && "+y+" == '"+t+"' && !(typeof "+m+" == 'function' ? ",a+=e.async?" (async"+s+" ? await "+m+"("+u+") : "+m+"("+u+")) ":" "+m+"("+u+") ",a+=" : "+m+".test("+u+"))))) {"}else{var m;if(!(m=e.formats[i])){if("ignore"==f)return e.logger.warn('unknown format "'+i+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(a+=" if (true) { "),a;if(p&&0<=f.indexOf(i))return c&&(a+=" if (true) { "),a;throw new Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,y=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var g=!0===m.async;m=m.validate}if(y!=t)return c&&(a+=" if (true) { "),a;if(g){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(P="formats"+e.util.getProperty(i)+".validate")+"("+u+"))) { "}else{a+=" if (! ";var P="formats"+e.util.getProperty(i);v&&(P+=".validate"),a+="function"==typeof m?" "+P+"("+u+") ":" "+P+".test("+u+") ",a+=") { "}}var E=E||[];E.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=d?""+h:""+e.util.toQuotedString(i),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=d?"' + "+h+" + '":""+e.util.escapeQuotes(i),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+n:""+e.util.toQuotedString(i),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var w=a;return a=E.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+w+"]); ":" validate.errors = ["+w+"]; return false; ":" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(a+=" else { "),a}},{}],26:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h="errs__"+a,d=e.util.copy(e);d.level++;var f="valid"+d.level,p=e.schema.then,m=e.schema.else,v=void 0!==p&&(e.opts.strictKeywords?"object"==typeof p&&0<Object.keys(p).length:e.util.schemaHasRules(p,e.RULES.all)),y=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&0<Object.keys(m).length:e.util.schemaHasRules(m,e.RULES.all)),g=d.baseId;if(v||y){var P;d.createErrors=!1,d.schema=o,d.schemaPath=i,d.errSchemaPath=n,t+=" var "+h+" = errors; var "+u+" = true; ";var E=e.compositeRule;e.compositeRule=d.compositeRule=!0,t+=" "+e.validate(d)+" ",d.baseId=g,d.createErrors=!0,t+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=d.compositeRule=E,v?(t+=" if ("+f+") { ",d.schema=e.schema.then,d.schemaPath=e.schemaPath+".then",d.errSchemaPath=e.errSchemaPath+"/then",t+=" "+e.validate(d)+" ",d.baseId=g,t+=" "+u+" = "+f+"; ",v&&y?t+=" var "+(P="ifClause"+a)+" = 'then'; ":P="'then'",t+=" } ",y&&(t+=" else { ")):t+=" if (!"+f+") { ",y&&(d.schema=e.schema.else,d.schemaPath=e.schemaPath+".else",d.errSchemaPath=e.errSchemaPath+"/else",t+=" "+e.validate(d)+" ",d.baseId=g,t+=" "+u+" = "+f+"; ",v&&y?t+=" var "+(P="ifClause"+a)+" = 'else'; ":P="'else'",t+=" } "),t+=" if (!"+u+") { var err = ",!1!==e.createErrors?(t+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { failingKeyword: "+P+" } ",!1!==e.opts.messages&&(t+=" , message: 'should match \"' + "+P+" + '\" schema' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(t+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),t+=" } ",l&&(t+=" else { "),t=e.util.cleanUpCode(t)}else l&&(t+=" if (true) { ");return t}},{}],27:[function(e,r,t){"use strict";r.exports={$ref:e("./ref"),allOf:e("./allOf"),anyOf:e("./anyOf"),$comment:e("./comment"),const:e("./const"),contains:e("./contains"),dependencies:e("./dependencies"),enum:e("./enum"),format:e("./format"),if:e("./if"),items:e("./items"),maximum:e("./_limit"),minimum:e("./_limit"),maxItems:e("./_limitItems"),minItems:e("./_limitItems"),maxLength:e("./_limitLength"),minLength:e("./_limitLength"),maxProperties:e("./_limitProperties"),minProperties:e("./_limitProperties"),multipleOf:e("./multipleOf"),not:e("./not"),oneOf:e("./oneOf"),pattern:e("./pattern"),properties:e("./properties"),propertyNames:e("./propertyNames"),required:e("./required"),uniqueItems:e("./uniqueItems"),validate:e("./validate")}},{"./_limit":13,"./_limitItems":14,"./_limitLength":15,"./_limitProperties":16,"./allOf":17,"./anyOf":18,"./comment":19,"./const":20,"./contains":21,"./dependencies":23,"./enum":24,"./format":25,"./if":26,"./items":28,"./multipleOf":29,"./not":30,"./oneOf":31,"./pattern":32,"./properties":33,"./propertyNames":34,"./ref":35,"./required":36,"./uniqueItems":37,"./validate":38}],28:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h="errs__"+a,d=e.util.copy(e),f="";d.level++;var p="valid"+d.level,m="i"+a,v=d.dataLevel=e.dataLevel+1,y="data"+v,g=e.baseId;if(t+="var "+h+" = errors;var "+u+";",Array.isArray(o)){var P=e.schema.additionalItems;if(!1===P){t+=" "+u+" = "+c+".length <= "+o.length+"; ";var E=n;n=e.errSchemaPath+"/additionalItems";var w=w||[];w.push(t+=" if (!"+u+") { "),t="",!1!==e.createErrors?(t+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var b=t;t=w.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+b+"]); ":" validate.errors = ["+b+"]; return false; ":" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } ",n=E,l&&(f+="}",t+=" else { ")}var S=o;if(S)for(var _,F=-1,x=S.length-1;F<x;)if(_=S[F+=1],e.opts.strictKeywords?"object"==typeof _&&0<Object.keys(_).length:e.util.schemaHasRules(_,e.RULES.all)){t+=" "+p+" = true; if ("+c+".length > "+F+") { ";var $=c+"["+F+"]";d.schema=_,d.schemaPath=i+"["+F+"]",d.errSchemaPath=n+"/"+F,d.errorPath=e.util.getPathExpr(e.errorPath,F,e.opts.jsonPointers,!0),d.dataPathArr[v]=F;var R=e.validate(d);d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,$)+" ":t+=" var "+y+" = "+$+"; "+R+" ",t+=" } ",l&&(t+=" if ("+p+") { ",f+="}")}if("object"==typeof P&&(e.opts.strictKeywords?"object"==typeof P&&0<Object.keys(P).length:e.util.schemaHasRules(P,e.RULES.all))){d.schema=P,d.schemaPath=e.schemaPath+".additionalItems",d.errSchemaPath=e.errSchemaPath+"/additionalItems",t+=" "+p+" = true; if ("+c+".length > "+o.length+") { for (var "+m+" = "+o.length+"; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);$=c+"["+m+"]";d.dataPathArr[v]=m;R=e.validate(d);d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,$)+" ":t+=" var "+y+" = "+$+"; "+R+" ",l&&(t+=" if (!"+p+") break; "),t+=" } } ",l&&(t+=" if ("+p+") { ",f+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&0<Object.keys(o).length:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=i,d.errSchemaPath=n,t+=" for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);$=c+"["+m+"]";d.dataPathArr[v]=m;R=e.validate(d);d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,$)+" ":t+=" var "+y+" = "+$+"; "+R+" ",l&&(t+=" if (!"+p+") break; "),t+=" }"}return l&&(t+=" "+f+" if ("+h+" == errors) {"),t=e.util.cleanUpCode(t)}},{}],29:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,a+="var division"+s+";if (",h&&(a+=" "+t+" !== undefined && ( typeof "+t+" != 'number' || "),a+=" (division"+s+" = "+u+" / "+t+", ",a+=e.opts.multipleOfPrecision?" Math.abs(Math.round(division"+s+") - division"+s+") > 1e-"+e.opts.multipleOfPrecision+" ":" division"+s+" !== parseInt(division"+s+") ",a+=" ) ",h&&(a+=" ) ");var d=d||[];d.push(a+=" ) { "),a="",!1!==e.createErrors?(a+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+t+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be multiple of ",a+=h?"' + "+t:t+"'"),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var f=a;return a=d.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],30:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e);h.level++;var d="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof o&&0<Object.keys(o).length:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=i,h.errSchemaPath=n,t+=" var "+u+" = errors; ";var f,p=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(f=h.opts.allErrors,h.opts.allErrors=!1),t+=" "+e.validate(h)+" ",h.createErrors=!0,f&&(h.opts.allErrors=f),e.compositeRule=h.compositeRule=p;var m=m||[];m.push(t+=" if ("+d+") { "),t="",!1!==e.createErrors?(t+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: {} ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be valid' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var v=t;t=m.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(t+=" } ")}else t+=" var err = ",!1!==e.createErrors?(t+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: {} ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be valid' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(t+=" if (false) { ");return t}},{}],31:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h="errs__"+a,d=e.util.copy(e),f="";d.level++;var p="valid"+d.level,m=d.baseId,v="prevValid"+a,y="passingSchemas"+a;t+="var "+h+" = errors , "+v+" = false , "+u+" = false , "+y+" = null; ";var g=e.compositeRule;e.compositeRule=d.compositeRule=!0;var P=o;if(P)for(var E,w=-1,b=P.length-1;w<b;)E=P[w+=1],(e.opts.strictKeywords?"object"==typeof E&&0<Object.keys(E).length:e.util.schemaHasRules(E,e.RULES.all))?(d.schema=E,d.schemaPath=i+"["+w+"]",d.errSchemaPath=n+"/"+w,t+=" "+e.validate(d)+" ",d.baseId=m):t+=" var "+p+" = true; ",w&&(t+=" if ("+p+" && "+v+") { "+u+" = false; "+y+" = ["+y+", "+w+"]; } else { ",f+="}"),t+=" if ("+p+") { "+u+" = "+v+" = true; "+y+" = "+w+"; }";return e.compositeRule=d.compositeRule=g,t+=f+"if (!"+u+") { var err = ",!1!==e.createErrors?(t+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(t+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(t+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),t+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(t+=" } "),t}},{}],32:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i;var d=h?"(new RegExp("+t+"))":e.usePattern(i);a+="if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'string') || ");var f=f||[];f.push(a+=" !"+d+".test("+u+") ) { "),a="",!1!==e.createErrors?(a+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { pattern: ",a+=h?""+t:""+e.util.toQuotedString(i),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match pattern \"",a+=h?"' + "+t+" + '":""+e.util.escapeQuotes(i),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+e.util.toQuotedString(i),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var p=a;return a=f.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],33:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e),d="";h.level++;var f="valid"+h.level,p="key"+a,m="idx"+a,v=h.dataLevel=e.dataLevel+1,y="data"+v,g="dataProperties"+a,P=Object.keys(o||{}),E=e.schema.patternProperties||{},w=Object.keys(E),b=e.schema.additionalProperties,S=P.length||w.length,_=!1===b,F="object"==typeof b&&Object.keys(b).length,x=e.opts.removeAdditional,$=_||F||x,R=e.opts.ownProperties,D=e.baseId,j=e.schema.required;if(j&&(!e.opts.$data||!j.$data)&&j.length<e.opts.loopRequired)var O=e.util.toHash(j);if(t+="var "+u+" = errors;var "+f+" = true;",R&&(t+=" var "+g+" = undefined;"),$){if(t+=R?" "+g+" = "+g+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+g+".length; "+m+"++) { var "+p+" = "+g+"["+m+"]; ":" for (var "+p+" in "+c+") { ",S){if(t+=" var isAdditional"+a+" = !(false ",P.length)if(8<P.length)t+=" || validate.schema"+i+".hasOwnProperty("+p+") ";else{var I=P;if(I)for(var A=-1,C=I.length-1;A<C;)B=I[A+=1],t+=" || "+p+" == "+e.util.toQuotedString(B)+" "}if(w.length){var k=w;if(k)for(var L=-1,z=k.length-1;L<z;)ae=k[L+=1],t+=" || "+e.usePattern(ae)+".test("+p+") "}t+=" ); if (isAdditional"+a+") { "}if("all"==x)t+=" delete "+c+"["+p+"]; ";else{var T=e.errorPath,q="' + "+p+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers)),_)if(x)t+=" delete "+c+"["+p+"]; ";else{var N=n;n=e.errSchemaPath+"/additionalProperties",(ee=ee||[]).push(t+=" "+f+" = false; "),t="",!1!==e.createErrors?(t+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { additionalProperty: '"+q+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is an invalid additional property":"should NOT have additional properties",t+="' "),e.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var Q=t;t=ee.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+Q+"]); ":" validate.errors = ["+Q+"]; return false; ":" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n=N,l&&(t+=" break; ")}else if(F)if("failing"==x){t+=" var "+u+" = errors; ";var U=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=b,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers);var V=c+"["+p+"]";h.dataPathArr[v]=p;var H=e.validate(h);h.baseId=D,e.util.varOccurences(H,y)<2?t+=" "+e.util.varReplace(H,y,V)+" ":t+=" var "+y+" = "+V+"; "+H+" ",t+=" if (!"+f+") { errors = "+u+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+c+"["+p+"]; } ",e.compositeRule=h.compositeRule=U}else{h.schema=b,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers);V=c+"["+p+"]";h.dataPathArr[v]=p;H=e.validate(h);h.baseId=D,e.util.varOccurences(H,y)<2?t+=" "+e.util.varReplace(H,y,V)+" ":t+=" var "+y+" = "+V+"; "+H+" ",l&&(t+=" if (!"+f+") break; ")}e.errorPath=T}S&&(t+=" } "),t+=" } ",l&&(t+=" if ("+f+") { ",d+="}")}var K=e.opts.useDefaults&&!e.compositeRule;if(P.length){var M=P;if(M)for(var B,J=-1,Z=M.length-1;J<Z;){var G=o[B=M[J+=1]];if(e.opts.strictKeywords?"object"==typeof G&&0<Object.keys(G).length:e.util.schemaHasRules(G,e.RULES.all)){var Y=e.util.getProperty(B),W=(V=c+Y,K&&void 0!==G.default);h.schema=G,h.schemaPath=i+Y,h.errSchemaPath=n+"/"+e.util.escapeFragment(B),h.errorPath=e.util.getPath(e.errorPath,B,e.opts.jsonPointers),h.dataPathArr[v]=e.util.toQuotedString(B);H=e.validate(h);if(h.baseId=D,e.util.varOccurences(H,y)<2){H=e.util.varReplace(H,y,V);var X=V}else{X=y;t+=" var "+y+" = "+V+"; "}if(W)t+=" "+H+" ";else{if(O&&O[B]){t+=" if ( "+X+" === undefined ",R&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(B)+"') "),t+=") { "+f+" = false; ";T=e.errorPath,N=n;var ee,re=e.util.escapeQuotes(B);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(T,B,e.opts.jsonPointers)),n=e.errSchemaPath+"/required",(ee=ee||[]).push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+re+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";Q=t;t=ee.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+Q+"]); ":" validate.errors = ["+Q+"]; return false; ":" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n=N,e.errorPath=T,t+=" } else { "}else l?(t+=" if ( "+X+" === undefined ",R&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(B)+"') "),t+=") { "+f+" = true; } else { "):(t+=" if ("+X+" !== undefined ",R&&(t+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(B)+"') "),t+=" ) { ");t+=" "+H+" } "}}l&&(t+=" if ("+f+") { ",d+="}")}}if(w.length){var te=w;if(te)for(var ae,se=-1,oe=te.length-1;se<oe;){G=E[ae=te[se+=1]];if(e.opts.strictKeywords?"object"==typeof G&&0<Object.keys(G).length:e.util.schemaHasRules(G,e.RULES.all)){h.schema=G,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),t+=R?" "+g+" = "+g+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+g+".length; "+m+"++) { var "+p+" = "+g+"["+m+"]; ":" for (var "+p+" in "+c+") { ",t+=" if ("+e.usePattern(ae)+".test("+p+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers);V=c+"["+p+"]";h.dataPathArr[v]=p;H=e.validate(h);h.baseId=D,e.util.varOccurences(H,y)<2?t+=" "+e.util.varReplace(H,y,V)+" ":t+=" var "+y+" = "+V+"; "+H+" ",l&&(t+=" if (!"+f+") break; "),t+=" } ",l&&(t+=" else "+f+" = true; "),t+=" } ",l&&(t+=" if ("+f+") { ",d+="}")}}}return l&&(t+=" "+d+" if ("+u+" == errors) {"),t=e.util.cleanUpCode(t)}},{}],34:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e);h.level++;var d="valid"+h.level;if(t+="var "+u+" = errors;",e.opts.strictKeywords?"object"==typeof o&&0<Object.keys(o).length:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=i,h.errSchemaPath=n;var f="key"+a,p="idx"+a,m="i"+a,v="' + "+f+" + '",y="data"+(h.dataLevel=e.dataLevel+1),g="dataProperties"+a,P=e.opts.ownProperties,E=e.baseId;P&&(t+=" var "+g+" = undefined; "),t+=P?" "+g+" = "+g+" || Object.keys("+c+"); for (var "+p+"=0; "+p+"<"+g+".length; "+p+"++) { var "+f+" = "+g+"["+p+"]; ":" for (var "+f+" in "+c+") { ",t+=" var startErrs"+a+" = errors; ";var w=f,b=e.compositeRule;e.compositeRule=h.compositeRule=!0;var S=e.validate(h);h.baseId=E,e.util.varOccurences(S,y)<2?t+=" "+e.util.varReplace(S,y,w)+" ":t+=" var "+y+" = "+w+"; "+S+" ",e.compositeRule=h.compositeRule=b,t+=" if (!"+d+") { for (var "+m+"=startErrs"+a+"; "+m+"<errors; "+m+"++) { vErrors["+m+"].propertyName = "+f+"; } var err = ",!1!==e.createErrors?(t+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { propertyName: '"+v+"' } ",!1!==e.opts.messages&&(t+=" , message: 'property name \\'"+v+"\\' is invalid' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(t+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),l&&(t+=" break; "),t+=" } }"}return l&&(t+=" if ("+u+" == errors) {"),t=e.util.cleanUpCode(t)}},{}],35:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.dataLevel,i=e.schema[r],n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(o||""),u="valid"+e.level;if("#"==i||"#/"==i)a=e.isRoot?(t=e.async,"validate"):(t=!0===e.root.schema.$async,"root.refVal[0]");else{var h=e.resolveRef(e.baseId,i,e.isRoot);if(void 0===h){var d=e.MissingRefError.message(e.baseId,i);if("fail"==e.opts.missingRefs){e.logger.error(d),(v=v||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { ref: '"+e.util.escapeQuotes(i)+"' } ",!1!==e.opts.messages&&(s+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(i)+"' "),e.opts.verbose&&(s+=" , schema: "+e.util.toQuotedString(i)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),s+=" } "):s+=" {} ";var f=s;s=v.pop(),s+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(s+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,i,d);e.logger.warn(d),l&&(s+=" if (true) { ")}}else if(h.inline){var p=e.util.copy(e);p.level++;var m="valid"+p.level;p.schema=h.schema,p.schemaPath="",p.errSchemaPath=i,s+=" "+e.validate(p).replace(/validate\.schema/g,h.code)+" ",l&&(s+=" if ("+m+") { ")}else t=!0===h.$async||e.async&&!1!==h.$async,a=h.code}if(a){var v;(v=v||[]).push(s),s="",s+=e.opts.passContext?" "+a+".call(this, ":" "+a+"( ",s+=" "+c+", (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath);var y=s+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+(o?e.dataPathArr[o]:"parentDataProperty")+", rootData) ";if(s=v.pop(),t){if(!e.async)throw new Error("async schema referenced by sync schema");l&&(s+=" var "+u+"; "),s+=" try { await "+y+"; ",l&&(s+=" "+u+" = true; "),s+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",l&&(s+=" "+u+" = false; "),s+=" } ",l&&(s+=" if ("+u+") { ")}else s+=" if (!"+y+") { if (vErrors === null) vErrors = "+a+".errors; else vErrors = vErrors.concat("+a+".errors); errors = vErrors.length; } ",l&&(s+=" else { ")}return s}},{}],36:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h=e.opts.$data&&o&&o.$data;h&&(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ");var d="schema"+a;if(!h)if(o.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var f=[],p=o;if(p)for(var m,v=-1,y=p.length-1;v<y;){m=p[v+=1];var g=e.schema.properties[m];g&&(e.opts.strictKeywords?"object"==typeof g&&0<Object.keys(g).length:e.util.schemaHasRules(g,e.RULES.all))||(f[f.length]=m)}}else f=o;if(h||f.length){var P=e.errorPath,E=h||e.opts.loopRequired<=f.length,w=e.opts.ownProperties;if(l)if(t+=" var missing"+a+"; ",E){h||(t+=" var "+d+" = validate.schema"+i+"; ");var b="' + "+(R="schema"+a+"["+(F="i"+a)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(P,R,e.opts.jsonPointers)),t+=" var "+u+" = true; ",h&&(t+=" if (schema"+a+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+a+")) "+u+" = false; else {"),t+=" for (var "+F+" = 0; "+F+" < "+d+".length; "+F+"++) { "+u+" = "+c+"["+d+"["+F+"]] !== undefined ",w&&(t+=" && Object.prototype.hasOwnProperty.call("+c+", "+d+"["+F+"]) "),t+="; if (!"+u+") break; } ",h&&(t+=" } "),($=$||[]).push(t+=" if (!"+u+") { "),t="",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+b+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var S=t;t=$.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { "}else{t+=" if ( ";var _=f;if(_)for(var F=-1,x=_.length-1;F<x;){j=_[F+=1],F&&(t+=" || "),t+=" ( ( "+(C=c+(A=e.util.getProperty(j)))+" === undefined ",w&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(j)+"') "),t+=") && (missing"+a+" = "+e.util.toQuotedString(e.opts.jsonPointers?j:A)+") ) "}t+=") { ";var $;b="' + "+(R="missing"+a)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(P,R,!0):P+" + "+R),($=$||[]).push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+b+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";S=t;t=$.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { "}else if(E){h||(t+=" var "+d+" = validate.schema"+i+"; ");var R;b="' + "+(R="schema"+a+"["+(F="i"+a)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(P,R,e.opts.jsonPointers)),h&&(t+=" if ("+d+" && !Array.isArray("+d+")) { var err = ",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+b+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+d+" !== undefined) { "),t+=" for (var "+F+" = 0; "+F+" < "+d+".length; "+F+"++) { if ("+c+"["+d+"["+F+"]] === undefined ",w&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", "+d+"["+F+"]) "),t+=") { var err = ",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+b+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(t+=" } ")}else{var D=f;if(D)for(var j,O=-1,I=D.length-1;O<I;){j=D[O+=1];var A=e.util.getProperty(j),C=(b=e.util.escapeQuotes(j),c+A);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(P,j,e.opts.jsonPointers)),t+=" if ( "+C+" === undefined ",w&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(j)+"') "),t+=") { var err = ",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+b+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=P}else l&&(t+=" if (true) {");return t}},{}],37:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h="valid"+s,d=e.opts.$data&&i&&i.$data;if(t=d?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,(i||d)&&!1!==e.opts.uniqueItems){d&&(a+=" var "+h+"; if ("+t+" === false || "+t+" === undefined) "+h+" = true; else if (typeof "+t+" != 'boolean') "+h+" = false; else { "),a+=" var i = "+u+".length , "+h+" = true , j; if (i > 1) { ";var f=e.schema.items&&e.schema.items.type,p=Array.isArray(f);if(!f||"object"==f||"array"==f||p&&(0<=f.indexOf("object")||0<=f.indexOf("array")))a+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+h+" = false; break outer; } } } ";else a+=" var itemIndices = {}, item; for (;i--;) { var item = "+u+"[i]; ",a+=" if ("+e.util["checkDataType"+(p?"s":"")](f,"item",!0)+") continue; ",p&&(a+=" if (typeof item == 'string') item = '\"' + item; "),a+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ";a+=" } ",d&&(a+=" } ");var m=m||[];m.push(a+=" if (!"+h+") { "),a="",!1!==e.createErrors?(a+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var v=a;a=m.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(a+=" else { ")}else c&&(a+=" if (true) { ");return a}},{}],38:[function(e,r,t){"use strict";r.exports=function(a,e){var r="",t=!0===a.schema.$async,s=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),o=a.self._getId(a.schema);if(a.opts.strictKeywords){var i=a.util.schemaUnknownRules(a.schema,a.RULES.keywords);if(i){var n="unknown keyword: "+i;if("log"!==a.opts.strictKeywords)throw new Error(n);a.logger.warn(n)}}if(a.isTop&&(r+=" var validate = ",t&&(a.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(a.opts.sourceCode||a.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof a.schema||!s&&!a.schema.$ref){var l=a.level,c=a.dataLevel,u=a.schema[e="false schema"],h=a.schemaPath+a.util.getProperty(e),d=a.errSchemaPath+"/"+e,f=!a.opts.allErrors,p="data"+(c||""),m="valid"+l;if(!1===a.schema){a.isTop?f=!0:r+=" var "+m+" = false; ",(Z=Z||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: {} ",!1!==a.opts.messages&&(r+=" , message: 'boolean schema is false' "),a.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var v=r;r=Z.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else r+=a.isTop?t?" return data; ":" validate.errors = null; return true; ":" var "+m+" = true; ";return a.isTop&&(r+=" }; return validate; "),r}if(a.isTop){var y=a.isTop;l=a.level=0,c=a.dataLevel=0,p="data";if(a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[void 0],void 0!==a.schema.default&&a.opts.useDefaults&&a.opts.strictDefaults){var g="default is ignored in the schema root";if("log"!==a.opts.strictDefaults)throw new Error(g);a.logger.warn(g)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{l=a.level,p="data"+((c=a.dataLevel)||"");if(o&&(a.baseId=a.resolve.url(a.baseId,o)),t&&!a.async)throw new Error("async schema in sync schema");r+=" var errs_"+l+" = errors;"}m="valid"+l,f=!a.opts.allErrors;var P="",E="",w=a.schema.type,b=Array.isArray(w);if(w&&a.opts.nullable&&!0===a.schema.nullable&&(b?-1==w.indexOf("null")&&(w=w.concat("null")):"null"!=w&&(w=[w,"null"],b=!0)),b&&1==w.length&&(w=w[0],b=!1),a.schema.$ref&&s){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(s=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(r+=" "+a.RULES.all.$comment.code(a,"$comment")),w){if(a.opts.coerceTypes)var S=a.util.coerceToTypes(a.opts.coerceTypes,w);var _=a.RULES.types[w];if(S||b||!0===_||_&&!G(_)){h=a.schemaPath+".type",d=a.errSchemaPath+"/type",h=a.schemaPath+".type",d=a.errSchemaPath+"/type";if(r+=" if ("+a.util[b?"checkDataTypes":"checkDataType"](w,p,!0)+") { ",S){var F="dataType"+l,x="coerced"+l;r+=" var "+F+" = typeof "+p+"; ","array"==a.opts.coerceTypes&&(r+=" if ("+F+" == 'object' && Array.isArray("+p+")) "+F+" = 'array'; "),r+=" var "+x+" = undefined; ";var $="",R=S;if(R)for(var D,j=-1,O=R.length-1;j<O;)D=R[j+=1],j&&(r+=" if ("+x+" === undefined) { ",$+="}"),"array"==a.opts.coerceTypes&&"array"!=D&&(r+=" if ("+F+" == 'array' && "+p+".length == 1) { "+x+" = "+p+" = "+p+"[0]; "+F+" = typeof "+p+"; } "),"string"==D?r+=" if ("+F+" == 'number' || "+F+" == 'boolean') "+x+" = '' + "+p+"; else if ("+p+" === null) "+x+" = ''; ":"number"==D||"integer"==D?(r+=" if ("+F+" == 'boolean' || "+p+" === null || ("+F+" == 'string' && "+p+" && "+p+" == +"+p+" ","integer"==D&&(r+=" && !("+p+" % 1)"),r+=")) "+x+" = +"+p+"; "):"boolean"==D?r+=" if ("+p+" === 'false' || "+p+" === 0 || "+p+" === null) "+x+" = false; else if ("+p+" === 'true' || "+p+" === 1) "+x+" = true; ":"null"==D?r+=" if ("+p+" === '' || "+p+" === 0 || "+p+" === false) "+x+" = null; ":"array"==a.opts.coerceTypes&&"array"==D&&(r+=" if ("+F+" == 'string' || "+F+" == 'number' || "+F+" == 'boolean' || "+p+" == null) "+x+" = ["+p+"]; ");(Z=Z||[]).push(r+=" "+$+" if ("+x+" === undefined) { "),r="",!1!==a.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: { type: '",r+=b?""+w.join(","):""+w,r+="' } ",!1!==a.opts.messages&&(r+=" , message: 'should be ",r+=b?""+w.join(","):""+w,r+="' "),a.opts.verbose&&(r+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";v=r;r=Z.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ";var I=c?"data"+(c-1||""):"parentData";r+=" "+p+" = "+x+"; ",c||(r+="if ("+I+" !== undefined)"),r+=" "+I+"["+(c?a.dataPathArr[c]:"parentDataProperty")+"] = "+x+"; } "}else{(Z=Z||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: { type: '",r+=b?""+w.join(","):""+w,r+="' } ",!1!==a.opts.messages&&(r+=" , message: 'should be ",r+=b?""+w.join(","):""+w,r+="' "),a.opts.verbose&&(r+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";v=r;r=Z.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(a.schema.$ref&&!s)r+=" "+a.RULES.all.$ref.code(a,"$ref")+" ",f&&(r+=" } if (errors === ",r+=y?"0":"errs_"+l,r+=") { ",E+="}");else{var A=a.RULES;if(A)for(var C=-1,k=A.length-1;C<k;)if(G(_=A[C+=1])){if(_.type&&(r+=" if ("+a.util.checkDataType(_.type,p)+") { "),a.opts.useDefaults)if("object"==_.type&&a.schema.properties){u=a.schema.properties;var L=Object.keys(u);if(L)for(var z,T=-1,q=L.length-1;T<q;){if(void 0!==(U=u[z=L[T+=1]]).default){var N=p+a.util.getProperty(z);if(a.compositeRule){if(a.opts.strictDefaults){g="default is ignored for: "+N;if("log"!==a.opts.strictDefaults)throw new Error(g);a.logger.warn(g)}}else r+=" if ("+N+" === undefined ","empty"==a.opts.useDefaults&&(r+=" || "+N+" === null || "+N+" === '' "),r+=" ) "+N+" = ",r+="shared"==a.opts.useDefaults?" "+a.useDefault(U.default)+" ":" "+JSON.stringify(U.default)+" ",r+="; "}}}else if("array"==_.type&&Array.isArray(a.schema.items)){var Q=a.schema.items;if(Q){j=-1;for(var U,V=Q.length-1;j<V;)if(void 0!==(U=Q[j+=1]).default){N=p+"["+j+"]";if(a.compositeRule){if(a.opts.strictDefaults){g="default is ignored for: "+N;if("log"!==a.opts.strictDefaults)throw new Error(g);a.logger.warn(g)}}else r+=" if ("+N+" === undefined ","empty"==a.opts.useDefaults&&(r+=" || "+N+" === null || "+N+" === '' "),r+=" ) "+N+" = ",r+="shared"==a.opts.useDefaults?" "+a.useDefault(U.default)+" ":" "+JSON.stringify(U.default)+" ",r+="; "}}}var H=_.rules;if(H)for(var K,M=-1,B=H.length-1;M<B;)if(Y(K=H[M+=1])){var J=K.code(a,K.keyword,_.type);J&&(r+=" "+J+" ",f&&(P+="}"))}if(f&&(r+=" "+P+" ",P=""),_.type&&(r+=" } ",w&&w===_.type&&!S)){var Z;h=a.schemaPath+".type",d=a.errSchemaPath+"/type";(Z=Z||[]).push(r+=" else { "),r="",!1!==a.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: { type: '",r+=b?""+w.join(","):""+w,r+="' } ",!1!==a.opts.messages&&(r+=" , message: 'should be ",r+=b?""+w.join(","):""+w,r+="' "),a.opts.verbose&&(r+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";v=r;r=Z.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}f&&(r+=" if (errors === ",r+=y?"0":"errs_"+l,r+=") { ",E+="}")}}function G(e){for(var r=e.rules,t=0;t<r.length;t++)if(Y(r[t]))return 1}function Y(e){return void 0!==a.schema[e.keyword]||e.implements&&function(e){for(var r=e.implements,t=0;t<r.length;t++)if(void 0!==a.schema[r[t]])return!0}(e)}return f&&(r+=" "+E+" "),y?(t?(r+=" if (errors === 0) return data; ",r+=" else throw new ValidationError(vErrors); "):(r+=" validate.errors = vErrors; ",r+=" return errors === 0; "),r+=" }; return validate;"):r+=" var "+m+" = errors === errs_"+l+";",r=a.util.cleanUpCode(r),y&&(r=a.util.finalCleanUpCode(r,t)),r}},{}],39:[function(e,r,t){"use strict";var i=/^[a-z_$][a-z0-9_$-]*$/i,l=e("./dotjs/custom"),s=e("./definition_schema");r.exports={add:function(e,r){var n=this.RULES;if(n.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!i.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(r){this.validateKeyword(r,!0);var t=r.type;if(Array.isArray(t))for(var a=0;a<t.length;a++)o(e,t[a],r);else o(e,t,r);var s=r.metaSchema;s&&(r.$data&&this._opts.$data&&(s={anyOf:[s,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]}),r.validateSchema=this.compile(s,!0))}function o(e,r,t){for(var a,s=0;s<n.length;s++){var o=n[s];if(o.type==r){a=o;break}}a||n.push(a={type:r,rules:[]});var i={keyword:e,definition:t,custom:!0,code:l,implements:t.implements};a.rules.push(i),n.custom[e]=i}return n.keywords[e]=n.all[e]=!0,this},get:function(e){var r=this.RULES.custom[e];return r?r.definition:this.RULES.keywords[e]||!1},remove:function(e){var r=this.RULES;delete r.keywords[e],delete r.all[e],delete r.custom[e];for(var t=0;t<r.length;t++)for(var a=r[t].rules,s=0;s<a.length;s++)if(a[s].keyword==e){a.splice(s,1);break}return this},validate:function e(r,t){e.errors=null;var a=this._validateKeyword=this._validateKeyword||this.compile(s,!0);if(a(r))return!0;e.errors=a.errors;{if(t)throw new Error("custom keyword definition is invalid: "+this.errorsText(a.errors));return!1}}}},{"./definition_schema":12,"./dotjs/custom":22}],40:[function(e,r,t){r.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}},{}],41:[function(e,r,t){r.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}},{}],42:[function(e,r,t){"use strict";r.exports=function e(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){if(r.constructor!==t.constructor)return!1;var a,s,o;if(Array.isArray(r)){if((a=r.length)!=t.length)return!1;for(s=a;0!=s--;)if(!e(r[s],t[s]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if((a=(o=Object.keys(r)).length)!==Object.keys(t).length)return!1;for(s=a;0!=s--;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=a;0!=s--;){var i=o[s];if(!e(r[i],t[i]))return!1}return!0}return r!=r&&t!=t}},{}],43:[function(e,r,t){"use strict";r.exports=function(e,r){"function"==typeof(r=r||{})&&(r={cmp:r});var a,l="boolean"==typeof r.cycles&&r.cycles,c=r.cmp&&(a=r.cmp,function(t){return function(e,r){return a({key:e,value:t[e]},{key:r,value:t[r]})}}),u=[];return function e(r){if(r&&r.toJSON&&"function"==typeof r.toJSON&&(r=r.toJSON()),void 0!==r){if("number"==typeof r)return isFinite(r)?""+r:"null";if("object"!=typeof r)return JSON.stringify(r);var t,a;if(Array.isArray(r)){for(a="[",t=0;t<r.length;t++)t&&(a+=","),a+=e(r[t])||"null";return a+"]"}if(null===r)return"null";if(-1!==u.indexOf(r)){if(l)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=u.push(r)-1,o=Object.keys(r).sort(c&&c(r));for(a="",t=0;t<o.length;t++){var i=o[t],n=e(r[i]);n&&(a&&(a+=","),a+=JSON.stringify(i)+":"+n)}return u.splice(s,1),"{"+a+"}"}}(e)}},{}],44:[function(e,r,t){"use strict";var m=r.exports=function(e,r,t){"function"==typeof r&&(t=r,r={}),function e(r,t,a,s,o,i,n,l,c,u){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in t(s,o,i,n,l,c,u),s){var d=s[h];if(Array.isArray(d)){if(h in m.arrayKeywords)for(var f=0;f<d.length;f++)e(r,t,a,d[f],o+"/"+h+"/"+f,i,o,h,s,f)}else if(h in m.propsKeywords){if(d&&"object"==typeof d)for(var p in d)e(r,t,a,d[p],o+"/"+h+"/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),i,o,h,s,p)}else(h in m.keywords||r.allKeys&&!(h in m.skipKeywords))&&e(r,t,a,d,o+"/"+h,i,o,h,s)}a(s,o,i,n,l,c,u)}}(r,"function"==typeof(t=r.cb||t)?t:t.pre||function(){},t.post||function(){},e,"",e)};m.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},m.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},m.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},m.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},{}],45:[function(e,r,t){var a;a=this,function(e){"use strict";function J(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(1<r.length){r[0]=r[0].slice(0,-1);for(var a=r.length-1,s=1;s<a;++s)r[s]=r[s].slice(1,-1);return r[a]=r[a].slice(1),r.join("")}return r[0]}function Z(e){return"(?:"+e+")"}function a(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function p(e){return e.toUpperCase()}function r(e){var r="[A-Za-z]",t="[0-9]",a=J(t,"[A-Fa-f]"),s=Z(Z("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+Z("%[89A-Fa-f]"+a+"%"+a+a)+"|"+Z("%"+a+a)),o="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",i=J("[\\:\\/\\?\\#\\[\\]\\@]",o),n=e?"[\\uE000-\\uF8FF]":"[]",l=J(r,t,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),c=Z(r+J(r,t,"[\\+\\-\\.]")+"*"),u=Z(Z(s+"|"+J(l,o,"[\\:]"))+"*"),h=(Z("(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9][0-9])|(?:[1-9][0-9])|"+t),Z("(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9][0-9])|(?:0?[1-9][0-9])|0?0?"+t)),d=Z(h+"\\."+h+"\\."+h+"\\."+h),f=Z(a+"{1,4}"),p=Z(Z(f+"\\:"+f)+"|"+d),m=Z(Z(f+"\\:")+"{6}"+p),v=Z("\\:\\:"+Z(f+"\\:")+"{5}"+p),y=Z(Z(f)+"?\\:\\:"+Z(f+"\\:")+"{4}"+p),g=Z(Z(Z(f+"\\:")+"{0,1}"+f)+"?\\:\\:"+Z(f+"\\:")+"{3}"+p),P=Z(Z(Z(f+"\\:")+"{0,2}"+f)+"?\\:\\:"+Z(f+"\\:")+"{2}"+p),E=Z(Z(Z(f+"\\:")+"{0,3}"+f)+"?\\:\\:"+f+"\\:"+p),w=Z(Z(Z(f+"\\:")+"{0,4}"+f)+"?\\:\\:"+p),b=Z(Z(Z(f+"\\:")+"{0,5}"+f)+"?\\:\\:"+f),S=Z(Z(Z(f+"\\:")+"{0,6}"+f)+"?\\:\\:"),_=Z([m,v,y,g,P,E,w,b,S].join("|")),F=Z(Z(l+"|"+s)+"+"),x=(Z(_+"\\%25"+F),Z(_+Z("\\%25|\\%(?!"+a+"{2})")+F)),$=Z("[vV]"+a+"+\\."+J(l,o,"[\\:]")+"+"),R=Z("\\["+Z(x+"|"+_+"|"+$)+"\\]"),D=Z(Z(s+"|"+J(l,o))+"*"),j=Z(R+"|"+d+"(?!"+D+")|"+D),O=Z(t+"*"),I=Z(Z(u+"@")+"?"+j+Z("\\:"+O)+"?"),A=Z(s+"|"+J(l,o,"[\\:\\@]")),C=Z(A+"*"),k=Z(A+"+"),L=Z(Z(s+"|"+J(l,o,"[\\@]"))+"+"),z=Z(Z("\\/"+C)+"*"),T=Z("\\/"+Z(k+z)+"?"),q=Z(L+z),N=Z(k+z),Q="(?!"+A+")",U=(Z(z+"|"+T+"|"+q+"|"+N+"|"+Q),Z(Z(A+"|"+J("[\\/\\?]",n))+"*")),V=Z(Z(A+"|[\\/\\?]")+"*"),H=Z(Z("\\/\\/"+I+z)+"|"+T+"|"+N+"|"+Q),K=Z(c+"\\:"+H+Z("\\?"+U)+"?"+Z("\\#"+V)+"?"),M=Z(Z("\\/\\/"+I+z)+"|"+T+"|"+q+"|"+Q),B=Z(M+Z("\\?"+U)+"?"+Z("\\#"+V)+"?");Z(K+"|"+B),Z(c+"\\:"+H+Z("\\?"+U)+"?"),Z(Z("\\/\\/("+Z("("+u+")@")+"?("+j+")"+Z("\\:("+O+")")+"?)")+"?("+z+"|"+T+"|"+N+"|"+Q+")"),Z("\\?("+U+")"),Z("\\#("+V+")"),Z(Z("\\/\\/("+Z("("+u+")@")+"?("+j+")"+Z("\\:("+O+")")+"?)")+"?("+z+"|"+T+"|"+q+"|"+Q+")"),Z("\\?("+U+")"),Z("\\#("+V+")"),Z(Z("\\/\\/("+Z("("+u+")@")+"?("+j+")"+Z("\\:("+O+")")+"?)")+"?("+z+"|"+T+"|"+N+"|"+Q+")"),Z("\\?("+U+")"),Z("\\#("+V+")"),Z("("+u+")@"),Z("\\:("+O+")");return{NOT_SCHEME:new RegExp(J("[^]",r,t,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(J("[^\\%\\:]",l,o),"g"),NOT_HOST:new RegExp(J("[^\\%\\[\\]\\:]",l,o),"g"),NOT_PATH:new RegExp(J("[^\\%\\/\\:\\@]",l,o),"g"),NOT_PATH_NOSCHEME:new RegExp(J("[^\\%\\/\\@]",l,o),"g"),NOT_QUERY:new RegExp(J("[^\\%]",l,o,"[\\:\\@\\/\\?]",n),"g"),NOT_FRAGMENT:new RegExp(J("[^\\%]",l,o,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(J("[^]",l,o),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(J("[^\\%]",l,i),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+d+")$"),IPV6ADDRESS:new RegExp("^\\[?("+_+")"+Z(Z("\\%25|\\%(?!"+a+"{2})")+"("+F+")")+"?\\]?$")}}var u=r(!1),h=r(!0),w=function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,r){var t=[],a=!0,s=!1,o=void 0;try{for(var i,n=e[Symbol.iterator]();!(a=(i=n.next()).done)&&(t.push(i.value),!r||t.length!==r);a=!0);}catch(e){s=!0,o=e}finally{try{!a&&n.return&&n.return()}finally{if(s)throw o}}return t}(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")},A=2147483647,t=/^xn--/,s=/[^\0-\x7E]/,o=/[\x2E\u3002\uFF0E\uFF61]/g,i={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=Math.floor,k=String.fromCharCode;function L(e){throw new RangeError(i[e])}function n(e,r){var t=e.split("@"),a="";return 1<t.length&&(a=t[0]+"@",e=t[1]),a+function(e,r){for(var t=[],a=e.length;a--;)t[a]=r(e[a]);return t}((e=e.replace(o,".")).split("."),r).join(".")}function z(e){for(var r=[],t=0,a=e.length;t<a;){var s=e.charCodeAt(t++);if(55296<=s&&s<=56319&&t<a){var o=e.charCodeAt(t++);56320==(64512&o)?r.push(((1023&s)<<10)+(1023&o)+65536):(r.push(s),t--)}else r.push(s)}return r}function T(e,r){return e+22+75*(e<26)-((0!=r)<<5)}function q(e,r,t){var a=0;for(e=t?C(e/700):e>>1,e+=C(e/r);455<e;a+=36)e=C(e/35);return C(a+36*e/(e+38))}function l(e){var r,t=[],a=e.length,s=0,o=128,i=72,n=e.lastIndexOf("-");n<0&&(n=0);for(var l=0;l<n;++l)128<=e.charCodeAt(l)&&L("not-basic"),t.push(e.charCodeAt(l));for(var c=0<n?n+1:0;c<a;){for(var u=s,h=1,d=36;;d+=36){a<=c&&L("invalid-input");var f=(r=e.charCodeAt(c++))-48<10?r-22:r-65<26?r-65:r-97<26?r-97:36;(36<=f||f>C((A-s)/h))&&L("overflow"),s+=f*h;var p=d<=i?1:i+26<=d?26:d-i;if(f<p)break;var m=36-p;h>C(A/m)&&L("overflow"),h*=m}var v=t.length+1;i=q(s-u,v,0==u),C(s/v)>A-o&&L("overflow"),o+=C(s/v),s%=v,t.splice(s++,0,o)}return String.fromCodePoint.apply(String,t)}function c(e){var r=[],t=(e=z(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var c,u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var h=c.value;h<128&&r.push(k(h))}}catch(e){n=!0,l=e}finally{try{!i&&u.return&&u.return()}finally{if(n)throw l}}var d=r.length,f=d;for(d&&r.push("-");f<t;){var p=A,m=!0,v=!1,y=void 0;try{for(var g,P=e[Symbol.iterator]();!(m=(g=P.next()).done);m=!0){var E=g.value;a<=E&&E<p&&(p=E)}}catch(e){v=!0,y=e}finally{try{!m&&P.return&&P.return()}finally{if(v)throw y}}var w=f+1;p-a>C((A-s)/w)&&L("overflow"),s+=(p-a)*w,a=p;var b=!0,S=!1,_=void 0;try{for(var F,x=e[Symbol.iterator]();!(b=(F=x.next()).done);b=!0){var $=F.value;if($<a&&++s>A&&L("overflow"),$==a){for(var R=s,D=36;;D+=36){var j=D<=o?1:o+26<=D?26:D-o;if(R<j)break;var O=R-j,I=36-j;r.push(k(T(j+O%I,0))),R=C(O/I)}r.push(k(T(R,0))),o=q(s,w,f==d),s=0,++f}}}catch(e){S=!0,_=e}finally{try{!b&&x.return&&x.return()}finally{if(S)throw _}}++s,++a}return r.join("")}var v={version:"2.1.0",ucs2:{decode:z,encode:function(e){return String.fromCodePoint.apply(String,function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)}(e))}},decode:l,encode:c,toASCII:function(e){return n(e,function(e){return s.test(e)?"xn--"+c(e):e})},toUnicode:function(e){return n(e,function(e){return t.test(e)?l(e.slice(4).toLowerCase()):e})}},d={};function m(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function f(e){for(var r="",t=0,a=e.length;t<a;){var s=parseInt(e.substr(t+1,2),16);if(s<128)r+=String.fromCharCode(s),t+=3;else if(194<=s&&s<224){if(6<=a-t){var o=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&s)<<6|63&o)}else r+=e.substr(t,6);t+=6}else if(224<=s){if(9<=a-t){var i=parseInt(e.substr(t+4,2),16),n=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&s)<<12|(63&i)<<6|63&n)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function y(e,t){function r(e){var r=f(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,m).replace(t.PCT_ENCODED,p)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,m).replace(t.PCT_ENCODED,p)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,m).replace(t.PCT_ENCODED,p)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,m).replace(t.PCT_ENCODED,p)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,m).replace(t.PCT_ENCODED,p)),e}function b(e){return e.replace(/^0*(.*)/,"$1")||"0"}function S(e,r){var t=e.match(r.IPV4ADDRESS)||[],a=w(t,2)[1];return a?a.split(".").map(b).join("."):e}function g(e,r){var t=e.match(r.IPV6ADDRESS)||[],a=w(t,3),s=a[1],o=a[2];if(s){for(var i=s.toLowerCase().split("::").reverse(),n=w(i,2),l=n[0],c=n[1],u=c?c.split(":").map(b):[],h=l.split(":").map(b),d=r.IPV4ADDRESS.test(h[h.length-1]),f=d?7:8,p=h.length-f,m=Array(f),v=0;v<f;++v)m[v]=u[v]||h[p+v]||"";d&&(m[f-1]=S(m[f-1],r));var y=m.reduce(function(e,r,t){if(!r||"0"===r){var a=e[e.length-1];a&&a.index+a.length===t?a.length++:e.push({index:t,length:1})}return e},[]).sort(function(e,r){return r.length-e.length})[0],g=void 0;if(y&&1<y.length){var P=m.slice(0,y.index),E=m.slice(y.index+y.length);g=P.join(":")+"::"+E.join(":")}else g=m.join(":");return o&&(g+="%"+o),g}return e}var P=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,E=void 0==="".match(/(){0}/)[1];function _(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t={},a=!1!==r.iri?h:u;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var s=e.match(P);if(s){E?(t.scheme=s[1],t.userinfo=s[3],t.host=s[4],t.port=parseInt(s[5],10),t.path=s[6]||"",t.query=s[7],t.fragment=s[8],isNaN(t.port)&&(t.port=s[5])):(t.scheme=s[1]||void 0,t.userinfo=-1!==e.indexOf("@")?s[3]:void 0,t.host=-1!==e.indexOf("//")?s[4]:void 0,t.port=parseInt(s[5],10),t.path=s[6]||"",t.query=-1!==e.indexOf("?")?s[7]:void 0,t.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),t.host&&(t.host=g(S(t.host,a),a)),t.reference=void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?"relative":void 0===t.fragment?"absolute":"uri":"same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var o=d[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||o&&o.unicodeSupport)y(t,a);else{if(t.host&&(r.domainHost||o&&o.domainHost))try{t.host=v.toASCII(t.host.replace(a.PCT_ENCODED,f).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}y(t,u)}o&&o.parse&&o.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}var F=/^\.\.?\//,x=/^\/\.(\/|$)/,$=/^\/\.\.(\/|$)/,R=/^\/?(?:.|\n)*?(?=\/|$)/;function D(e){for(var r=[];e.length;)if(e.match(F))e=e.replace(F,"");else if(e.match(x))e=e.replace(x,"/");else if(e.match($))e=e.replace($,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(R);if(!t)throw new Error("Unexpected dot segment condition");var a=t[0];e=e.slice(a.length),r.push(a)}return r.join("")}function j(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.iri?h:u,a=[],s=d[(t.scheme||r.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(r,t),r.host&&!e.IPV6ADDRESS.test(r.host)&&(t.domainHost||s&&s.domainHost))try{r.host=t.iri?v.toUnicode(r.host):v.toASCII(r.host.replace(e.PCT_ENCODED,f).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}y(r,e),"suffix"!==t.reference&&r.scheme&&(a.push(r.scheme),a.push(":"));var o,i,n,l=(i=!1!==t.iri?h:u,n=[],void 0!==(o=r).userinfo&&(n.push(o.userinfo),n.push("@")),void 0!==o.host&&n.push(g(S(String(o.host),i),i).replace(i.IPV6ADDRESS,function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"})),"number"==typeof o.port&&(n.push(":"),n.push(o.port.toString(10))),n.length?n.join(""):void 0);if(void 0!==l&&("suffix"!==t.reference&&a.push("//"),a.push(l),r.path&&"/"!==r.path.charAt(0)&&a.push("/")),void 0!==r.path){var c=r.path;t.absolutePath||s&&s.absolutePath||(c=D(c)),void 0===l&&(c=c.replace(/^\/\//,"/%2F")),a.push(c)}return void 0!==r.query&&(a.push("?"),a.push(r.query)),void 0!==r.fragment&&(a.push("#"),a.push(r.fragment)),a.join("")}function O(e,r){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=_(j(e,t),t),r=_(j(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(a.scheme=r.scheme,a.userinfo=r.userinfo,a.host=r.host,a.port=r.port,a.path=D(r.path||""),a.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(a.userinfo=r.userinfo,a.host=r.host,a.port=r.port,a.path=D(r.path||""),a.query=r.query):(r.path?("/"===r.path.charAt(0)?a.path=D(r.path):(a.path=void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:r.path:"/"+r.path,a.path=D(a.path)),a.query=r.query):(a.path=e.path,a.query=void 0!==r.query?r.query:e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=r.fragment,a}function I(e,r){return e&&e.toString().replace(r&&r.iri?h.PCT_ENCODED:u.PCT_ENCODED,f)}var N={scheme:"http",domainHost:!0,parse:function(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},Q={scheme:"https",domainHost:N.domainHost,parse:N.parse,serialize:N.serialize},U={},V="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",H="[0-9A-Fa-f]",K=(Z(Z("%[EFef]"+H+"%"+H+H+"%"+H+H)+"|"+Z("%[89A-Fa-f]"+H+"%"+H+H)+"|"+Z("%"+H+H)),J("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]')),M=new RegExp(V,"g"),B=new RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),G=new RegExp(J("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',K),"g"),Y=new RegExp(J("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),W=Y;function X(e){var r=f(e);return r.match(M)?r:e}var ee={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n<l;++n){var c=i[n].split("=");switch(c[0]){case"to":for(var u=c[1].split(","),h=0,d=u.length;h<d;++h)a.push(u[h]);break;case"subject":t.subject=I(c[1],r);break;case"body":t.body=I(c[1],r);break;default:s=!0,o[I(c[0],r)]=I(c[1],r)}}s&&(t.headers=o)}t.query=void 0;for(var f=0,p=a.length;f<p;++f){var m=a[f].split("@");if(m[0]=I(m[0]),r.unicodeSupport)m[1]=I(m[1],r).toLowerCase();else try{m[1]=v.toASCII(I(m[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}a[f]=m.join("@")}return t},serialize:function(e,r){var t,a=e,s=null!=(t=e.to)?t instanceof Array?t:"number"!=typeof t.length||t.split||t.setInterval||t.call?[t]:Array.prototype.slice.call(t):[];if(s){for(var o=0,i=s.length;o<i;++o){var n=String(s[o]),l=n.lastIndexOf("@"),c=n.slice(0,l).replace(B,X).replace(B,p).replace(G,m),u=n.slice(l+1);try{u=r.iri?v.toUnicode(u):v.toASCII(I(u,r).toLowerCase())}catch(e){a.error=a.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}s[o]=c+"@"+u}a.path=s.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var d=[];for(var f in h)h[f]!==U[f]&&d.push(f.replace(B,X).replace(B,p).replace(Y,m)+"="+h[f].replace(B,X).replace(B,p).replace(W,m));return d.length&&(a.query=d.join("&")),a}},re=/^([^\:]+)\:(.*)/,te={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(re),a=e;if(t){var s=r.scheme||a.scheme||"urn",o=t[1].toLowerCase(),i=t[2],n=d[s+":"+(r.nid||o)];a.nid=o,a.nss=i,a.path=void 0,n&&(a=n.parse(a,r))}else a.error=a.error||"URN can not be parsed.";return a},serialize:function(e,r){var t=e.nid,a=d[(r.scheme||e.scheme||"urn")+":"+(r.nid||t)];a&&(e=a.serialize(e,r));var s=e;return s.path=(t||r.nid)+":"+e.nss,s}},ae=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,se={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(ae)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};d[N.scheme]=N,d[Q.scheme]=Q,d[ee.scheme]=ee,d[te.scheme]=te,d[se.scheme]=se,e.SCHEMES=d,e.pctEncChar=m,e.pctDecChars=f,e.parse=_,e.removeDotSegments=D,e.serialize=j,e.resolveComponents=O,e.resolve=function(e,r,t){var a=function(e,r){var t=e;if(r)for(var a in r)t[a]=r[a];return t}({scheme:"null"},t);return j(O(_(e,a),_(r,a),a,!0),a)},e.normalize=function(e,r){return"string"==typeof e?e=j(_(e,r),r):"object"===a(e)&&(e=_(j(e,r),r)),e},e.equal=function(e,r,t){return"string"==typeof e?e=j(_(e,t),t):"object"===a(e)&&(e=j(e,t)),"string"==typeof r?r=j(_(r,t),t):"object"===a(r)&&(r=j(r,t)),e===r},e.escapeComponent=function(e,r){return e&&e.toString().replace(r&&r.iri?h.ESCAPE:u.ESCAPE,m)},e.unescapeComponent=I,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof t&&void 0!==r?t:a.URI=a.URI||{})},{}],ajv:[function(a,e,r){"use strict";var n=a("./compile"),d=a("./compile/resolve"),t=a("./cache"),f=a("./compile/schema_obj"),s=a("fast-json-stable-stringify"),o=a("./compile/formats"),i=a("./compile/rules"),l=a("./data"),c=a("./compile/util");(e.exports=y).prototype.validate=function(e,r){var t;if("string"==typeof e){if(!(t=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);t=a.validate||this._compile(a)}var s=t(r);!0!==t.$async&&(this.errors=t.errors);return s},y.prototype.compile=function(e,r){var t=this._addSchema(e,void 0,r);return t.validate||this._compile(t)},y.prototype.addSchema=function(e,r,t,a){if(Array.isArray(e)){for(var s=0;s<e.length;s++)this.addSchema(e[s],void 0,t,a);return this}var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");return S(this,r=d.normalizeId(r||o)),this._schemas[r]=this._addSchema(e,t,a,!0),this},y.prototype.addMetaSchema=function(e,r,t){return this.addSchema(e,r,t,!0),this},y.prototype.validateSchema=function(e,r){var t=e.$schema;if(void 0!==t&&"string"!=typeof t)throw new Error("$schema must be a string");if(!(t=t||this._opts.defaultMeta||function(e){var r=e._opts.meta;return e._opts.defaultMeta="object"==typeof r?e._getId(r)||r:e.getSchema(p)?p:void 0,e._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),!(this.errors=null);var a=this.validate(t,e);if(!a&&r){var s="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(s);this.logger.error(s)}return a},y.prototype.getSchema=function(e){var r=g(this,e);switch(typeof r){case"object":return r.validate||this._compile(r);case"string":return this.getSchema(r);case"undefined":return function(e,r){var t=d.schema.call(e,{schema:{}},r);if(t){var a=t.schema,s=t.root,o=t.baseId,i=n.call(e,a,s,void 0,o);return e._fragments[r]=new f({ref:r,fragment:!0,schema:a,root:s,baseId:o,validate:i}),i}}(this,e)}},y.prototype.removeSchema=function(e){if(e instanceof RegExp)return P(this,this._schemas,e),P(this,this._refs,e),this;switch(typeof e){case"undefined":return P(this,this._schemas),P(this,this._refs),this._cache.clear(),this;case"string":var r=g(this,e);return r&&this._cache.del(r.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var t=this._opts.serialize,a=t?t(e):e;this._cache.del(a);var s=this._getId(e);s&&(s=d.normalizeId(s),delete this._schemas[s],delete this._refs[s])}return this},y.prototype.addFormat=function(e,r){"string"==typeof r&&(r=new RegExp(r));return this._formats[e]=r,this},y.prototype.errorsText=function(e,r){if(!(e=e||this.errors))return"No errors";for(var t=void 0===(r=r||{}).separator?", ":r.separator,a=void 0===r.dataVar?"data":r.dataVar,s="",o=0;o<e.length;o++){var i=e[o];i&&(s+=a+i.dataPath+" "+i.message+t)}return s.slice(0,-t.length)},y.prototype._addSchema=function(e,r,t,a){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var s=this._opts.serialize,o=s?s(e):e,i=this._cache.get(o);if(i)return i;a=a||!1!==this._opts.addUsedSchema;var n=d.normalizeId(this._getId(e));n&&a&&S(this,n);var l,c=!1!==this._opts.validateSchema&&!r;c&&!(l=n&&n==d.normalizeId(e.$schema))&&this.validateSchema(e,!0);var u=d.ids.call(this,e),h=new f({id:n,schema:e,localRefs:u,cacheKey:o,meta:t});"#"!=n[0]&&a&&(this._refs[n]=h);this._cache.put(o,h),c&&l&&this.validateSchema(e,!0);return h},y.prototype._compile=function(t,e){if(t.compiling)return(t.validate=s).schema=t.schema,s.errors=null,s.root=e||s,!0===t.schema.$async&&(s.$async=!0),s;var r,a;t.compiling=!0,t.meta&&(r=this._opts,this._opts=this._metaOpts);try{a=n.call(this,t.schema,e,t.localRefs)}catch(e){throw delete t.validate,e}finally{t.compiling=!1,t.meta&&(this._opts=r)}return t.validate=a,t.refs=a.refs,t.refVal=a.refVal,t.root=a.root,a;function s(){var e=t.validate,r=e.apply(this,arguments);return s.errors=e.errors,r}},y.prototype.compileAsync=a("./compile/async");var u=a("./keyword");y.prototype.addKeyword=u.add,y.prototype.getKeyword=u.get,y.prototype.removeKeyword=u.remove,y.prototype.validateKeyword=u.validate;var h=a("./compile/error_classes");y.ValidationError=h.Validation,y.MissingRefError=h.MissingRef,y.$dataMetaSchema=l;var p="http://json-schema.org/draft-07/schema",m=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],v=["/properties"];function y(e){if(!(this instanceof y))return new y(e);e=this._opts=c.copy(e)||{},function(e){var r=e._opts.logger;if(!1===r)e.logger={log:_,warn:_,error:_};else{if(void 0===r&&(r=console),!("object"==typeof r&&r.log&&r.warn&&r.error))throw new Error("logger must implement log, warn and error methods");e.logger=r}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=o(e.format),this._cache=e.cache||new t,this._loadingSchemas={},this._compilations=[],this.RULES=i(),this._getId=function(e){switch(e.schemaId){case"auto":return b;case"id":return E;default:return w}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=s),this._metaOpts=function(e){for(var r=c.copy(e._opts),t=0;t<m.length;t++)delete r[m[t]];return r}(this),e.formats&&function(e){for(var r in e._opts.formats){e.addFormat(r,e._opts.formats[r])}}(this),e.keywords&&function(e){for(var r in e._opts.keywords){e.addKeyword(r,e._opts.keywords[r])}}(this),function(e){var r;e._opts.$data&&(r=a("./refs/data.json"),e.addMetaSchema(r,r.$id,!0));if(!1===e._opts.meta)return;var t=a("./refs/json-schema-draft-07.json");e._opts.$data&&(t=l(t,v));e.addMetaSchema(t,p,!0),e._refs["http://json-schema.org/schema"]=p}(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function(e){var r=e._opts.schemas;if(!r)return;if(Array.isArray(r))e.addSchema(r);else for(var t in r)e.addSchema(r[t],t)}(this)}function g(e,r){return r=d.normalizeId(r),e._schemas[r]||e._refs[r]||e._fragments[r]}function P(e,r,t){for(var a in r){var s=r[a];s.meta||t&&!t.test(a)||(e._cache.del(s.cacheKey),delete r[a])}}function E(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function w(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function b(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function S(e,r){if(e._schemas[r]||e._refs[r])throw new Error('schema with key or id "'+r+'" already exists')}function _(){}},{"./cache":1,"./compile":5,"./compile/async":2,"./compile/error_classes":3,"./compile/formats":4,"./compile/resolve":6,"./compile/rules":7,"./compile/schema_obj":8,"./compile/util":10,"./data":11,"./keyword":39,"./refs/data.json":40,"./refs/json-schema-draft-07.json":41,"fast-json-stable-stringify":43}]},{},[])("ajv")});
+/* ajv 6.12.2: Another JSON Schema Validator */
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Ajv=e()}}(function(){return function o(i,n,l){function c(r,e){if(!n[r]){if(!i[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(u)return u(r,!0);var a=new Error("Cannot find module '"+r+"'");throw a.code="MODULE_NOT_FOUND",a}var s=n[r]={exports:{}};i[r][0].call(s.exports,function(e){return c(i[r][1][e]||e)},s,s.exports,o,i,n,l)}return n[r].exports}for(var u="function"==typeof require&&require,e=0;e<l.length;e++)c(l[e]);return c}({1:[function(e,r,t){"use strict";var a=r.exports=function(){this._cache={}};a.prototype.put=function(e,r){this._cache[e]=r},a.prototype.get=function(e){return this._cache[e]},a.prototype.del=function(e){delete this._cache[e]},a.prototype.clear=function(){this._cache={}}},{}],2:[function(e,r,t){"use strict";var a=e("./error_classes").MissingRef;function s(r,n,t){var l=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof n&&(t=n,n=void 0);var e=c(r).then(function(){var e=l._addSchema(r,void 0,n);return e.validate||function o(i){try{return l._compile(i)}catch(e){if(e instanceof a)return r(e);throw e}function r(e){var r=e.missingSchema;if(s(r))throw new Error("Schema "+r+" is loaded but "+e.missingRef+" cannot be resolved");var t=l._loadingSchemas[r];return t||(t=l._loadingSchemas[r]=l._opts.loadSchema(r)).then(a,a),t.then(function(e){if(!s(r))return c(e).then(function(){s(r)||l.addSchema(e,r,void 0,n)})}).then(function(){return o(i)});function a(){delete l._loadingSchemas[r]}function s(e){return l._refs[e]||l._schemas[e]}}}(e)});return t&&e.then(function(e){t(null,e)},t),e;function c(e){var r=e.$schema;return r&&!l.getSchema(r)?s.call(l,{$ref:r},!0):Promise.resolve()}}r.exports=s},{"./error_classes":3}],3:[function(e,r,t){"use strict";var a=e("./resolve");function s(e,r,t){this.message=t||s.message(e,r),this.missingRef=a.url(e,r),this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e}r.exports={Validation:o(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:o(s)},s.message=function(e,r){return"can't resolve reference "+r+" from id "+e}},{"./resolve":6}],4:[function(e,r,t){"use strict";var a=e("./util"),o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31],n=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,s=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,l=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,c=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,f=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return a.copy(m[e="full"==e?"full":"fast"])}function v(e){var r=e.match(o);if(!r)return!1;var t,a=+r[2],s=+r[3];return 1<=a&&a<=12&&1<=s&&s<=(2!=a||((t=+r[1])%4!=0||t%100==0&&t%400!=0)?i[a]:29)}function y(e,r){var t=e.match(n);if(!t)return!1;var a=t[1],s=t[2],o=t[3];return(a<=23&&s<=59&&o<=59||23==a&&59==s&&60==o)&&(!r||t[5])}(r.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":f,"relative-json-pointer":p},m.full={date:v,time:y,"date-time":function(e){var r=e.split(g);return 2==r.length&&v(r[0])&&y(r[1],!0)},uri:function(e){return P.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":f,"relative-json-pointer":p};var g=/t|\s/i;var P=/\/|:/;var E=/[^\\]\\Z/;function w(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){"use strict";var $=e("./resolve"),R=e("./util"),D=e("./error_classes"),j=e("fast-json-stable-stringify"),O=e("../dotjs/validate"),I=R.ucs2length,A=e("fast-deep-equal"),C=D.Validation;function k(e,c,u,r){var d=this,f=this._opts,h=[void 0],p={},l=[],t={},m=[],a={},v=[],s=function(e,r,t){var a=L.call(this,e,r,t);return 0<=a?{index:a,compiling:!0}:{index:a=this._compilations.length,compiling:!(this._compilations[a]={schema:e,root:r,baseId:t})}}.call(this,e,c=c||{schema:e,refVal:h,refs:p},r),o=this._compilations[s.index];if(s.compiling)return o.callValidate=P;var y=this._formats,g=this.RULES;try{var i=E(e,c,u,r);o.validate=i;var n=o.callValidate;return n&&(n.schema=i.schema,n.errors=null,n.refs=i.refs,n.refVal=i.refVal,n.root=i.root,n.$async=i.$async,f.sourceCode&&(n.source=i.source)),i}finally{(function(e,r,t){var a=L.call(this,e,r,t);0<=a&&this._compilations.splice(a,1)}).call(this,e,c,r)}function P(){var e=o.validate,r=e.apply(this,arguments);return P.errors=e.errors,r}function E(e,r,t,a){var s=!r||r&&r.schema==e;if(r.schema!=c.schema)return k.call(d,e,r,t,a);var o,i=!0===e.$async,n=O({isTop:!0,schema:e,isRoot:s,baseId:a,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:D.MissingRef,RULES:g,validate:O,util:R,resolve:$,resolveRef:w,usePattern:_,useDefault:F,useCustomRule:x,opts:f,formats:y,logger:d.logger,self:d});n=Q(h,q)+Q(l,z)+Q(m,T)+Q(v,N)+n,f.processCode&&(n=f.processCode(n));try{o=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",n)(d,g,y,c,h,m,v,A,I,C),h[0]=o}catch(e){throw d.logger.error("Error compiling schema, function code:",n),e}return o.schema=e,o.errors=null,o.refs=p,o.refVal=h,o.root=s?o:r,i&&(o.$async=!0),!0===f.sourceCode&&(o.source={code:n,patterns:l,defaults:m}),o}function w(e,r,t){r=$.url(e,r);var a,s,o=p[r];if(void 0!==o)return S(a=h[o],s="refVal["+o+"]");if(!t&&c.refs){var i=c.refs[r];if(void 0!==i)return S(a=c.refVal[i],s=b(r,a))}s=b(r);var n=$.call(d,E,c,r);if(void 0===n){var l=u&&u[r];l&&(n=$.inlineRef(l,f.inlineRefs)?l:k.call(d,l,c,u,e))}if(void 0!==n)return h[p[r]]=n,S(n,s);delete p[r]}function b(e,r){var t=h.length;return h[t]=r,"refVal"+(p[e]=t)}function S(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&!!e.$async}}function _(e){var r=t[e];return void 0===r&&(r=t[e]=l.length,l[r]=e),"pattern"+r}function F(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return R.toQuotedString(e);case"object":if(null===e)return"null";var r=j(e),t=a[r];return void 0===t&&(t=a[r]=m.length,m[t]=e),"default"+t}}function x(e,r,t,a){if(!1!==d._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(t,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));var o=e.definition.validateSchema;if(o)if(!o(r)){var i="keyword schema is invalid: "+d.errorsText(o.errors);if("log"!=d._opts.validateSchema)throw new Error(i);d.logger.error(i)}}var n,l=e.definition.compile,c=e.definition.inline,u=e.definition.macro;if(l)n=l.call(d,r,t,a);else if(u)n=u.call(d,r,t,a),!1!==f.validateSchema&&d.validateSchema(n,!0);else if(c)n=c.call(d,a,e.keyword,r,t);else if(!(n=e.definition.validate))return;if(void 0===n)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=v.length;return{code:"customRule"+h,validate:v[h]=n}}}function L(e,r,t){for(var a=0;a<this._compilations.length;a++){var s=this._compilations[a];if(s.schema==e&&s.root==r&&s.baseId==t)return a}return-1}function z(e,r){return"var pattern"+e+" = new RegExp("+R.toQuotedString(r[e])+");"}function T(e){return"var default"+e+" = defaults["+e+"];"}function q(e,r){return void 0===r[e]?"":"var refVal"+e+" = refVal["+e+"];"}function N(e){return"var customRule"+e+" = customRules["+e+"];"}function Q(e,r){if(!e.length)return"";for(var t="",a=0;a<e.length;a++)t+=r(a,e);return t}r.exports=k},{"../dotjs/validate":38,"./error_classes":3,"./resolve":6,"./util":10,"fast-deep-equal":42,"fast-json-stable-stringify":43}],6:[function(e,r,t){"use strict";var m=e("uri-js"),v=e("fast-deep-equal"),y=e("./util"),l=e("./schema_obj"),a=e("json-schema-traverse");function c(e,r,t){var a=this._refs[t];if("string"==typeof a){if(!this._refs[a])return c.call(this,e,r,a);a=this._refs[a]}if((a=a||this._schemas[t])instanceof l)return d(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var s,o,i,n=u.call(this,r,t);return n&&(s=n.schema,r=n.root,i=n.baseId),s instanceof l?o=s.validate||e.call(this,s.schema,r,void 0,i):void 0!==s&&(o=d(s,this._opts.inlineRefs)?s:e.call(this,s,r,void 0,i)),o}function u(e,r){var t=m.parse(r),a=f(t),s=g(this._getId(e.schema));if(0===Object.keys(e.schema).length||a!==s){var o=P(a),i=this._refs[o];if("string"==typeof i)return function(e,r,t){var a=u.call(this,e,r);if(a){var s=a.schema,o=a.baseId;e=a.root;var i=this._getId(s);return i&&(o=p(o,i)),n.call(this,t,o,s,e)}}.call(this,e,i,t);if(i instanceof l)i.validate||this._compile(i),e=i;else{if(!((i=this._schemas[o])instanceof l))return;if(i.validate||this._compile(i),o==P(r))return{schema:i,root:e,baseId:s};e=i}if(!e.schema)return;s=g(this._getId(e.schema))}return n.call(this,t,s,e.schema,e)}(r.exports=c).normalizeId=P,c.fullPath=g,c.url=p,c.ids=function(e){var r=P(this._getId(e)),h={"":r},d={"":g(r,!1)},f={},p=this;return a(e,{allKeys:!0},function(e,r,t,a,s,o,i){if(""!==r){var n=p._getId(e),l=h[a],c=d[a]+"/"+s;if(void 0!==i&&(c+="/"+("number"==typeof i?i:y.escapeFragment(i))),"string"==typeof n){n=l=P(l?m.resolve(l,n):n);var u=p._refs[n];if("string"==typeof u&&(u=p._refs[u]),u&&u.schema){if(!v(e,u.schema))throw new Error('id "'+n+'" resolves to more than one schema')}else if(n!=P(c))if("#"==n[0]){if(f[n]&&!v(e,f[n]))throw new Error('id "'+n+'" resolves to more than one schema');f[n]=e}else p._refs[n]=c}h[r]=l,d[r]=c}}),f},c.inlineRef=d,c.schema=u;var h=y.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function n(e,r,t,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var s=e.fragment.split("/"),o=1;o<s.length;o++){var i=s[o];if(i){if(void 0===(t=t[i=y.unescapeFragment(i)]))break;var n;if(!h[i]&&((n=this._getId(t))&&(r=p(r,n)),t.$ref)){var l=p(r,t.$ref),c=u.call(this,a,l);c&&(t=c.schema,a=c.root,r=c.baseId)}}}return void 0!==t&&t!==a.schema?{schema:t,root:a,baseId:r}:void 0}}var i=y.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function d(e,r){return!1!==r&&(void 0===r||!0===r?function e(r){var t;if(Array.isArray(r)){for(var a=0;a<r.length;a++)if("object"==typeof(t=r[a])&&!e(t))return!1}else for(var s in r){if("$ref"==s)return!1;if("object"==typeof(t=r[s])&&!e(t))return!1}return!0}(e):r?function e(r){var t,a=0;if(Array.isArray(r)){for(var s=0;s<r.length;s++)if("object"==typeof(t=r[s])&&(a+=e(t)),a==1/0)return 1/0}else for(var o in r){if("$ref"==o)return 1/0;if(i[o])a++;else if("object"==typeof(t=r[o])&&(a+=e(t)+1),a==1/0)return 1/0}return a}(e)<=r:void 0)}function g(e,r){return!1!==r&&(e=P(e)),f(m.parse(e))}function f(e){return m.serialize(e).split("#")[0]+"#"}var s=/#\/?$/;function P(e){return e?e.replace(s,""):""}function p(e,r){return r=P(r),m.resolve(e,r)}},{"./schema_obj":8,"./util":10,"fast-deep-equal":42,"json-schema-traverse":44,"uri-js":45}],7:[function(e,r,t){"use strict";var o=e("../dotjs"),i=e("./util").toHash;r.exports=function(){var a=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],s=["type","$comment"];return a.all=i(s),a.types=i(["number","integer","string","array","object","boolean","null"]),a.forEach(function(e){e.rules=e.rules.map(function(e){var r;if("object"==typeof e){var t=Object.keys(e)[0];r=e[t],e=t,r.forEach(function(e){s.push(e),a.all[e]=!0})}return s.push(e),a.all[e]={keyword:e,code:o[e],implements:r}}),a.all.$comment={keyword:"$comment",code:o.$comment},e.type&&(a.types[e.type]=e)}),a.keywords=i(s.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),a.custom={},a}},{"../dotjs":27,"./util":10}],8:[function(e,r,t){"use strict";var a=e("./util");r.exports=function(e){a.copy(e,this)}},{"./util":10}],9:[function(e,r,t){"use strict";r.exports=function(e){for(var r,t=0,a=e.length,s=0;s<a;)t++,55296<=(r=e.charCodeAt(s++))&&r<=56319&&s<a&&56320==(64512&(r=e.charCodeAt(s)))&&s++;return t}},{}],10:[function(e,r,t){"use strict";function o(e,r,t){var a=t?" !== ":" === ",s=t?" || ":" && ",o=t?"!":"",i=t?"":"!";switch(e){case"null":return r+a+"null";case"array":return o+"Array.isArray("+r+")";case"object":return"("+o+r+s+"typeof "+r+a+'"object"'+s+i+"Array.isArray("+r+"))";case"integer":return"(typeof "+r+a+'"number"'+s+i+"("+r+" % 1)"+s+r+a+r+")";default:return"typeof "+r+a+'"'+e+'"'}}r.exports={copy:function(e,r){for(var t in r=r||{},e)r[t]=e[t];return r},checkDataType:o,checkDataTypes:function(e,r){switch(e.length){case 1:return o(e[0],r,!0);default:var t="",a=n(e);for(var s in a.array&&a.object&&(t=a.null?"(":"(!"+r+" || ",t+="typeof "+r+' !== "object")',delete a.null,delete a.array,delete a.object),a.number&&delete a.integer,a)t+=(t?" && ":"")+o(s,r,!0);return t}},coerceToTypes:function(e,r){if(Array.isArray(r)){for(var t=[],a=0;a<r.length;a++){var s=r[a];(i[s]||"array"===e&&"array"===s)&&(t[t.length]=s)}if(t.length)return t}else{if(i[r])return[r];if("array"===e&&"array"===r)return["array"]}},toHash:n,getProperty:h,escapeQuotes:l,equal:e("fast-deep-equal"),ucs2length:e("./ucs2length"),varOccurences:function(e,r){r+="[^0-9]";var t=e.match(new RegExp(r,"g"));return t?t.length:0},varReplace:function(e,r,t){return r+="([^0-9])",t=t.replace(/\$/g,"$$$$"),e.replace(new RegExp(r,"g"),t+"$1")},cleanUpCode:function(e){return e.replace(c,"").replace(u,"").replace(d,"if (!($1))")},finalCleanUpCode:function(e,r){var t=e.match(f);t&&2==t.length&&(e=r?e.replace(m,"").replace(g,P):e.replace(p,"").replace(v,y));return(t=e.match(E))&&3===t.length?e.replace(w,""):e},schemaHasRules:function(e,r){if("boolean"==typeof e)return!e;for(var t in e)if(r[t])return!0},schemaHasRulesExcept:function(e,r,t){if("boolean"==typeof e)return!e&&"not"!=t;for(var a in e)if(a!=t&&r[a])return!0},schemaUnknownRules:function(e,r){if("boolean"==typeof e)return;for(var t in e)if(!r[t])return t},toQuotedString:b,getPathExpr:function(e,r,t,a){return F(e,t?"'/' + "+r+(a?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):a?"'[' + "+r+" + ']'":"'[\\'' + "+r+" + '\\']'")},getPath:function(e,r,t){var a=b(t?"/"+x(r):h(r));return F(e,a)},getData:function(e,r,t){var a,s,o,i;if(""===e)return"rootData";if("/"==e[0]){if(!S.test(e))throw new Error("Invalid JSON-pointer: "+e);s=e,o="rootData"}else{if(!(i=e.match(_)))throw new Error("Invalid JSON-pointer: "+e);if(a=+i[1],"#"==(s=i[2])){if(r<=a)throw new Error("Cannot access property/index "+a+" levels up, current level is "+r);return t[r-a]}if(r<a)throw new Error("Cannot access data "+a+" levels up, current level is "+r);if(o="data"+(r-a||""),!s)return o}for(var n=o,l=s.split("/"),c=0;c<l.length;c++){var u=l[c];u&&(o+=h($(u)),n+=" && "+o)}return n},unescapeFragment:function(e){return $(decodeURIComponent(e))},unescapeJsonPointer:$,escapeFragment:function(e){return encodeURIComponent(x(e))},escapeJsonPointer:x};var i=n(["string","number","integer","boolean","null"]);function n(e){for(var r={},t=0;t<e.length;t++)r[e[t]]=!0;return r}var a=/^[a-z$_][a-z$_0-9]*$/i,s=/'|\\/g;function h(e){return"number"==typeof e?"["+e+"]":a.test(e)?"."+e:"['"+l(e)+"']"}function l(e){return e.replace(s,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}var c=/else\s*{\s*}/g,u=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,d=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;var f=/[^v.]errors/g,p=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,m=/var errors = 0;|var vErrors = null;/g,v="return errors === 0;",y="validate.errors = null; return true;",g=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,P="return data;",E=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,w=/if \(rootData === undefined\) rootData = data;/;function b(e){return"'"+l(e)+"'"}var S=/^\/(?:[^~]|~0|~1)*$/,_=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function F(e,r){return'""'==e?r:(e+" + "+r).replace(/' \+ '/g,"")}function x(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function $(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},{"./ucs2length":9,"fast-deep-equal":42}],11:[function(e,r,t){"use strict";var l=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];r.exports=function(e,r){for(var t=0;t<r.length;t++){e=JSON.parse(JSON.stringify(e));var a,s=r[t].split("/"),o=e;for(a=1;a<s.length;a++)o=o[s[a]];for(a=0;a<l.length;a++){var i=l[a],n=o[i];n&&(o[i]={anyOf:[n,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]})}}return e}},{}],12:[function(e,r,t){"use strict";var a=e("./refs/json-schema-draft-07.json");r.exports={$id:"https://github.com/epoberezkin/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:a.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:a.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},{"./refs/json-schema-draft-07.json":41}],13:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i;var d="maximum"==r,f=d?"exclusiveMaximum":"exclusiveMinimum",p=e.schema[f],m=e.opts.$data&&p&&p.$data,v=d?"<":">",y=d?">":"<",g=void 0;if(m){var P=e.util.getData(p.$data,o,e.dataPathArr),E="exclusive"+s,w="exclType"+s,b="exclIsNumber"+s,S="' + "+(x="op"+s)+" + '";a+=" var schemaExcl"+s+" = "+P+"; ";var _;g=f;(_=_||[]).push(a+=" var "+E+"; var "+w+" = typeof "+(P="schemaExcl"+s)+"; if ("+w+" != 'boolean' && "+w+" != 'undefined' && "+w+" != 'number') { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(g||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var F=a;a=_.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+F+"]); ":" validate.errors = ["+F+"]; return false; ":" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),a+=" "+w+" == 'number' ? ( ("+E+" = "+t+" === undefined || "+P+" "+v+"= "+t+") ? "+u+" "+y+"= "+P+" : "+u+" "+y+" "+t+" ) : ( ("+E+" = "+P+" === true) ? "+u+" "+y+"= "+t+" : "+u+" "+y+" "+t+" ) || "+u+" !== "+u+") { var op"+s+" = "+E+" ? '"+v+"' : '"+v+"='; ",void 0===i&&(l=e.errSchemaPath+"/"+(g=f),t=P,h=m)}else{S=v;if((b="number"==typeof p)&&h){var x="'"+S+"'";a+=" if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),a+=" ( "+t+" === undefined || "+p+" "+v+"= "+t+" ? "+u+" "+y+"= "+p+" : "+u+" "+y+" "+t+" ) || "+u+" !== "+u+") { "}else{b&&void 0===i?(E=!0,l=e.errSchemaPath+"/"+(g=f),t=p,y+="="):(b&&(t=Math[d?"min":"max"](p,i)),p===(!b||t)?(E=!0,l=e.errSchemaPath+"/"+(g=f),y+="="):(E=!1,S+="="));x="'"+S+"'";a+=" if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),a+=" "+u+" "+y+" "+t+" || "+u+" !== "+u+") { "}}g=g||r,(_=_||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(g||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+x+", limit: "+t+", exclusive: "+E+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be "+S+" ",a+=h?"' + "+t:t+"'"),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";F=a;return a=_.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+F+"]); ":" validate.errors = ["+F+"]; return false; ":" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(a+=" else { "),a}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,a+="if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || ");var d=r,f=f||[];f.push(a+=" "+u+".length "+("maxItems"==r?">":"<")+" "+t+") { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+t+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxItems"==r?"more":"fewer",a+=" than ",a+=h?"' + "+t+" + '":""+i,a+=" items' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var p=a;return a=f.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,a+="if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || "),a+=!1===e.opts.unicode?" "+u+".length ":" ucs2length("+u+") ";var d=r,f=f||[];f.push(a+=" "+("maxLength"==r?">":"<")+" "+t+") { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+t+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be ",a+="maxLength"==r?"longer":"shorter",a+=" than ",a+=h?"' + "+t+" + '":""+i,a+=" characters' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var p=a;return a=f.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,a+="if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'number') || ");var d=r,f=f||[];f.push(a+=" Object.keys("+u+").length "+("maxProperties"==r?">":"<")+" "+t+") { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+t+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxProperties"==r?"more":"fewer",a+=" than ",a+=h?"' + "+t+" + '":""+i,a+=" properties' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var p=a;return a=f.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.schema[r],s=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,n=e.util.copy(e),l="";n.level++;var c="valid"+n.level,u=n.baseId,h=!0,d=a;if(d)for(var f,p=-1,m=d.length-1;p<m;)f=d[p+=1],(e.opts.strictKeywords?"object"==typeof f&&0<Object.keys(f).length:e.util.schemaHasRules(f,e.RULES.all))&&(h=!1,n.schema=f,n.schemaPath=s+"["+p+"]",n.errSchemaPath=o+"/"+p,t+=" "+e.validate(n)+" ",n.baseId=u,i&&(t+=" if ("+c+") { ",l+="}"));return i&&(t+=h?" if (true) { ":" "+l.slice(0,-1)+" "),t=e.util.cleanUpCode(t)}},{}],18:[function(e,r,t){"use strict";r.exports=function(r,e){var t=" ",a=r.level,s=r.dataLevel,o=r.schema[e],i=r.schemaPath+r.util.getProperty(e),n=r.errSchemaPath+"/"+e,l=!r.opts.allErrors,c="data"+(s||""),u="valid"+a,h="errs__"+a,d=r.util.copy(r),f="";d.level++;var p="valid"+d.level;if(o.every(function(e){return r.opts.strictKeywords?"object"==typeof e&&0<Object.keys(e).length:r.util.schemaHasRules(e,r.RULES.all)})){var m=d.baseId;t+=" var "+h+" = errors; var "+u+" = false; ";var v=r.compositeRule;r.compositeRule=d.compositeRule=!0;var y=o;if(y)for(var g,P=-1,E=y.length-1;P<E;)g=y[P+=1],d.schema=g,d.schemaPath=i+"["+P+"]",d.errSchemaPath=n+"/"+P,t+=" "+r.validate(d)+" ",d.baseId=m,t+=" "+u+" = "+u+" || "+p+"; if (!"+u+") { ",f+="}";r.compositeRule=d.compositeRule=v,t+=" "+f+" if (!"+u+") { var err = ",!1!==r.createErrors?(t+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(n)+" , params: {} ",!1!==r.opts.messages&&(t+=" , message: 'should match some schema in anyOf' "),r.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!r.compositeRule&&l&&(t+=r.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),t+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",r.opts.allErrors&&(t+=" } "),t=r.util.cleanUpCode(t)}else l&&(t+=" if (true) { ");return t}},{}],19:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.errSchemaPath+"/"+r,s=e.util.toQuotedString(e.schema[r]);return!0===e.opts.$comment?t+=" console.log("+s+");":"function"==typeof e.opts.$comment&&(t+=" self._opts.$comment("+s+", "+e.util.toQuotedString(a)+", validate.root.schema);"),t}},{}],20:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h=e.opts.$data&&o&&o.$data;h&&(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; "),h||(t+=" var schema"+a+" = validate.schema"+i+";");var d=d||[];d.push(t+="var "+u+" = equal("+c+", schema"+a+"); if (!"+u+") { "),t="",!1!==e.createErrors?(t+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { allowedValue: schema"+a+" } ",!1!==e.opts.messages&&(t+=" , message: 'should be equal to constant' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t;return t=d.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" }",l&&(t+=" else { "),t}},{}],21:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h="errs__"+a,d=e.util.copy(e);d.level++;var f="valid"+d.level,p="i"+a,m=d.dataLevel=e.dataLevel+1,v="data"+m,y=e.baseId,g=e.opts.strictKeywords?"object"==typeof o&&0<Object.keys(o).length:e.util.schemaHasRules(o,e.RULES.all);if(t+="var "+h+" = errors;var "+u+";",g){var P=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=o,d.schemaPath=i,d.errSchemaPath=n,t+=" var "+f+" = false; for (var "+p+" = 0; "+p+" < "+c+".length; "+p+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers,!0);var E=c+"["+p+"]";d.dataPathArr[m]=p;var w=e.validate(d);d.baseId=y,e.util.varOccurences(w,v)<2?t+=" "+e.util.varReplace(w,v,E)+" ":t+=" var "+v+" = "+E+"; "+w+" ",t+=" if ("+f+") break; } ",e.compositeRule=d.compositeRule=P,t+=" if (!"+f+") {"}else t+=" if ("+c+".length == 0) {";var b=b||[];b.push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: {} ",!1!==e.opts.messages&&(t+=" , message: 'should contain a valid item' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var S=t;return t=b.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { ",g&&(t+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(t+=" } "),t=e.util.cleanUpCode(t)}},{}],22:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,h="data"+(i||""),d="valid"+o,f="errs__"+o,p=e.opts.$data&&n&&n.$data;a=p?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n;var m,v,y,g,P,E=this,w="definition"+o,b=E.definition,S="";if(p&&b.$data){var _=b.validateSchema;s+=" var "+w+" = RULES.custom['"+r+"'].definition; var "+(P="keywordValidate"+o)+" = "+w+".validate;"}else{if(!(g=e.useCustomRule(E,n,e.schema,e)))return;a="validate.schema"+l,P=g.code,m=b.compile,v=b.inline,y=b.macro}var F=P+".errors",x="i"+o,$="ruleErr"+o,R=b.async;if(R&&!e.async)throw new Error("async keyword in sync schema");if(v||y||(s+=F+" = null;"),s+="var "+f+" = errors;var "+d+";",p&&b.$data&&(S+="}",s+=" if ("+a+" === undefined) { "+d+" = true; } else { ",_&&(S+="}",s+=" "+d+" = "+w+".validateSchema("+a+"); if ("+d+") { ")),v)s+=b.statements?" "+g.validate+" ":" "+d+" = "+g.validate+"; ";else if(y){var D=e.util.copy(e);S="";D.level++;var j="valid"+D.level;D.schema=g.validate,D.schemaPath="";var O=e.compositeRule;e.compositeRule=D.compositeRule=!0;var I=e.validate(D).replace(/validate\.schema/g,P);e.compositeRule=D.compositeRule=O,s+=" "+I}else{(L=L||[]).push(s),s="",s+=" "+P+".call( ",s+=e.opts.passContext?"this":"self",s+=m||!1===b.schema?" , "+h+" ":" , "+a+" , "+h+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath);var A=i?"data"+(i-1||""):"parentData",C=i?e.dataPathArr[i]:"parentDataProperty",k=s+=" , "+A+" , "+C+" , rootData ) ";s=L.pop(),!1===b.errors?(s+=" "+d+" = ",R&&(s+="await "),s+=k+"; "):s+=R?" var "+(F="customErrors"+o)+" = null; try { "+d+" = await "+k+"; } catch (e) { "+d+" = false; if (e instanceof ValidationError) "+F+" = e.errors; else throw e; } ":" "+F+" = null; "+d+" = "+k+"; "}if(b.modifying&&(s+=" if ("+A+") "+h+" = "+A+"["+C+"];"),s+=""+S,b.valid)u&&(s+=" if (true) { ");else{var L;s+=" if ( ",void 0===b.valid?(s+=" !",s+=y?""+j:d):s+=" "+!b.valid+" ",t=E.keyword,(L=L||[]).push(s+=") { "),(L=L||[]).push(s=""),s="",!1!==e.createErrors?(s+=" { keyword: '"+(t||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+E.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+E.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var z=s;s=L.pop();var T=s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+z+"]); ":" validate.errors = ["+z+"]; return false; ":" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";s=L.pop(),v?b.errors?"full"!=b.errors&&(s+=" for (var "+x+"="+f+"; "+x+"<errors; "+x+"++) { var "+$+" = vErrors["+x+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+$+".schemaPath === undefined) { "+$+'.schemaPath = "'+c+'"; } ',e.opts.verbose&&(s+=" "+$+".schema = "+a+"; "+$+".data = "+h+"; "),s+=" } "):!1===b.errors?s+=" "+T+" ":(s+=" if ("+f+" == errors) { "+T+" } else { for (var "+x+"="+f+"; "+x+"<errors; "+x+"++) { var "+$+" = vErrors["+x+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+$+".schemaPath === undefined) { "+$+'.schemaPath = "'+c+'"; } ',e.opts.verbose&&(s+=" "+$+".schema = "+a+"; "+$+".data = "+h+"; "),s+=" } } "):y?(s+=" var err = ",!1!==e.createErrors?(s+=" { keyword: '"+(t||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+E.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+E.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(s+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; ")):!1===b.errors?s+=" "+T+" ":(s+=" if (Array.isArray("+F+")) { if (vErrors === null) vErrors = "+F+"; else vErrors = vErrors.concat("+F+"); errors = vErrors.length; for (var "+x+"="+f+"; "+x+"<errors; "+x+"++) { var "+$+" = vErrors["+x+"]; if ("+$+".dataPath === undefined) "+$+".dataPath = (dataPath || '') + "+e.errorPath+"; "+$+'.schemaPath = "'+c+'"; ',e.opts.verbose&&(s+=" "+$+".schema = "+a+"; "+$+".data = "+h+"; "),s+=" } } else { "+T+" } "),s+=" } ",u&&(s+=" else { ")}return s}},{}],23:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e),d="";h.level++;var f="valid"+h.level,p={},m={},v=e.opts.ownProperties;for(E in o){var y=o[E],g=Array.isArray(y)?m:p;g[E]=y}t+="var "+u+" = errors;";var P=e.errorPath;for(var E in t+="var missing"+a+";",m)if((g=m[E]).length){if(t+=" if ( "+c+e.util.getProperty(E)+" !== undefined ",v&&(t+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(E)+"') "),l){t+=" && ( ";var w=g;if(w)for(var b=-1,S=w.length-1;b<S;){D=w[b+=1],b&&(t+=" || "),t+=" ( ( "+(A=c+(I=e.util.getProperty(D)))+" === undefined ",v&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(D)+"') "),t+=") && (missing"+a+" = "+e.util.toQuotedString(e.opts.jsonPointers?D:I)+") ) "}t+=")) { ";var _="missing"+a,F="' + "+_+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(P,_,!0):P+" + "+_);var x=x||[];x.push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { property: '"+e.util.escapeQuotes(E)+"', missingProperty: '"+F+"', depsCount: "+g.length+", deps: '"+e.util.escapeQuotes(1==g.length?g[0]:g.join(", "))+"' } ",!1!==e.opts.messages&&(t+=" , message: 'should have ",t+=1==g.length?"property "+e.util.escapeQuotes(g[0]):"properties "+e.util.escapeQuotes(g.join(", ")),t+=" when property "+e.util.escapeQuotes(E)+" is present' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var $=t;t=x.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+$+"]); ":" validate.errors = ["+$+"]; return false; ":" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{t+=" ) { ";var R=g;if(R)for(var D,j=-1,O=R.length-1;j<O;){D=R[j+=1];var I=e.util.getProperty(D),A=(F=e.util.escapeQuotes(D),c+I);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(P,D,e.opts.jsonPointers)),t+=" if ( "+A+" === undefined ",v&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(D)+"') "),t+=") { var err = ",!1!==e.createErrors?(t+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { property: '"+e.util.escapeQuotes(E)+"', missingProperty: '"+F+"', depsCount: "+g.length+", deps: '"+e.util.escapeQuotes(1==g.length?g[0]:g.join(", "))+"' } ",!1!==e.opts.messages&&(t+=" , message: 'should have ",t+=1==g.length?"property "+e.util.escapeQuotes(g[0]):"properties "+e.util.escapeQuotes(g.join(", ")),t+=" when property "+e.util.escapeQuotes(E)+" is present' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}t+=" } ",l&&(d+="}",t+=" else { ")}e.errorPath=P;var C=h.baseId;for(var E in p){y=p[E];(e.opts.strictKeywords?"object"==typeof y&&0<Object.keys(y).length:e.util.schemaHasRules(y,e.RULES.all))&&(t+=" "+f+" = true; if ( "+c+e.util.getProperty(E)+" !== undefined ",v&&(t+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(E)+"') "),t+=") { ",h.schema=y,h.schemaPath=i+e.util.getProperty(E),h.errSchemaPath=n+"/"+e.util.escapeFragment(E),t+=" "+e.validate(h)+" ",h.baseId=C,t+=" } ",l&&(t+=" if ("+f+") { ",d+="}"))}return l&&(t+=" "+d+" if ("+u+" == errors) {"),t=e.util.cleanUpCode(t)}},{}],24:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h=e.opts.$data&&o&&o.$data;h&&(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ");var d="i"+a,f="schema"+a;h||(t+=" var "+f+" = validate.schema"+i+";"),t+="var "+u+";",h&&(t+=" if (schema"+a+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+a+")) "+u+" = false; else {"),t+=u+" = false;for (var "+d+"=0; "+d+"<"+f+".length; "+d+"++) if (equal("+c+", "+f+"["+d+"])) { "+u+" = true; break; }",h&&(t+=" } ");var p=p||[];p.push(t+=" if (!"+u+") { "),t="",!1!==e.createErrors?(t+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { allowedValues: schema"+a+" } ",!1!==e.opts.messages&&(t+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var m=t;return t=p.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" }",l&&(t+=" else { "),t}},{}],25:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||"");if(!1===e.opts.format)return c&&(a+=" if (true) { "),a;var h,d=e.opts.$data&&i&&i.$data;h=d?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i;var f=e.opts.unknownFormats,p=Array.isArray(f);if(d){a+=" var "+(m="format"+s)+" = formats["+h+"]; var "+(v="isObject"+s)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(y="formatType"+s)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+s+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",d&&(a+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),a+=" (","ignore"!=f&&(a+=" ("+h+" && !"+m+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+h+") == -1 "),a+=") || "),a+=" ("+m+" && "+y+" == '"+t+"' && !(typeof "+m+" == 'function' ? ",a+=e.async?" (async"+s+" ? await "+m+"("+u+") : "+m+"("+u+")) ":" "+m+"("+u+") ",a+=" : "+m+".test("+u+"))))) {"}else{var m;if(!(m=e.formats[i])){if("ignore"==f)return e.logger.warn('unknown format "'+i+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(a+=" if (true) { "),a;if(p&&0<=f.indexOf(i))return c&&(a+=" if (true) { "),a;throw new Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,y=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var g=!0===m.async;m=m.validate}if(y!=t)return c&&(a+=" if (true) { "),a;if(g){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(P="formats"+e.util.getProperty(i)+".validate")+"("+u+"))) { "}else{a+=" if (! ";var P="formats"+e.util.getProperty(i);v&&(P+=".validate"),a+="function"==typeof m?" "+P+"("+u+") ":" "+P+".test("+u+") ",a+=") { "}}var E=E||[];E.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=d?""+h:""+e.util.toQuotedString(i),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=d?"' + "+h+" + '":""+e.util.escapeQuotes(i),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+n:""+e.util.toQuotedString(i),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var w=a;return a=E.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+w+"]); ":" validate.errors = ["+w+"]; return false; ":" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(a+=" else { "),a}},{}],26:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h="errs__"+a,d=e.util.copy(e);d.level++;var f="valid"+d.level,p=e.schema.then,m=e.schema.else,v=void 0!==p&&(e.opts.strictKeywords?"object"==typeof p&&0<Object.keys(p).length:e.util.schemaHasRules(p,e.RULES.all)),y=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&0<Object.keys(m).length:e.util.schemaHasRules(m,e.RULES.all)),g=d.baseId;if(v||y){var P;d.createErrors=!1,d.schema=o,d.schemaPath=i,d.errSchemaPath=n,t+=" var "+h+" = errors; var "+u+" = true; ";var E=e.compositeRule;e.compositeRule=d.compositeRule=!0,t+=" "+e.validate(d)+" ",d.baseId=g,d.createErrors=!0,t+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=d.compositeRule=E,v?(t+=" if ("+f+") { ",d.schema=e.schema.then,d.schemaPath=e.schemaPath+".then",d.errSchemaPath=e.errSchemaPath+"/then",t+=" "+e.validate(d)+" ",d.baseId=g,t+=" "+u+" = "+f+"; ",v&&y?t+=" var "+(P="ifClause"+a)+" = 'then'; ":P="'then'",t+=" } ",y&&(t+=" else { ")):t+=" if (!"+f+") { ",y&&(d.schema=e.schema.else,d.schemaPath=e.schemaPath+".else",d.errSchemaPath=e.errSchemaPath+"/else",t+=" "+e.validate(d)+" ",d.baseId=g,t+=" "+u+" = "+f+"; ",v&&y?t+=" var "+(P="ifClause"+a)+" = 'else'; ":P="'else'",t+=" } "),t+=" if (!"+u+") { var err = ",!1!==e.createErrors?(t+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { failingKeyword: "+P+" } ",!1!==e.opts.messages&&(t+=" , message: 'should match \"' + "+P+" + '\" schema' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(t+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),t+=" } ",l&&(t+=" else { "),t=e.util.cleanUpCode(t)}else l&&(t+=" if (true) { ");return t}},{}],27:[function(e,r,t){"use strict";r.exports={$ref:e("./ref"),allOf:e("./allOf"),anyOf:e("./anyOf"),$comment:e("./comment"),const:e("./const"),contains:e("./contains"),dependencies:e("./dependencies"),enum:e("./enum"),format:e("./format"),if:e("./if"),items:e("./items"),maximum:e("./_limit"),minimum:e("./_limit"),maxItems:e("./_limitItems"),minItems:e("./_limitItems"),maxLength:e("./_limitLength"),minLength:e("./_limitLength"),maxProperties:e("./_limitProperties"),minProperties:e("./_limitProperties"),multipleOf:e("./multipleOf"),not:e("./not"),oneOf:e("./oneOf"),pattern:e("./pattern"),properties:e("./properties"),propertyNames:e("./propertyNames"),required:e("./required"),uniqueItems:e("./uniqueItems"),validate:e("./validate")}},{"./_limit":13,"./_limitItems":14,"./_limitLength":15,"./_limitProperties":16,"./allOf":17,"./anyOf":18,"./comment":19,"./const":20,"./contains":21,"./dependencies":23,"./enum":24,"./format":25,"./if":26,"./items":28,"./multipleOf":29,"./not":30,"./oneOf":31,"./pattern":32,"./properties":33,"./propertyNames":34,"./ref":35,"./required":36,"./uniqueItems":37,"./validate":38}],28:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h="errs__"+a,d=e.util.copy(e),f="";d.level++;var p="valid"+d.level,m="i"+a,v=d.dataLevel=e.dataLevel+1,y="data"+v,g=e.baseId;if(t+="var "+h+" = errors;var "+u+";",Array.isArray(o)){var P=e.schema.additionalItems;if(!1===P){t+=" "+u+" = "+c+".length <= "+o.length+"; ";var E=n;n=e.errSchemaPath+"/additionalItems";var w=w||[];w.push(t+=" if (!"+u+") { "),t="",!1!==e.createErrors?(t+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var b=t;t=w.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+b+"]); ":" validate.errors = ["+b+"]; return false; ":" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } ",n=E,l&&(f+="}",t+=" else { ")}var S=o;if(S)for(var _,F=-1,x=S.length-1;F<x;)if(_=S[F+=1],e.opts.strictKeywords?"object"==typeof _&&0<Object.keys(_).length:e.util.schemaHasRules(_,e.RULES.all)){t+=" "+p+" = true; if ("+c+".length > "+F+") { ";var $=c+"["+F+"]";d.schema=_,d.schemaPath=i+"["+F+"]",d.errSchemaPath=n+"/"+F,d.errorPath=e.util.getPathExpr(e.errorPath,F,e.opts.jsonPointers,!0),d.dataPathArr[v]=F;var R=e.validate(d);d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,$)+" ":t+=" var "+y+" = "+$+"; "+R+" ",t+=" } ",l&&(t+=" if ("+p+") { ",f+="}")}if("object"==typeof P&&(e.opts.strictKeywords?"object"==typeof P&&0<Object.keys(P).length:e.util.schemaHasRules(P,e.RULES.all))){d.schema=P,d.schemaPath=e.schemaPath+".additionalItems",d.errSchemaPath=e.errSchemaPath+"/additionalItems",t+=" "+p+" = true; if ("+c+".length > "+o.length+") { for (var "+m+" = "+o.length+"; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);$=c+"["+m+"]";d.dataPathArr[v]=m;R=e.validate(d);d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,$)+" ":t+=" var "+y+" = "+$+"; "+R+" ",l&&(t+=" if (!"+p+") break; "),t+=" } } ",l&&(t+=" if ("+p+") { ",f+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&0<Object.keys(o).length:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=i,d.errSchemaPath=n,t+=" for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);$=c+"["+m+"]";d.dataPathArr[v]=m;R=e.validate(d);d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,$)+" ":t+=" var "+y+" = "+$+"; "+R+" ",l&&(t+=" if (!"+p+") break; "),t+=" }"}return l&&(t+=" "+f+" if ("+h+" == errors) {"),t=e.util.cleanUpCode(t)}},{}],29:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,a+="var division"+s+";if (",h&&(a+=" "+t+" !== undefined && ( typeof "+t+" != 'number' || "),a+=" (division"+s+" = "+u+" / "+t+", ",a+=e.opts.multipleOfPrecision?" Math.abs(Math.round(division"+s+") - division"+s+") > 1e-"+e.opts.multipleOfPrecision+" ":" division"+s+" !== parseInt(division"+s+") ",a+=" ) ",h&&(a+=" ) ");var d=d||[];d.push(a+=" ) { "),a="",!1!==e.createErrors?(a+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+t+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be multiple of ",a+=h?"' + "+t:t+"'"),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var f=a;return a=d.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],30:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e);h.level++;var d="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof o&&0<Object.keys(o).length:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=i,h.errSchemaPath=n,t+=" var "+u+" = errors; ";var f,p=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(f=h.opts.allErrors,h.opts.allErrors=!1),t+=" "+e.validate(h)+" ",h.createErrors=!0,f&&(h.opts.allErrors=f),e.compositeRule=h.compositeRule=p;var m=m||[];m.push(t+=" if ("+d+") { "),t="",!1!==e.createErrors?(t+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: {} ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be valid' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var v=t;t=m.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(t+=" } ")}else t+=" var err = ",!1!==e.createErrors?(t+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: {} ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be valid' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(t+=" if (false) { ");return t}},{}],31:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h="errs__"+a,d=e.util.copy(e),f="";d.level++;var p="valid"+d.level,m=d.baseId,v="prevValid"+a,y="passingSchemas"+a;t+="var "+h+" = errors , "+v+" = false , "+u+" = false , "+y+" = null; ";var g=e.compositeRule;e.compositeRule=d.compositeRule=!0;var P=o;if(P)for(var E,w=-1,b=P.length-1;w<b;)E=P[w+=1],(e.opts.strictKeywords?"object"==typeof E&&0<Object.keys(E).length:e.util.schemaHasRules(E,e.RULES.all))?(d.schema=E,d.schemaPath=i+"["+w+"]",d.errSchemaPath=n+"/"+w,t+=" "+e.validate(d)+" ",d.baseId=m):t+=" var "+p+" = true; ",w&&(t+=" if ("+p+" && "+v+") { "+u+" = false; "+y+" = ["+y+", "+w+"]; } else { ",f+="}"),t+=" if ("+p+") { "+u+" = "+v+" = true; "+y+" = "+w+"; }";return e.compositeRule=d.compositeRule=g,t+=f+"if (!"+u+") { var err = ",!1!==e.createErrors?(t+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(t+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(t+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),t+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(t+=" } "),t}},{}],32:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data;t=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i;var d=h?"(new RegExp("+t+"))":e.usePattern(i);a+="if ( ",h&&(a+=" ("+t+" !== undefined && typeof "+t+" != 'string') || ");var f=f||[];f.push(a+=" !"+d+".test("+u+") ) { "),a="",!1!==e.createErrors?(a+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { pattern: ",a+=h?""+t:""+e.util.toQuotedString(i),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match pattern \"",a+=h?"' + "+t+" + '":""+e.util.escapeQuotes(i),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+e.util.toQuotedString(i),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var p=a;return a=f.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],33:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e),d="";h.level++;var f="valid"+h.level,p="key"+a,m="idx"+a,v=h.dataLevel=e.dataLevel+1,y="data"+v,g="dataProperties"+a,P=Object.keys(o||{}),E=e.schema.patternProperties||{},w=Object.keys(E),b=e.schema.additionalProperties,S=P.length||w.length,_=!1===b,F="object"==typeof b&&Object.keys(b).length,x=e.opts.removeAdditional,$=_||F||x,R=e.opts.ownProperties,D=e.baseId,j=e.schema.required;if(j&&(!e.opts.$data||!j.$data)&&j.length<e.opts.loopRequired)var O=e.util.toHash(j);if(t+="var "+u+" = errors;var "+f+" = true;",R&&(t+=" var "+g+" = undefined;"),$){if(t+=R?" "+g+" = "+g+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+g+".length; "+m+"++) { var "+p+" = "+g+"["+m+"]; ":" for (var "+p+" in "+c+") { ",S){if(t+=" var isAdditional"+a+" = !(false ",P.length)if(8<P.length)t+=" || validate.schema"+i+".hasOwnProperty("+p+") ";else{var I=P;if(I)for(var A=-1,C=I.length-1;A<C;)B=I[A+=1],t+=" || "+p+" == "+e.util.toQuotedString(B)+" "}if(w.length){var k=w;if(k)for(var L=-1,z=k.length-1;L<z;)ae=k[L+=1],t+=" || "+e.usePattern(ae)+".test("+p+") "}t+=" ); if (isAdditional"+a+") { "}if("all"==x)t+=" delete "+c+"["+p+"]; ";else{var T=e.errorPath,q="' + "+p+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers)),_)if(x)t+=" delete "+c+"["+p+"]; ";else{var N=n;n=e.errSchemaPath+"/additionalProperties",(ee=ee||[]).push(t+=" "+f+" = false; "),t="",!1!==e.createErrors?(t+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { additionalProperty: '"+q+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is an invalid additional property":"should NOT have additional properties",t+="' "),e.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var Q=t;t=ee.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+Q+"]); ":" validate.errors = ["+Q+"]; return false; ":" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n=N,l&&(t+=" break; ")}else if(F)if("failing"==x){t+=" var "+u+" = errors; ";var U=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=b,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers);var V=c+"["+p+"]";h.dataPathArr[v]=p;var H=e.validate(h);h.baseId=D,e.util.varOccurences(H,y)<2?t+=" "+e.util.varReplace(H,y,V)+" ":t+=" var "+y+" = "+V+"; "+H+" ",t+=" if (!"+f+") { errors = "+u+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+c+"["+p+"]; } ",e.compositeRule=h.compositeRule=U}else{h.schema=b,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers);V=c+"["+p+"]";h.dataPathArr[v]=p;H=e.validate(h);h.baseId=D,e.util.varOccurences(H,y)<2?t+=" "+e.util.varReplace(H,y,V)+" ":t+=" var "+y+" = "+V+"; "+H+" ",l&&(t+=" if (!"+f+") break; ")}e.errorPath=T}S&&(t+=" } "),t+=" } ",l&&(t+=" if ("+f+") { ",d+="}")}var K=e.opts.useDefaults&&!e.compositeRule;if(P.length){var M=P;if(M)for(var B,J=-1,Z=M.length-1;J<Z;){var G=o[B=M[J+=1]];if(e.opts.strictKeywords?"object"==typeof G&&0<Object.keys(G).length:e.util.schemaHasRules(G,e.RULES.all)){var Y=e.util.getProperty(B),W=(V=c+Y,K&&void 0!==G.default);h.schema=G,h.schemaPath=i+Y,h.errSchemaPath=n+"/"+e.util.escapeFragment(B),h.errorPath=e.util.getPath(e.errorPath,B,e.opts.jsonPointers),h.dataPathArr[v]=e.util.toQuotedString(B);H=e.validate(h);if(h.baseId=D,e.util.varOccurences(H,y)<2){H=e.util.varReplace(H,y,V);var X=V}else{X=y;t+=" var "+y+" = "+V+"; "}if(W)t+=" "+H+" ";else{if(O&&O[B]){t+=" if ( "+X+" === undefined ",R&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(B)+"') "),t+=") { "+f+" = false; ";T=e.errorPath,N=n;var ee,re=e.util.escapeQuotes(B);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(T,B,e.opts.jsonPointers)),n=e.errSchemaPath+"/required",(ee=ee||[]).push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+re+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";Q=t;t=ee.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+Q+"]); ":" validate.errors = ["+Q+"]; return false; ":" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n=N,e.errorPath=T,t+=" } else { "}else l?(t+=" if ( "+X+" === undefined ",R&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(B)+"') "),t+=") { "+f+" = true; } else { "):(t+=" if ("+X+" !== undefined ",R&&(t+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(B)+"') "),t+=" ) { ");t+=" "+H+" } "}}l&&(t+=" if ("+f+") { ",d+="}")}}if(w.length){var te=w;if(te)for(var ae,se=-1,oe=te.length-1;se<oe;){G=E[ae=te[se+=1]];if(e.opts.strictKeywords?"object"==typeof G&&0<Object.keys(G).length:e.util.schemaHasRules(G,e.RULES.all)){h.schema=G,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),t+=R?" "+g+" = "+g+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+g+".length; "+m+"++) { var "+p+" = "+g+"["+m+"]; ":" for (var "+p+" in "+c+") { ",t+=" if ("+e.usePattern(ae)+".test("+p+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers);V=c+"["+p+"]";h.dataPathArr[v]=p;H=e.validate(h);h.baseId=D,e.util.varOccurences(H,y)<2?t+=" "+e.util.varReplace(H,y,V)+" ":t+=" var "+y+" = "+V+"; "+H+" ",l&&(t+=" if (!"+f+") break; "),t+=" } ",l&&(t+=" else "+f+" = true; "),t+=" } ",l&&(t+=" if ("+f+") { ",d+="}")}}}return l&&(t+=" "+d+" if ("+u+" == errors) {"),t=e.util.cleanUpCode(t)}},{}],34:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e);h.level++;var d="valid"+h.level;if(t+="var "+u+" = errors;",e.opts.strictKeywords?"object"==typeof o&&0<Object.keys(o).length:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=i,h.errSchemaPath=n;var f="key"+a,p="idx"+a,m="i"+a,v="' + "+f+" + '",y="data"+(h.dataLevel=e.dataLevel+1),g="dataProperties"+a,P=e.opts.ownProperties,E=e.baseId;P&&(t+=" var "+g+" = undefined; "),t+=P?" "+g+" = "+g+" || Object.keys("+c+"); for (var "+p+"=0; "+p+"<"+g+".length; "+p+"++) { var "+f+" = "+g+"["+p+"]; ":" for (var "+f+" in "+c+") { ",t+=" var startErrs"+a+" = errors; ";var w=f,b=e.compositeRule;e.compositeRule=h.compositeRule=!0;var S=e.validate(h);h.baseId=E,e.util.varOccurences(S,y)<2?t+=" "+e.util.varReplace(S,y,w)+" ":t+=" var "+y+" = "+w+"; "+S+" ",e.compositeRule=h.compositeRule=b,t+=" if (!"+d+") { for (var "+m+"=startErrs"+a+"; "+m+"<errors; "+m+"++) { vErrors["+m+"].propertyName = "+f+"; } var err = ",!1!==e.createErrors?(t+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { propertyName: '"+v+"' } ",!1!==e.opts.messages&&(t+=" , message: 'property name \\'"+v+"\\' is invalid' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(t+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),l&&(t+=" break; "),t+=" } }"}return l&&(t+=" if ("+u+" == errors) {"),t=e.util.cleanUpCode(t)}},{}],35:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.dataLevel,i=e.schema[r],n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(o||""),u="valid"+e.level;if("#"==i||"#/"==i)a=e.isRoot?(t=e.async,"validate"):(t=!0===e.root.schema.$async,"root.refVal[0]");else{var h=e.resolveRef(e.baseId,i,e.isRoot);if(void 0===h){var d=e.MissingRefError.message(e.baseId,i);if("fail"==e.opts.missingRefs){e.logger.error(d),(v=v||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { ref: '"+e.util.escapeQuotes(i)+"' } ",!1!==e.opts.messages&&(s+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(i)+"' "),e.opts.verbose&&(s+=" , schema: "+e.util.toQuotedString(i)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),s+=" } "):s+=" {} ";var f=s;s=v.pop(),s+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(s+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,i,d);e.logger.warn(d),l&&(s+=" if (true) { ")}}else if(h.inline){var p=e.util.copy(e);p.level++;var m="valid"+p.level;p.schema=h.schema,p.schemaPath="",p.errSchemaPath=i,s+=" "+e.validate(p).replace(/validate\.schema/g,h.code)+" ",l&&(s+=" if ("+m+") { ")}else t=!0===h.$async||e.async&&!1!==h.$async,a=h.code}if(a){var v;(v=v||[]).push(s),s="",s+=e.opts.passContext?" "+a+".call(this, ":" "+a+"( ",s+=" "+c+", (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath);var y=s+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+(o?e.dataPathArr[o]:"parentDataProperty")+", rootData) ";if(s=v.pop(),t){if(!e.async)throw new Error("async schema referenced by sync schema");l&&(s+=" var "+u+"; "),s+=" try { await "+y+"; ",l&&(s+=" "+u+" = true; "),s+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",l&&(s+=" "+u+" = false; "),s+=" } ",l&&(s+=" if ("+u+") { ")}else s+=" if (!"+y+") { if (vErrors === null) vErrors = "+a+".errors; else vErrors = vErrors.concat("+a+".errors); errors = vErrors.length; } ",l&&(s+=" else { ")}return s}},{}],36:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="valid"+a,h=e.opts.$data&&o&&o.$data;h&&(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ");var d="schema"+a;if(!h)if(o.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var f=[],p=o;if(p)for(var m,v=-1,y=p.length-1;v<y;){m=p[v+=1];var g=e.schema.properties[m];g&&(e.opts.strictKeywords?"object"==typeof g&&0<Object.keys(g).length:e.util.schemaHasRules(g,e.RULES.all))||(f[f.length]=m)}}else f=o;if(h||f.length){var P=e.errorPath,E=h||e.opts.loopRequired<=f.length,w=e.opts.ownProperties;if(l)if(t+=" var missing"+a+"; ",E){h||(t+=" var "+d+" = validate.schema"+i+"; ");var b="' + "+(R="schema"+a+"["+(F="i"+a)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(P,R,e.opts.jsonPointers)),t+=" var "+u+" = true; ",h&&(t+=" if (schema"+a+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+a+")) "+u+" = false; else {"),t+=" for (var "+F+" = 0; "+F+" < "+d+".length; "+F+"++) { "+u+" = "+c+"["+d+"["+F+"]] !== undefined ",w&&(t+=" && Object.prototype.hasOwnProperty.call("+c+", "+d+"["+F+"]) "),t+="; if (!"+u+") break; } ",h&&(t+=" } "),($=$||[]).push(t+=" if (!"+u+") { "),t="",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+b+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var S=t;t=$.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { "}else{t+=" if ( ";var _=f;if(_)for(var F=-1,x=_.length-1;F<x;){j=_[F+=1],F&&(t+=" || "),t+=" ( ( "+(C=c+(A=e.util.getProperty(j)))+" === undefined ",w&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(j)+"') "),t+=") && (missing"+a+" = "+e.util.toQuotedString(e.opts.jsonPointers?j:A)+") ) "}t+=") { ";var $;b="' + "+(R="missing"+a)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(P,R,!0):P+" + "+R),($=$||[]).push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+b+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";S=t;t=$.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { "}else if(E){h||(t+=" var "+d+" = validate.schema"+i+"; ");var R;b="' + "+(R="schema"+a+"["+(F="i"+a)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(P,R,e.opts.jsonPointers)),h&&(t+=" if ("+d+" && !Array.isArray("+d+")) { var err = ",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+b+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+d+" !== undefined) { "),t+=" for (var "+F+" = 0; "+F+" < "+d+".length; "+F+"++) { if ("+c+"["+d+"["+F+"]] === undefined ",w&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", "+d+"["+F+"]) "),t+=") { var err = ",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+b+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(t+=" } ")}else{var D=f;if(D)for(var j,O=-1,I=D.length-1;O<I;){j=D[O+=1];var A=e.util.getProperty(j),C=(b=e.util.escapeQuotes(j),c+A);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(P,j,e.opts.jsonPointers)),t+=" if ( "+C+" === undefined ",w&&(t+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(j)+"') "),t+=") { var err = ",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+b+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=P}else l&&(t+=" if (true) {");return t}},{}],37:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h="valid"+s,d=e.opts.$data&&i&&i.$data;if(t=d?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,(i||d)&&!1!==e.opts.uniqueItems){d&&(a+=" var "+h+"; if ("+t+" === false || "+t+" === undefined) "+h+" = true; else if (typeof "+t+" != 'boolean') "+h+" = false; else { "),a+=" var i = "+u+".length , "+h+" = true , j; if (i > 1) { ";var f=e.schema.items&&e.schema.items.type,p=Array.isArray(f);if(!f||"object"==f||"array"==f||p&&(0<=f.indexOf("object")||0<=f.indexOf("array")))a+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+h+" = false; break outer; } } } ";else a+=" var itemIndices = {}, item; for (;i--;) { var item = "+u+"[i]; ",a+=" if ("+e.util["checkDataType"+(p?"s":"")](f,"item",!0)+") continue; ",p&&(a+=" if (typeof item == 'string') item = '\"' + item; "),a+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ";a+=" } ",d&&(a+=" } ");var m=m||[];m.push(a+=" if (!"+h+") { "),a="",!1!==e.createErrors?(a+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var v=a;a=m.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(a+=" else { ")}else c&&(a+=" if (true) { ");return a}},{}],38:[function(e,r,t){"use strict";r.exports=function(a,e){var r="",t=!0===a.schema.$async,s=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),o=a.self._getId(a.schema);if(a.opts.strictKeywords){var i=a.util.schemaUnknownRules(a.schema,a.RULES.keywords);if(i){var n="unknown keyword: "+i;if("log"!==a.opts.strictKeywords)throw new Error(n);a.logger.warn(n)}}if(a.isTop&&(r+=" var validate = ",t&&(a.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(a.opts.sourceCode||a.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof a.schema||!s&&!a.schema.$ref){var l=a.level,c=a.dataLevel,u=a.schema[e="false schema"],h=a.schemaPath+a.util.getProperty(e),d=a.errSchemaPath+"/"+e,f=!a.opts.allErrors,p="data"+(c||""),m="valid"+l;if(!1===a.schema){a.isTop?f=!0:r+=" var "+m+" = false; ",(Z=Z||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: {} ",!1!==a.opts.messages&&(r+=" , message: 'boolean schema is false' "),a.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var v=r;r=Z.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else r+=a.isTop?t?" return data; ":" validate.errors = null; return true; ":" var "+m+" = true; ";return a.isTop&&(r+=" }; return validate; "),r}if(a.isTop){var y=a.isTop;l=a.level=0,c=a.dataLevel=0,p="data";if(a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[void 0],void 0!==a.schema.default&&a.opts.useDefaults&&a.opts.strictDefaults){var g="default is ignored in the schema root";if("log"!==a.opts.strictDefaults)throw new Error(g);a.logger.warn(g)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{l=a.level,p="data"+((c=a.dataLevel)||"");if(o&&(a.baseId=a.resolve.url(a.baseId,o)),t&&!a.async)throw new Error("async schema in sync schema");r+=" var errs_"+l+" = errors;"}m="valid"+l,f=!a.opts.allErrors;var P="",E="",w=a.schema.type,b=Array.isArray(w);if(w&&a.opts.nullable&&!0===a.schema.nullable&&(b?-1==w.indexOf("null")&&(w=w.concat("null")):"null"!=w&&(w=[w,"null"],b=!0)),b&&1==w.length&&(w=w[0],b=!1),a.schema.$ref&&s){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(s=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(r+=" "+a.RULES.all.$comment.code(a,"$comment")),w){if(a.opts.coerceTypes)var S=a.util.coerceToTypes(a.opts.coerceTypes,w);var _=a.RULES.types[w];if(S||b||!0===_||_&&!G(_)){h=a.schemaPath+".type",d=a.errSchemaPath+"/type",h=a.schemaPath+".type",d=a.errSchemaPath+"/type";if(r+=" if ("+a.util[b?"checkDataTypes":"checkDataType"](w,p,!0)+") { ",S){var F="dataType"+l,x="coerced"+l;r+=" var "+F+" = typeof "+p+"; ","array"==a.opts.coerceTypes&&(r+=" if ("+F+" == 'object' && Array.isArray("+p+")) "+F+" = 'array'; "),r+=" var "+x+" = undefined; ";var $="",R=S;if(R)for(var D,j=-1,O=R.length-1;j<O;)D=R[j+=1],j&&(r+=" if ("+x+" === undefined) { ",$+="}"),"array"==a.opts.coerceTypes&&"array"!=D&&(r+=" if ("+F+" == 'array' && "+p+".length == 1) { "+x+" = "+p+" = "+p+"[0]; "+F+" = typeof "+p+"; } "),"string"==D?r+=" if ("+F+" == 'number' || "+F+" == 'boolean') "+x+" = '' + "+p+"; else if ("+p+" === null) "+x+" = ''; ":"number"==D||"integer"==D?(r+=" if ("+F+" == 'boolean' || "+p+" === null || ("+F+" == 'string' && "+p+" && "+p+" == +"+p+" ","integer"==D&&(r+=" && !("+p+" % 1)"),r+=")) "+x+" = +"+p+"; "):"boolean"==D?r+=" if ("+p+" === 'false' || "+p+" === 0 || "+p+" === null) "+x+" = false; else if ("+p+" === 'true' || "+p+" === 1) "+x+" = true; ":"null"==D?r+=" if ("+p+" === '' || "+p+" === 0 || "+p+" === false) "+x+" = null; ":"array"==a.opts.coerceTypes&&"array"==D&&(r+=" if ("+F+" == 'string' || "+F+" == 'number' || "+F+" == 'boolean' || "+p+" == null) "+x+" = ["+p+"]; ");(Z=Z||[]).push(r+=" "+$+" if ("+x+" === undefined) { "),r="",!1!==a.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: { type: '",r+=b?""+w.join(","):""+w,r+="' } ",!1!==a.opts.messages&&(r+=" , message: 'should be ",r+=b?""+w.join(","):""+w,r+="' "),a.opts.verbose&&(r+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";v=r;r=Z.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ";var I=c?"data"+(c-1||""):"parentData";r+=" "+p+" = "+x+"; ",c||(r+="if ("+I+" !== undefined)"),r+=" "+I+"["+(c?a.dataPathArr[c]:"parentDataProperty")+"] = "+x+"; } "}else{(Z=Z||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: { type: '",r+=b?""+w.join(","):""+w,r+="' } ",!1!==a.opts.messages&&(r+=" , message: 'should be ",r+=b?""+w.join(","):""+w,r+="' "),a.opts.verbose&&(r+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";v=r;r=Z.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(a.schema.$ref&&!s)r+=" "+a.RULES.all.$ref.code(a,"$ref")+" ",f&&(r+=" } if (errors === ",r+=y?"0":"errs_"+l,r+=") { ",E+="}");else{var A=a.RULES;if(A)for(var C=-1,k=A.length-1;C<k;)if(G(_=A[C+=1])){if(_.type&&(r+=" if ("+a.util.checkDataType(_.type,p)+") { "),a.opts.useDefaults)if("object"==_.type&&a.schema.properties){u=a.schema.properties;var L=Object.keys(u);if(L)for(var z,T=-1,q=L.length-1;T<q;){if(void 0!==(U=u[z=L[T+=1]]).default){var N=p+a.util.getProperty(z);if(a.compositeRule){if(a.opts.strictDefaults){g="default is ignored for: "+N;if("log"!==a.opts.strictDefaults)throw new Error(g);a.logger.warn(g)}}else r+=" if ("+N+" === undefined ","empty"==a.opts.useDefaults&&(r+=" || "+N+" === null || "+N+" === '' "),r+=" ) "+N+" = ",r+="shared"==a.opts.useDefaults?" "+a.useDefault(U.default)+" ":" "+JSON.stringify(U.default)+" ",r+="; "}}}else if("array"==_.type&&Array.isArray(a.schema.items)){var Q=a.schema.items;if(Q){j=-1;for(var U,V=Q.length-1;j<V;)if(void 0!==(U=Q[j+=1]).default){N=p+"["+j+"]";if(a.compositeRule){if(a.opts.strictDefaults){g="default is ignored for: "+N;if("log"!==a.opts.strictDefaults)throw new Error(g);a.logger.warn(g)}}else r+=" if ("+N+" === undefined ","empty"==a.opts.useDefaults&&(r+=" || "+N+" === null || "+N+" === '' "),r+=" ) "+N+" = ",r+="shared"==a.opts.useDefaults?" "+a.useDefault(U.default)+" ":" "+JSON.stringify(U.default)+" ",r+="; "}}}var H=_.rules;if(H)for(var K,M=-1,B=H.length-1;M<B;)if(Y(K=H[M+=1])){var J=K.code(a,K.keyword,_.type);J&&(r+=" "+J+" ",f&&(P+="}"))}if(f&&(r+=" "+P+" ",P=""),_.type&&(r+=" } ",w&&w===_.type&&!S)){var Z;h=a.schemaPath+".type",d=a.errSchemaPath+"/type";(Z=Z||[]).push(r+=" else { "),r="",!1!==a.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: { type: '",r+=b?""+w.join(","):""+w,r+="' } ",!1!==a.opts.messages&&(r+=" , message: 'should be ",r+=b?""+w.join(","):""+w,r+="' "),a.opts.verbose&&(r+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";v=r;r=Z.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}f&&(r+=" if (errors === ",r+=y?"0":"errs_"+l,r+=") { ",E+="}")}}function G(e){for(var r=e.rules,t=0;t<r.length;t++)if(Y(r[t]))return 1}function Y(e){return void 0!==a.schema[e.keyword]||e.implements&&function(e){for(var r=e.implements,t=0;t<r.length;t++)if(void 0!==a.schema[r[t]])return!0}(e)}return f&&(r+=" "+E+" "),y?(t?(r+=" if (errors === 0) return data; ",r+=" else throw new ValidationError(vErrors); "):(r+=" validate.errors = vErrors; ",r+=" return errors === 0; "),r+=" }; return validate;"):r+=" var "+m+" = errors === errs_"+l+";",r=a.util.cleanUpCode(r),y&&(r=a.util.finalCleanUpCode(r,t)),r}},{}],39:[function(e,r,t){"use strict";var i=/^[a-z_$][a-z0-9_$-]*$/i,l=e("./dotjs/custom"),a=e("./definition_schema");function s(e,r){s.errors=null;var t=this._validateKeyword=this._validateKeyword||this.compile(a,!0);if(t(e))return!0;if(s.errors=t.errors,r)throw new Error("custom keyword definition is invalid: "+this.errorsText(t.errors));return!1}r.exports={add:function(e,r){var n=this.RULES;if(n.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!i.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(r){this.validateKeyword(r,!0);var t=r.type;if(Array.isArray(t))for(var a=0;a<t.length;a++)o(e,t[a],r);else o(e,t,r);var s=r.metaSchema;s&&(r.$data&&this._opts.$data&&(s={anyOf:[s,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]}),r.validateSchema=this.compile(s,!0))}function o(e,r,t){for(var a,s=0;s<n.length;s++){var o=n[s];if(o.type==r){a=o;break}}a||n.push(a={type:r,rules:[]});var i={keyword:e,definition:t,custom:!0,code:l,implements:t.implements};a.rules.push(i),n.custom[e]=i}return n.keywords[e]=n.all[e]=!0,this},get:function(e){var r=this.RULES.custom[e];return r?r.definition:this.RULES.keywords[e]||!1},remove:function(e){var r=this.RULES;delete r.keywords[e],delete r.all[e],delete r.custom[e];for(var t=0;t<r.length;t++)for(var a=r[t].rules,s=0;s<a.length;s++)if(a[s].keyword==e){a.splice(s,1);break}return this},validate:s}},{"./definition_schema":12,"./dotjs/custom":22}],40:[function(e,r,t){r.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}},{}],41:[function(e,r,t){r.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}},{}],42:[function(e,r,t){"use strict";r.exports=function e(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){if(r.constructor!==t.constructor)return!1;var a,s,o;if(Array.isArray(r)){if((a=r.length)!=t.length)return!1;for(s=a;0!=s--;)if(!e(r[s],t[s]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if((a=(o=Object.keys(r)).length)!==Object.keys(t).length)return!1;for(s=a;0!=s--;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=a;0!=s--;){var i=o[s];if(!e(r[i],t[i]))return!1}return!0}return r!=r&&t!=t}},{}],43:[function(e,r,t){"use strict";r.exports=function(e,r){"function"==typeof(r=r||{})&&(r={cmp:r});var a,l="boolean"==typeof r.cycles&&r.cycles,c=r.cmp&&(a=r.cmp,function(t){return function(e,r){return a({key:e,value:t[e]},{key:r,value:t[r]})}}),u=[];return function e(r){if(r&&r.toJSON&&"function"==typeof r.toJSON&&(r=r.toJSON()),void 0!==r){if("number"==typeof r)return isFinite(r)?""+r:"null";if("object"!=typeof r)return JSON.stringify(r);var t,a;if(Array.isArray(r)){for(a="[",t=0;t<r.length;t++)t&&(a+=","),a+=e(r[t])||"null";return a+"]"}if(null===r)return"null";if(-1!==u.indexOf(r)){if(l)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=u.push(r)-1,o=Object.keys(r).sort(c&&c(r));for(a="",t=0;t<o.length;t++){var i=o[t],n=e(r[i]);n&&(a&&(a+=","),a+=JSON.stringify(i)+":"+n)}return u.splice(s,1),"{"+a+"}"}}(e)}},{}],44:[function(e,r,t){"use strict";var m=r.exports=function(e,r,t){"function"==typeof r&&(t=r,r={}),function e(r,t,a,s,o,i,n,l,c,u){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in t(s,o,i,n,l,c,u),s){var d=s[h];if(Array.isArray(d)){if(h in m.arrayKeywords)for(var f=0;f<d.length;f++)e(r,t,a,d[f],o+"/"+h+"/"+f,i,o,h,s,f)}else if(h in m.propsKeywords){if(d&&"object"==typeof d)for(var p in d)e(r,t,a,d[p],o+"/"+h+"/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),i,o,h,s,p)}else(h in m.keywords||r.allKeys&&!(h in m.skipKeywords))&&e(r,t,a,d,o+"/"+h,i,o,h,s)}a(s,o,i,n,l,c,u)}}(r,"function"==typeof(t=r.cb||t)?t:t.pre||function(){},t.post||function(){},e,"",e)};m.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},m.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},m.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},m.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},{}],45:[function(e,r,t){var a;a=this,function(e){"use strict";function J(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(1<r.length){r[0]=r[0].slice(0,-1);for(var a=r.length-1,s=1;s<a;++s)r[s]=r[s].slice(1,-1);return r[a]=r[a].slice(1),r.join("")}return r[0]}function Z(e){return"(?:"+e+")"}function a(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function p(e){return e.toUpperCase()}function r(e){var r="[A-Za-z]",t="[0-9]",a=J(t,"[A-Fa-f]"),s=Z(Z("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+Z("%[89A-Fa-f]"+a+"%"+a+a)+"|"+Z("%"+a+a)),o="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",i=J("[\\:\\/\\?\\#\\[\\]\\@]",o),n=e?"[\\uE000-\\uF8FF]":"[]",l=J(r,t,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),c=Z(r+J(r,t,"[\\+\\-\\.]")+"*"),u=Z(Z(s+"|"+J(l,o,"[\\:]"))+"*"),h=(Z("(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9][0-9])|(?:[1-9][0-9])|"+t),Z("(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9][0-9])|(?:0?[1-9][0-9])|0?0?"+t)),d=Z(h+"\\."+h+"\\."+h+"\\."+h),f=Z(a+"{1,4}"),p=Z(Z(f+"\\:"+f)+"|"+d),m=Z(Z(f+"\\:")+"{6}"+p),v=Z("\\:\\:"+Z(f+"\\:")+"{5}"+p),y=Z(Z(f)+"?\\:\\:"+Z(f+"\\:")+"{4}"+p),g=Z(Z(Z(f+"\\:")+"{0,1}"+f)+"?\\:\\:"+Z(f+"\\:")+"{3}"+p),P=Z(Z(Z(f+"\\:")+"{0,2}"+f)+"?\\:\\:"+Z(f+"\\:")+"{2}"+p),E=Z(Z(Z(f+"\\:")+"{0,3}"+f)+"?\\:\\:"+f+"\\:"+p),w=Z(Z(Z(f+"\\:")+"{0,4}"+f)+"?\\:\\:"+p),b=Z(Z(Z(f+"\\:")+"{0,5}"+f)+"?\\:\\:"+f),S=Z(Z(Z(f+"\\:")+"{0,6}"+f)+"?\\:\\:"),_=Z([m,v,y,g,P,E,w,b,S].join("|")),F=Z(Z(l+"|"+s)+"+"),x=(Z(_+"\\%25"+F),Z(_+Z("\\%25|\\%(?!"+a+"{2})")+F)),$=Z("[vV]"+a+"+\\."+J(l,o,"[\\:]")+"+"),R=Z("\\["+Z(x+"|"+_+"|"+$)+"\\]"),D=Z(Z(s+"|"+J(l,o))+"*"),j=Z(R+"|"+d+"(?!"+D+")|"+D),O=Z(t+"*"),I=Z(Z(u+"@")+"?"+j+Z("\\:"+O)+"?"),A=Z(s+"|"+J(l,o,"[\\:\\@]")),C=Z(A+"*"),k=Z(A+"+"),L=Z(Z(s+"|"+J(l,o,"[\\@]"))+"+"),z=Z(Z("\\/"+C)+"*"),T=Z("\\/"+Z(k+z)+"?"),q=Z(L+z),N=Z(k+z),Q="(?!"+A+")",U=(Z(z+"|"+T+"|"+q+"|"+N+"|"+Q),Z(Z(A+"|"+J("[\\/\\?]",n))+"*")),V=Z(Z(A+"|[\\/\\?]")+"*"),H=Z(Z("\\/\\/"+I+z)+"|"+T+"|"+N+"|"+Q),K=Z(c+"\\:"+H+Z("\\?"+U)+"?"+Z("\\#"+V)+"?"),M=Z(Z("\\/\\/"+I+z)+"|"+T+"|"+q+"|"+Q),B=Z(M+Z("\\?"+U)+"?"+Z("\\#"+V)+"?");Z(K+"|"+B),Z(c+"\\:"+H+Z("\\?"+U)+"?"),Z(Z("\\/\\/("+Z("("+u+")@")+"?("+j+")"+Z("\\:("+O+")")+"?)")+"?("+z+"|"+T+"|"+N+"|"+Q+")"),Z("\\?("+U+")"),Z("\\#("+V+")"),Z(Z("\\/\\/("+Z("("+u+")@")+"?("+j+")"+Z("\\:("+O+")")+"?)")+"?("+z+"|"+T+"|"+q+"|"+Q+")"),Z("\\?("+U+")"),Z("\\#("+V+")"),Z(Z("\\/\\/("+Z("("+u+")@")+"?("+j+")"+Z("\\:("+O+")")+"?)")+"?("+z+"|"+T+"|"+N+"|"+Q+")"),Z("\\?("+U+")"),Z("\\#("+V+")"),Z("("+u+")@"),Z("\\:("+O+")");return{NOT_SCHEME:new RegExp(J("[^]",r,t,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(J("[^\\%\\:]",l,o),"g"),NOT_HOST:new RegExp(J("[^\\%\\[\\]\\:]",l,o),"g"),NOT_PATH:new RegExp(J("[^\\%\\/\\:\\@]",l,o),"g"),NOT_PATH_NOSCHEME:new RegExp(J("[^\\%\\/\\@]",l,o),"g"),NOT_QUERY:new RegExp(J("[^\\%]",l,o,"[\\:\\@\\/\\?]",n),"g"),NOT_FRAGMENT:new RegExp(J("[^\\%]",l,o,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(J("[^]",l,o),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(J("[^\\%]",l,i),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+d+")$"),IPV6ADDRESS:new RegExp("^\\[?("+_+")"+Z(Z("\\%25|\\%(?!"+a+"{2})")+"("+F+")")+"?\\]?$")}}var u=r(!1),h=r(!0),w=function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,r){var t=[],a=!0,s=!1,o=void 0;try{for(var i,n=e[Symbol.iterator]();!(a=(i=n.next()).done)&&(t.push(i.value),!r||t.length!==r);a=!0);}catch(e){s=!0,o=e}finally{try{!a&&n.return&&n.return()}finally{if(s)throw o}}return t}(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")},A=2147483647,t=/^xn--/,s=/[^\0-\x7E]/,o=/[\x2E\u3002\uFF0E\uFF61]/g,i={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=Math.floor,k=String.fromCharCode;function L(e){throw new RangeError(i[e])}function n(e,r){var t=e.split("@"),a="";return 1<t.length&&(a=t[0]+"@",e=t[1]),a+function(e,r){for(var t=[],a=e.length;a--;)t[a]=r(e[a]);return t}((e=e.replace(o,".")).split("."),r).join(".")}function z(e){for(var r=[],t=0,a=e.length;t<a;){var s=e.charCodeAt(t++);if(55296<=s&&s<=56319&&t<a){var o=e.charCodeAt(t++);56320==(64512&o)?r.push(((1023&s)<<10)+(1023&o)+65536):(r.push(s),t--)}else r.push(s)}return r}function T(e,r){return e+22+75*(e<26)-((0!=r)<<5)}function q(e,r,t){var a=0;for(e=t?C(e/700):e>>1,e+=C(e/r);455<e;a+=36)e=C(e/35);return C(a+36*e/(e+38))}function l(e){var r,t=[],a=e.length,s=0,o=128,i=72,n=e.lastIndexOf("-");n<0&&(n=0);for(var l=0;l<n;++l)128<=e.charCodeAt(l)&&L("not-basic"),t.push(e.charCodeAt(l));for(var c=0<n?n+1:0;c<a;){for(var u=s,h=1,d=36;;d+=36){a<=c&&L("invalid-input");var f=(r=e.charCodeAt(c++))-48<10?r-22:r-65<26?r-65:r-97<26?r-97:36;(36<=f||f>C((A-s)/h))&&L("overflow"),s+=f*h;var p=d<=i?1:i+26<=d?26:d-i;if(f<p)break;var m=36-p;h>C(A/m)&&L("overflow"),h*=m}var v=t.length+1;i=q(s-u,v,0==u),C(s/v)>A-o&&L("overflow"),o+=C(s/v),s%=v,t.splice(s++,0,o)}return String.fromCodePoint.apply(String,t)}function c(e){var r=[],t=(e=z(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var c,u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var h=c.value;h<128&&r.push(k(h))}}catch(e){n=!0,l=e}finally{try{!i&&u.return&&u.return()}finally{if(n)throw l}}var d=r.length,f=d;for(d&&r.push("-");f<t;){var p=A,m=!0,v=!1,y=void 0;try{for(var g,P=e[Symbol.iterator]();!(m=(g=P.next()).done);m=!0){var E=g.value;a<=E&&E<p&&(p=E)}}catch(e){v=!0,y=e}finally{try{!m&&P.return&&P.return()}finally{if(v)throw y}}var w=f+1;p-a>C((A-s)/w)&&L("overflow"),s+=(p-a)*w,a=p;var b=!0,S=!1,_=void 0;try{for(var F,x=e[Symbol.iterator]();!(b=(F=x.next()).done);b=!0){var $=F.value;if($<a&&++s>A&&L("overflow"),$==a){for(var R=s,D=36;;D+=36){var j=D<=o?1:o+26<=D?26:D-o;if(R<j)break;var O=R-j,I=36-j;r.push(k(T(j+O%I,0))),R=C(O/I)}r.push(k(T(R,0))),o=q(s,w,f==d),s=0,++f}}}catch(e){S=!0,_=e}finally{try{!b&&x.return&&x.return()}finally{if(S)throw _}}++s,++a}return r.join("")}var v={version:"2.1.0",ucs2:{decode:z,encode:function(e){return String.fromCodePoint.apply(String,function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)}(e))}},decode:l,encode:c,toASCII:function(e){return n(e,function(e){return s.test(e)?"xn--"+c(e):e})},toUnicode:function(e){return n(e,function(e){return t.test(e)?l(e.slice(4).toLowerCase()):e})}},d={};function m(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function f(e){for(var r="",t=0,a=e.length;t<a;){var s=parseInt(e.substr(t+1,2),16);if(s<128)r+=String.fromCharCode(s),t+=3;else if(194<=s&&s<224){if(6<=a-t){var o=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((31&s)<<6|63&o)}else r+=e.substr(t,6);t+=6}else if(224<=s){if(9<=a-t){var i=parseInt(e.substr(t+4,2),16),n=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((15&s)<<12|(63&i)<<6|63&n)}else r+=e.substr(t,9);t+=9}else r+=e.substr(t,3),t+=3}return r}function y(e,t){function r(e){var r=f(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,m).replace(t.PCT_ENCODED,p)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,m).replace(t.PCT_ENCODED,p)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,m).replace(t.PCT_ENCODED,p)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,m).replace(t.PCT_ENCODED,p)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,m).replace(t.PCT_ENCODED,p)),e}function b(e){return e.replace(/^0*(.*)/,"$1")||"0"}function S(e,r){var t=e.match(r.IPV4ADDRESS)||[],a=w(t,2)[1];return a?a.split(".").map(b).join("."):e}function g(e,r){var t=e.match(r.IPV6ADDRESS)||[],a=w(t,3),s=a[1],o=a[2];if(s){for(var i=s.toLowerCase().split("::").reverse(),n=w(i,2),l=n[0],c=n[1],u=c?c.split(":").map(b):[],h=l.split(":").map(b),d=r.IPV4ADDRESS.test(h[h.length-1]),f=d?7:8,p=h.length-f,m=Array(f),v=0;v<f;++v)m[v]=u[v]||h[p+v]||"";d&&(m[f-1]=S(m[f-1],r));var y=m.reduce(function(e,r,t){if(!r||"0"===r){var a=e[e.length-1];a&&a.index+a.length===t?a.length++:e.push({index:t,length:1})}return e},[]).sort(function(e,r){return r.length-e.length})[0],g=void 0;if(y&&1<y.length){var P=m.slice(0,y.index),E=m.slice(y.index+y.length);g=P.join(":")+"::"+E.join(":")}else g=m.join(":");return o&&(g+="%"+o),g}return e}var P=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,E=void 0==="".match(/(){0}/)[1];function _(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t={},a=!1!==r.iri?h:u;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var s=e.match(P);if(s){E?(t.scheme=s[1],t.userinfo=s[3],t.host=s[4],t.port=parseInt(s[5],10),t.path=s[6]||"",t.query=s[7],t.fragment=s[8],isNaN(t.port)&&(t.port=s[5])):(t.scheme=s[1]||void 0,t.userinfo=-1!==e.indexOf("@")?s[3]:void 0,t.host=-1!==e.indexOf("//")?s[4]:void 0,t.port=parseInt(s[5],10),t.path=s[6]||"",t.query=-1!==e.indexOf("?")?s[7]:void 0,t.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),t.host&&(t.host=g(S(t.host,a),a)),t.reference=void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?"relative":void 0===t.fragment?"absolute":"uri":"same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");var o=d[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||o&&o.unicodeSupport)y(t,a);else{if(t.host&&(r.domainHost||o&&o.domainHost))try{t.host=v.toASCII(t.host.replace(a.PCT_ENCODED,f).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}y(t,u)}o&&o.parse&&o.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}var F=/^\.\.?\//,x=/^\/\.(\/|$)/,$=/^\/\.\.(\/|$)/,R=/^\/?(?:.|\n)*?(?=\/|$)/;function D(e){for(var r=[];e.length;)if(e.match(F))e=e.replace(F,"");else if(e.match(x))e=e.replace(x,"/");else if(e.match($))e=e.replace($,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(R);if(!t)throw new Error("Unexpected dot segment condition");var a=t[0];e=e.slice(a.length),r.push(a)}return r.join("")}function j(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.iri?h:u,a=[],s=d[(t.scheme||r.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(r,t),r.host&&!e.IPV6ADDRESS.test(r.host)&&(t.domainHost||s&&s.domainHost))try{r.host=t.iri?v.toUnicode(r.host):v.toASCII(r.host.replace(e.PCT_ENCODED,f).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}y(r,e),"suffix"!==t.reference&&r.scheme&&(a.push(r.scheme),a.push(":"));var o,i,n,l=(i=!1!==t.iri?h:u,n=[],void 0!==(o=r).userinfo&&(n.push(o.userinfo),n.push("@")),void 0!==o.host&&n.push(g(S(String(o.host),i),i).replace(i.IPV6ADDRESS,function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"})),"number"==typeof o.port&&(n.push(":"),n.push(o.port.toString(10))),n.length?n.join(""):void 0);if(void 0!==l&&("suffix"!==t.reference&&a.push("//"),a.push(l),r.path&&"/"!==r.path.charAt(0)&&a.push("/")),void 0!==r.path){var c=r.path;t.absolutePath||s&&s.absolutePath||(c=D(c)),void 0===l&&(c=c.replace(/^\/\//,"/%2F")),a.push(c)}return void 0!==r.query&&(a.push("?"),a.push(r.query)),void 0!==r.fragment&&(a.push("#"),a.push(r.fragment)),a.join("")}function O(e,r){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=_(j(e,t),t),r=_(j(r,t),t)),!(t=t||{}).tolerant&&r.scheme?(a.scheme=r.scheme,a.userinfo=r.userinfo,a.host=r.host,a.port=r.port,a.path=D(r.path||""),a.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(a.userinfo=r.userinfo,a.host=r.host,a.port=r.port,a.path=D(r.path||""),a.query=r.query):(r.path?("/"===r.path.charAt(0)?a.path=D(r.path):(a.path=void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:r.path:"/"+r.path,a.path=D(a.path)),a.query=r.query):(a.path=e.path,a.query=void 0!==r.query?r.query:e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=r.fragment,a}function I(e,r){return e&&e.toString().replace(r&&r.iri?h.PCT_ENCODED:u.PCT_ENCODED,f)}var N={scheme:"http",domainHost:!0,parse:function(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},Q={scheme:"https",domainHost:N.domainHost,parse:N.parse,serialize:N.serialize},U={},V="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",H="[0-9A-Fa-f]",K=(Z(Z("%[EFef]"+H+"%"+H+H+"%"+H+H)+"|"+Z("%[89A-Fa-f]"+H+"%"+H+H)+"|"+Z("%"+H+H)),J("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]')),M=new RegExp(V,"g"),B=new RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),G=new RegExp(J("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',K),"g"),Y=new RegExp(J("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),W=Y;function X(e){var r=f(e);return r.match(M)?r:e}var ee={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n<l;++n){var c=i[n].split("=");switch(c[0]){case"to":for(var u=c[1].split(","),h=0,d=u.length;h<d;++h)a.push(u[h]);break;case"subject":t.subject=I(c[1],r);break;case"body":t.body=I(c[1],r);break;default:s=!0,o[I(c[0],r)]=I(c[1],r)}}s&&(t.headers=o)}t.query=void 0;for(var f=0,p=a.length;f<p;++f){var m=a[f].split("@");if(m[0]=I(m[0]),r.unicodeSupport)m[1]=I(m[1],r).toLowerCase();else try{m[1]=v.toASCII(I(m[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}a[f]=m.join("@")}return t},serialize:function(e,r){var t,a=e,s=null!=(t=e.to)?t instanceof Array?t:"number"!=typeof t.length||t.split||t.setInterval||t.call?[t]:Array.prototype.slice.call(t):[];if(s){for(var o=0,i=s.length;o<i;++o){var n=String(s[o]),l=n.lastIndexOf("@"),c=n.slice(0,l).replace(B,X).replace(B,p).replace(G,m),u=n.slice(l+1);try{u=r.iri?v.toUnicode(u):v.toASCII(I(u,r).toLowerCase())}catch(e){a.error=a.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}s[o]=c+"@"+u}a.path=s.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var d=[];for(var f in h)h[f]!==U[f]&&d.push(f.replace(B,X).replace(B,p).replace(Y,m)+"="+h[f].replace(B,X).replace(B,p).replace(W,m));return d.length&&(a.query=d.join("&")),a}},re=/^([^\:]+)\:(.*)/,te={scheme:"urn",parse:function(e,r){var t=e.path&&e.path.match(re),a=e;if(t){var s=r.scheme||a.scheme||"urn",o=t[1].toLowerCase(),i=t[2],n=d[s+":"+(r.nid||o)];a.nid=o,a.nss=i,a.path=void 0,n&&(a=n.parse(a,r))}else a.error=a.error||"URN can not be parsed.";return a},serialize:function(e,r){var t=e.nid,a=d[(r.scheme||e.scheme||"urn")+":"+(r.nid||t)];a&&(e=a.serialize(e,r));var s=e;return s.path=(t||r.nid)+":"+e.nss,s}},ae=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,se={scheme:"urn:uuid",parse:function(e,r){var t=e;return t.uuid=t.nss,t.nss=void 0,r.tolerant||t.uuid&&t.uuid.match(ae)||(t.error=t.error||"UUID is not valid."),t},serialize:function(e){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};d[N.scheme]=N,d[Q.scheme]=Q,d[ee.scheme]=ee,d[te.scheme]=te,d[se.scheme]=se,e.SCHEMES=d,e.pctEncChar=m,e.pctDecChars=f,e.parse=_,e.removeDotSegments=D,e.serialize=j,e.resolveComponents=O,e.resolve=function(e,r,t){var a=function(e,r){var t=e;if(r)for(var a in r)t[a]=r[a];return t}({scheme:"null"},t);return j(O(_(e,a),_(r,a),a,!0),a)},e.normalize=function(e,r){return"string"==typeof e?e=j(_(e,r),r):"object"===a(e)&&(e=_(j(e,r),r)),e},e.equal=function(e,r,t){return"string"==typeof e?e=j(_(e,t),t):"object"===a(e)&&(e=j(e,t)),"string"==typeof r?r=j(_(r,t),t):"object"===a(r)&&(r=j(r,t)),e===r},e.escapeComponent=function(e,r){return e&&e.toString().replace(r&&r.iri?h.ESCAPE:u.ESCAPE,m)},e.unescapeComponent=I,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof t&&void 0!==r?t:a.URI=a.URI||{})},{}],ajv:[function(a,e,r){"use strict";var n=a("./compile"),d=a("./compile/resolve"),t=a("./cache"),f=a("./compile/schema_obj"),s=a("fast-json-stable-stringify"),o=a("./compile/formats"),i=a("./compile/rules"),l=a("./data"),c=a("./compile/util");(e.exports=y).prototype.validate=function(e,r){var t;if("string"==typeof e){if(!(t=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);t=a.validate||this._compile(a)}var s=t(r);!0!==t.$async&&(this.errors=t.errors);return s},y.prototype.compile=function(e,r){var t=this._addSchema(e,void 0,r);return t.validate||this._compile(t)},y.prototype.addSchema=function(e,r,t,a){if(Array.isArray(e)){for(var s=0;s<e.length;s++)this.addSchema(e[s],void 0,t,a);return this}var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");return S(this,r=d.normalizeId(r||o)),this._schemas[r]=this._addSchema(e,t,a,!0),this},y.prototype.addMetaSchema=function(e,r,t){return this.addSchema(e,r,t,!0),this},y.prototype.validateSchema=function(e,r){var t=e.$schema;if(void 0!==t&&"string"!=typeof t)throw new Error("$schema must be a string");if(!(t=t||this._opts.defaultMeta||function(e){var r=e._opts.meta;return e._opts.defaultMeta="object"==typeof r?e._getId(r)||r:e.getSchema(p)?p:void 0,e._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),!(this.errors=null);var a=this.validate(t,e);if(!a&&r){var s="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(s);this.logger.error(s)}return a},y.prototype.getSchema=function(e){var r=g(this,e);switch(typeof r){case"object":return r.validate||this._compile(r);case"string":return this.getSchema(r);case"undefined":return function(e,r){var t=d.schema.call(e,{schema:{}},r);if(t){var a=t.schema,s=t.root,o=t.baseId,i=n.call(e,a,s,void 0,o);return e._fragments[r]=new f({ref:r,fragment:!0,schema:a,root:s,baseId:o,validate:i}),i}}(this,e)}},y.prototype.removeSchema=function(e){if(e instanceof RegExp)return P(this,this._schemas,e),P(this,this._refs,e),this;switch(typeof e){case"undefined":return P(this,this._schemas),P(this,this._refs),this._cache.clear(),this;case"string":var r=g(this,e);return r&&this._cache.del(r.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var t=this._opts.serialize,a=t?t(e):e;this._cache.del(a);var s=this._getId(e);s&&(s=d.normalizeId(s),delete this._schemas[s],delete this._refs[s])}return this},y.prototype.addFormat=function(e,r){"string"==typeof r&&(r=new RegExp(r));return this._formats[e]=r,this},y.prototype.errorsText=function(e,r){if(!(e=e||this.errors))return"No errors";for(var t=void 0===(r=r||{}).separator?", ":r.separator,a=void 0===r.dataVar?"data":r.dataVar,s="",o=0;o<e.length;o++){var i=e[o];i&&(s+=a+i.dataPath+" "+i.message+t)}return s.slice(0,-t.length)},y.prototype._addSchema=function(e,r,t,a){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var s=this._opts.serialize,o=s?s(e):e,i=this._cache.get(o);if(i)return i;a=a||!1!==this._opts.addUsedSchema;var n=d.normalizeId(this._getId(e));n&&a&&S(this,n);var l,c=!1!==this._opts.validateSchema&&!r;c&&!(l=n&&n==d.normalizeId(e.$schema))&&this.validateSchema(e,!0);var u=d.ids.call(this,e),h=new f({id:n,schema:e,localRefs:u,cacheKey:o,meta:t});"#"!=n[0]&&a&&(this._refs[n]=h);this._cache.put(o,h),c&&l&&this.validateSchema(e,!0);return h},y.prototype._compile=function(t,e){if(t.compiling)return(t.validate=s).schema=t.schema,s.errors=null,s.root=e||s,!0===t.schema.$async&&(s.$async=!0),s;var r,a;t.compiling=!0,t.meta&&(r=this._opts,this._opts=this._metaOpts);try{a=n.call(this,t.schema,e,t.localRefs)}catch(e){throw delete t.validate,e}finally{t.compiling=!1,t.meta&&(this._opts=r)}return t.validate=a,t.refs=a.refs,t.refVal=a.refVal,t.root=a.root,a;function s(){var e=t.validate,r=e.apply(this,arguments);return s.errors=e.errors,r}},y.prototype.compileAsync=a("./compile/async");var u=a("./keyword");y.prototype.addKeyword=u.add,y.prototype.getKeyword=u.get,y.prototype.removeKeyword=u.remove,y.prototype.validateKeyword=u.validate;var h=a("./compile/error_classes");y.ValidationError=h.Validation,y.MissingRefError=h.MissingRef,y.$dataMetaSchema=l;var p="http://json-schema.org/draft-07/schema",m=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],v=["/properties"];function y(e){if(!(this instanceof y))return new y(e);e=this._opts=c.copy(e)||{},function(e){var r=e._opts.logger;if(!1===r)e.logger={log:_,warn:_,error:_};else{if(void 0===r&&(r=console),!("object"==typeof r&&r.log&&r.warn&&r.error))throw new Error("logger must implement log, warn and error methods");e.logger=r}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=o(e.format),this._cache=e.cache||new t,this._loadingSchemas={},this._compilations=[],this.RULES=i(),this._getId=function(e){switch(e.schemaId){case"auto":return b;case"id":return E;default:return w}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=s),this._metaOpts=function(e){for(var r=c.copy(e._opts),t=0;t<m.length;t++)delete r[m[t]];return r}(this),e.formats&&function(e){for(var r in e._opts.formats){e.addFormat(r,e._opts.formats[r])}}(this),e.keywords&&function(e){for(var r in e._opts.keywords){e.addKeyword(r,e._opts.keywords[r])}}(this),function(e){var r;e._opts.$data&&(r=a("./refs/data.json"),e.addMetaSchema(r,r.$id,!0));if(!1===e._opts.meta)return;var t=a("./refs/json-schema-draft-07.json");e._opts.$data&&(t=l(t,v));e.addMetaSchema(t,p,!0),e._refs["http://json-schema.org/schema"]=p}(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function(e){var r=e._opts.schemas;if(!r)return;if(Array.isArray(r))e.addSchema(r);else for(var t in r)e.addSchema(r[t],t)}(this)}function g(e,r){return r=d.normalizeId(r),e._schemas[r]||e._refs[r]||e._fragments[r]}function P(e,r,t){for(var a in r){var s=r[a];s.meta||t&&!t.test(a)||(e._cache.del(s.cacheKey),delete r[a])}}function E(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function w(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function b(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function S(e,r){if(e._schemas[r]||e._refs[r])throw new Error('schema with key or id "'+r+'" already exists')}function _(){}},{"./cache":1,"./compile":5,"./compile/async":2,"./compile/error_classes":3,"./compile/formats":4,"./compile/resolve":6,"./compile/rules":7,"./compile/schema_obj":8,"./compile/util":10,"./data":11,"./keyword":39,"./refs/data.json":40,"./refs/json-schema-draft-07.json":41,"fast-json-stable-stringify":43}]},{},[])("ajv")});
//# sourceMappingURL=ajv.min.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/ajv/package.json b/tools/node_modules/eslint/node_modules/ajv/package.json
index 63c133ad94..746dc87395 100644
--- a/tools/node_modules/eslint/node_modules/ajv/package.json
+++ b/tools/node_modules/eslint/node_modules/ajv/package.json
@@ -6,6 +6,10 @@
"url": "https://github.com/epoberezkin/ajv/issues"
},
"bundleDependencies": false,
+ "collective": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/ajv"
+ },
"dependencies": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -30,10 +34,10 @@
"js-beautify": "^1.7.3",
"jshint": "^2.10.2",
"json-schema-test": "^2.0.0",
- "karma": "^4.0.1",
+ "karma": "^5.0.0",
"karma-chrome-launcher": "^3.0.0",
- "karma-mocha": "^1.1.1",
- "karma-sauce-launcher": "^2.0.0",
+ "karma-mocha": "^2.0.0",
+ "karma-sauce-launcher": "^4.1.3",
"mocha": "^7.0.1",
"nyc": "^15.0.0",
"pre-commit": "^1.1.1",
@@ -98,5 +102,5 @@
},
"tonicExampleFilename": ".tonic_example.js",
"typings": "lib/ajv.d.ts",
- "version": "6.12.0"
+ "version": "6.12.2"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/chalk/package.json b/tools/node_modules/eslint/node_modules/chalk/package.json
index b6219713ce..ca3e62533f 100644
--- a/tools/node_modules/eslint/node_modules/chalk/package.json
+++ b/tools/node_modules/eslint/node_modules/chalk/package.json
@@ -12,21 +12,22 @@
"devDependencies": {
"ava": "^2.4.0",
"coveralls": "^3.0.7",
- "execa": "^3.2.0",
+ "execa": "^4.0.0",
"import-fresh": "^3.1.0",
"matcha": "^0.7.0",
- "nyc": "^14.1.1",
+ "nyc": "^15.0.0",
"resolve-from": "^5.0.0",
"tsd": "^0.7.4",
- "xo": "^0.25.3"
+ "xo": "^0.28.2"
},
"engines": {
- "node": ">=8"
+ "node": ">=10"
},
"files": [
"source",
"index.d.ts"
],
+ "funding": "https://github.com/chalk/chalk?sponsor=1",
"homepage": "https://github.com/chalk/chalk#readme",
"keywords": [
"color",
@@ -62,11 +63,15 @@
"bench": "matcha benchmark.js",
"test": "xo && nyc ava && tsd"
},
- "version": "3.0.0",
+ "version": "4.0.0",
"xo": {
"rules": {
"unicorn/prefer-string-slice": "off",
- "unicorn/prefer-includes": "off"
+ "unicorn/prefer-includes": "off",
+ "@typescript-eslint/member-ordering": "off",
+ "no-redeclare": "off",
+ "unicorn/string-content": "off",
+ "unicorn/better-regex": "off"
}
}
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/chalk/readme.md b/tools/node_modules/eslint/node_modules/chalk/readme.md
index 877cb93b78..a0ca245604 100644
--- a/tools/node_modules/eslint/node_modules/chalk/readme.md
+++ b/tools/node_modules/eslint/node_modules/chalk/readme.md
@@ -9,11 +9,10 @@
> Terminal string styling done right
-[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg)
+[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](http://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk)
<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
-
## Highlights
- Expressive API
@@ -24,8 +23,7 @@
- Doesn't extend `String.prototype`
- Clean and focused
- Actively maintained
-- [Used by ~46,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 1, 2019
-
+- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020
## Install
@@ -33,7 +31,6 @@
$ npm install chalk
```
-
## Usage
```js
@@ -107,7 +104,6 @@ console.log(chalk.green('Hello %s'), name);
//=> 'Hello Sindre'
```
-
## API
### chalk.`<style>[.<style>...](string, [string...])`
@@ -149,7 +145,6 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=
`chalk.stderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `chalk.supportsColor` apply to this too. `chalk.stderr.supportsColor` is exposed for convenience.
-
## Styles
### Modifiers
@@ -202,7 +197,6 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=
- `bgCyanBright`
- `bgWhiteBright`
-
## Tagged template literal
Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
@@ -232,7 +226,6 @@ Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain
All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
-
## 256 and Truecolor color support
Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
@@ -262,24 +255,20 @@ The following color models can be used:
- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
-
## Windows
If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
-
## Origin story
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
-
## chalk for enterprise
Available as part of the Tidelift Subscription.
The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
-
## Related
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
@@ -297,7 +286,6 @@ The maintainers of chalk and thousands of other packages are working with Tideli
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
-
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
diff --git a/tools/node_modules/eslint/node_modules/chalk/source/index.js b/tools/node_modules/eslint/node_modules/chalk/source/index.js
index 53fcc168b9..e3b2f16367 100644
--- a/tools/node_modules/eslint/node_modules/chalk/source/index.js
+++ b/tools/node_modules/eslint/node_modules/chalk/source/index.js
@@ -17,7 +17,7 @@ const levelMapping = [
const styles = Object.create(null);
const applyOptions = (object, options = {}) => {
- if (options.level > 3 || options.level < 0) {
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
throw new Error('The `level` option should be an integer from 0 to 3');
}
@@ -28,6 +28,7 @@ const applyOptions = (object, options = {}) => {
class ChalkClass {
constructor(options) {
+ // eslint-disable-next-line no-constructor-return
return chalkFactory(options);
}
}
@@ -139,9 +140,9 @@ const createBuilder = (self, _styler, _isEmpty) => {
return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
};
- // `__proto__` is used because we must return a function, but there is
+ // We alter the prototype because we must return a function, but there is
// no way to create a function with a different prototype
- builder.__proto__ = proto; // eslint-disable-line no-proto
+ Object.setPrototypeOf(builder, proto);
builder._generator = self;
builder._styler = _styler;
@@ -218,16 +219,4 @@ chalk.supportsColor = stdoutColor;
chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap
chalk.stderr.supportsColor = stderrColor;
-// For TypeScript
-chalk.Level = {
- None: 0,
- Basic: 1,
- Ansi256: 2,
- TrueColor: 3,
- 0: 'None',
- 1: 'Basic',
- 2: 'Ansi256',
- 3: 'TrueColor'
-};
-
module.exports = chalk;
diff --git a/tools/node_modules/eslint/node_modules/chalk/source/templates.js b/tools/node_modules/eslint/node_modules/chalk/source/templates.js
index fe94642b4c..b130949d64 100644
--- a/tools/node_modules/eslint/node_modules/chalk/source/templates.js
+++ b/tools/node_modules/eslint/node_modules/chalk/source/templates.js
@@ -2,7 +2,7 @@
const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
-const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi;
+const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
const ESCAPES = new Map([
['n', '\n'],
@@ -126,8 +126,8 @@ module.exports = (chalk, temporary) => {
chunks.push(chunk.join(''));
if (styles.length > 0) {
- const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
- throw new Error(errMsg);
+ const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
+ throw new Error(errMessage);
}
return chunks.join('');
diff --git a/tools/node_modules/eslint/node_modules/cli-width/index.js b/tools/node_modules/eslint/node_modules/cli-width/index.js
index de939f3194..2628b8d2c2 100644
--- a/tools/node_modules/eslint/node_modules/cli-width/index.js
+++ b/tools/node_modules/eslint/node_modules/cli-width/index.js
@@ -11,15 +11,15 @@ function normalizeOpts(options) {
if (!options) {
return defaultOpts;
- } else {
- Object.keys(defaultOpts).forEach(function (key) {
- if (!options[key]) {
- options[key] = defaultOpts[key];
- }
- });
-
- return options;
}
+
+ Object.keys(defaultOpts).forEach(function (key) {
+ if (!options[key]) {
+ options[key] = defaultOpts[key];
+ }
+ });
+
+ return options;
}
function cliWidth(options) {
@@ -27,23 +27,23 @@ function cliWidth(options) {
if (opts.output.getWindowSize) {
return opts.output.getWindowSize()[0] || opts.defaultWidth;
- } else {
- if (opts.tty.getWindowSize) {
- return opts.tty.getWindowSize()[1] || opts.defaultWidth;
- } else {
- if (opts.output.columns) {
- return opts.output.columns;
- } else {
- if (process.env.CLI_WIDTH) {
- var width = parseInt(process.env.CLI_WIDTH, 10);
-
- if (!isNaN(width) && width !== 0) {
- return width;
- }
- }
- }
-
- return opts.defaultWidth;
+ }
+
+ if (opts.tty.getWindowSize) {
+ return opts.tty.getWindowSize()[1] || opts.defaultWidth;
+ }
+
+ if (opts.output.columns) {
+ return opts.output.columns;
+ }
+
+ if (process.env.CLI_WIDTH) {
+ var width = parseInt(process.env.CLI_WIDTH, 10);
+
+ if (!isNaN(width) && width !== 0) {
+ return width;
}
}
+
+ return opts.defaultWidth;
};
diff --git a/tools/node_modules/eslint/node_modules/cli-width/package.json b/tools/node_modules/eslint/node_modules/cli-width/package.json
index 5612f01d08..ff44c7733b 100644
--- a/tools/node_modules/eslint/node_modules/cli-width/package.json
+++ b/tools/node_modules/eslint/node_modules/cli-width/package.json
@@ -1,7 +1,7 @@
{
"author": {
"name": "Ilya Radchenko",
- "email": "ilya@burstcreations.com"
+ "email": "knownasilya@gmail.com"
},
"bugs": {
"url": "https://github.com/knownasilya/cli-width/issues"
@@ -10,12 +10,11 @@
"deprecated": false,
"description": "Get stdout window width, with two fallbacks, tty and then a default.",
"devDependencies": {
- "coveralls": "^2.11.4",
- "isparta": "^3.0.4",
- "rimraf": "^2.4.3",
- "standard-version": "^4.2.0",
- "tap-spec": "^4.1.0",
- "tape": "^3.4.0"
+ "coveralls": "^3.0.11",
+ "nyc": "^15.0.1",
+ "standard-version": "^7.1.0",
+ "tap-spec": "^5.0.0",
+ "tape": "^4.13.2"
},
"homepage": "https://github.com/knownasilya/cli-width",
"license": "ISC",
@@ -26,11 +25,10 @@
"url": "git+ssh://git@github.com/knownasilya/cli-width.git"
},
"scripts": {
- "coverage": "isparta cover test/*.js | tspec",
+ "coverage": "nyc node test | tspec",
"coveralls": "npm run coverage -s && coveralls < coverage/lcov.info",
- "postcoveralls": "rimraf ./coverage",
"release": "standard-version",
"test": "node test | tspec"
},
- "version": "2.2.0"
+ "version": "2.2.1"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/cross-spawn/README.md b/tools/node_modules/eslint/node_modules/cross-spawn/README.md
index 0f957816cb..c4a4da8447 100644
--- a/tools/node_modules/eslint/node_modules/cross-spawn/README.md
+++ b/tools/node_modules/eslint/node_modules/cross-spawn/README.md
@@ -3,10 +3,10 @@
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]
[npm-url]:https://npmjs.org/package/cross-spawn
-[downloads-image]:http://img.shields.io/npm/dm/cross-spawn.svg
-[npm-image]:http://img.shields.io/npm/v/cross-spawn.svg
+[downloads-image]:https://img.shields.io/npm/dm/cross-spawn.svg
+[npm-image]:https://img.shields.io/npm/v/cross-spawn.svg
[travis-url]:https://travis-ci.org/moxystudio/node-cross-spawn
-[travis-image]:http://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg
+[travis-image]:https://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg
[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn
[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg
[codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn
@@ -93,4 +93,4 @@ Remember to always test your code on Windows!
## License
-Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
+Released under the [MIT License](https://www.opensource.org/licenses/mit-license.php).
diff --git a/tools/node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js b/tools/node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js
index c46d8d7fd9..6825a8bc5f 100644
--- a/tools/node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js
+++ b/tools/node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js
@@ -8,7 +8,7 @@ function resolveCommandAttempt(parsed, withoutPathExt) {
const cwd = process.cwd();
const hasCustomCwd = parsed.options.cwd != null;
// Worker threads do not have process.chdir()
- const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined;
+ const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;
// If a custom `cwd` was specified, we need to change the process cwd
// because `which` will do stat calls but does not support a custom cwd
diff --git a/tools/node_modules/eslint/node_modules/cross-spawn/package.json b/tools/node_modules/eslint/node_modules/cross-spawn/package.json
index a5b650211c..cc4588cec1 100644
--- a/tools/node_modules/eslint/node_modules/cross-spawn/package.json
+++ b/tools/node_modules/eslint/node_modules/cross-spawn/package.json
@@ -72,14 +72,10 @@
},
"scripts": {
"lint": "eslint .",
+ "postrelease": "git push --follow-tags origin HEAD && npm publish",
"prerelease": "npm t && npm run lint",
"release": "standard-version",
"test": "jest --env node --coverage"
},
- "standard-version": {
- "scripts": {
- "posttag": "git push --follow-tags origin master"
- }
- },
- "version": "7.0.1"
+ "version": "7.0.2"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.js b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.js
index bfb6bbee93..aa23d09f79 100644
--- a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.js
+++ b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.js
@@ -1,3 +1,91 @@
+function _typeof(obj) {
+ "@babel/helpers - typeof";
+
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function (obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function (obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+}
+
+function _slicedToArray(arr, i) {
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
+}
+
+function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+}
+
+function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+}
+
+function _arrayWithHoles(arr) {
+ if (Array.isArray(arr)) return arr;
+}
+
+function _iterableToArray(iter) {
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
+}
+
+function _iterableToArrayLimit(arr, i) {
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
+ var _arr = [];
+ var _n = true;
+ var _d = false;
+ var _e = undefined;
+
+ try {
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
+ _arr.push(_s.value);
+
+ if (i && _arr.length === i) break;
+ }
+ } catch (err) {
+ _d = true;
+ _e = err;
+ } finally {
+ try {
+ if (!_n && _i["return"] != null) _i["return"]();
+ } finally {
+ if (_d) throw _e;
+ }
+ }
+
+ return _arr;
+}
+
+function _unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(n);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+}
+
+function _arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+
+ return arr2;
+}
+
+function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+}
+
+function _nonIterableRest() {
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+}
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function createCommonjsModule(fn, module) {
@@ -5,772 +93,791 @@ function createCommonjsModule(fn, module) {
}
var estraverse = createCommonjsModule(function (module, exports) {
-/*
- Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
- Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/*jslint vars:false, bitwise:true*/
-/*jshint indent:4*/
-/*global exports:true*/
-(function clone(exports) {
-
- var Syntax,
- VisitorOption,
- VisitorKeys,
- BREAK,
- SKIP,
- REMOVE;
+ /*
+ Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
+ Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ /*jslint vars:false, bitwise:true*/
+
+ /*jshint indent:4*/
+
+ /*global exports:true*/
+ (function clone(exports) {
+
+ var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE;
function deepCopy(obj) {
- var ret = {}, key, val;
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- val = obj[key];
- if (typeof val === 'object' && val !== null) {
- ret[key] = deepCopy(val);
- } else {
- ret[key] = val;
- }
- }
+ var ret = {},
+ key,
+ val;
+
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ val = obj[key];
+
+ if (typeof val === 'object' && val !== null) {
+ ret[key] = deepCopy(val);
+ } else {
+ ret[key] = val;
+ }
}
- return ret;
- }
+ }
- // based on LLVM libc++ upper_bound / lower_bound
+ return ret;
+ } // based on LLVM libc++ upper_bound / lower_bound
// MIT License
+
function upperBound(array, func) {
- var diff, len, i, current;
+ var diff, len, i, current;
+ len = array.length;
+ i = 0;
- len = array.length;
- i = 0;
+ while (len) {
+ diff = len >>> 1;
+ current = i + diff;
- while (len) {
- diff = len >>> 1;
- current = i + diff;
- if (func(array[current])) {
- len = diff;
- } else {
- i = current + 1;
- len -= diff + 1;
- }
+ if (func(array[current])) {
+ len = diff;
+ } else {
+ i = current + 1;
+ len -= diff + 1;
}
- return i;
+ }
+
+ return i;
}
Syntax = {
- AssignmentExpression: 'AssignmentExpression',
- AssignmentPattern: 'AssignmentPattern',
- ArrayExpression: 'ArrayExpression',
- ArrayPattern: 'ArrayPattern',
- ArrowFunctionExpression: 'ArrowFunctionExpression',
- AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.
- BlockStatement: 'BlockStatement',
- BinaryExpression: 'BinaryExpression',
- BreakStatement: 'BreakStatement',
- CallExpression: 'CallExpression',
- CatchClause: 'CatchClause',
- ClassBody: 'ClassBody',
- ClassDeclaration: 'ClassDeclaration',
- ClassExpression: 'ClassExpression',
- ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7.
- ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7.
- ConditionalExpression: 'ConditionalExpression',
- ContinueStatement: 'ContinueStatement',
- DebuggerStatement: 'DebuggerStatement',
- DirectiveStatement: 'DirectiveStatement',
- DoWhileStatement: 'DoWhileStatement',
- EmptyStatement: 'EmptyStatement',
- ExportAllDeclaration: 'ExportAllDeclaration',
- ExportDefaultDeclaration: 'ExportDefaultDeclaration',
- ExportNamedDeclaration: 'ExportNamedDeclaration',
- ExportSpecifier: 'ExportSpecifier',
- ExpressionStatement: 'ExpressionStatement',
- ForStatement: 'ForStatement',
- ForInStatement: 'ForInStatement',
- ForOfStatement: 'ForOfStatement',
- FunctionDeclaration: 'FunctionDeclaration',
- FunctionExpression: 'FunctionExpression',
- GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7.
- Identifier: 'Identifier',
- IfStatement: 'IfStatement',
- ImportExpression: 'ImportExpression',
- ImportDeclaration: 'ImportDeclaration',
- ImportDefaultSpecifier: 'ImportDefaultSpecifier',
- ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
- ImportSpecifier: 'ImportSpecifier',
- Literal: 'Literal',
- LabeledStatement: 'LabeledStatement',
- LogicalExpression: 'LogicalExpression',
- MemberExpression: 'MemberExpression',
- MetaProperty: 'MetaProperty',
- MethodDefinition: 'MethodDefinition',
- ModuleSpecifier: 'ModuleSpecifier',
- NewExpression: 'NewExpression',
- ObjectExpression: 'ObjectExpression',
- ObjectPattern: 'ObjectPattern',
- Program: 'Program',
- Property: 'Property',
- RestElement: 'RestElement',
- ReturnStatement: 'ReturnStatement',
- SequenceExpression: 'SequenceExpression',
- SpreadElement: 'SpreadElement',
- Super: 'Super',
- SwitchStatement: 'SwitchStatement',
- SwitchCase: 'SwitchCase',
- TaggedTemplateExpression: 'TaggedTemplateExpression',
- TemplateElement: 'TemplateElement',
- TemplateLiteral: 'TemplateLiteral',
- ThisExpression: 'ThisExpression',
- ThrowStatement: 'ThrowStatement',
- TryStatement: 'TryStatement',
- UnaryExpression: 'UnaryExpression',
- UpdateExpression: 'UpdateExpression',
- VariableDeclaration: 'VariableDeclaration',
- VariableDeclarator: 'VariableDeclarator',
- WhileStatement: 'WhileStatement',
- WithStatement: 'WithStatement',
- YieldExpression: 'YieldExpression'
+ AssignmentExpression: 'AssignmentExpression',
+ AssignmentPattern: 'AssignmentPattern',
+ ArrayExpression: 'ArrayExpression',
+ ArrayPattern: 'ArrayPattern',
+ ArrowFunctionExpression: 'ArrowFunctionExpression',
+ AwaitExpression: 'AwaitExpression',
+ // CAUTION: It's deferred to ES7.
+ BlockStatement: 'BlockStatement',
+ BinaryExpression: 'BinaryExpression',
+ BreakStatement: 'BreakStatement',
+ CallExpression: 'CallExpression',
+ CatchClause: 'CatchClause',
+ ClassBody: 'ClassBody',
+ ClassDeclaration: 'ClassDeclaration',
+ ClassExpression: 'ClassExpression',
+ ComprehensionBlock: 'ComprehensionBlock',
+ // CAUTION: It's deferred to ES7.
+ ComprehensionExpression: 'ComprehensionExpression',
+ // CAUTION: It's deferred to ES7.
+ ConditionalExpression: 'ConditionalExpression',
+ ContinueStatement: 'ContinueStatement',
+ DebuggerStatement: 'DebuggerStatement',
+ DirectiveStatement: 'DirectiveStatement',
+ DoWhileStatement: 'DoWhileStatement',
+ EmptyStatement: 'EmptyStatement',
+ ExportAllDeclaration: 'ExportAllDeclaration',
+ ExportDefaultDeclaration: 'ExportDefaultDeclaration',
+ ExportNamedDeclaration: 'ExportNamedDeclaration',
+ ExportSpecifier: 'ExportSpecifier',
+ ExpressionStatement: 'ExpressionStatement',
+ ForStatement: 'ForStatement',
+ ForInStatement: 'ForInStatement',
+ ForOfStatement: 'ForOfStatement',
+ FunctionDeclaration: 'FunctionDeclaration',
+ FunctionExpression: 'FunctionExpression',
+ GeneratorExpression: 'GeneratorExpression',
+ // CAUTION: It's deferred to ES7.
+ Identifier: 'Identifier',
+ IfStatement: 'IfStatement',
+ ImportExpression: 'ImportExpression',
+ ImportDeclaration: 'ImportDeclaration',
+ ImportDefaultSpecifier: 'ImportDefaultSpecifier',
+ ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
+ ImportSpecifier: 'ImportSpecifier',
+ Literal: 'Literal',
+ LabeledStatement: 'LabeledStatement',
+ LogicalExpression: 'LogicalExpression',
+ MemberExpression: 'MemberExpression',
+ MetaProperty: 'MetaProperty',
+ MethodDefinition: 'MethodDefinition',
+ ModuleSpecifier: 'ModuleSpecifier',
+ NewExpression: 'NewExpression',
+ ObjectExpression: 'ObjectExpression',
+ ObjectPattern: 'ObjectPattern',
+ Program: 'Program',
+ Property: 'Property',
+ RestElement: 'RestElement',
+ ReturnStatement: 'ReturnStatement',
+ SequenceExpression: 'SequenceExpression',
+ SpreadElement: 'SpreadElement',
+ Super: 'Super',
+ SwitchStatement: 'SwitchStatement',
+ SwitchCase: 'SwitchCase',
+ TaggedTemplateExpression: 'TaggedTemplateExpression',
+ TemplateElement: 'TemplateElement',
+ TemplateLiteral: 'TemplateLiteral',
+ ThisExpression: 'ThisExpression',
+ ThrowStatement: 'ThrowStatement',
+ TryStatement: 'TryStatement',
+ UnaryExpression: 'UnaryExpression',
+ UpdateExpression: 'UpdateExpression',
+ VariableDeclaration: 'VariableDeclaration',
+ VariableDeclarator: 'VariableDeclarator',
+ WhileStatement: 'WhileStatement',
+ WithStatement: 'WithStatement',
+ YieldExpression: 'YieldExpression'
};
-
VisitorKeys = {
- AssignmentExpression: ['left', 'right'],
- AssignmentPattern: ['left', 'right'],
- ArrayExpression: ['elements'],
- ArrayPattern: ['elements'],
- ArrowFunctionExpression: ['params', 'body'],
- AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.
- BlockStatement: ['body'],
- BinaryExpression: ['left', 'right'],
- BreakStatement: ['label'],
- CallExpression: ['callee', 'arguments'],
- CatchClause: ['param', 'body'],
- ClassBody: ['body'],
- ClassDeclaration: ['id', 'superClass', 'body'],
- ClassExpression: ['id', 'superClass', 'body'],
- ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7.
- ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
- ConditionalExpression: ['test', 'consequent', 'alternate'],
- ContinueStatement: ['label'],
- DebuggerStatement: [],
- DirectiveStatement: [],
- DoWhileStatement: ['body', 'test'],
- EmptyStatement: [],
- ExportAllDeclaration: ['source'],
- ExportDefaultDeclaration: ['declaration'],
- ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
- ExportSpecifier: ['exported', 'local'],
- ExpressionStatement: ['expression'],
- ForStatement: ['init', 'test', 'update', 'body'],
- ForInStatement: ['left', 'right', 'body'],
- ForOfStatement: ['left', 'right', 'body'],
- FunctionDeclaration: ['id', 'params', 'body'],
- FunctionExpression: ['id', 'params', 'body'],
- GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
- Identifier: [],
- IfStatement: ['test', 'consequent', 'alternate'],
- ImportExpression: ['source'],
- ImportDeclaration: ['specifiers', 'source'],
- ImportDefaultSpecifier: ['local'],
- ImportNamespaceSpecifier: ['local'],
- ImportSpecifier: ['imported', 'local'],
- Literal: [],
- LabeledStatement: ['label', 'body'],
- LogicalExpression: ['left', 'right'],
- MemberExpression: ['object', 'property'],
- MetaProperty: ['meta', 'property'],
- MethodDefinition: ['key', 'value'],
- ModuleSpecifier: [],
- NewExpression: ['callee', 'arguments'],
- ObjectExpression: ['properties'],
- ObjectPattern: ['properties'],
- Program: ['body'],
- Property: ['key', 'value'],
- RestElement: [ 'argument' ],
- ReturnStatement: ['argument'],
- SequenceExpression: ['expressions'],
- SpreadElement: ['argument'],
- Super: [],
- SwitchStatement: ['discriminant', 'cases'],
- SwitchCase: ['test', 'consequent'],
- TaggedTemplateExpression: ['tag', 'quasi'],
- TemplateElement: [],
- TemplateLiteral: ['quasis', 'expressions'],
- ThisExpression: [],
- ThrowStatement: ['argument'],
- TryStatement: ['block', 'handler', 'finalizer'],
- UnaryExpression: ['argument'],
- UpdateExpression: ['argument'],
- VariableDeclaration: ['declarations'],
- VariableDeclarator: ['id', 'init'],
- WhileStatement: ['test', 'body'],
- WithStatement: ['object', 'body'],
- YieldExpression: ['argument']
- };
+ AssignmentExpression: ['left', 'right'],
+ AssignmentPattern: ['left', 'right'],
+ ArrayExpression: ['elements'],
+ ArrayPattern: ['elements'],
+ ArrowFunctionExpression: ['params', 'body'],
+ AwaitExpression: ['argument'],
+ // CAUTION: It's deferred to ES7.
+ BlockStatement: ['body'],
+ BinaryExpression: ['left', 'right'],
+ BreakStatement: ['label'],
+ CallExpression: ['callee', 'arguments'],
+ CatchClause: ['param', 'body'],
+ ClassBody: ['body'],
+ ClassDeclaration: ['id', 'superClass', 'body'],
+ ClassExpression: ['id', 'superClass', 'body'],
+ ComprehensionBlock: ['left', 'right'],
+ // CAUTION: It's deferred to ES7.
+ ComprehensionExpression: ['blocks', 'filter', 'body'],
+ // CAUTION: It's deferred to ES7.
+ ConditionalExpression: ['test', 'consequent', 'alternate'],
+ ContinueStatement: ['label'],
+ DebuggerStatement: [],
+ DirectiveStatement: [],
+ DoWhileStatement: ['body', 'test'],
+ EmptyStatement: [],
+ ExportAllDeclaration: ['source'],
+ ExportDefaultDeclaration: ['declaration'],
+ ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
+ ExportSpecifier: ['exported', 'local'],
+ ExpressionStatement: ['expression'],
+ ForStatement: ['init', 'test', 'update', 'body'],
+ ForInStatement: ['left', 'right', 'body'],
+ ForOfStatement: ['left', 'right', 'body'],
+ FunctionDeclaration: ['id', 'params', 'body'],
+ FunctionExpression: ['id', 'params', 'body'],
+ GeneratorExpression: ['blocks', 'filter', 'body'],
+ // CAUTION: It's deferred to ES7.
+ Identifier: [],
+ IfStatement: ['test', 'consequent', 'alternate'],
+ ImportExpression: ['source'],
+ ImportDeclaration: ['specifiers', 'source'],
+ ImportDefaultSpecifier: ['local'],
+ ImportNamespaceSpecifier: ['local'],
+ ImportSpecifier: ['imported', 'local'],
+ Literal: [],
+ LabeledStatement: ['label', 'body'],
+ LogicalExpression: ['left', 'right'],
+ MemberExpression: ['object', 'property'],
+ MetaProperty: ['meta', 'property'],
+ MethodDefinition: ['key', 'value'],
+ ModuleSpecifier: [],
+ NewExpression: ['callee', 'arguments'],
+ ObjectExpression: ['properties'],
+ ObjectPattern: ['properties'],
+ Program: ['body'],
+ Property: ['key', 'value'],
+ RestElement: ['argument'],
+ ReturnStatement: ['argument'],
+ SequenceExpression: ['expressions'],
+ SpreadElement: ['argument'],
+ Super: [],
+ SwitchStatement: ['discriminant', 'cases'],
+ SwitchCase: ['test', 'consequent'],
+ TaggedTemplateExpression: ['tag', 'quasi'],
+ TemplateElement: [],
+ TemplateLiteral: ['quasis', 'expressions'],
+ ThisExpression: [],
+ ThrowStatement: ['argument'],
+ TryStatement: ['block', 'handler', 'finalizer'],
+ UnaryExpression: ['argument'],
+ UpdateExpression: ['argument'],
+ VariableDeclaration: ['declarations'],
+ VariableDeclarator: ['id', 'init'],
+ WhileStatement: ['test', 'body'],
+ WithStatement: ['object', 'body'],
+ YieldExpression: ['argument']
+ }; // unique id
- // unique id
BREAK = {};
SKIP = {};
REMOVE = {};
-
VisitorOption = {
- Break: BREAK,
- Skip: SKIP,
- Remove: REMOVE
+ Break: BREAK,
+ Skip: SKIP,
+ Remove: REMOVE
};
function Reference(parent, key) {
- this.parent = parent;
- this.key = key;
+ this.parent = parent;
+ this.key = key;
}
Reference.prototype.replace = function replace(node) {
- this.parent[this.key] = node;
+ this.parent[this.key] = node;
};
Reference.prototype.remove = function remove() {
- if (Array.isArray(this.parent)) {
- this.parent.splice(this.key, 1);
- return true;
- } else {
- this.replace(null);
- return false;
- }
+ if (Array.isArray(this.parent)) {
+ this.parent.splice(this.key, 1);
+ return true;
+ } else {
+ this.replace(null);
+ return false;
+ }
};
function Element(node, path, wrap, ref) {
- this.node = node;
- this.path = path;
- this.wrap = wrap;
- this.ref = ref;
+ this.node = node;
+ this.path = path;
+ this.wrap = wrap;
+ this.ref = ref;
}
- function Controller() { }
-
- // API:
+ function Controller() {} // API:
// return property path array from root to current node
+
+
Controller.prototype.path = function path() {
- var i, iz, j, jz, result, element;
+ var i, iz, j, jz, result, element;
- function addToPath(result, path) {
- if (Array.isArray(path)) {
- for (j = 0, jz = path.length; j < jz; ++j) {
- result.push(path[j]);
- }
- } else {
- result.push(path);
- }
+ function addToPath(result, path) {
+ if (Array.isArray(path)) {
+ for (j = 0, jz = path.length; j < jz; ++j) {
+ result.push(path[j]);
+ }
+ } else {
+ result.push(path);
}
+ } // root node
- // root node
- if (!this.__current.path) {
- return null;
- }
- // first node is sentinel, second node is root element
- result = [];
- for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
- element = this.__leavelist[i];
- addToPath(result, element.path);
- }
- addToPath(result, this.__current.path);
- return result;
- };
+ if (!this.__current.path) {
+ return null;
+ } // first node is sentinel, second node is root element
+
- // API:
+ result = [];
+
+ for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
+ element = this.__leavelist[i];
+ addToPath(result, element.path);
+ }
+
+ addToPath(result, this.__current.path);
+ return result;
+ }; // API:
// return type of current node
- Controller.prototype.type = function () {
- var node = this.current();
- return node.type || this.__current.wrap;
- };
- // API:
+
+ Controller.prototype.type = function () {
+ var node = this.current();
+ return node.type || this.__current.wrap;
+ }; // API:
// return array of parent elements
+
+
Controller.prototype.parents = function parents() {
- var i, iz, result;
+ var i, iz, result; // first node is sentinel
- // first node is sentinel
- result = [];
- for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
- result.push(this.__leavelist[i].node);
- }
+ result = [];
- return result;
- };
+ for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
+ result.push(this.__leavelist[i].node);
+ }
- // API:
+ return result;
+ }; // API:
// return current node
+
+
Controller.prototype.current = function current() {
- return this.__current.node;
+ return this.__current.node;
};
Controller.prototype.__execute = function __execute(callback, element) {
- var previous, result;
-
- result = undefined;
+ var previous, result;
+ result = undefined;
+ previous = this.__current;
+ this.__current = element;
+ this.__state = null;
+
+ if (callback) {
+ result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
+ }
- previous = this.__current;
- this.__current = element;
- this.__state = null;
- if (callback) {
- result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
- }
- this.__current = previous;
+ this.__current = previous;
+ return result;
+ }; // API:
+ // notify control skip / break
- return result;
- };
- // API:
- // notify control skip / break
Controller.prototype.notify = function notify(flag) {
- this.__state = flag;
- };
-
- // API:
+ this.__state = flag;
+ }; // API:
// skip child nodes of current node
- Controller.prototype.skip = function () {
- this.notify(SKIP);
- };
- // API:
+
+ Controller.prototype.skip = function () {
+ this.notify(SKIP);
+ }; // API:
// break traversals
- Controller.prototype['break'] = function () {
- this.notify(BREAK);
- };
- // API:
+
+ Controller.prototype['break'] = function () {
+ this.notify(BREAK);
+ }; // API:
// remove node
+
+
Controller.prototype.remove = function () {
- this.notify(REMOVE);
+ this.notify(REMOVE);
};
- Controller.prototype.__initialize = function(root, visitor) {
- this.visitor = visitor;
- this.root = root;
- this.__worklist = [];
- this.__leavelist = [];
- this.__current = null;
- this.__state = null;
- this.__fallback = null;
- if (visitor.fallback === 'iteration') {
- this.__fallback = Object.keys;
- } else if (typeof visitor.fallback === 'function') {
- this.__fallback = visitor.fallback;
- }
+ Controller.prototype.__initialize = function (root, visitor) {
+ this.visitor = visitor;
+ this.root = root;
+ this.__worklist = [];
+ this.__leavelist = [];
+ this.__current = null;
+ this.__state = null;
+ this.__fallback = null;
+
+ if (visitor.fallback === 'iteration') {
+ this.__fallback = Object.keys;
+ } else if (typeof visitor.fallback === 'function') {
+ this.__fallback = visitor.fallback;
+ }
- this.__keys = VisitorKeys;
- if (visitor.keys) {
- this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
- }
+ this.__keys = VisitorKeys;
+
+ if (visitor.keys) {
+ this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
+ }
};
function isNode(node) {
- if (node == null) {
- return false;
- }
- return typeof node === 'object' && typeof node.type === 'string';
+ if (node == null) {
+ return false;
+ }
+
+ return typeof node === 'object' && typeof node.type === 'string';
}
function isProperty(nodeType, key) {
- return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
+ return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
+ }
+
+ function candidateExistsInLeaveList(leavelist, candidate) {
+ for (var i = leavelist.length - 1; i >= 0; --i) {
+ if (leavelist[i].node === candidate) {
+ return true;
+ }
+ }
+
+ return false;
}
Controller.prototype.traverse = function traverse(root, visitor) {
- var worklist,
- leavelist,
- element,
- node,
- nodeType,
- ret,
- key,
- current,
- current2,
- candidates,
- candidate,
- sentinel;
+ var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel;
- this.__initialize(root, visitor);
+ this.__initialize(root, visitor);
- sentinel = {};
+ sentinel = {}; // reference
- // reference
- worklist = this.__worklist;
- leavelist = this.__leavelist;
+ worklist = this.__worklist;
+ leavelist = this.__leavelist; // initialize
- // initialize
- worklist.push(new Element(root, null, null, null));
- leavelist.push(new Element(null, null, null, null));
+ worklist.push(new Element(root, null, null, null));
+ leavelist.push(new Element(null, null, null, null));
- while (worklist.length) {
- element = worklist.pop();
+ while (worklist.length) {
+ element = worklist.pop();
- if (element === sentinel) {
- element = leavelist.pop();
+ if (element === sentinel) {
+ element = leavelist.pop();
+ ret = this.__execute(visitor.leave, element);
- ret = this.__execute(visitor.leave, element);
+ if (this.__state === BREAK || ret === BREAK) {
+ return;
+ }
- if (this.__state === BREAK || ret === BREAK) {
- return;
- }
- continue;
+ continue;
+ }
+
+ if (element.node) {
+ ret = this.__execute(visitor.enter, element);
+
+ if (this.__state === BREAK || ret === BREAK) {
+ return;
+ }
+
+ worklist.push(sentinel);
+ leavelist.push(element);
+
+ if (this.__state === SKIP || ret === SKIP) {
+ continue;
+ }
+
+ node = element.node;
+ nodeType = node.type || element.wrap;
+ candidates = this.__keys[nodeType];
+
+ if (!candidates) {
+ if (this.__fallback) {
+ candidates = this.__fallback(node);
+ } else {
+ throw new Error('Unknown node type ' + nodeType + '.');
}
+ }
- if (element.node) {
+ current = candidates.length;
- ret = this.__execute(visitor.enter, element);
+ while ((current -= 1) >= 0) {
+ key = candidates[current];
+ candidate = node[key];
- if (this.__state === BREAK || ret === BREAK) {
- return;
- }
+ if (!candidate) {
+ continue;
+ }
- worklist.push(sentinel);
- leavelist.push(element);
+ if (Array.isArray(candidate)) {
+ current2 = candidate.length;
- if (this.__state === SKIP || ret === SKIP) {
- continue;
+ while ((current2 -= 1) >= 0) {
+ if (!candidate[current2]) {
+ continue;
}
- node = element.node;
- nodeType = node.type || element.wrap;
- candidates = this.__keys[nodeType];
- if (!candidates) {
- if (this.__fallback) {
- candidates = this.__fallback(node);
- } else {
- throw new Error('Unknown node type ' + nodeType + '.');
- }
+ if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
+ continue;
}
- current = candidates.length;
- while ((current -= 1) >= 0) {
- key = candidates[current];
- candidate = node[key];
- if (!candidate) {
- continue;
- }
-
- if (Array.isArray(candidate)) {
- current2 = candidate.length;
- while ((current2 -= 1) >= 0) {
- if (!candidate[current2]) {
- continue;
- }
- if (isProperty(nodeType, candidates[current])) {
- element = new Element(candidate[current2], [key, current2], 'Property', null);
- } else if (isNode(candidate[current2])) {
- element = new Element(candidate[current2], [key, current2], null, null);
- } else {
- continue;
- }
- worklist.push(element);
- }
- } else if (isNode(candidate)) {
- worklist.push(new Element(candidate, key, null, null));
- }
+ if (isProperty(nodeType, candidates[current])) {
+ element = new Element(candidate[current2], [key, current2], 'Property', null);
+ } else if (isNode(candidate[current2])) {
+ element = new Element(candidate[current2], [key, current2], null, null);
+ } else {
+ continue;
}
+
+ worklist.push(element);
+ }
+ } else if (isNode(candidate)) {
+ if (candidateExistsInLeaveList(leavelist, candidate)) {
+ continue;
+ }
+
+ worklist.push(new Element(candidate, key, null, null));
}
+ }
}
+ }
};
Controller.prototype.replace = function replace(root, visitor) {
- var worklist,
- leavelist,
- node,
- nodeType,
- target,
- element,
- current,
- current2,
- candidates,
- candidate,
- sentinel,
- outer,
- key;
-
- function removeElem(element) {
- var i,
- key,
- nextElem,
- parent;
-
- if (element.ref.remove()) {
- // When the reference is an element of an array.
- key = element.ref.key;
- parent = element.ref.parent;
-
- // If removed from array, then decrease following items' keys.
- i = worklist.length;
- while (i--) {
- nextElem = worklist[i];
- if (nextElem.ref && nextElem.ref.parent === parent) {
- if (nextElem.ref.key < key) {
- break;
- }
- --nextElem.ref.key;
- }
- }
+ var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key;
+
+ function removeElem(element) {
+ var i, key, nextElem, parent;
+
+ if (element.ref.remove()) {
+ // When the reference is an element of an array.
+ key = element.ref.key;
+ parent = element.ref.parent; // If removed from array, then decrease following items' keys.
+
+ i = worklist.length;
+
+ while (i--) {
+ nextElem = worklist[i];
+
+ if (nextElem.ref && nextElem.ref.parent === parent) {
+ if (nextElem.ref.key < key) {
+ break;
+ }
+
+ --nextElem.ref.key;
}
+ }
}
+ }
- this.__initialize(root, visitor);
+ this.__initialize(root, visitor);
- sentinel = {};
+ sentinel = {}; // reference
- // reference
- worklist = this.__worklist;
- leavelist = this.__leavelist;
+ worklist = this.__worklist;
+ leavelist = this.__leavelist; // initialize
- // initialize
- outer = {
- root: root
- };
- element = new Element(root, null, null, new Reference(outer, 'root'));
- worklist.push(element);
- leavelist.push(element);
+ outer = {
+ root: root
+ };
+ element = new Element(root, null, null, new Reference(outer, 'root'));
+ worklist.push(element);
+ leavelist.push(element);
- while (worklist.length) {
- element = worklist.pop();
+ while (worklist.length) {
+ element = worklist.pop();
- if (element === sentinel) {
- element = leavelist.pop();
+ if (element === sentinel) {
+ element = leavelist.pop();
+ target = this.__execute(visitor.leave, element); // node may be replaced with null,
+ // so distinguish between undefined and null in this place
- target = this.__execute(visitor.leave, element);
+ if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
+ // replace
+ element.ref.replace(target);
+ }
- // node may be replaced with null,
- // so distinguish between undefined and null in this place
- if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
- // replace
- element.ref.replace(target);
- }
+ if (this.__state === REMOVE || target === REMOVE) {
+ removeElem(element);
+ }
- if (this.__state === REMOVE || target === REMOVE) {
- removeElem(element);
- }
+ if (this.__state === BREAK || target === BREAK) {
+ return outer.root;
+ }
- if (this.__state === BREAK || target === BREAK) {
- return outer.root;
- }
- continue;
- }
+ continue;
+ }
- target = this.__execute(visitor.enter, element);
+ target = this.__execute(visitor.enter, element); // node may be replaced with null,
+ // so distinguish between undefined and null in this place
- // node may be replaced with null,
- // so distinguish between undefined and null in this place
- if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
- // replace
- element.ref.replace(target);
- element.node = target;
- }
+ if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
+ // replace
+ element.ref.replace(target);
+ element.node = target;
+ }
- if (this.__state === REMOVE || target === REMOVE) {
- removeElem(element);
- element.node = null;
- }
+ if (this.__state === REMOVE || target === REMOVE) {
+ removeElem(element);
+ element.node = null;
+ }
- if (this.__state === BREAK || target === BREAK) {
- return outer.root;
- }
+ if (this.__state === BREAK || target === BREAK) {
+ return outer.root;
+ } // node may be null
- // node may be null
- node = element.node;
- if (!node) {
- continue;
- }
- worklist.push(sentinel);
- leavelist.push(element);
+ node = element.node;
- if (this.__state === SKIP || target === SKIP) {
- continue;
- }
+ if (!node) {
+ continue;
+ }
- nodeType = node.type || element.wrap;
- candidates = this.__keys[nodeType];
- if (!candidates) {
- if (this.__fallback) {
- candidates = this.__fallback(node);
- } else {
- throw new Error('Unknown node type ' + nodeType + '.');
- }
- }
+ worklist.push(sentinel);
+ leavelist.push(element);
- current = candidates.length;
- while ((current -= 1) >= 0) {
- key = candidates[current];
- candidate = node[key];
- if (!candidate) {
- continue;
- }
+ if (this.__state === SKIP || target === SKIP) {
+ continue;
+ }
- if (Array.isArray(candidate)) {
- current2 = candidate.length;
- while ((current2 -= 1) >= 0) {
- if (!candidate[current2]) {
- continue;
- }
- if (isProperty(nodeType, candidates[current])) {
- element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
- } else if (isNode(candidate[current2])) {
- element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
- } else {
- continue;
- }
- worklist.push(element);
- }
- } else if (isNode(candidate)) {
- worklist.push(new Element(candidate, key, null, new Reference(node, key)));
- }
+ nodeType = node.type || element.wrap;
+ candidates = this.__keys[nodeType];
+
+ if (!candidates) {
+ if (this.__fallback) {
+ candidates = this.__fallback(node);
+ } else {
+ throw new Error('Unknown node type ' + nodeType + '.');
+ }
+ }
+
+ current = candidates.length;
+
+ while ((current -= 1) >= 0) {
+ key = candidates[current];
+ candidate = node[key];
+
+ if (!candidate) {
+ continue;
+ }
+
+ if (Array.isArray(candidate)) {
+ current2 = candidate.length;
+
+ while ((current2 -= 1) >= 0) {
+ if (!candidate[current2]) {
+ continue;
+ }
+
+ if (isProperty(nodeType, candidates[current])) {
+ element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
+ } else if (isNode(candidate[current2])) {
+ element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
+ } else {
+ continue;
+ }
+
+ worklist.push(element);
}
+ } else if (isNode(candidate)) {
+ worklist.push(new Element(candidate, key, null, new Reference(node, key)));
+ }
}
+ }
- return outer.root;
+ return outer.root;
};
function traverse(root, visitor) {
- var controller = new Controller();
- return controller.traverse(root, visitor);
+ var controller = new Controller();
+ return controller.traverse(root, visitor);
}
function replace(root, visitor) {
- var controller = new Controller();
- return controller.replace(root, visitor);
+ var controller = new Controller();
+ return controller.replace(root, visitor);
}
function extendCommentRange(comment, tokens) {
- var target;
-
- target = upperBound(tokens, function search(token) {
- return token.range[0] > comment.range[0];
- });
-
- comment.extendedRange = [comment.range[0], comment.range[1]];
+ var target;
+ target = upperBound(tokens, function search(token) {
+ return token.range[0] > comment.range[0];
+ });
+ comment.extendedRange = [comment.range[0], comment.range[1]];
+
+ if (target !== tokens.length) {
+ comment.extendedRange[1] = tokens[target].range[0];
+ }
- if (target !== tokens.length) {
- comment.extendedRange[1] = tokens[target].range[0];
- }
+ target -= 1;
- target -= 1;
- if (target >= 0) {
- comment.extendedRange[0] = tokens[target].range[1];
- }
+ if (target >= 0) {
+ comment.extendedRange[0] = tokens[target].range[1];
+ }
- return comment;
+ return comment;
}
function attachComments(tree, providedComments, tokens) {
- // At first, we should calculate extended comment ranges.
- var comments = [], comment, len, i, cursor;
+ // At first, we should calculate extended comment ranges.
+ var comments = [],
+ comment,
+ len,
+ i,
+ cursor;
+
+ if (!tree.range) {
+ throw new Error('attachComments needs range information');
+ } // tokens array is empty, we attach comments to tree as 'leadingComments'
+
+
+ if (!tokens.length) {
+ if (providedComments.length) {
+ for (i = 0, len = providedComments.length; i < len; i += 1) {
+ comment = deepCopy(providedComments[i]);
+ comment.extendedRange = [0, tree.range[0]];
+ comments.push(comment);
+ }
- if (!tree.range) {
- throw new Error('attachComments needs range information');
+ tree.leadingComments = comments;
}
- // tokens array is empty, we attach comments to tree as 'leadingComments'
- if (!tokens.length) {
- if (providedComments.length) {
- for (i = 0, len = providedComments.length; i < len; i += 1) {
- comment = deepCopy(providedComments[i]);
- comment.extendedRange = [0, tree.range[0]];
- comments.push(comment);
- }
- tree.leadingComments = comments;
- }
- return tree;
- }
+ return tree;
+ }
- for (i = 0, len = providedComments.length; i < len; i += 1) {
- comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
- }
+ for (i = 0, len = providedComments.length; i < len; i += 1) {
+ comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
+ } // This is based on John Freeman's implementation.
- // This is based on John Freeman's implementation.
- cursor = 0;
- traverse(tree, {
- enter: function (node) {
- var comment;
- while (cursor < comments.length) {
- comment = comments[cursor];
- if (comment.extendedRange[1] > node.range[0]) {
- break;
- }
+ cursor = 0;
+ traverse(tree, {
+ enter: function (node) {
+ var comment;
- if (comment.extendedRange[1] === node.range[0]) {
- if (!node.leadingComments) {
- node.leadingComments = [];
- }
- node.leadingComments.push(comment);
- comments.splice(cursor, 1);
- } else {
- cursor += 1;
- }
- }
+ while (cursor < comments.length) {
+ comment = comments[cursor];
- // already out of owned node
- if (cursor === comments.length) {
- return VisitorOption.Break;
- }
+ if (comment.extendedRange[1] > node.range[0]) {
+ break;
+ }
- if (comments[cursor].extendedRange[0] > node.range[1]) {
- return VisitorOption.Skip;
- }
+ if (comment.extendedRange[1] === node.range[0]) {
+ if (!node.leadingComments) {
+ node.leadingComments = [];
+ }
+
+ node.leadingComments.push(comment);
+ comments.splice(cursor, 1);
+ } else {
+ cursor += 1;
}
- });
+ } // already out of owned node
- cursor = 0;
- traverse(tree, {
- leave: function (node) {
- var comment;
- while (cursor < comments.length) {
- comment = comments[cursor];
- if (node.range[1] < comment.extendedRange[0]) {
- break;
- }
+ if (cursor === comments.length) {
+ return VisitorOption.Break;
+ }
- if (node.range[1] === comment.extendedRange[0]) {
- if (!node.trailingComments) {
- node.trailingComments = [];
- }
- node.trailingComments.push(comment);
- comments.splice(cursor, 1);
- } else {
- cursor += 1;
- }
- }
+ if (comments[cursor].extendedRange[0] > node.range[1]) {
+ return VisitorOption.Skip;
+ }
+ }
+ });
+ cursor = 0;
+ traverse(tree, {
+ leave: function (node) {
+ var comment;
- // already out of owned node
- if (cursor === comments.length) {
- return VisitorOption.Break;
- }
+ while (cursor < comments.length) {
+ comment = comments[cursor];
- if (comments[cursor].extendedRange[0] > node.range[1]) {
- return VisitorOption.Skip;
- }
+ if (node.range[1] < comment.extendedRange[0]) {
+ break;
}
- });
- return tree;
+ if (node.range[1] === comment.extendedRange[0]) {
+ if (!node.trailingComments) {
+ node.trailingComments = [];
+ }
+
+ node.trailingComments.push(comment);
+ comments.splice(cursor, 1);
+ } else {
+ cursor += 1;
+ }
+ } // already out of owned node
+
+
+ if (cursor === comments.length) {
+ return VisitorOption.Break;
+ }
+
+ if (comments[cursor].extendedRange[0] > node.range[1]) {
+ return VisitorOption.Skip;
+ }
+ }
+ });
+ return tree;
}
exports.Syntax = Syntax;
@@ -780,423 +887,531 @@ var estraverse = createCommonjsModule(function (module, exports) {
exports.VisitorKeys = VisitorKeys;
exports.VisitorOption = VisitorOption;
exports.Controller = Controller;
- exports.cloneEnvironment = function () { return clone({}); };
+
+ exports.cloneEnvironment = function () {
+ return clone({});
+ };
return exports;
-}(exports));
-/* vim: set sw=4 ts=4 et tw=80 : */
+ })(exports);
+ /* vim: set sw=4 ts=4 et tw=80 : */
+
});
var parser = createCommonjsModule(function (module) {
-/*
- * Generated by PEG.js 0.10.0.
- *
- * http://pegjs.org/
- */
-(function(root, factory) {
- if ( module.exports) {
- module.exports = factory();
- }
-})(commonjsGlobal, function() {
-
- function peg$subclass(child, parent) {
- function ctor() { this.constructor = child; }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- }
-
- function peg$SyntaxError(message, expected, found, location) {
- this.message = message;
- this.expected = expected;
- this.found = found;
- this.location = location;
- this.name = "SyntaxError";
-
- if (typeof Error.captureStackTrace === "function") {
- Error.captureStackTrace(this, peg$SyntaxError);
+ /*
+ * Generated by PEG.js 0.10.0.
+ *
+ * http://pegjs.org/
+ */
+ (function (root, factory) {
+ if ( module.exports) {
+ module.exports = factory();
}
- }
+ })(commonjsGlobal, function () {
- peg$subclass(peg$SyntaxError, Error);
-
- peg$SyntaxError.buildMessage = function(expected, found) {
- var DESCRIBE_EXPECTATION_FNS = {
- literal: function(expectation) {
- return "\"" + literalEscape(expectation.text) + "\"";
- },
+ function peg$subclass(child, parent) {
+ function ctor() {
+ this.constructor = child;
+ }
- "class": function(expectation) {
- var escapedParts = "",
- i;
+ ctor.prototype = parent.prototype;
+ child.prototype = new ctor();
+ }
- for (i = 0; i < expectation.parts.length; i++) {
- escapedParts += expectation.parts[i] instanceof Array
- ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
- : classEscape(expectation.parts[i]);
- }
+ function peg$SyntaxError(message, expected, found, location) {
+ this.message = message;
+ this.expected = expected;
+ this.found = found;
+ this.location = location;
+ this.name = "SyntaxError";
- return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
- },
+ if (typeof Error.captureStackTrace === "function") {
+ Error.captureStackTrace(this, peg$SyntaxError);
+ }
+ }
- any: function(expectation) {
- return "any character";
- },
+ peg$subclass(peg$SyntaxError, Error);
- end: function(expectation) {
- return "end of input";
- },
+ peg$SyntaxError.buildMessage = function (expected, found) {
+ var DESCRIBE_EXPECTATION_FNS = {
+ literal: function literal(expectation) {
+ return "\"" + literalEscape(expectation.text) + "\"";
+ },
+ "class": function _class(expectation) {
+ var escapedParts = "",
+ i;
- other: function(expectation) {
- return expectation.description;
+ for (i = 0; i < expectation.parts.length; i++) {
+ escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]);
}
- };
-
- function hex(ch) {
- return ch.charCodeAt(0).toString(16).toUpperCase();
- }
- function literalEscape(s) {
- return s
- .replace(/\\/g, '\\\\')
- .replace(/"/g, '\\"')
- .replace(/\0/g, '\\0')
- .replace(/\t/g, '\\t')
- .replace(/\n/g, '\\n')
- .replace(/\r/g, '\\r')
- .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
- }
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
+ },
+ any: function any(expectation) {
+ return "any character";
+ },
+ end: function end(expectation) {
+ return "end of input";
+ },
+ other: function other(expectation) {
+ return expectation.description;
+ }
+ };
- function classEscape(s) {
- return s
- .replace(/\\/g, '\\\\')
- .replace(/\]/g, '\\]')
- .replace(/\^/g, '\\^')
- .replace(/-/g, '\\-')
- .replace(/\0/g, '\\0')
- .replace(/\t/g, '\\t')
- .replace(/\n/g, '\\n')
- .replace(/\r/g, '\\r')
- .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
- }
+ function hex(ch) {
+ return ch.charCodeAt(0).toString(16).toUpperCase();
+ }
- function describeExpectation(expectation) {
- return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
- }
+ function literalEscape(s) {
+ return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
+ return '\\x0' + hex(ch);
+ }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
+ return '\\x' + hex(ch);
+ });
+ }
- function describeExpected(expected) {
- var descriptions = new Array(expected.length),
- i, j;
+ function classEscape(s) {
+ return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
+ return '\\x0' + hex(ch);
+ }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
+ return '\\x' + hex(ch);
+ });
+ }
- for (i = 0; i < expected.length; i++) {
- descriptions[i] = describeExpectation(expected[i]);
+ function describeExpectation(expectation) {
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
}
- descriptions.sort();
+ function describeExpected(expected) {
+ var descriptions = new Array(expected.length),
+ i,
+ j;
- if (descriptions.length > 0) {
- for (i = 1, j = 1; i < descriptions.length; i++) {
- if (descriptions[i - 1] !== descriptions[i]) {
- descriptions[j] = descriptions[i];
- j++;
- }
+ for (i = 0; i < expected.length; i++) {
+ descriptions[i] = describeExpectation(expected[i]);
}
- descriptions.length = j;
- }
- switch (descriptions.length) {
- case 1:
- return descriptions[0];
+ descriptions.sort();
- case 2:
- return descriptions[0] + " or " + descriptions[1];
-
- default:
- return descriptions.slice(0, -1).join(", ")
- + ", or "
- + descriptions[descriptions.length - 1];
- }
- }
+ if (descriptions.length > 0) {
+ for (i = 1, j = 1; i < descriptions.length; i++) {
+ if (descriptions[i - 1] !== descriptions[i]) {
+ descriptions[j] = descriptions[i];
+ j++;
+ }
+ }
- function describeFound(found) {
- return found ? "\"" + literalEscape(found) + "\"" : "end of input";
- }
+ descriptions.length = j;
+ }
- return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
- };
+ switch (descriptions.length) {
+ case 1:
+ return descriptions[0];
- function peg$parse(input, options) {
- options = options !== void 0 ? options : {};
+ case 2:
+ return descriptions[0] + " or " + descriptions[1];
- var peg$FAILED = {},
+ default:
+ return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
+ }
+ }
- peg$startRuleFunctions = { start: peg$parsestart },
- peg$startRuleFunction = peg$parsestart,
+ function describeFound(found) {
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
+ }
- peg$c0 = function(ss) {
- return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss };
- },
- peg$c1 = function() { return void 0; },
- peg$c2 = " ",
- peg$c3 = peg$literalExpectation(" ", false),
- peg$c4 = /^[^ [\],():#!=><~+.]/,
- peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false),
- peg$c6 = function(i) { return i.join(''); },
- peg$c7 = ">",
- peg$c8 = peg$literalExpectation(">", false),
- peg$c9 = function() { return 'child'; },
- peg$c10 = "~",
- peg$c11 = peg$literalExpectation("~", false),
- peg$c12 = function() { return 'sibling'; },
- peg$c13 = "+",
- peg$c14 = peg$literalExpectation("+", false),
- peg$c15 = function() { return 'adjacent'; },
- peg$c16 = function() { return 'descendant'; },
- peg$c17 = ",",
- peg$c18 = peg$literalExpectation(",", false),
- peg$c19 = function(s, ss) {
- return [s].concat(ss.map(function (s) { return s[3]; }));
- },
- peg$c20 = function(a, ops) {
- return ops.reduce(function (memo, rhs) {
- return { type: rhs[0], left: memo, right: rhs[1] };
- }, a);
- },
- peg$c21 = "!",
- peg$c22 = peg$literalExpectation("!", false),
- peg$c23 = function(subject, as) {
- const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as };
- if(subject) b.subject = true;
- return b;
- },
- peg$c24 = "*",
- peg$c25 = peg$literalExpectation("*", false),
- peg$c26 = function(a) { return { type: 'wildcard', value: a }; },
- peg$c27 = "#",
- peg$c28 = peg$literalExpectation("#", false),
- peg$c29 = function(i) { return { type: 'identifier', value: i }; },
- peg$c30 = "[",
- peg$c31 = peg$literalExpectation("[", false),
- peg$c32 = "]",
- peg$c33 = peg$literalExpectation("]", false),
- peg$c34 = function(v) { return v; },
- peg$c35 = /^[><!]/,
- peg$c36 = peg$classExpectation([">", "<", "!"], false, false),
- peg$c37 = "=",
- peg$c38 = peg$literalExpectation("=", false),
- peg$c39 = function(a) { return (a || '') + '='; },
- peg$c40 = /^[><]/,
- peg$c41 = peg$classExpectation([">", "<"], false, false),
- peg$c42 = ".",
- peg$c43 = peg$literalExpectation(".", false),
- peg$c44 = function(name, op, value) {
- return { type: 'attribute', name: name, operator: op, value: value };
- },
- peg$c45 = function(name) { return { type: 'attribute', name: name }; },
- peg$c46 = "\"",
- peg$c47 = peg$literalExpectation("\"", false),
- peg$c48 = /^[^\\"]/,
- peg$c49 = peg$classExpectation(["\\", "\""], true, false),
- peg$c50 = "\\",
- peg$c51 = peg$literalExpectation("\\", false),
- peg$c52 = peg$anyExpectation(),
- peg$c53 = function(a, b) { return a + b; },
- peg$c54 = function(d) {
- return { type: 'literal', value: strUnescape(d.join('')) };
- },
- peg$c55 = "'",
- peg$c56 = peg$literalExpectation("'", false),
- peg$c57 = /^[^\\']/,
- peg$c58 = peg$classExpectation(["\\", "'"], true, false),
- peg$c59 = /^[0-9]/,
- peg$c60 = peg$classExpectation([["0", "9"]], false, false),
- peg$c61 = function(a, b) {
- // Can use `a.flat().join('')` once supported
- const leadingDecimals = a ? [].concat.apply([], a).join('') : '';
- return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) };
- },
- peg$c62 = function(i) { return { type: 'literal', value: i }; },
- peg$c63 = "type(",
- peg$c64 = peg$literalExpectation("type(", false),
- peg$c65 = /^[^ )]/,
- peg$c66 = peg$classExpectation([" ", ")"], true, false),
- peg$c67 = ")",
- peg$c68 = peg$literalExpectation(")", false),
- peg$c69 = function(t) { return { type: 'type', value: t.join('') }; },
- peg$c70 = /^[imsu]/,
- peg$c71 = peg$classExpectation(["i", "m", "s", "u"], false, false),
- peg$c72 = "/",
- peg$c73 = peg$literalExpectation("/", false),
- peg$c74 = /^[^\/]/,
- peg$c75 = peg$classExpectation(["/"], true, false),
- peg$c76 = function(d, flgs) { return {
- type: 'regexp', value: new RegExp(d.join(''), flgs ? flgs.join('') : '') };
- },
- peg$c77 = function(i, is) {
- return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)};
- },
- peg$c78 = ":not(",
- peg$c79 = peg$literalExpectation(":not(", false),
- peg$c80 = function(ss) { return { type: 'not', selectors: ss }; },
- peg$c81 = ":matches(",
- peg$c82 = peg$literalExpectation(":matches(", false),
- peg$c83 = function(ss) { return { type: 'matches', selectors: ss }; },
- peg$c84 = ":has(",
- peg$c85 = peg$literalExpectation(":has(", false),
- peg$c86 = function(ss) { return { type: 'has', selectors: ss }; },
- peg$c87 = ":first-child",
- peg$c88 = peg$literalExpectation(":first-child", false),
- peg$c89 = function() { return nth(1); },
- peg$c90 = ":last-child",
- peg$c91 = peg$literalExpectation(":last-child", false),
- peg$c92 = function() { return nthLast(1); },
- peg$c93 = ":nth-child(",
- peg$c94 = peg$literalExpectation(":nth-child(", false),
- peg$c95 = function(n) { return nth(parseInt(n.join(''), 10)); },
- peg$c96 = ":nth-last-child(",
- peg$c97 = peg$literalExpectation(":nth-last-child(", false),
- peg$c98 = function(n) { return nthLast(parseInt(n.join(''), 10)); },
- peg$c99 = ":",
- peg$c100 = peg$literalExpectation(":", false),
- peg$c101 = "statement",
- peg$c102 = peg$literalExpectation("statement", true),
- peg$c103 = "expression",
- peg$c104 = peg$literalExpectation("expression", true),
- peg$c105 = "declaration",
- peg$c106 = peg$literalExpectation("declaration", true),
- peg$c107 = "function",
- peg$c108 = peg$literalExpectation("function", true),
- peg$c109 = "pattern",
- peg$c110 = peg$literalExpectation("pattern", true),
- peg$c111 = function(c) {
- return { type: 'class', name: c };
- },
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
+ };
- peg$currPos = 0,
- peg$posDetailsCache = [{ line: 1, column: 1 }],
- peg$maxFailPos = 0,
- peg$maxFailExpected = [],
- peg$resultsCache = {},
+ function peg$parse(input, options) {
+ options = options !== void 0 ? options : {};
+
+ var peg$FAILED = {},
+ peg$startRuleFunctions = {
+ start: peg$parsestart
+ },
+ peg$startRuleFunction = peg$parsestart,
+ peg$c0 = function peg$c0(ss) {
+ return ss.length === 1 ? ss[0] : {
+ type: 'matches',
+ selectors: ss
+ };
+ },
+ peg$c1 = function peg$c1() {
+ return void 0;
+ },
+ peg$c2 = " ",
+ peg$c3 = peg$literalExpectation(" ", false),
+ peg$c4 = /^[^ [\],():#!=><~+.]/,
+ peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false),
+ peg$c6 = function peg$c6(i) {
+ return i.join('');
+ },
+ peg$c7 = ">",
+ peg$c8 = peg$literalExpectation(">", false),
+ peg$c9 = function peg$c9() {
+ return 'child';
+ },
+ peg$c10 = "~",
+ peg$c11 = peg$literalExpectation("~", false),
+ peg$c12 = function peg$c12() {
+ return 'sibling';
+ },
+ peg$c13 = "+",
+ peg$c14 = peg$literalExpectation("+", false),
+ peg$c15 = function peg$c15() {
+ return 'adjacent';
+ },
+ peg$c16 = function peg$c16() {
+ return 'descendant';
+ },
+ peg$c17 = ",",
+ peg$c18 = peg$literalExpectation(",", false),
+ peg$c19 = function peg$c19(s, ss) {
+ return [s].concat(ss.map(function (s) {
+ return s[3];
+ }));
+ },
+ peg$c20 = function peg$c20(a, ops) {
+ return ops.reduce(function (memo, rhs) {
+ return {
+ type: rhs[0],
+ left: memo,
+ right: rhs[1]
+ };
+ }, a);
+ },
+ peg$c21 = "!",
+ peg$c22 = peg$literalExpectation("!", false),
+ peg$c23 = function peg$c23(subject, as) {
+ var b = as.length === 1 ? as[0] : {
+ type: 'compound',
+ selectors: as
+ };
+ if (subject) b.subject = true;
+ return b;
+ },
+ peg$c24 = "*",
+ peg$c25 = peg$literalExpectation("*", false),
+ peg$c26 = function peg$c26(a) {
+ return {
+ type: 'wildcard',
+ value: a
+ };
+ },
+ peg$c27 = "#",
+ peg$c28 = peg$literalExpectation("#", false),
+ peg$c29 = function peg$c29(i) {
+ return {
+ type: 'identifier',
+ value: i
+ };
+ },
+ peg$c30 = "[",
+ peg$c31 = peg$literalExpectation("[", false),
+ peg$c32 = "]",
+ peg$c33 = peg$literalExpectation("]", false),
+ peg$c34 = function peg$c34(v) {
+ return v;
+ },
+ peg$c35 = /^[><!]/,
+ peg$c36 = peg$classExpectation([">", "<", "!"], false, false),
+ peg$c37 = "=",
+ peg$c38 = peg$literalExpectation("=", false),
+ peg$c39 = function peg$c39(a) {
+ return (a || '') + '=';
+ },
+ peg$c40 = /^[><]/,
+ peg$c41 = peg$classExpectation([">", "<"], false, false),
+ peg$c42 = ".",
+ peg$c43 = peg$literalExpectation(".", false),
+ peg$c44 = function peg$c44(name, op, value) {
+ return {
+ type: 'attribute',
+ name: name,
+ operator: op,
+ value: value
+ };
+ },
+ peg$c45 = function peg$c45(name) {
+ return {
+ type: 'attribute',
+ name: name
+ };
+ },
+ peg$c46 = "\"",
+ peg$c47 = peg$literalExpectation("\"", false),
+ peg$c48 = /^[^\\"]/,
+ peg$c49 = peg$classExpectation(["\\", "\""], true, false),
+ peg$c50 = "\\",
+ peg$c51 = peg$literalExpectation("\\", false),
+ peg$c52 = peg$anyExpectation(),
+ peg$c53 = function peg$c53(a, b) {
+ return a + b;
+ },
+ peg$c54 = function peg$c54(d) {
+ return {
+ type: 'literal',
+ value: strUnescape(d.join(''))
+ };
+ },
+ peg$c55 = "'",
+ peg$c56 = peg$literalExpectation("'", false),
+ peg$c57 = /^[^\\']/,
+ peg$c58 = peg$classExpectation(["\\", "'"], true, false),
+ peg$c59 = /^[0-9]/,
+ peg$c60 = peg$classExpectation([["0", "9"]], false, false),
+ peg$c61 = function peg$c61(a, b) {
+ // Can use `a.flat().join('')` once supported
+ var leadingDecimals = a ? [].concat.apply([], a).join('') : '';
+ return {
+ type: 'literal',
+ value: parseFloat(leadingDecimals + b.join(''))
+ };
+ },
+ peg$c62 = function peg$c62(i) {
+ return {
+ type: 'literal',
+ value: i
+ };
+ },
+ peg$c63 = "type(",
+ peg$c64 = peg$literalExpectation("type(", false),
+ peg$c65 = /^[^ )]/,
+ peg$c66 = peg$classExpectation([" ", ")"], true, false),
+ peg$c67 = ")",
+ peg$c68 = peg$literalExpectation(")", false),
+ peg$c69 = function peg$c69(t) {
+ return {
+ type: 'type',
+ value: t.join('')
+ };
+ },
+ peg$c70 = /^[imsu]/,
+ peg$c71 = peg$classExpectation(["i", "m", "s", "u"], false, false),
+ peg$c72 = "/",
+ peg$c73 = peg$literalExpectation("/", false),
+ peg$c74 = /^[^\/]/,
+ peg$c75 = peg$classExpectation(["/"], true, false),
+ peg$c76 = function peg$c76(d, flgs) {
+ return {
+ type: 'regexp',
+ value: new RegExp(d.join(''), flgs ? flgs.join('') : '')
+ };
+ },
+ peg$c77 = function peg$c77(i, is) {
+ return {
+ type: 'field',
+ name: is.reduce(function (memo, p) {
+ return memo + p[0] + p[1];
+ }, i)
+ };
+ },
+ peg$c78 = ":not(",
+ peg$c79 = peg$literalExpectation(":not(", false),
+ peg$c80 = function peg$c80(ss) {
+ return {
+ type: 'not',
+ selectors: ss
+ };
+ },
+ peg$c81 = ":matches(",
+ peg$c82 = peg$literalExpectation(":matches(", false),
+ peg$c83 = function peg$c83(ss) {
+ return {
+ type: 'matches',
+ selectors: ss
+ };
+ },
+ peg$c84 = ":has(",
+ peg$c85 = peg$literalExpectation(":has(", false),
+ peg$c86 = function peg$c86(ss) {
+ return {
+ type: 'has',
+ selectors: ss
+ };
+ },
+ peg$c87 = ":first-child",
+ peg$c88 = peg$literalExpectation(":first-child", false),
+ peg$c89 = function peg$c89() {
+ return nth(1);
+ },
+ peg$c90 = ":last-child",
+ peg$c91 = peg$literalExpectation(":last-child", false),
+ peg$c92 = function peg$c92() {
+ return nthLast(1);
+ },
+ peg$c93 = ":nth-child(",
+ peg$c94 = peg$literalExpectation(":nth-child(", false),
+ peg$c95 = function peg$c95(n) {
+ return nth(parseInt(n.join(''), 10));
+ },
+ peg$c96 = ":nth-last-child(",
+ peg$c97 = peg$literalExpectation(":nth-last-child(", false),
+ peg$c98 = function peg$c98(n) {
+ return nthLast(parseInt(n.join(''), 10));
+ },
+ peg$c99 = ":",
+ peg$c100 = peg$literalExpectation(":", false),
+ peg$c101 = "statement",
+ peg$c102 = peg$literalExpectation("statement", true),
+ peg$c103 = "expression",
+ peg$c104 = peg$literalExpectation("expression", true),
+ peg$c105 = "declaration",
+ peg$c106 = peg$literalExpectation("declaration", true),
+ peg$c107 = "function",
+ peg$c108 = peg$literalExpectation("function", true),
+ peg$c109 = "pattern",
+ peg$c110 = peg$literalExpectation("pattern", true),
+ peg$c111 = function peg$c111(c) {
+ return {
+ type: 'class',
+ name: c
+ };
+ },
+ peg$currPos = 0,
+ peg$posDetailsCache = [{
+ line: 1,
+ column: 1
+ }],
+ peg$maxFailPos = 0,
+ peg$maxFailExpected = [],
+ peg$resultsCache = {},
+ peg$result;
+
+ if ("startRule" in options) {
+ if (!(options.startRule in peg$startRuleFunctions)) {
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
+ }
- peg$result;
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
+ }
- if ("startRule" in options) {
- if (!(options.startRule in peg$startRuleFunctions)) {
- throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
+ function peg$literalExpectation(text, ignoreCase) {
+ return {
+ type: "literal",
+ text: text,
+ ignoreCase: ignoreCase
+ };
}
- peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
- }
+ function peg$classExpectation(parts, inverted, ignoreCase) {
+ return {
+ type: "class",
+ parts: parts,
+ inverted: inverted,
+ ignoreCase: ignoreCase
+ };
+ }
- function peg$literalExpectation(text, ignoreCase) {
- return { type: "literal", text: text, ignoreCase: ignoreCase };
- }
+ function peg$anyExpectation() {
+ return {
+ type: "any"
+ };
+ }
- function peg$classExpectation(parts, inverted, ignoreCase) {
- return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
- }
+ function peg$endExpectation() {
+ return {
+ type: "end"
+ };
+ }
- function peg$anyExpectation() {
- return { type: "any" };
- }
+ function peg$computePosDetails(pos) {
+ var details = peg$posDetailsCache[pos],
+ p;
- function peg$endExpectation() {
- return { type: "end" };
- }
+ if (details) {
+ return details;
+ } else {
+ p = pos - 1;
- function peg$computePosDetails(pos) {
- var details = peg$posDetailsCache[pos], p;
+ while (!peg$posDetailsCache[p]) {
+ p--;
+ }
- if (details) {
- return details;
- } else {
- p = pos - 1;
- while (!peg$posDetailsCache[p]) {
- p--;
- }
+ details = peg$posDetailsCache[p];
+ details = {
+ line: details.line,
+ column: details.column
+ };
- details = peg$posDetailsCache[p];
- details = {
- line: details.line,
- column: details.column
- };
+ while (p < pos) {
+ if (input.charCodeAt(p) === 10) {
+ details.line++;
+ details.column = 1;
+ } else {
+ details.column++;
+ }
- while (p < pos) {
- if (input.charCodeAt(p) === 10) {
- details.line++;
- details.column = 1;
- } else {
- details.column++;
+ p++;
}
- p++;
+ peg$posDetailsCache[pos] = details;
+ return details;
}
-
- peg$posDetailsCache[pos] = details;
- return details;
}
- }
- function peg$computeLocation(startPos, endPos) {
- var startPosDetails = peg$computePosDetails(startPos),
- endPosDetails = peg$computePosDetails(endPos);
+ function peg$computeLocation(startPos, endPos) {
+ var startPosDetails = peg$computePosDetails(startPos),
+ endPosDetails = peg$computePosDetails(endPos);
+ return {
+ start: {
+ offset: startPos,
+ line: startPosDetails.line,
+ column: startPosDetails.column
+ },
+ end: {
+ offset: endPos,
+ line: endPosDetails.line,
+ column: endPosDetails.column
+ }
+ };
+ }
- return {
- start: {
- offset: startPos,
- line: startPosDetails.line,
- column: startPosDetails.column
- },
- end: {
- offset: endPos,
- line: endPosDetails.line,
- column: endPosDetails.column
+ function peg$fail(expected) {
+ if (peg$currPos < peg$maxFailPos) {
+ return;
}
- };
- }
- function peg$fail(expected) {
- if (peg$currPos < peg$maxFailPos) { return; }
+ if (peg$currPos > peg$maxFailPos) {
+ peg$maxFailPos = peg$currPos;
+ peg$maxFailExpected = [];
+ }
- if (peg$currPos > peg$maxFailPos) {
- peg$maxFailPos = peg$currPos;
- peg$maxFailExpected = [];
+ peg$maxFailExpected.push(expected);
}
- peg$maxFailExpected.push(expected);
- }
+ function peg$buildStructuredError(expected, found, location) {
+ return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
+ }
- function peg$buildStructuredError(expected, found, location) {
- return new peg$SyntaxError(
- peg$SyntaxError.buildMessage(expected, found),
- expected,
- found,
- location
- );
- }
+ function peg$parsestart() {
+ var s0, s1, s2, s3;
+ var key = peg$currPos * 30 + 0,
+ cached = peg$resultsCache[key];
- function peg$parsestart() {
- var s0, s1, s2, s3;
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- var key = peg$currPos * 30 + 0,
- cached = peg$resultsCache[key];
+ s0 = peg$currPos;
+ s1 = peg$parse_();
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parseselectors();
- return cached.result;
- }
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parse_();
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- s2 = peg$parseselectors();
- if (s2 !== peg$FAILED) {
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- s1 = peg$c0(s2);
- s0 = s1;
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c0(s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -1205,159 +1420,155 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- s1 = peg$c1();
- }
- s0 = s1;
- }
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
+ s1 = peg$parse_();
- return s0;
- }
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c1();
+ }
- function peg$parse_() {
- var s0, s1;
+ s0 = s1;
+ }
- var key = peg$currPos * 30 + 1,
- cached = peg$resultsCache[key];
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
- if (cached) {
- peg$currPos = cached.nextPos;
+ function peg$parse_() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 1,
+ cached = peg$resultsCache[key];
- return cached.result;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = [];
- s0 = [];
- if (input.charCodeAt(peg$currPos) === 32) {
- s1 = peg$c2;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c3); }
- }
- while (s1 !== peg$FAILED) {
- s0.push(s1);
if (input.charCodeAt(peg$currPos) === 32) {
s1 = peg$c2;
peg$currPos++;
} else {
s1 = peg$FAILED;
- { peg$fail(peg$c3); }
- }
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseidentifierName() {
- var s0, s1, s2;
- var key = peg$currPos * 30 + 2,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c3);
+ }
+ }
- return cached.result;
- }
+ while (s1 !== peg$FAILED) {
+ s0.push(s1);
- s0 = peg$currPos;
- s1 = [];
- if (peg$c4.test(input.charAt(peg$currPos))) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c5); }
- }
- if (s2 !== peg$FAILED) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- if (peg$c4.test(input.charAt(peg$currPos))) {
- s2 = input.charAt(peg$currPos);
+ if (input.charCodeAt(peg$currPos) === 32) {
+ s1 = peg$c2;
peg$currPos++;
} else {
- s2 = peg$FAILED;
- { peg$fail(peg$c5); }
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c3);
+ }
}
}
- } else {
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- s1 = peg$c6(s1);
- }
- s0 = s1;
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
- return s0;
- }
-
- function peg$parsebinaryOp() {
- var s0, s1, s2, s3;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
- var key = peg$currPos * 30 + 3,
- cached = peg$resultsCache[key];
+ function peg$parseidentifierName() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 2,
+ cached = peg$resultsCache[key];
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- return cached.result;
- }
+ s0 = peg$currPos;
+ s1 = [];
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 62) {
- s2 = peg$c7;
+ if (peg$c4.test(input.charAt(peg$currPos))) {
+ s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
- { peg$fail(peg$c8); }
+
+ {
+ peg$fail(peg$c5);
+ }
}
+
if (s2 !== peg$FAILED) {
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- s1 = peg$c9();
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+ while (s2 !== peg$FAILED) {
+ s1.push(s2);
+
+ if (peg$c4.test(input.charAt(peg$currPos))) {
+ s2 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c5);
+ }
+ }
}
} else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+ s1 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c6(s1);
+ }
+
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- if (s0 === peg$FAILED) {
+
+ function peg$parsebinaryOp() {
+ var s0, s1, s2, s3;
+ var key = peg$currPos * 30 + 3,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
s0 = peg$currPos;
s1 = peg$parse_();
+
if (s1 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 126) {
- s2 = peg$c10;
+ if (input.charCodeAt(peg$currPos) === 62) {
+ s2 = peg$c7;
peg$currPos++;
} else {
s2 = peg$FAILED;
- { peg$fail(peg$c11); }
+
+ {
+ peg$fail(peg$c8);
+ }
}
+
if (s2 !== peg$FAILED) {
s3 = peg$parse_();
+
if (s3 !== peg$FAILED) {
- s1 = peg$c12();
+ s1 = peg$c9();
s0 = s1;
} else {
peg$currPos = s0;
@@ -1371,21 +1582,28 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
+
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = peg$parse_();
+
if (s1 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 43) {
- s2 = peg$c13;
+ if (input.charCodeAt(peg$currPos) === 126) {
+ s2 = peg$c10;
peg$currPos++;
} else {
s2 = peg$FAILED;
- { peg$fail(peg$c14); }
+
+ {
+ peg$fail(peg$c11);
+ }
}
+
if (s2 !== peg$FAILED) {
s3 = peg$parse_();
+
if (s3 !== peg$FAILED) {
- s1 = peg$c15();
+ s1 = peg$c12();
s0 = s1;
} else {
peg$currPos = s0;
@@ -1399,20 +1617,33 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
+
if (s0 === peg$FAILED) {
s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 32) {
- s1 = peg$c2;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c3); }
- }
+ s1 = peg$parse_();
+
if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
+ if (input.charCodeAt(peg$currPos) === 43) {
+ s2 = peg$c13;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c14);
+ }
+ }
+
if (s2 !== peg$FAILED) {
- s1 = peg$c16();
- s0 = s1;
+ s3 = peg$parse_();
+
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c15();
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -1421,80 +1652,82 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- }
- }
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
- function peg$parseselectors() {
- var s0, s1, s2, s3, s4, s5, s6, s7;
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 4,
- cached = peg$resultsCache[key];
+ if (input.charCodeAt(peg$currPos) === 32) {
+ s1 = peg$c2;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c3);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
- s0 = peg$currPos;
- s1 = peg$parseselector();
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$currPos;
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s5 = peg$c17;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c18); }
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parse_();
- if (s6 !== peg$FAILED) {
- s7 = peg$parseselector();
- if (s7 !== peg$FAILED) {
- s4 = [s4, s5, s6, s7];
- s3 = s4;
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c16();
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
- peg$currPos = s3;
- s3 = peg$FAILED;
+ peg$currPos = s0;
+ s0 = peg$FAILED;
}
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
}
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
}
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
}
- while (s3 !== peg$FAILED) {
- s2.push(s3);
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseselectors() {
+ var s0, s1, s2, s3, s4, s5, s6, s7;
+ var key = peg$currPos * 30 + 4,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = peg$parseselector();
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
s3 = peg$currPos;
s4 = peg$parse_();
+
if (s4 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 44) {
s5 = peg$c17;
peg$currPos++;
} else {
s5 = peg$FAILED;
- { peg$fail(peg$c18); }
+
+ {
+ peg$fail(peg$c18);
+ }
}
+
if (s5 !== peg$FAILED) {
s6 = peg$parse_();
+
if (s6 !== peg$FAILED) {
s7 = peg$parseselector();
+
if (s7 !== peg$FAILED) {
s4 = [s4, s5, s6, s7];
s3 = s4;
@@ -1514,61 +1747,91 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s3;
s3 = peg$FAILED;
}
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c19(s1, s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+ s3 = peg$currPos;
+ s4 = peg$parse_();
- return s0;
- }
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 44) {
+ s5 = peg$c17;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
- function peg$parseselector() {
- var s0, s1, s2, s3, s4, s5;
+ {
+ peg$fail(peg$c18);
+ }
+ }
- var key = peg$currPos * 30 + 5,
- cached = peg$resultsCache[key];
+ if (s5 !== peg$FAILED) {
+ s6 = peg$parse_();
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (s6 !== peg$FAILED) {
+ s7 = peg$parseselector();
- return cached.result;
- }
+ if (s7 !== peg$FAILED) {
+ s4 = [s4, s5, s6, s7];
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ }
- s0 = peg$currPos;
- s1 = peg$parsesequence();
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$currPos;
- s4 = peg$parsebinaryOp();
- if (s4 !== peg$FAILED) {
- s5 = peg$parsesequence();
- if (s5 !== peg$FAILED) {
- s4 = [s4, s5];
- s3 = s4;
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c19(s1, s2);
+ s0 = s1;
} else {
- peg$currPos = s3;
- s3 = peg$FAILED;
+ peg$currPos = s0;
+ s0 = peg$FAILED;
}
} else {
- peg$currPos = s3;
- s3 = peg$FAILED;
+ peg$currPos = s0;
+ s0 = peg$FAILED;
}
- while (s3 !== peg$FAILED) {
- s2.push(s3);
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseselector() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 5,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = peg$parsesequence();
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
s3 = peg$currPos;
s4 = peg$parsebinaryOp();
+
if (s4 !== peg$FAILED) {
s5 = peg$parsesequence();
+
if (s5 !== peg$FAILED) {
s4 = [s4, s5];
s3 = s4;
@@ -1580,110 +1843,151 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s3;
s3 = peg$FAILED;
}
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c20(s1, s2);
- s0 = s1;
+
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+ s3 = peg$currPos;
+ s4 = peg$parsebinaryOp();
+
+ if (s4 !== peg$FAILED) {
+ s5 = peg$parsesequence();
+
+ if (s5 !== peg$FAILED) {
+ s4 = [s4, s5];
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c20(s1, s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parsesequence() {
+ var s0, s1, s2, s3;
+ var key = peg$currPos * 30 + 6,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parsesequence() {
- var s0, s1, s2, s3;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 6,
- cached = peg$resultsCache[key];
+ if (input.charCodeAt(peg$currPos) === 33) {
+ s1 = peg$c21;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c22);
+ }
+ }
- return cached.result;
- }
+ if (s1 === peg$FAILED) {
+ s1 = null;
+ }
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 33) {
- s1 = peg$c21;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c22); }
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parseatom();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parseatom();
+ if (s1 !== peg$FAILED) {
+ s2 = [];
+ s3 = peg$parseatom();
+
+ if (s3 !== peg$FAILED) {
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+ s3 = peg$parseatom();
+ }
+ } else {
+ s2 = peg$FAILED;
+ }
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c23(s1, s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
}
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c23(s1, s2);
- s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
- function peg$parseatom() {
- var s0;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
- var key = peg$currPos * 30 + 7,
- cached = peg$resultsCache[key];
+ function peg$parseatom() {
+ var s0;
+ var key = peg$currPos * 30 + 7,
+ cached = peg$resultsCache[key];
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- return cached.result;
- }
+ s0 = peg$parsewildcard();
- s0 = peg$parsewildcard();
- if (s0 === peg$FAILED) {
- s0 = peg$parseidentifier();
if (s0 === peg$FAILED) {
- s0 = peg$parseattr();
+ s0 = peg$parseidentifier();
+
if (s0 === peg$FAILED) {
- s0 = peg$parsefield();
+ s0 = peg$parseattr();
+
if (s0 === peg$FAILED) {
- s0 = peg$parsenegation();
+ s0 = peg$parsefield();
+
if (s0 === peg$FAILED) {
- s0 = peg$parsematches();
+ s0 = peg$parsenegation();
+
if (s0 === peg$FAILED) {
- s0 = peg$parsehas();
+ s0 = peg$parsematches();
+
if (s0 === peg$FAILED) {
- s0 = peg$parsefirstChild();
+ s0 = peg$parsehas();
+
if (s0 === peg$FAILED) {
- s0 = peg$parselastChild();
+ s0 = peg$parsefirstChild();
+
if (s0 === peg$FAILED) {
- s0 = peg$parsenthChild();
+ s0 = peg$parselastChild();
+
if (s0 === peg$FAILED) {
- s0 = peg$parsenthLastChild();
+ s0 = peg$parsenthChild();
+
if (s0 === peg$FAILED) {
- s0 = peg$parseclass();
+ s0 = peg$parsenthLastChild();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parseclass();
+ }
}
}
}
@@ -1694,122 +1998,149 @@ var parser = createCommonjsModule(function (module) {
}
}
}
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parsewildcard() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 8,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parsewildcard() {
- var s0, s1;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 8,
- cached = peg$resultsCache[key];
+ if (input.charCodeAt(peg$currPos) === 42) {
+ s1 = peg$c24;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c25);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c26(s1);
+ }
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 42) {
- s1 = peg$c24;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c25); }
- }
- if (s1 !== peg$FAILED) {
- s1 = peg$c26(s1);
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- s0 = s1;
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parseidentifier() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 9,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
- function peg$parseidentifier() {
- var s0, s1, s2;
+ if (input.charCodeAt(peg$currPos) === 35) {
+ s1 = peg$c27;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
- var key = peg$currPos * 30 + 9,
- cached = peg$resultsCache[key];
+ {
+ peg$fail(peg$c28);
+ }
+ }
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (s1 === peg$FAILED) {
+ s1 = null;
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parseidentifierName();
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 35) {
- s1 = peg$c27;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c28); }
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parseidentifierName();
- if (s2 !== peg$FAILED) {
- s1 = peg$c29(s2);
- s0 = s1;
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c29(s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parseattr() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 10,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parseattr() {
- var s0, s1, s2, s3, s4, s5;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 10,
- cached = peg$resultsCache[key];
+ if (input.charCodeAt(peg$currPos) === 91) {
+ s1 = peg$c30;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c31);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 91) {
- s1 = peg$c30;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c31); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseattrValue();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 93) {
- s5 = peg$c32;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c33); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c34(s3);
- s0 = s1;
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseattrValue();
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 93) {
+ s5 = peg$c32;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c33);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c34(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -1826,237 +2157,233 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseattrOps() {
- var s0, s1, s2;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
- var key = peg$currPos * 30 + 11,
- cached = peg$resultsCache[key];
+ function peg$parseattrOps() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 11,
+ cached = peg$resultsCache[key];
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- return cached.result;
- }
+ s0 = peg$currPos;
- s0 = peg$currPos;
- if (peg$c35.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c36); }
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 61) {
- s2 = peg$c37;
+ if (peg$c35.test(input.charAt(peg$currPos))) {
+ s1 = input.charAt(peg$currPos);
peg$currPos++;
} else {
- s2 = peg$FAILED;
- { peg$fail(peg$c38); }
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c39(s1);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- if (peg$c40.test(input.charAt(peg$currPos))) {
- s0 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s0 = peg$FAILED;
- { peg$fail(peg$c41); }
- }
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
+ s1 = peg$FAILED;
- function peg$parseattrEqOps() {
- var s0, s1, s2;
+ {
+ peg$fail(peg$c36);
+ }
+ }
- var key = peg$currPos * 30 + 12,
- cached = peg$resultsCache[key];
+ if (s1 === peg$FAILED) {
+ s1 = null;
+ }
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (s1 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 61) {
+ s2 = peg$c37;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
- return cached.result;
- }
+ {
+ peg$fail(peg$c38);
+ }
+ }
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 33) {
- s1 = peg$c21;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c22); }
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 61) {
- s2 = peg$c37;
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c38); }
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c39(s1);
- s0 = s1;
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c39(s1);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ if (s0 === peg$FAILED) {
+ if (peg$c40.test(input.charAt(peg$currPos))) {
+ s0 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s0 = peg$FAILED;
- return s0;
- }
+ {
+ peg$fail(peg$c41);
+ }
+ }
+ }
- function peg$parseattrName() {
- var s0, s1, s2;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
- var key = peg$currPos * 30 + 13,
- cached = peg$resultsCache[key];
+ function peg$parseattrEqOps() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 12,
+ cached = peg$resultsCache[key];
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- return cached.result;
- }
+ s0 = peg$currPos;
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$parseidentifierName();
- if (s2 === peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 46) {
- s2 = peg$c42;
+ if (input.charCodeAt(peg$currPos) === 33) {
+ s1 = peg$c21;
peg$currPos++;
} else {
- s2 = peg$FAILED;
- { peg$fail(peg$c43); }
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c22);
+ }
}
- }
- if (s2 !== peg$FAILED) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$parseidentifierName();
- if (s2 === peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 46) {
- s2 = peg$c42;
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c43); }
+
+ if (s1 === peg$FAILED) {
+ s1 = null;
+ }
+
+ if (s1 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 61) {
+ s2 = peg$c37;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c38);
}
}
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c39(s1);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
}
- } else {
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- s1 = peg$c6(s1);
- }
- s0 = s1;
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
- return s0;
- }
+ function peg$parseattrName() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 13,
+ cached = peg$resultsCache[key];
- function peg$parseattrValue() {
- var s0, s1, s2, s3, s4, s5;
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- var key = peg$currPos * 30 + 14,
- cached = peg$resultsCache[key];
+ s0 = peg$currPos;
+ s1 = [];
+ s2 = peg$parseidentifierName();
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (s2 === peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s2 = peg$c42;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
- return cached.result;
- }
+ {
+ peg$fail(peg$c43);
+ }
+ }
+ }
- s0 = peg$currPos;
- s1 = peg$parseattrName();
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
if (s2 !== peg$FAILED) {
- s3 = peg$parseattrEqOps();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- s5 = peg$parsetype();
- if (s5 === peg$FAILED) {
- s5 = peg$parseregex();
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c44(s1, s3, s5);
- s0 = s1;
+ while (s2 !== peg$FAILED) {
+ s1.push(s2);
+ s2 = peg$parseidentifierName();
+
+ if (s2 === peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s2 = peg$c42;
+ peg$currPos++;
} else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c43);
+ }
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
}
} else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+ s1 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c6(s1);
+ }
+
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- if (s0 === peg$FAILED) {
+
+ function peg$parseattrValue() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 14,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
s0 = peg$currPos;
s1 = peg$parseattrName();
+
if (s1 !== peg$FAILED) {
s2 = peg$parse_();
+
if (s2 !== peg$FAILED) {
- s3 = peg$parseattrOps();
+ s3 = peg$parseattrEqOps();
+
if (s3 !== peg$FAILED) {
s4 = peg$parse_();
+
if (s4 !== peg$FAILED) {
- s5 = peg$parsestring();
+ s5 = peg$parsetype();
+
if (s5 === peg$FAILED) {
- s5 = peg$parsenumber();
- if (s5 === peg$FAILED) {
- s5 = peg$parsepath();
- }
+ s5 = peg$parseregex();
}
+
if (s5 !== peg$FAILED) {
s1 = peg$c44(s1, s3, s5);
s0 = s1;
@@ -2080,176 +2407,137 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
+
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = peg$parseattrName();
- if (s1 !== peg$FAILED) {
- s1 = peg$c45(s1);
- }
- s0 = s1;
- }
- }
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
- return s0;
- }
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseattrOps();
- function peg$parsestring() {
- var s0, s1, s2, s3, s4, s5;
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
- var key = peg$currPos * 30 + 15,
- cached = peg$resultsCache[key];
+ if (s4 !== peg$FAILED) {
+ s5 = peg$parsestring();
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (s5 === peg$FAILED) {
+ s5 = peg$parsenumber();
- return cached.result;
- }
+ if (s5 === peg$FAILED) {
+ s5 = peg$parsepath();
+ }
+ }
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 34) {
- s1 = peg$c46;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c47); }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- if (peg$c48.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c49); }
- }
- if (s3 === peg$FAILED) {
- s3 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 92) {
- s4 = peg$c50;
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c51); }
- }
- if (s4 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s5 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c52); }
- }
- if (s5 !== peg$FAILED) {
- s4 = peg$c53(s4, s5);
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- }
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- if (peg$c48.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c49); }
- }
- if (s3 === peg$FAILED) {
- s3 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 92) {
- s4 = peg$c50;
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c51); }
- }
- if (s4 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s5 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c52); }
- }
- if (s5 !== peg$FAILED) {
- s4 = peg$c53(s4, s5);
- s3 = s4;
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c44(s1, s3, s5);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
- peg$currPos = s3;
- s3 = peg$FAILED;
+ peg$currPos = s0;
+ s0 = peg$FAILED;
}
} else {
- peg$currPos = s3;
- s3 = peg$FAILED;
+ peg$currPos = s0;
+ s0 = peg$FAILED;
}
- }
- }
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 34) {
- s3 = peg$c46;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c47); }
- }
- if (s3 !== peg$FAILED) {
- s1 = peg$c54(s2);
- s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
+ s1 = peg$parseattrName();
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c45(s1);
+ }
+
+ s0 = s1;
+ }
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- if (s0 === peg$FAILED) {
+
+ function peg$parsestring() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 15,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 39) {
- s1 = peg$c55;
+
+ if (input.charCodeAt(peg$currPos) === 34) {
+ s1 = peg$c46;
peg$currPos++;
} else {
s1 = peg$FAILED;
- { peg$fail(peg$c56); }
+
+ {
+ peg$fail(peg$c47);
+ }
}
+
if (s1 !== peg$FAILED) {
s2 = [];
- if (peg$c57.test(input.charAt(peg$currPos))) {
+
+ if (peg$c48.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
- { peg$fail(peg$c58); }
+
+ {
+ peg$fail(peg$c49);
+ }
}
+
if (s3 === peg$FAILED) {
s3 = peg$currPos;
+
if (input.charCodeAt(peg$currPos) === 92) {
s4 = peg$c50;
peg$currPos++;
} else {
s4 = peg$FAILED;
- { peg$fail(peg$c51); }
+
+ {
+ peg$fail(peg$c51);
+ }
}
+
if (s4 !== peg$FAILED) {
if (input.length > peg$currPos) {
s5 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s5 = peg$FAILED;
- { peg$fail(peg$c52); }
+
+ {
+ peg$fail(peg$c52);
+ }
}
+
if (s5 !== peg$FAILED) {
s4 = peg$c53(s4, s5);
s3 = s4;
@@ -2262,32 +2550,47 @@ var parser = createCommonjsModule(function (module) {
s3 = peg$FAILED;
}
}
+
while (s3 !== peg$FAILED) {
s2.push(s3);
- if (peg$c57.test(input.charAt(peg$currPos))) {
+
+ if (peg$c48.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
- { peg$fail(peg$c58); }
+
+ {
+ peg$fail(peg$c49);
+ }
}
+
if (s3 === peg$FAILED) {
s3 = peg$currPos;
+
if (input.charCodeAt(peg$currPos) === 92) {
s4 = peg$c50;
peg$currPos++;
} else {
s4 = peg$FAILED;
- { peg$fail(peg$c51); }
+
+ {
+ peg$fail(peg$c51);
+ }
}
+
if (s4 !== peg$FAILED) {
if (input.length > peg$currPos) {
s5 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s5 = peg$FAILED;
- { peg$fail(peg$c52); }
+
+ {
+ peg$fail(peg$c52);
+ }
}
+
if (s5 !== peg$FAILED) {
s4 = peg$c53(s4, s5);
s3 = s4;
@@ -2301,14 +2604,19 @@ var parser = createCommonjsModule(function (module) {
}
}
}
+
if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 39) {
- s3 = peg$c55;
+ if (input.charCodeAt(peg$currPos) === 34) {
+ s3 = peg$c46;
peg$currPos++;
} else {
s3 = peg$FAILED;
- { peg$fail(peg$c56); }
+
+ {
+ peg$fail(peg$c47);
+ }
}
+
if (s3 !== peg$FAILED) {
s1 = peg$c54(s2);
s0 = s1;
@@ -2324,189 +2632,390 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- }
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
- return s0;
- }
+ if (input.charCodeAt(peg$currPos) === 39) {
+ s1 = peg$c55;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
- function peg$parsenumber() {
- var s0, s1, s2, s3;
+ {
+ peg$fail(peg$c56);
+ }
+ }
- var key = peg$currPos * 30 + 16,
- cached = peg$resultsCache[key];
+ if (s1 !== peg$FAILED) {
+ s2 = [];
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (peg$c57.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
- return cached.result;
- }
+ {
+ peg$fail(peg$c58);
+ }
+ }
- s0 = peg$currPos;
- s1 = peg$currPos;
- s2 = [];
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c60); }
+ if (s3 === peg$FAILED) {
+ s3 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 92) {
+ s4 = peg$c50;
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c51);
+ }
+ }
+
+ if (s4 !== peg$FAILED) {
+ if (input.length > peg$currPos) {
+ s5 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c52);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s4 = peg$c53(s4, s5);
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ }
+
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+
+ if (peg$c57.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c58);
+ }
+ }
+
+ if (s3 === peg$FAILED) {
+ s3 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 92) {
+ s4 = peg$c50;
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c51);
+ }
+ }
+
+ if (s4 !== peg$FAILED) {
+ if (input.length > peg$currPos) {
+ s5 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c52);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s4 = peg$c53(s4, s5);
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 39) {
+ s3 = peg$c55;
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c56);
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c54(s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- while (s3 !== peg$FAILED) {
- s2.push(s3);
+
+ function peg$parsenumber() {
+ var s0, s1, s2, s3;
+ var key = peg$currPos * 30 + 16,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = peg$currPos;
+ s2 = [];
+
if (peg$c59.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
- { peg$fail(peg$c60); }
+
+ {
+ peg$fail(peg$c60);
+ }
}
- }
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 46) {
- s3 = peg$c42;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c43); }
+
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
}
- if (s3 !== peg$FAILED) {
- s2 = [s2, s3];
- s1 = s2;
+
+ if (s2 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s3 = peg$c42;
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c43);
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ s2 = [s2, s3];
+ s1 = s2;
+ } else {
+ peg$currPos = s1;
+ s1 = peg$FAILED;
+ }
} else {
peg$currPos = s1;
s1 = peg$FAILED;
}
- } else {
- peg$currPos = s1;
- s1 = peg$FAILED;
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c60); }
+
+ if (s1 === peg$FAILED) {
+ s1 = null;
}
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c60); }
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
}
}
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c61(s1, s2);
- s0 = s1;
+
+ if (s3 !== peg$FAILED) {
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
+ }
+ } else {
+ s2 = peg$FAILED;
+ }
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c61(s1, s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parsepath() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 17,
+ cached = peg$resultsCache[key];
- return s0;
- }
-
- function peg$parsepath() {
- var s0, s1;
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- var key = peg$currPos * 30 + 17,
- cached = peg$resultsCache[key];
+ s0 = peg$currPos;
+ s1 = peg$parseidentifierName();
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c62(s1);
+ }
- return cached.result;
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- s0 = peg$currPos;
- s1 = peg$parseidentifierName();
- if (s1 !== peg$FAILED) {
- s1 = peg$c62(s1);
- }
- s0 = s1;
+ function peg$parsetype() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 18,
+ cached = peg$resultsCache[key];
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- return s0;
- }
+ s0 = peg$currPos;
- function peg$parsetype() {
- var s0, s1, s2, s3, s4, s5;
+ if (input.substr(peg$currPos, 5) === peg$c63) {
+ s1 = peg$c63;
+ peg$currPos += 5;
+ } else {
+ s1 = peg$FAILED;
- var key = peg$currPos * 30 + 18,
- cached = peg$resultsCache[key];
+ {
+ peg$fail(peg$c64);
+ }
+ }
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
- return cached.result;
- }
+ if (s2 !== peg$FAILED) {
+ s3 = [];
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 5) === peg$c63) {
- s1 = peg$c63;
- peg$currPos += 5;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c64); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = [];
- if (peg$c65.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c66); }
- }
- if (s4 !== peg$FAILED) {
- while (s4 !== peg$FAILED) {
- s3.push(s4);
- if (peg$c65.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c66); }
+ if (peg$c65.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c66);
}
}
- } else {
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
+
if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
+ while (s4 !== peg$FAILED) {
+ s3.push(s4);
+
+ if (peg$c65.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c66);
+ }
+ }
}
- if (s5 !== peg$FAILED) {
- s1 = peg$c69(s3);
- s0 = s1;
+ } else {
+ s3 = peg$FAILED;
+ }
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c69(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -2523,115 +3032,145 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
- return s0;
- }
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
- function peg$parseflags() {
- var s0, s1;
+ function peg$parseflags() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 19,
+ cached = peg$resultsCache[key];
- var key = peg$currPos * 30 + 19,
- cached = peg$resultsCache[key];
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- if (cached) {
- peg$currPos = cached.nextPos;
+ s0 = [];
- return cached.result;
- }
+ if (peg$c70.test(input.charAt(peg$currPos))) {
+ s1 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
- s0 = [];
- if (peg$c70.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c71); }
- }
- if (s1 !== peg$FAILED) {
- while (s1 !== peg$FAILED) {
- s0.push(s1);
- if (peg$c70.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c71); }
+ {
+ peg$fail(peg$c71);
}
}
- } else {
- s0 = peg$FAILED;
- }
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ if (s1 !== peg$FAILED) {
+ while (s1 !== peg$FAILED) {
+ s0.push(s1);
- return s0;
- }
+ if (peg$c70.test(input.charAt(peg$currPos))) {
+ s1 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
- function peg$parseregex() {
- var s0, s1, s2, s3, s4;
+ {
+ peg$fail(peg$c71);
+ }
+ }
+ }
+ } else {
+ s0 = peg$FAILED;
+ }
- var key = peg$currPos * 30 + 20,
- cached = peg$resultsCache[key];
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
- if (cached) {
- peg$currPos = cached.nextPos;
+ function peg$parseregex() {
+ var s0, s1, s2, s3, s4;
+ var key = peg$currPos * 30 + 20,
+ cached = peg$resultsCache[key];
- return cached.result;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 47) {
- s1 = peg$c72;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c73); }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- if (peg$c74.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 47) {
+ s1 = peg$c72;
peg$currPos++;
} else {
- s3 = peg$FAILED;
- { peg$fail(peg$c75); }
- }
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- if (peg$c74.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c75); }
- }
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c73);
}
- } else {
- s2 = peg$FAILED;
}
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 47) {
- s3 = peg$c72;
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
+
+ if (peg$c74.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
- { peg$fail(peg$c73); }
+
+ {
+ peg$fail(peg$c75);
+ }
}
+
if (s3 !== peg$FAILED) {
- s4 = peg$parseflags();
- if (s4 === peg$FAILED) {
- s4 = null;
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+
+ if (peg$c74.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c75);
+ }
+ }
}
- if (s4 !== peg$FAILED) {
- s1 = peg$c76(s2, s4);
- s0 = s1;
+ } else {
+ s2 = peg$FAILED;
+ }
+
+ if (s2 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 47) {
+ s3 = peg$c72;
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c73);
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parseflags();
+
+ if (s4 === peg$FAILED) {
+ s4 = null;
+ }
+
+ if (s4 !== peg$FAILED) {
+ s1 = peg$c76(s2, s4);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -2644,73 +3183,58 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parsefield() {
+ var s0, s1, s2, s3, s4, s5, s6;
+ var key = peg$currPos * 30 + 21,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parsefield() {
- var s0, s1, s2, s3, s4, s5, s6;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 21,
- cached = peg$resultsCache[key];
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s1 = peg$c42;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c43);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parseidentifierName();
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 46) {
- s1 = peg$c42;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c43); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parseidentifierName();
- if (s2 !== peg$FAILED) {
- s3 = [];
- s4 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 46) {
- s5 = peg$c42;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c43); }
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parseidentifierName();
- if (s6 !== peg$FAILED) {
- s5 = [s5, s6];
- s4 = s5;
- } else {
- peg$currPos = s4;
- s4 = peg$FAILED;
- }
- } else {
- peg$currPos = s4;
- s4 = peg$FAILED;
- }
- while (s4 !== peg$FAILED) {
- s3.push(s4);
+ if (s2 !== peg$FAILED) {
+ s3 = [];
s4 = peg$currPos;
+
if (input.charCodeAt(peg$currPos) === 46) {
s5 = peg$c42;
peg$currPos++;
} else {
s5 = peg$FAILED;
- { peg$fail(peg$c43); }
+
+ {
+ peg$fail(peg$c43);
+ }
}
+
if (s5 !== peg$FAILED) {
s6 = peg$parseidentifierName();
+
if (s6 !== peg$FAILED) {
s5 = [s5, s6];
s4 = s5;
@@ -2722,10 +3246,45 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s4;
s4 = peg$FAILED;
}
- }
- if (s3 !== peg$FAILED) {
- s1 = peg$c77(s2, s3);
- s0 = s1;
+
+ while (s4 !== peg$FAILED) {
+ s3.push(s4);
+ s4 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s5 = peg$c42;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c43);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s6 = peg$parseidentifierName();
+
+ if (s6 !== peg$FAILED) {
+ s5 = [s5, s6];
+ s4 = s5;
+ } else {
+ peg$currPos = s4;
+ s4 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s4;
+ s4 = peg$FAILED;
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c77(s2, s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -2734,53 +3293,65 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parsenegation() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 22,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parsenegation() {
- var s0, s1, s2, s3, s4, s5;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 22,
- cached = peg$resultsCache[key];
+ if (input.substr(peg$currPos, 5) === peg$c78) {
+ s1 = peg$c78;
+ peg$currPos += 5;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c79);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 5) === peg$c78) {
- s1 = peg$c78;
- peg$currPos += 5;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c79); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseselectors();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c80(s3);
- s0 = s1;
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseselectors();
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c80(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -2797,53 +3368,65 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parsematches() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 23,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parsematches() {
- var s0, s1, s2, s3, s4, s5;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 23,
- cached = peg$resultsCache[key];
+ if (input.substr(peg$currPos, 9) === peg$c81) {
+ s1 = peg$c81;
+ peg$currPos += 9;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c82);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 9) === peg$c81) {
- s1 = peg$c81;
- peg$currPos += 9;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c82); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseselectors();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c83(s3);
- s0 = s1;
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseselectors();
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c83(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -2860,53 +3443,65 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parsehas() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 24,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parsehas() {
- var s0, s1, s2, s3, s4, s5;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 24,
- cached = peg$resultsCache[key];
+ if (input.substr(peg$currPos, 5) === peg$c84) {
+ s1 = peg$c84;
+ peg$currPos += 5;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c85);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 5) === peg$c84) {
- s1 = peg$c84;
- peg$currPos += 5;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c85); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseselectors();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c86(s3);
- s0 = s1;
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseselectors();
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c86(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -2923,134 +3518,165 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parsefirstChild() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 25,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parsefirstChild() {
- var s0, s1;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 25,
- cached = peg$resultsCache[key];
+ if (input.substr(peg$currPos, 12) === peg$c87) {
+ s1 = peg$c87;
+ peg$currPos += 12;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c88);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c89();
+ }
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 12) === peg$c87) {
- s1 = peg$c87;
- peg$currPos += 12;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c88); }
- }
- if (s1 !== peg$FAILED) {
- s1 = peg$c89();
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- s0 = s1;
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parselastChild() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 26,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parselastChild() {
- var s0, s1;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 26,
- cached = peg$resultsCache[key];
+ if (input.substr(peg$currPos, 11) === peg$c90) {
+ s1 = peg$c90;
+ peg$currPos += 11;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c91);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c92();
+ }
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 11) === peg$c90) {
- s1 = peg$c90;
- peg$currPos += 11;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c91); }
- }
- if (s1 !== peg$FAILED) {
- s1 = peg$c92();
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- s0 = s1;
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parsenthChild() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 27,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parsenthChild() {
- var s0, s1, s2, s3, s4, s5;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 27,
- cached = peg$resultsCache[key];
+ if (input.substr(peg$currPos, 11) === peg$c93) {
+ s1 = peg$c93;
+ peg$currPos += 11;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c94);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 11) === peg$c93) {
- s1 = peg$c93;
- peg$currPos += 11;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c94); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = [];
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c60); }
- }
- if (s4 !== peg$FAILED) {
- while (s4 !== peg$FAILED) {
- s3.push(s4);
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c60); }
+ if (s2 !== peg$FAILED) {
+ s3 = [];
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
}
}
- } else {
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
+
if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
+ while (s4 !== peg$FAILED) {
+ s3.push(s4);
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
}
- if (s5 !== peg$FAILED) {
- s1 = peg$c95(s3);
- s0 = s1;
+ } else {
+ s3 = peg$FAILED;
+ }
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c95(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -3067,74 +3693,95 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
}
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ function peg$parsenthLastChild() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 28,
+ cached = peg$resultsCache[key];
- return s0;
- }
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- function peg$parsenthLastChild() {
- var s0, s1, s2, s3, s4, s5;
+ s0 = peg$currPos;
- var key = peg$currPos * 30 + 28,
- cached = peg$resultsCache[key];
+ if (input.substr(peg$currPos, 16) === peg$c96) {
+ s1 = peg$c96;
+ peg$currPos += 16;
+ } else {
+ s1 = peg$FAILED;
- if (cached) {
- peg$currPos = cached.nextPos;
+ {
+ peg$fail(peg$c97);
+ }
+ }
- return cached.result;
- }
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 16) === peg$c96) {
- s1 = peg$c96;
- peg$currPos += 16;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c97); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = [];
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c60); }
- }
- if (s4 !== peg$FAILED) {
- while (s4 !== peg$FAILED) {
- s3.push(s4);
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c60); }
+ if (s2 !== peg$FAILED) {
+ s3 = [];
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
}
}
- } else {
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
+
if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
+ while (s4 !== peg$FAILED) {
+ s3.push(s4);
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
}
- if (s5 !== peg$FAILED) {
- s1 = peg$c98(s3);
- s0 = s1;
+ } else {
+ s3 = peg$FAILED;
+ }
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c98(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
@@ -3151,150 +3798,201 @@ var parser = createCommonjsModule(function (module) {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
- return s0;
- }
-
- function peg$parseclass() {
- var s0, s1, s2;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
- var key = peg$currPos * 30 + 29,
- cached = peg$resultsCache[key];
+ function peg$parseclass() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 29,
+ cached = peg$resultsCache[key];
- if (cached) {
- peg$currPos = cached.nextPos;
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
- return cached.result;
- }
+ s0 = peg$currPos;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 58) {
- s1 = peg$c99;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c100); }
- }
- if (s1 !== peg$FAILED) {
- if (input.substr(peg$currPos, 9).toLowerCase() === peg$c101) {
- s2 = input.substr(peg$currPos, 9);
- peg$currPos += 9;
+ if (input.charCodeAt(peg$currPos) === 58) {
+ s1 = peg$c99;
+ peg$currPos++;
} else {
- s2 = peg$FAILED;
- { peg$fail(peg$c102); }
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c100);
+ }
}
- if (s2 === peg$FAILED) {
- if (input.substr(peg$currPos, 10).toLowerCase() === peg$c103) {
- s2 = input.substr(peg$currPos, 10);
- peg$currPos += 10;
+
+ if (s1 !== peg$FAILED) {
+ if (input.substr(peg$currPos, 9).toLowerCase() === peg$c101) {
+ s2 = input.substr(peg$currPos, 9);
+ peg$currPos += 9;
} else {
s2 = peg$FAILED;
- { peg$fail(peg$c104); }
+
+ {
+ peg$fail(peg$c102);
+ }
}
+
if (s2 === peg$FAILED) {
- if (input.substr(peg$currPos, 11).toLowerCase() === peg$c105) {
- s2 = input.substr(peg$currPos, 11);
- peg$currPos += 11;
+ if (input.substr(peg$currPos, 10).toLowerCase() === peg$c103) {
+ s2 = input.substr(peg$currPos, 10);
+ peg$currPos += 10;
} else {
s2 = peg$FAILED;
- { peg$fail(peg$c106); }
+
+ {
+ peg$fail(peg$c104);
+ }
}
+
if (s2 === peg$FAILED) {
- if (input.substr(peg$currPos, 8).toLowerCase() === peg$c107) {
- s2 = input.substr(peg$currPos, 8);
- peg$currPos += 8;
+ if (input.substr(peg$currPos, 11).toLowerCase() === peg$c105) {
+ s2 = input.substr(peg$currPos, 11);
+ peg$currPos += 11;
} else {
s2 = peg$FAILED;
- { peg$fail(peg$c108); }
+
+ {
+ peg$fail(peg$c106);
+ }
}
+
if (s2 === peg$FAILED) {
- if (input.substr(peg$currPos, 7).toLowerCase() === peg$c109) {
- s2 = input.substr(peg$currPos, 7);
- peg$currPos += 7;
+ if (input.substr(peg$currPos, 8).toLowerCase() === peg$c107) {
+ s2 = input.substr(peg$currPos, 8);
+ peg$currPos += 8;
} else {
s2 = peg$FAILED;
- { peg$fail(peg$c110); }
+
+ {
+ peg$fail(peg$c108);
+ }
+ }
+
+ if (s2 === peg$FAILED) {
+ if (input.substr(peg$currPos, 7).toLowerCase() === peg$c109) {
+ s2 = input.substr(peg$currPos, 7);
+ peg$currPos += 7;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c110);
+ }
+ }
}
}
}
}
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c111(s2);
- s0 = s1;
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c111(s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
- return s0;
- }
+ function nth(n) {
+ return {
+ type: 'nth-child',
+ index: {
+ type: 'literal',
+ value: n
+ }
+ };
+ }
+ function nthLast(n) {
+ return {
+ type: 'nth-last-child',
+ index: {
+ type: 'literal',
+ value: n
+ }
+ };
+ }
- function nth(n) { return { type: 'nth-child', index: { type: 'literal', value: n } }; }
- function nthLast(n) { return { type: 'nth-last-child', index: { type: 'literal', value: n } }; }
function strUnescape(s) {
- return s.replace(/\\(.)/g, function(match, ch) {
- switch(ch) {
- case 'b': return '\b';
- case 'f': return '\f';
- case 'n': return '\n';
- case 'r': return '\r';
- case 't': return '\t';
- case 'v': return '\v';
- default: return ch;
+ return s.replace(/\\(.)/g, function (match, ch) {
+ switch (ch) {
+ case 'b':
+ return '\b';
+
+ case 'f':
+ return '\f';
+
+ case 'n':
+ return '\n';
+
+ case 'r':
+ return '\r';
+
+ case 't':
+ return '\t';
+
+ case 'v':
+ return '\v';
+
+ default:
+ return ch;
}
});
}
+ peg$result = peg$startRuleFunction();
- peg$result = peg$startRuleFunction();
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
+ return peg$result;
+ } else {
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
+ peg$fail(peg$endExpectation());
+ }
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
- return peg$result;
- } else {
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
- peg$fail(peg$endExpectation());
+ throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
}
-
- throw peg$buildStructuredError(
- peg$maxFailExpected,
- peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
- peg$maxFailPos < input.length
- ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
- : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
- );
}
- }
- return {
- SyntaxError: peg$SyntaxError,
- parse: peg$parse
- };
-});
+ return {
+ SyntaxError: peg$SyntaxError,
+ parse: peg$parse
+ };
+ });
});
-/* vim: set sw=4 sts=4 : */
+function _objectEntries(obj) {
+ var entries = [];
+ var keys = Object.keys(obj);
+
+ for (var k = 0; k < keys.length; k++) entries.push([keys[k], obj[keys[k]]]);
+ return entries;
+}
/**
* @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side
*/
-const LEFT_SIDE = 'LEFT_SIDE';
-const RIGHT_SIDE = 'RIGHT_SIDE';
-
+var LEFT_SIDE = 'LEFT_SIDE';
+var RIGHT_SIDE = 'RIGHT_SIDE';
/**
* @external AST
* @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html
@@ -3318,15 +4016,20 @@ const RIGHT_SIDE = 'RIGHT_SIDE';
* @param {string} key
* @returns {undefined|boolean|string|number|external:AST}
*/
+
function getPath(obj, key) {
- const keys = key.split('.');
- for (let i = 0; i < keys.length; i++) {
- if (obj == null) { return obj; }
- obj = obj[keys[i]];
+ var keys = key.split('.');
+
+ for (var i = 0; i < keys.length; i++) {
+ if (obj == null) {
+ return obj;
}
- return obj;
-}
+ obj = obj[keys[i]];
+ }
+
+ return obj;
+}
/**
* Determine whether `node` can be reached by following `path`,
* starting at `ancestor`.
@@ -3335,21 +4038,32 @@ function getPath(obj, key) {
* @param {string[]} path
* @returns {boolean}
*/
+
+
function inPath(node, ancestor, path) {
- if (path.length === 0) { return node === ancestor; }
- if (ancestor == null) { return false; }
- const field = ancestor[path[0]];
- const remainingPath = path.slice(1);
- if (Array.isArray(field)) {
- for (let i = 0, l = field.length; i < l; ++i) {
- if (inPath(node, field[i], remainingPath)) { return true; }
- }
- return false;
- } else {
- return inPath(node, field, remainingPath);
+ if (path.length === 0) {
+ return node === ancestor;
+ }
+
+ if (ancestor == null) {
+ return false;
+ }
+
+ var field = ancestor[path[0]];
+ var remainingPath = path.slice(1);
+
+ if (Array.isArray(field)) {
+ for (var i = 0, l = field.length; i < l; ++i) {
+ if (inPath(node, field[i], remainingPath)) {
+ return true;
+ }
}
-}
+ return false;
+ } else {
+ return inPath(node, field, remainingPath);
+ }
+}
/**
* Given a `node` and its ancestors, determine if `node` is matched
* by `selector`.
@@ -3360,156 +4074,209 @@ function inPath(node, ancestor, path) {
* selector value type)
* @returns {boolean}
*/
+
+
function matches(node, selector, ancestry) {
- if (!selector) { return true; }
- if (!node) { return false; }
- if (!ancestry) { ancestry = []; }
+ if (!selector) {
+ return true;
+ }
- switch(selector.type) {
- case 'wildcard':
- return true;
+ if (!node) {
+ return false;
+ }
+
+ if (!ancestry) {
+ ancestry = [];
+ }
- case 'identifier':
- return selector.value.toLowerCase() === node.type.toLowerCase();
+ switch (selector.type) {
+ case 'wildcard':
+ return true;
- case 'field': {
- const path = selector.name.split('.');
- const ancestor = ancestry[path.length - 1];
- return inPath(node, ancestor, path);
+ case 'identifier':
+ return selector.value.toLowerCase() === node.type.toLowerCase();
+ case 'field':
+ {
+ var path = selector.name.split('.');
+ var ancestor = ancestry[path.length - 1];
+ return inPath(node, ancestor, path);
+ }
+
+ case 'matches':
+ for (var i = 0, l = selector.selectors.length; i < l; ++i) {
+ if (matches(node, selector.selectors[i], ancestry)) {
+ return true;
}
- case 'matches':
- for (let i = 0, l = selector.selectors.length; i < l; ++i) {
- if (matches(node, selector.selectors[i], ancestry)) { return true; }
- }
- return false;
+ }
- case 'compound':
- for (let i = 0, l = selector.selectors.length; i < l; ++i) {
- if (!matches(node, selector.selectors[i], ancestry)) { return false; }
- }
+ return false;
+
+ case 'compound':
+ for (var _i = 0, _l = selector.selectors.length; _i < _l; ++_i) {
+ if (!matches(node, selector.selectors[_i], ancestry)) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case 'not':
+ for (var _i2 = 0, _l2 = selector.selectors.length; _i2 < _l2; ++_i2) {
+ if (matches(node, selector.selectors[_i2], ancestry)) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case 'has':
+ {
+ var _ret = function () {
+ var collector = [];
+
+ var _loop = function _loop(_i3, _l3) {
+ var a = [];
+ estraverse.traverse(node, {
+ enter: function enter(node, parent) {
+ if (parent != null) {
+ a.unshift(parent);
+ }
+
+ if (matches(node, selector.selectors[_i3], a)) {
+ collector.push(node);
+ }
+ },
+ leave: function leave() {
+ a.shift();
+ },
+ fallback: 'iteration'
+ });
+ };
+
+ for (var _i3 = 0, _l3 = selector.selectors.length; _i3 < _l3; ++_i3) {
+ _loop(_i3);
+ }
+
+ return {
+ v: collector.length !== 0
+ };
+ }();
+
+ if (_typeof(_ret) === "object") return _ret.v;
+ }
+
+ case 'child':
+ if (matches(node, selector.right, ancestry)) {
+ return matches(ancestry[0], selector.left, ancestry.slice(1));
+ }
+
+ return false;
+
+ case 'descendant':
+ if (matches(node, selector.right, ancestry)) {
+ for (var _i4 = 0, _l4 = ancestry.length; _i4 < _l4; ++_i4) {
+ if (matches(ancestry[_i4], selector.left, ancestry.slice(_i4 + 1))) {
return true;
+ }
+ }
+ }
+
+ return false;
+
+ case 'attribute':
+ {
+ var p = getPath(node, selector.name);
+
+ switch (selector.operator) {
+ case void 0:
+ return p != null;
+
+ case '=':
+ switch (selector.value.type) {
+ case 'regexp':
+ return typeof p === 'string' && selector.value.value.test(p);
+
+ case 'literal':
+ return "".concat(selector.value.value) === "".concat(p);
- case 'not':
- for (let i = 0, l = selector.selectors.length; i < l; ++i) {
- if (matches(node, selector.selectors[i], ancestry)) { return false; }
+ case 'type':
+ return selector.value.value === _typeof(p);
}
- return true;
- case 'has': {
- const collector = [];
- for (let i = 0, l = selector.selectors.length; i < l; ++i) {
- const a = [];
- estraverse.traverse(node, {
- enter (node, parent) {
- if (parent != null) { a.unshift(parent); }
- if (matches(node, selector.selectors[i], a)) {
- collector.push(node);
- }
- },
- leave () { a.shift(); },
- fallback: 'iteration'
- });
+ throw new Error("Unknown selector value type: ".concat(selector.value.type));
+
+ case '!=':
+ switch (selector.value.type) {
+ case 'regexp':
+ return !selector.value.value.test(p);
+
+ case 'literal':
+ return "".concat(selector.value.value) !== "".concat(p);
+
+ case 'type':
+ return selector.value.value !== _typeof(p);
}
- return collector.length !== 0;
+ throw new Error("Unknown selector value type: ".concat(selector.value.type));
+
+ case '<=':
+ return p <= selector.value.value;
+
+ case '<':
+ return p < selector.value.value;
+
+ case '>':
+ return p > selector.value.value;
+
+ case '>=':
+ return p >= selector.value.value;
}
- case 'child':
- if (matches(node, selector.right, ancestry)) {
- return matches(ancestry[0], selector.left, ancestry.slice(1));
- }
- return false;
- case 'descendant':
- if (matches(node, selector.right, ancestry)) {
- for (let i = 0, l = ancestry.length; i < l; ++i) {
- if (matches(ancestry[i], selector.left, ancestry.slice(i + 1))) {
- return true;
- }
- }
- }
- return false;
-
- case 'attribute': {
- const p = getPath(node, selector.name);
- switch (selector.operator) {
- case void 0:
- return p != null;
- case '=':
- switch (selector.value.type) {
- case 'regexp': return typeof p === 'string' && selector.value.value.test(p);
- case 'literal': return `${selector.value.value}` === `${p}`;
- case 'type': return selector.value.value === typeof p;
- }
- throw new Error(`Unknown selector value type: ${selector.value.type}`);
- case '!=':
- switch (selector.value.type) {
- case 'regexp': return !selector.value.value.test(p);
- case 'literal': return `${selector.value.value}` !== `${p}`;
- case 'type': return selector.value.value !== typeof p;
- }
- throw new Error(`Unknown selector value type: ${selector.value.type}`);
- case '<=': return p <= selector.value.value;
- case '<': return p < selector.value.value;
- case '>': return p > selector.value.value;
- case '>=': return p >= selector.value.value;
- }
- throw new Error(`Unknown operator: ${selector.operator}`);
- }
- case 'sibling':
- return matches(node, selector.right, ancestry) &&
- sibling(node, selector.left, ancestry, LEFT_SIDE) ||
- selector.left.subject &&
- matches(node, selector.left, ancestry) &&
- sibling(node, selector.right, ancestry, RIGHT_SIDE);
- case 'adjacent':
- return matches(node, selector.right, ancestry) &&
- adjacent(node, selector.left, ancestry, LEFT_SIDE) ||
- selector.right.subject &&
- matches(node, selector.left, ancestry) &&
- adjacent(node, selector.right, ancestry, RIGHT_SIDE);
-
- case 'nth-child':
- return matches(node, selector.right, ancestry) &&
- nthChild(node, ancestry, function () {
- return selector.index.value - 1;
- });
-
- case 'nth-last-child':
- return matches(node, selector.right, ancestry) &&
- nthChild(node, ancestry, function (length) {
- return length - selector.index.value;
- });
-
- case 'class':
- switch(selector.name.toLowerCase()){
- case 'statement':
- if(node.type.slice(-9) === 'Statement') return true;
- // fallthrough: interface Declaration <: Statement { }
- case 'declaration':
- return node.type.slice(-11) === 'Declaration';
- case 'pattern':
- if(node.type.slice(-7) === 'Pattern') return true;
- // fallthrough: interface Expression <: Node, Pattern { }
- case 'expression':
- return node.type.slice(-10) === 'Expression' ||
- node.type.slice(-7) === 'Literal' ||
- (
- node.type === 'Identifier' &&
- (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty')
- ) ||
- node.type === 'MetaProperty';
- case 'function':
- return node.type === 'FunctionDeclaration' ||
- node.type === 'FunctionExpression' ||
- node.type === 'ArrowFunctionExpression';
- }
- throw new Error(`Unknown class name: ${selector.name}`);
- }
+ throw new Error("Unknown operator: ".concat(selector.operator));
+ }
- throw new Error(`Unknown selector type: ${selector.type}`);
-}
+ case 'sibling':
+ return matches(node, selector.right, ancestry) && sibling(node, selector.left, ancestry, LEFT_SIDE) || selector.left.subject && matches(node, selector.left, ancestry) && sibling(node, selector.right, ancestry, RIGHT_SIDE);
+
+ case 'adjacent':
+ return matches(node, selector.right, ancestry) && adjacent(node, selector.left, ancestry, LEFT_SIDE) || selector.right.subject && matches(node, selector.left, ancestry) && adjacent(node, selector.right, ancestry, RIGHT_SIDE);
+
+ case 'nth-child':
+ return matches(node, selector.right, ancestry) && nthChild(node, ancestry, function () {
+ return selector.index.value - 1;
+ });
+
+ case 'nth-last-child':
+ return matches(node, selector.right, ancestry) && nthChild(node, ancestry, function (length) {
+ return length - selector.index.value;
+ });
+
+ case 'class':
+ switch (selector.name.toLowerCase()) {
+ case 'statement':
+ if (node.type.slice(-9) === 'Statement') return true;
+ // fallthrough: interface Declaration <: Statement { }
+
+ case 'declaration':
+ return node.type.slice(-11) === 'Declaration';
+
+ case 'pattern':
+ if (node.type.slice(-7) === 'Pattern') return true;
+ // fallthrough: interface Expression <: Node, Pattern { }
+
+ case 'expression':
+ return node.type.slice(-10) === 'Expression' || node.type.slice(-7) === 'Literal' || node.type === 'Identifier' && (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty') || node.type === 'MetaProperty';
+ case 'function':
+ return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression';
+ }
+
+ throw new Error("Unknown class name: ".concat(selector.name));
+ }
+
+ throw new Error("Unknown selector type: ".concat(selector.type));
+}
/**
* Determines if the given node has a sibling that matches the
* given selector.
@@ -3519,33 +4286,49 @@ function matches(node, selector, ancestry) {
* @param {Side} side
* @returns {boolean}
*/
+
+
function sibling(node, selector, ancestry, side) {
- const [parent] = ancestry;
- if (!parent) { return false; }
- const keys = estraverse.VisitorKeys[parent.type];
- for (let i = 0, l = keys.length; i < l; ++i) {
- const listProp = parent[keys[i]];
- if (Array.isArray(listProp)) {
- const startIndex = listProp.indexOf(node);
- if (startIndex < 0) { continue; }
- let lowerBound, upperBound;
- if (side === LEFT_SIDE) {
- lowerBound = 0;
- upperBound = startIndex;
- } else {
- lowerBound = startIndex + 1;
- upperBound = listProp.length;
- }
- for (let k = lowerBound; k < upperBound; ++k) {
- if (matches(listProp[k], selector, ancestry)) {
- return true;
- }
- }
+ var _ancestry = _slicedToArray(ancestry, 1),
+ parent = _ancestry[0];
+
+ if (!parent) {
+ return false;
+ }
+
+ var keys = estraverse.VisitorKeys[parent.type];
+
+ for (var i = 0, l = keys.length; i < l; ++i) {
+ var listProp = parent[keys[i]];
+
+ if (Array.isArray(listProp)) {
+ var startIndex = listProp.indexOf(node);
+
+ if (startIndex < 0) {
+ continue;
+ }
+
+ var lowerBound = void 0,
+ upperBound = void 0;
+
+ if (side === LEFT_SIDE) {
+ lowerBound = 0;
+ upperBound = startIndex;
+ } else {
+ lowerBound = startIndex + 1;
+ upperBound = listProp.length;
+ }
+
+ for (var k = lowerBound; k < upperBound; ++k) {
+ if (matches(listProp[k], selector, ancestry)) {
+ return true;
}
+ }
}
- return false;
-}
+ }
+ return false;
+}
/**
* Determines if the given node has an adjacent sibling that matches
* the given selector.
@@ -3555,26 +4338,40 @@ function sibling(node, selector, ancestry, side) {
* @param {Side} side
* @returns {boolean}
*/
+
+
function adjacent(node, selector, ancestry, side) {
- const [parent] = ancestry;
- if (!parent) { return false; }
- const keys = estraverse.VisitorKeys[parent.type];
- for (let i = 0, l = keys.length; i < l; ++i) {
- const listProp = parent[keys[i]];
- if (Array.isArray(listProp)) {
- const idx = listProp.indexOf(node);
- if (idx < 0) { continue; }
- if (side === LEFT_SIDE && idx > 0 && matches(listProp[idx - 1], selector, ancestry)) {
- return true;
- }
- if (side === RIGHT_SIDE && idx < listProp.length - 1 && matches(listProp[idx + 1], selector, ancestry)) {
- return true;
- }
- }
- }
+ var _ancestry2 = _slicedToArray(ancestry, 1),
+ parent = _ancestry2[0];
+
+ if (!parent) {
return false;
-}
+ }
+
+ var keys = estraverse.VisitorKeys[parent.type];
+
+ for (var i = 0, l = keys.length; i < l; ++i) {
+ var listProp = parent[keys[i]];
+
+ if (Array.isArray(listProp)) {
+ var idx = listProp.indexOf(node);
+
+ if (idx < 0) {
+ continue;
+ }
+
+ if (side === LEFT_SIDE && idx > 0 && matches(listProp[idx - 1], selector, ancestry)) {
+ return true;
+ }
+
+ if (side === RIGHT_SIDE && idx < listProp.length - 1 && matches(listProp[idx + 1], selector, ancestry)) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
/**
* @callback IndexFunction
* @param {Integer} len Containing list's length
@@ -3589,20 +4386,32 @@ function adjacent(node, selector, ancestry, side) {
* @param {IndexFunction} idxFn
* @returns {boolean}
*/
+
+
function nthChild(node, ancestry, idxFn) {
- const [parent] = ancestry;
- if (!parent) { return false; }
- const keys = estraverse.VisitorKeys[parent.type];
- for (let i = 0, l = keys.length; i < l; ++i) {
- const listProp = parent[keys[i]];
- if (Array.isArray(listProp)) {
- const idx = listProp.indexOf(node);
- if (idx >= 0 && idx === idxFn(listProp.length)) { return true; }
- }
- }
+ var _ancestry3 = _slicedToArray(ancestry, 1),
+ parent = _ancestry3[0];
+
+ if (!parent) {
return false;
-}
+ }
+
+ var keys = estraverse.VisitorKeys[parent.type];
+ for (var i = 0, l = keys.length; i < l; ++i) {
+ var listProp = parent[keys[i]];
+
+ if (Array.isArray(listProp)) {
+ var idx = listProp.indexOf(node);
+
+ if (idx >= 0 && idx === idxFn(listProp.length)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
/**
* For each selector node marked as a subject, find the portion of the
* selector that the subject must match.
@@ -3610,72 +4419,126 @@ function nthChild(node, ancestry, idxFn) {
* @param {SelectorAST} [ancestor] Defaults to `selector`
* @returns {SelectorAST[]}
*/
+
+
function subjects(selector, ancestor) {
- if (selector == null || typeof selector != 'object') { return []; }
- if (ancestor == null) { ancestor = selector; }
- const results = selector.subject ? [ancestor] : [];
- for (const [p, sel] of Object.entries(selector)) {
- results.push(...subjects(sel, p === 'left' ? sel : ancestor));
- }
- return results;
+ if (selector == null || _typeof(selector) != 'object') {
+ return [];
+ }
+
+ if (ancestor == null) {
+ ancestor = selector;
+ }
+
+ var results = selector.subject ? [ancestor] : [];
+
+ for (var _i5 = 0, _Object$entries = _objectEntries(selector); _i5 < _Object$entries.length; _i5++) {
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i5], 2),
+ p = _Object$entries$_i[0],
+ sel = _Object$entries$_i[1];
+
+ results.push.apply(results, _toConsumableArray(subjects(sel, p === 'left' ? sel : ancestor)));
+ }
+
+ return results;
}
+/**
+* @callback TraverseVisitor
+* @param {?external:AST} node
+* @param {?external:AST} parent
+* @param {external:AST[]} ancestry
+*/
/**
* From a JS AST and a selector AST, collect all JS AST nodes that
* match the selector.
* @param {external:AST} ast
* @param {?SelectorAST} selector
+ * @param {TraverseVisitor} visitor
* @returns {external:AST[]}
*/
-function match(ast, selector) {
- const ancestry = [], results = [];
- if (!selector) { return results; }
- const altSubjects = subjects(selector);
- estraverse.traverse(ast, {
- enter (node, parent) {
- if (parent != null) { ancestry.unshift(parent); }
- if (matches(node, selector, ancestry)) {
- if (altSubjects.length) {
- for (let i = 0, l = altSubjects.length; i < l; ++i) {
- if (matches(node, altSubjects[i], ancestry)) { results.push(node); }
- for (let k = 0, m = ancestry.length; k < m; ++k) {
- if (matches(ancestry[k], altSubjects[i], ancestry.slice(k + 1))) {
- results.push(ancestry[k]);
- }
- }
- }
- } else {
- results.push(node);
- }
+
+
+function traverse(ast, selector, visitor) {
+ if (!selector) {
+ return;
+ }
+
+ var ancestry = [];
+ var altSubjects = subjects(selector);
+ estraverse.traverse(ast, {
+ enter: function enter(node, parent) {
+ if (parent != null) {
+ ancestry.unshift(parent);
+ }
+
+ if (matches(node, selector, ancestry)) {
+ if (altSubjects.length) {
+ for (var i = 0, l = altSubjects.length; i < l; ++i) {
+ if (matches(node, altSubjects[i], ancestry)) {
+ visitor(node, parent, ancestry);
}
- },
- leave () { ancestry.shift(); },
- fallback: 'iteration'
- });
- return results;
+
+ for (var k = 0, m = ancestry.length; k < m; ++k) {
+ var succeedingAncestry = ancestry.slice(k + 1);
+
+ if (matches(ancestry[k], altSubjects[i], succeedingAncestry)) {
+ visitor(ancestry[k], parent, succeedingAncestry);
+ }
+ }
+ }
+ } else {
+ visitor(node, parent, ancestry);
+ }
+ }
+ },
+ leave: function leave() {
+ ancestry.shift();
+ },
+ fallback: 'iteration'
+ });
}
+/**
+ * From a JS AST and a selector AST, collect all JS AST nodes that
+ * match the selector.
+ * @param {external:AST} ast
+ * @param {?SelectorAST} selector
+ * @returns {external:AST[]}
+ */
+
+function match(ast, selector) {
+ var results = [];
+ traverse(ast, selector, function (node) {
+ results.push(node);
+ });
+ return results;
+}
/**
* Parse a selector string and return its AST.
* @param {string} selector
* @returns {SelectorAST}
*/
+
+
function parse(selector) {
- return parser.parse(selector);
+ return parser.parse(selector);
}
-
/**
* Query the code AST using the selector string.
* @param {external:AST} ast
* @param {string} selector
* @returns {external:AST[]}
*/
+
+
function query(ast, selector) {
- return match(ast, parse(selector));
+ return match(ast, parse(selector));
}
query.parse = parse;
query.match = match;
+query.traverse = traverse;
query.matches = matches;
query.query = query;
diff --git a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.min.js b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.min.js
index 507a98c8dc..474e093dcc 100644
--- a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.min.js
+++ b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.esm.min.js
@@ -1,2 +1,2 @@
-"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e,t){return e(t={exports:{}},t.exports),t.exports}var t=e((function(e,t){!function e(t){var r,n,s,o,a,i;function l(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?l(r):r);return n}function u(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function p(){}function f(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function d(e,t){return(new p).traverse(e,t)}function x(e,t){var r;return r=function(e,t){var r,n,s,o;for(n=e.length,s=0;n;)t(e[o=s+(r=n>>>1)])?n=r:(s=o+1,n-=r+1);return s}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},s={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:o={},Skip:a={},Remove:i={}},u.prototype.replace=function(e){this.parent[this.key]=e},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},p.prototype.path=function(){var e,t,r,n,s;function o(e,t){if(Array.isArray(t))for(r=0,n=t.length;r<n;++r)e.push(t[r]);else e.push(t)}if(!this.__current.path)return null;for(s=[],e=2,t=this.__leavelist.length;e<t;++e)o(s,this.__leavelist[e].path);return o(s,this.__current.path),s},p.prototype.type=function(){return this.current().type||this.__current.wrap},p.prototype.parents=function(){var e,t,r;for(r=[],e=1,t=this.__leavelist.length;e<t;++e)r.push(this.__leavelist[e].node);return r},p.prototype.current=function(){return this.__current.node},p.prototype.__execute=function(e,t){var r,n;return n=void 0,r=this.__current,this.__current=t,this.__state=null,e&&(n=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=r,n},p.prototype.notify=function(e){this.__state=e},p.prototype.skip=function(){this.notify(a)},p.prototype.break=function(){this.notify(o)},p.prototype.remove=function(){this.notify(i)},p.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,"iteration"===t.fallback?this.__fallback=Object.keys:"function"==typeof t.fallback&&(this.__fallback=t.fallback),this.__keys=s,t.keys&&(this.__keys=Object.assign(Object.create(this.__keys),t.keys))},p.prototype.traverse=function(e,t){var r,n,s,i,l,u,p,d,x,m,y,g;for(this.__initialize(e,t),g={},r=this.__worklist,n=this.__leavelist,r.push(new c(e,null,null,null)),n.push(new c(null,null,null,null));r.length;)if((s=r.pop())!==g){if(s.node){if(u=this.__execute(t.enter,s),this.__state===o||u===o)return;if(r.push(g),n.push(s),this.__state===a||u===a)continue;if(l=(i=s.node).type||s.wrap,!(m=this.__keys[l])){if(!this.__fallback)throw new Error("Unknown node type "+l+".");m=this.__fallback(i)}for(d=m.length;(d-=1)>=0;)if(y=i[p=m[d]])if(Array.isArray(y)){for(x=y.length;(x-=1)>=0;)if(y[x]){if(h(l,m[d]))s=new c(y[x],[p,x],"Property",null);else{if(!f(y[x]))continue;s=new c(y[x],[p,x],null,null)}r.push(s)}}else f(y)&&r.push(new c(y,p,null,null))}}else if(s=n.pop(),u=this.__execute(t.leave,s),this.__state===o||u===o)return},p.prototype.replace=function(e,t){var r,n,s,l,p,d,x,m,y,g,v,A,E;function _(e){var t,n,s,o;if(e.ref.remove())for(n=e.ref.key,o=e.ref.parent,t=r.length;t--;)if((s=r[t]).ref&&s.ref.parent===o){if(s.ref.key<n)break;--s.ref.key}}for(this.__initialize(e,t),v={},r=this.__worklist,n=this.__leavelist,d=new c(e,null,null,new u(A={root:e},"root")),r.push(d),n.push(d);r.length;)if((d=r.pop())!==v){if(void 0!==(p=this.__execute(t.enter,d))&&p!==o&&p!==a&&p!==i&&(d.ref.replace(p),d.node=p),this.__state!==i&&p!==i||(_(d),d.node=null),this.__state===o||p===o)return A.root;if((s=d.node)&&(r.push(v),n.push(d),this.__state!==a&&p!==a)){if(l=s.type||d.wrap,!(y=this.__keys[l])){if(!this.__fallback)throw new Error("Unknown node type "+l+".");y=this.__fallback(s)}for(x=y.length;(x-=1)>=0;)if(g=s[E=y[x]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]){if(h(l,y[x]))d=new c(g[m],[E,m],"Property",new u(g,m));else{if(!f(g[m]))continue;d=new c(g[m],[E,m],null,new u(g,m))}r.push(d)}}else f(g)&&r.push(new c(g,E,null,new u(s,E)))}}else if(d=n.pop(),void 0!==(p=this.__execute(t.leave,d))&&p!==o&&p!==a&&p!==i&&d.ref.replace(p),this.__state!==i&&p!==i||_(d),this.__state===o||p===o)return A.root;return A.root},t.Syntax=r,t.traverse=d,t.replace=function(e,t){return(new p).replace(e,t)},t.attachComments=function(e,t,r){var s,o,a,i,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(a=0,o=t.length;a<o;a+=1)(s=l(t[a])).extendedRange=[0,e.range[0]],u.push(s);e.leadingComments=u}return e}for(a=0,o=t.length;a<o;a+=1)u.push(x(l(t[a]),r));return i=0,d(e,{enter:function(e){for(var t;i<u.length&&!((t=u[i]).extendedRange[1]>e.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(i,1)):i+=1;return i===u.length?n.Break:u[i].extendedRange[0]>e.range[1]?n.Skip:void 0}}),i=0,d(e,{leave:function(e){for(var t;i<u.length&&(t=u[i],!(e.range[1]<t.extendedRange[0]));)e.range[1]===t.extendedRange[0]?(e.trailingComments||(e.trailingComments=[]),e.trailingComments.push(t),u.splice(i,1)):i+=1;return i===u.length?n.Break:u[i].extendedRange[0]>e.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=s,t.VisitorOption=n,t.Controller=p,t.cloneEnvironment=function(){return e({})},t}(t)})),r=e((function(e){e.exports&&(e.exports=function(){function e(t,r,n,s){this.message=t,this.expected=r,this.found=n,this.location=s,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+s(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+r+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function s(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}return"Expected "+function(e){var t,n,s,o=new Array(e.length);for(t=0;t<e.length;t++)o[t]=(s=e[t],r[s.type](s));if(o.sort(),o.length>0){for(t=1,n=1;t<o.length;t++)o[t-1]!==o[t]&&(o[n]=o[t],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+s(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){r=void 0!==r?r:{};var n,s,o,a,i={},l={start:Ee},u=Ee,c=me(" ",!1),p=/^[^ [\],():#!=><~+.]/,f=ye([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=function(e){return e.join("")},d=me(">",!1),x=me("~",!1),m=me("+",!1),y=me(",",!1),g=me("!",!1),v=me("*",!1),A=me("#",!1),E=me("[",!1),_=me("]",!1),b=/^[><!]/,S=ye([">","<","!"],!1,!1),C=me("=",!1),w=function(e){return(e||"")+"="},P=/^[><]/,k=ye([">","<"],!1,!1),D=me(".",!1),I=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},F=me('"',!1),j=/^[^\\"]/,T=ye(["\\",'"'],!0,!1),L=me("\\",!1),R={type:"any"},O=function(e,t){return e+t},B=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},M=me("'",!1),U=/^[^\\']/,V=ye(["\\","'"],!0,!1),q=/^[0-9]/,N=ye([["0","9"]],!1,!1),W=me("type(",!1),$=/^[^ )]/,G=ye([" ",")"],!0,!1),z=me(")",!1),K=/^[imsu]/,H=ye(["i","m","s","u"],!1,!1),Y=me("/",!1),J=/^[^\/]/,Q=ye(["/"],!0,!1),X=me(":not(",!1),Z=me(":matches(",!1),ee=me(":has(",!1),te=me(":first-child",!1),re=me(":last-child",!1),ne=me(":nth-child(",!1),se=me(":nth-last-child(",!1),oe=me(":",!1),ae=me("statement",!0),ie=me("expression",!0),le=me("declaration",!0),ue=me("function",!0),ce=me("pattern",!0),pe=0,fe=[{line:1,column:1}],he=0,de=[],xe={};if("startRule"in r){if(!(r.startRule in l))throw new Error("Can't start parsing from rule \""+r.startRule+'".');u=l[r.startRule]}function me(e,t){return{type:"literal",text:e,ignoreCase:t}}function ye(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function ge(e){var r,n=fe[e];if(n)return n;for(r=e-1;!fe[r];)r--;for(n={line:(n=fe[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return fe[e]=n,n}function ve(e,t){var r=ge(e),n=ge(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function Ae(e){pe<he||(pe>he&&(he=pe,de=[]),de.push(e))}function Ee(){var e,t,r,n,s=30*pe+0,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,(t=_e())!==i&&(r=Ce())!==i&&_e()!==i?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(pe=e,e=i),e===i&&(e=pe,(t=_e())!==i&&(t=void 0),e=t),xe[s]={nextPos:pe,result:e},e)}function _e(){var e,r,n=30*pe+1,s=xe[n];if(s)return pe=s.nextPos,s.result;for(e=[],32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c));r!==i;)e.push(r),32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c));return xe[n]={nextPos:pe,result:e},e}function be(){var e,r,n,s=30*pe+2,o=xe[s];if(o)return pe=o.nextPos,o.result;if(r=[],p.test(t.charAt(pe))?(n=t.charAt(pe),pe++):(n=i,Ae(f)),n!==i)for(;n!==i;)r.push(n),p.test(t.charAt(pe))?(n=t.charAt(pe),pe++):(n=i,Ae(f));else r=i;return r!==i&&(r=h(r)),e=r,xe[s]={nextPos:pe,result:e},e}function Se(){var e,r,n,s=30*pe+3,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,(r=_e())!==i?(62===t.charCodeAt(pe)?(n=">",pe++):(n=i,Ae(d)),n!==i&&_e()!==i?e=r="child":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=_e())!==i?(126===t.charCodeAt(pe)?(n="~",pe++):(n=i,Ae(x)),n!==i&&_e()!==i?e=r="sibling":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=_e())!==i?(43===t.charCodeAt(pe)?(n="+",pe++):(n=i,Ae(m)),n!==i&&_e()!==i?e=r="adjacent":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c)),r!==i&&(n=_e())!==i?e=r="descendant":(pe=e,e=i)))),xe[s]={nextPos:pe,result:e},e)}function Ce(){var e,r,n,s,o,a,l,u,c=30*pe+4,p=xe[c];if(p)return pe=p.nextPos,p.result;if(e=pe,(r=we())!==i){for(n=[],s=pe,(o=_e())!==i?(44===t.charCodeAt(pe)?(a=",",pe++):(a=i,Ae(y)),a!==i&&(l=_e())!==i&&(u=we())!==i?s=o=[o,a,l,u]:(pe=s,s=i)):(pe=s,s=i);s!==i;)n.push(s),s=pe,(o=_e())!==i?(44===t.charCodeAt(pe)?(a=",",pe++):(a=i,Ae(y)),a!==i&&(l=_e())!==i&&(u=we())!==i?s=o=[o,a,l,u]:(pe=s,s=i)):(pe=s,s=i);n!==i?e=r=[r].concat(n.map((function(e){return e[3]}))):(pe=e,e=i)}else pe=e,e=i;return xe[c]={nextPos:pe,result:e},e}function we(){var e,t,r,n,s,o,a,l=30*pe+5,u=xe[l];if(u)return pe=u.nextPos,u.result;if(e=pe,(t=Pe())!==i){for(r=[],n=pe,(s=Se())!==i&&(o=Pe())!==i?n=s=[s,o]:(pe=n,n=i);n!==i;)r.push(n),n=pe,(s=Se())!==i&&(o=Pe())!==i?n=s=[s,o]:(pe=n,n=i);r!==i?(a=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),a)):(pe=e,e=i)}else pe=e,e=i;return xe[l]={nextPos:pe,result:e},e}function Pe(){var e,r,n,s,o=30*pe+6,a=xe[o];if(a)return pe=a.nextPos,a.result;if(e=pe,33===t.charCodeAt(pe)?(r="!",pe++):(r=i,Ae(g)),r===i&&(r=null),r!==i){if(n=[],(s=ke())!==i)for(;s!==i;)n.push(s),s=ke();else n=i;n!==i?e=r=function(e,t){const r=1===t.length?t[0]:{type:"compound",selectors:t};return e&&(r.subject=!0),r}(r,n):(pe=e,e=i)}else pe=e,e=i;return xe[o]={nextPos:pe,result:e},e}function ke(){var e,r=30*pe+7,n=xe[r];return n?(pe=n.nextPos,n.result):((e=function(){var e,r,n=30*pe+8,s=xe[n];return s?(pe=s.nextPos,s.result):(42===t.charCodeAt(pe)?(r="*",pe++):(r=i,Ae(v)),r!==i&&(r={type:"wildcard",value:r}),e=r,xe[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s=30*pe+9,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,35===t.charCodeAt(pe)?(r="#",pe++):(r=i,Ae(A)),r===i&&(r=null),r!==i&&(n=be())!==i?e=r={type:"identifier",value:n}:(pe=e,e=i),xe[s]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s,o=30*pe+10,a=xe[o];return a?(pe=a.nextPos,a.result):(e=pe,91===t.charCodeAt(pe)?(r="[",pe++):(r=i,Ae(E)),r!==i&&_e()!==i&&(n=function(){var e,r,n,s,o=30*pe+14,a=xe[o];return a?(pe=a.nextPos,a.result):(e=pe,(r=De())!==i&&_e()!==i&&(n=function(){var e,r,n,s=30*pe+12,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,33===t.charCodeAt(pe)?(r="!",pe++):(r=i,Ae(g)),r===i&&(r=null),r!==i?(61===t.charCodeAt(pe)?(n="=",pe++):(n=i,Ae(C)),n!==i?(r=w(r),e=r):(pe=e,e=i)):(pe=e,e=i),xe[s]={nextPos:pe,result:e},e)}())!==i&&_e()!==i?((s=function(){var e,r,n,s,o,a=30*pe+18,l=xe[a];if(l)return pe=l.nextPos,l.result;if(e=pe,"type("===t.substr(pe,5)?(r="type(",pe+=5):(r=i,Ae(W)),r!==i)if(_e()!==i){if(n=[],$.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(G)),s!==i)for(;s!==i;)n.push(s),$.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(G));else n=i;n!==i&&(s=_e())!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(z)),o!==i?(r={type:"type",value:n.join("")},e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return xe[a]={nextPos:pe,result:e},e}())===i&&(s=function(){var e,r,n,s,o,a,l=30*pe+20,u=xe[l];if(u)return pe=u.nextPos,u.result;if(e=pe,47===t.charCodeAt(pe)?(r="/",pe++):(r=i,Ae(Y)),r!==i){if(n=[],J.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(Q)),s!==i)for(;s!==i;)n.push(s),J.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(Q));else n=i;n!==i?(47===t.charCodeAt(pe)?(s="/",pe++):(s=i,Ae(Y)),s!==i?((o=function(){var e,r,n=30*pe+19,s=xe[n];if(s)return pe=s.nextPos,s.result;if(e=[],K.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(H)),r!==i)for(;r!==i;)e.push(r),K.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(H));else e=i;return xe[n]={nextPos:pe,result:e},e}())===i&&(o=null),o!==i?(a=o,r={type:"regexp",value:new RegExp(n.join(""),a?a.join(""):"")},e=r):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;return xe[l]={nextPos:pe,result:e},e}()),s!==i?(r=I(r,n,s),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=De())!==i&&_e()!==i&&(n=function(){var e,r,n,s=30*pe+11,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,b.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(S)),r===i&&(r=null),r!==i?(61===t.charCodeAt(pe)?(n="=",pe++):(n=i,Ae(C)),n!==i?(r=w(r),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(P.test(t.charAt(pe))?(e=t.charAt(pe),pe++):(e=i,Ae(k))),xe[s]={nextPos:pe,result:e},e)}())!==i&&_e()!==i?((s=function(){var e,r,n,s,o,a,l=30*pe+15,u=xe[l];if(u)return pe=u.nextPos,u.result;if(e=pe,34===t.charCodeAt(pe)?(r='"',pe++):(r=i,Ae(F)),r!==i){for(n=[],j.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(T)),s===i&&(s=pe,92===t.charCodeAt(pe)?(o="\\",pe++):(o=i,Ae(L)),o!==i?(t.length>pe?(a=t.charAt(pe),pe++):(a=i,Ae(R)),a!==i?(o=O(o,a),s=o):(pe=s,s=i)):(pe=s,s=i));s!==i;)n.push(s),j.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(T)),s===i&&(s=pe,92===t.charCodeAt(pe)?(o="\\",pe++):(o=i,Ae(L)),o!==i?(t.length>pe?(a=t.charAt(pe),pe++):(a=i,Ae(R)),a!==i?(o=O(o,a),s=o):(pe=s,s=i)):(pe=s,s=i));n!==i?(34===t.charCodeAt(pe)?(s='"',pe++):(s=i,Ae(F)),s!==i?(r=B(n),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;if(e===i)if(e=pe,39===t.charCodeAt(pe)?(r="'",pe++):(r=i,Ae(M)),r!==i){for(n=[],U.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(V)),s===i&&(s=pe,92===t.charCodeAt(pe)?(o="\\",pe++):(o=i,Ae(L)),o!==i?(t.length>pe?(a=t.charAt(pe),pe++):(a=i,Ae(R)),a!==i?(o=O(o,a),s=o):(pe=s,s=i)):(pe=s,s=i));s!==i;)n.push(s),U.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(V)),s===i&&(s=pe,92===t.charCodeAt(pe)?(o="\\",pe++):(o=i,Ae(L)),o!==i?(t.length>pe?(a=t.charAt(pe),pe++):(a=i,Ae(R)),a!==i?(o=O(o,a),s=o):(pe=s,s=i)):(pe=s,s=i));n!==i?(39===t.charCodeAt(pe)?(s="'",pe++):(s=i,Ae(M)),s!==i?(r=B(n),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;return xe[l]={nextPos:pe,result:e},e}())===i&&(s=function(){var e,r,n,s,o=30*pe+16,a=xe[o];if(a)return pe=a.nextPos,a.result;for(e=pe,r=pe,n=[],q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N));s!==i;)n.push(s),q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N));if(n!==i?(46===t.charCodeAt(pe)?(s=".",pe++):(s=i,Ae(D)),s!==i?r=n=[n,s]:(pe=r,r=i)):(pe=r,r=i),r===i&&(r=null),r!==i){if(n=[],q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N)),s!==i)for(;s!==i;)n.push(s),q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N));else n=i;n!==i?(r=function(e,t){const r=e?[].concat.apply([],e).join(""):"";return{type:"literal",value:parseFloat(r+t.join(""))}}(r,n),e=r):(pe=e,e=i)}else pe=e,e=i;return xe[o]={nextPos:pe,result:e},e}())===i&&(s=function(){var e,t,r=30*pe+17,n=xe[r];return n?(pe=n.nextPos,n.result):((t=be())!==i&&(t={type:"literal",value:t}),e=t,xe[r]={nextPos:pe,result:e},e)}()),s!==i?(r=I(r,n,s),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=De())!==i&&(r={type:"attribute",name:r}),e=r)),xe[o]={nextPos:pe,result:e},e)}())!==i&&_e()!==i?(93===t.charCodeAt(pe)?(s="]",pe++):(s=i,Ae(_)),s!==i?e=r=n:(pe=e,e=i)):(pe=e,e=i),xe[o]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s,o,a,l,u,c=30*pe+21,p=xe[c];if(p)return pe=p.nextPos,p.result;if(e=pe,46===t.charCodeAt(pe)?(r=".",pe++):(r=i,Ae(D)),r!==i)if((n=be())!==i){for(s=[],o=pe,46===t.charCodeAt(pe)?(a=".",pe++):(a=i,Ae(D)),a!==i&&(l=be())!==i?o=a=[a,l]:(pe=o,o=i);o!==i;)s.push(o),o=pe,46===t.charCodeAt(pe)?(a=".",pe++):(a=i,Ae(D)),a!==i&&(l=be())!==i?o=a=[a,l]:(pe=o,o=i);s!==i?(u=n,r={type:"field",name:s.reduce((function(e,t){return e+t[0]+t[1]}),u)},e=r):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return xe[c]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,s,o=30*pe+22,a=xe[o];return a?(pe=a.nextPos,a.result):(e=pe,":not("===t.substr(pe,5)?(r=":not(",pe+=5):(r=i,Ae(X)),r!==i&&_e()!==i&&(n=Ce())!==i&&_e()!==i?(41===t.charCodeAt(pe)?(s=")",pe++):(s=i,Ae(z)),s!==i?e=r={type:"not",selectors:n}:(pe=e,e=i)):(pe=e,e=i),xe[o]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s,o=30*pe+23,a=xe[o];return a?(pe=a.nextPos,a.result):(e=pe,":matches("===t.substr(pe,9)?(r=":matches(",pe+=9):(r=i,Ae(Z)),r!==i&&_e()!==i&&(n=Ce())!==i&&_e()!==i?(41===t.charCodeAt(pe)?(s=")",pe++):(s=i,Ae(z)),s!==i?e=r={type:"matches",selectors:n}:(pe=e,e=i)):(pe=e,e=i),xe[o]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s,o=30*pe+24,a=xe[o];return a?(pe=a.nextPos,a.result):(e=pe,":has("===t.substr(pe,5)?(r=":has(",pe+=5):(r=i,Ae(ee)),r!==i&&_e()!==i&&(n=Ce())!==i&&_e()!==i?(41===t.charCodeAt(pe)?(s=")",pe++):(s=i,Ae(z)),s!==i?e=r={type:"has",selectors:n}:(pe=e,e=i)):(pe=e,e=i),xe[o]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n=30*pe+25,s=xe[n];return s?(pe=s.nextPos,s.result):(":first-child"===t.substr(pe,12)?(r=":first-child",pe+=12):(r=i,Ae(te)),r!==i&&(r=Ie(1)),e=r,xe[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n=30*pe+26,s=xe[n];return s?(pe=s.nextPos,s.result):(":last-child"===t.substr(pe,11)?(r=":last-child",pe+=11):(r=i,Ae(re)),r!==i&&(r=Fe(1)),e=r,xe[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s,o,a=30*pe+27,l=xe[a];if(l)return pe=l.nextPos,l.result;if(e=pe,":nth-child("===t.substr(pe,11)?(r=":nth-child(",pe+=11):(r=i,Ae(ne)),r!==i)if(_e()!==i){if(n=[],q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N)),s!==i)for(;s!==i;)n.push(s),q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N));else n=i;n!==i&&(s=_e())!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(z)),o!==i?(r=Ie(parseInt(n.join(""),10)),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return xe[a]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,s,o,a=30*pe+28,l=xe[a];if(l)return pe=l.nextPos,l.result;if(e=pe,":nth-last-child("===t.substr(pe,16)?(r=":nth-last-child(",pe+=16):(r=i,Ae(se)),r!==i)if(_e()!==i){if(n=[],q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N)),s!==i)for(;s!==i;)n.push(s),q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N));else n=i;n!==i&&(s=_e())!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(z)),o!==i?(r=Fe(parseInt(n.join(""),10)),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return xe[a]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,s=30*pe+29,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,58===t.charCodeAt(pe)?(r=":",pe++):(r=i,Ae(oe)),r!==i?("statement"===t.substr(pe,9).toLowerCase()?(n=t.substr(pe,9),pe+=9):(n=i,Ae(ae)),n===i&&("expression"===t.substr(pe,10).toLowerCase()?(n=t.substr(pe,10),pe+=10):(n=i,Ae(ie)),n===i&&("declaration"===t.substr(pe,11).toLowerCase()?(n=t.substr(pe,11),pe+=11):(n=i,Ae(le)),n===i&&("function"===t.substr(pe,8).toLowerCase()?(n=t.substr(pe,8),pe+=8):(n=i,Ae(ue)),n===i&&("pattern"===t.substr(pe,7).toLowerCase()?(n=t.substr(pe,7),pe+=7):(n=i,Ae(ce)))))),n!==i?e=r={type:"class",name:n}:(pe=e,e=i)):(pe=e,e=i),xe[s]={nextPos:pe,result:e},e)}()),xe[r]={nextPos:pe,result:e},e)}function De(){var e,r,n,s=30*pe+13,o=xe[s];if(o)return pe=o.nextPos,o.result;if(r=[],(n=be())===i&&(46===t.charCodeAt(pe)?(n=".",pe++):(n=i,Ae(D))),n!==i)for(;n!==i;)r.push(n),(n=be())===i&&(46===t.charCodeAt(pe)?(n=".",pe++):(n=i,Ae(D)));else r=i;return r!==i&&(r=h(r)),e=r,xe[s]={nextPos:pe,result:e},e}function Ie(e){return{type:"nth-child",index:{type:"literal",value:e}}}function Fe(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=u())!==i&&pe===t.length)return n;throw n!==i&&pe<t.length&&Ae({type:"end"}),s=de,o=he<t.length?t.charAt(he):null,a=he<t.length?ve(he,he+1):ve(he,he),new e(e.buildMessage(s,o),s,o,a)}}}())}));function n(e,r,i){if(!r)return!0;if(!e)return!1;switch(i||(i=[]),r.type){case"wildcard":return!0;case"identifier":return r.value.toLowerCase()===e.type.toLowerCase();case"field":{const t=r.name.split(".");return function e(t,r,n){if(0===n.length)return t===r;if(null==r)return!1;const s=r[n[0]],o=n.slice(1);if(Array.isArray(s)){for(let r=0,n=s.length;r<n;++r)if(e(t,s[r],o))return!0;return!1}return e(t,s,o)}(e,i[t.length-1],t)}case"matches":for(let t=0,s=r.selectors.length;t<s;++t)if(n(e,r.selectors[t],i))return!0;return!1;case"compound":for(let t=0,s=r.selectors.length;t<s;++t)if(!n(e,r.selectors[t],i))return!1;return!0;case"not":for(let t=0,s=r.selectors.length;t<s;++t)if(n(e,r.selectors[t],i))return!1;return!0;case"has":{const s=[];for(let o=0,a=r.selectors.length;o<a;++o){const a=[];t.traverse(e,{enter(e,t){null!=t&&a.unshift(t),n(e,r.selectors[o],a)&&s.push(e)},leave(){a.shift()},fallback:"iteration"})}return 0!==s.length}case"child":return!!n(e,r.right,i)&&n(i[0],r.left,i.slice(1));case"descendant":if(n(e,r.right,i))for(let e=0,t=i.length;e<t;++e)if(n(i[e],r.left,i.slice(e+1)))return!0;return!1;case"attribute":{const t=function(e,t){const r=t.split(".");for(let t=0;t<r.length;t++){if(null==e)return e;e=e[r[t]]}return e}(e,r.name);switch(r.operator){case void 0:return null!=t;case"=":switch(r.value.type){case"regexp":return"string"==typeof t&&r.value.value.test(t);case"literal":return`${r.value.value}`===`${t}`;case"type":return r.value.value===typeof t}throw new Error(`Unknown selector value type: ${r.value.type}`);case"!=":switch(r.value.type){case"regexp":return!r.value.value.test(t);case"literal":return`${r.value.value}`!==`${t}`;case"type":return r.value.value!==typeof t}throw new Error(`Unknown selector value type: ${r.value.type}`);case"<=":return t<=r.value.value;case"<":return t<r.value.value;case">":return t>r.value.value;case">=":return t>=r.value.value}throw new Error(`Unknown operator: ${r.operator}`)}case"sibling":return n(e,r.right,i)&&s(e,r.left,i,"LEFT_SIDE")||r.left.subject&&n(e,r.left,i)&&s(e,r.right,i,"RIGHT_SIDE");case"adjacent":return n(e,r.right,i)&&o(e,r.left,i,"LEFT_SIDE")||r.right.subject&&n(e,r.left,i)&&o(e,r.right,i,"RIGHT_SIDE");case"nth-child":return n(e,r.right,i)&&a(e,i,(function(){return r.index.value-1}));case"nth-last-child":return n(e,r.right,i)&&a(e,i,(function(e){return e-r.index.value}));case"class":switch(r.name.toLowerCase()){case"statement":if("Statement"===e.type.slice(-9))return!0;case"declaration":return"Declaration"===e.type.slice(-11);case"pattern":if("Pattern"===e.type.slice(-7))return!0;case"expression":return"Expression"===e.type.slice(-10)||"Literal"===e.type.slice(-7)||"Identifier"===e.type&&(0===i.length||"MetaProperty"!==i[0].type)||"MetaProperty"===e.type;case"function":return"FunctionDeclaration"===e.type||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type}throw new Error(`Unknown class name: ${r.name}`)}throw new Error(`Unknown selector type: ${r.type}`)}function s(e,r,s,o){const[a]=s;if(!a)return!1;const i=t.VisitorKeys[a.type];for(let t=0,l=i.length;t<l;++t){const l=a[i[t]];if(Array.isArray(l)){const t=l.indexOf(e);if(t<0)continue;let a,i;"LEFT_SIDE"===o?(a=0,i=t):(a=t+1,i=l.length);for(let e=a;e<i;++e)if(n(l[e],r,s))return!0}}return!1}function o(e,r,s,o){const[a]=s;if(!a)return!1;const i=t.VisitorKeys[a.type];for(let t=0,l=i.length;t<l;++t){const l=a[i[t]];if(Array.isArray(l)){const t=l.indexOf(e);if(t<0)continue;if("LEFT_SIDE"===o&&t>0&&n(l[t-1],r,s))return!0;if("RIGHT_SIDE"===o&&t<l.length-1&&n(l[t+1],r,s))return!0}}return!1}function a(e,r,n){const[s]=r;if(!s)return!1;const o=t.VisitorKeys[s.type];for(let t=0,r=o.length;t<r;++t){const r=s[o[t]];if(Array.isArray(r)){const t=r.indexOf(e);if(t>=0&&t===n(r.length))return!0}}return!1}function i(e,r){const s=[],o=[];if(!r)return o;const a=function e(t,r){if(null==t||"object"!=typeof t)return[];null==r&&(r=t);const n=t.subject?[r]:[];for(const[s,o]of Object.entries(t))n.push(...e(o,"left"===s?o:r));return n}(r);return t.traverse(e,{enter(e,t){if(null!=t&&s.unshift(t),n(e,r,s))if(a.length)for(let t=0,r=a.length;t<r;++t){n(e,a[t],s)&&o.push(e);for(let e=0,r=s.length;e<r;++e)n(s[e],a[t],s.slice(e+1))&&o.push(s[e])}else o.push(e)},leave(){s.shift()},fallback:"iteration"}),o}function l(e){return r.parse(e)}function u(e,t){return i(e,l(t))}u.parse=l,u.match=i,u.matches=n,u.query=u;export default u;
+function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var s,i=e[Symbol.iterator]();!(n=(s=i.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return r}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function a(e,t){return e(t={exports:{}},t.exports),t.exports}var s=a((function(e,t){!function e(t){var r,n,o,a,s,i;function l(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?l(r):r);return n}function u(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function p(){}function f(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function d(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return!0;return!1}function y(e,t){return(new p).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},o={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:s={},Remove:i={}},u.prototype.replace=function(e){this.parent[this.key]=e},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},p.prototype.path=function(){var e,t,r,n,o;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r<n;++r)e.push(t[r]);else e.push(t)}if(!this.__current.path)return null;for(o=[],e=2,t=this.__leavelist.length;e<t;++e)a(o,this.__leavelist[e].path);return a(o,this.__current.path),o},p.prototype.type=function(){return this.current().type||this.__current.wrap},p.prototype.parents=function(){var e,t,r;for(r=[],e=1,t=this.__leavelist.length;e<t;++e)r.push(this.__leavelist[e].node);return r},p.prototype.current=function(){return this.__current.node},p.prototype.__execute=function(e,t){var r,n;return n=void 0,r=this.__current,this.__current=t,this.__state=null,e&&(n=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=r,n},p.prototype.notify=function(e){this.__state=e},p.prototype.skip=function(){this.notify(s)},p.prototype.break=function(){this.notify(a)},p.prototype.remove=function(){this.notify(i)},p.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,"iteration"===t.fallback?this.__fallback=Object.keys:"function"==typeof t.fallback&&(this.__fallback=t.fallback),this.__keys=o,t.keys&&(this.__keys=Object.assign(Object.create(this.__keys),t.keys))},p.prototype.traverse=function(e,t){var r,n,o,i,l,u,p,y,m,x,g,v;for(this.__initialize(e,t),v={},r=this.__worklist,n=this.__leavelist,r.push(new c(e,null,null,null)),n.push(new c(null,null,null,null));r.length;)if((o=r.pop())!==v){if(o.node){if(u=this.__execute(t.enter,o),this.__state===a||u===a)return;if(r.push(v),n.push(o),this.__state===s||u===s)continue;if(l=(i=o.node).type||o.wrap,!(x=this.__keys[l])){if(!this.__fallback)throw new Error("Unknown node type "+l+".");x=this.__fallback(i)}for(y=x.length;(y-=1)>=0;)if(g=i[p=x[y]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]&&!d(n,g[m])){if(h(l,x[y]))o=new c(g[m],[p,m],"Property",null);else{if(!f(g[m]))continue;o=new c(g[m],[p,m],null,null)}r.push(o)}}else if(f(g)){if(d(n,g))continue;r.push(new c(g,p,null,null))}}}else if(o=n.pop(),u=this.__execute(t.leave,o),this.__state===a||u===a)return},p.prototype.replace=function(e,t){var r,n,o,l,p,d,y,m,x,g,v,A,b;function E(e){var t,n,o,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((o=r[t]).ref&&o.ref.parent===a){if(o.ref.key<n)break;--o.ref.key}}for(this.__initialize(e,t),v={},r=this.__worklist,n=this.__leavelist,d=new c(e,null,null,new u(A={root:e},"root")),r.push(d),n.push(d);r.length;)if((d=r.pop())!==v){if(void 0!==(p=this.__execute(t.enter,d))&&p!==a&&p!==s&&p!==i&&(d.ref.replace(p),d.node=p),this.__state!==i&&p!==i||(E(d),d.node=null),this.__state===a||p===a)return A.root;if((o=d.node)&&(r.push(v),n.push(d),this.__state!==s&&p!==s)){if(l=o.type||d.wrap,!(x=this.__keys[l])){if(!this.__fallback)throw new Error("Unknown node type "+l+".");x=this.__fallback(o)}for(y=x.length;(y-=1)>=0;)if(g=o[b=x[y]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]){if(h(l,x[y]))d=new c(g[m],[b,m],"Property",new u(g,m));else{if(!f(g[m]))continue;d=new c(g[m],[b,m],null,new u(g,m))}r.push(d)}}else f(g)&&r.push(new c(g,b,null,new u(o,b)))}}else if(d=n.pop(),void 0!==(p=this.__execute(t.leave,d))&&p!==a&&p!==s&&p!==i&&d.ref.replace(p),this.__state!==i&&p!==i||E(d),this.__state===a||p===a)return A.root;return A.root},t.Syntax=r,t.traverse=y,t.replace=function(e,t){return(new p).replace(e,t)},t.attachComments=function(e,t,r){var o,a,s,i,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(s=0,a=t.length;s<a;s+=1)(o=l(t[s])).extendedRange=[0,e.range[0]],u.push(o);e.leadingComments=u}return e}for(s=0,a=t.length;s<a;s+=1)u.push(m(l(t[s]),r));return i=0,y(e,{enter:function(e){for(var t;i<u.length&&!((t=u[i]).extendedRange[1]>e.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(i,1)):i+=1;return i===u.length?n.Break:u[i].extendedRange[0]>e.range[1]?n.Skip:void 0}}),i=0,y(e,{leave:function(e){for(var t;i<u.length&&(t=u[i],!(e.range[1]<t.extendedRange[0]));)e.range[1]===t.extendedRange[0]?(e.trailingComments||(e.trailingComments=[]),e.trailingComments.push(t),u.splice(i,1)):i+=1;return i===u.length?n.Break:u[i].extendedRange[0]>e.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=o,t.VisitorOption=n,t.Controller=p,t.cloneEnvironment=function(){return e({})},t}(t)})),i=a((function(e){e.exports&&(e.exports=function(){function e(t,r,n,o){this.message=t,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?a(e.parts[t][0])+"-"+a(e.parts[t][1]):a(e.parts[t]);return"["+(e.inverted?"^":"")+r+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function a(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}return"Expected "+function(e){var t,n,o,a=new Array(e.length);for(t=0;t<e.length;t++)a[t]=(o=e[t],r[o.type](o));if(a.sort(),a.length>0){for(t=1,n=1;t<a.length;t++)a[t-1]!==a[t]&&(a[n]=a[t],n++);a.length=n}switch(a.length){case 1:return a[0];case 2:return a[0]+" or "+a[1];default:return a.slice(0,-1).join(", ")+", or "+a[a.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){r=void 0!==r?r:{};var n,o,a,s,i={},l={start:be},u=be,c=me(" ",!1),p=/^[^ [\],():#!=><~+.]/,f=xe([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=function(e){return e.join("")},d=me(">",!1),y=me("~",!1),m=me("+",!1),x=me(",",!1),g=me("!",!1),v=me("*",!1),A=me("#",!1),b=me("[",!1),E=me("]",!1),S=/^[><!]/,_=xe([">","<","!"],!1,!1),w=me("=",!1),C=function(e){return(e||"")+"="},P=/^[><]/,k=xe([">","<"],!1,!1),D=me(".",!1),I=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=me('"',!1),F=/^[^\\"]/,T=xe(["\\",'"'],!0,!1),L=me("\\",!1),R={type:"any"},O=function(e,t){return e+t},B=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},M=me("'",!1),U=/^[^\\']/,V=xe(["\\","'"],!0,!1),q=/^[0-9]/,N=xe([["0","9"]],!1,!1),W=me("type(",!1),G=/^[^ )]/,z=xe([" ",")"],!0,!1),K=me(")",!1),H=/^[imsu]/,Y=xe(["i","m","s","u"],!1,!1),$=me("/",!1),J=/^[^\/]/,Q=xe(["/"],!0,!1),X=me(":not(",!1),Z=me(":matches(",!1),ee=me(":has(",!1),te=me(":first-child",!1),re=me(":last-child",!1),ne=me(":nth-child(",!1),oe=me(":nth-last-child(",!1),ae=me(":",!1),se=me("statement",!0),ie=me("expression",!0),le=me("declaration",!0),ue=me("function",!0),ce=me("pattern",!0),pe=0,fe=[{line:1,column:1}],he=0,de=[],ye={};if("startRule"in r){if(!(r.startRule in l))throw new Error("Can't start parsing from rule \""+r.startRule+'".');u=l[r.startRule]}function me(e,t){return{type:"literal",text:e,ignoreCase:t}}function xe(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function ge(e){var r,n=fe[e];if(n)return n;for(r=e-1;!fe[r];)r--;for(n={line:(n=fe[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return fe[e]=n,n}function ve(e,t){var r=ge(e),n=ge(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function Ae(e){pe<he||(pe>he&&(he=pe,de=[]),de.push(e))}function be(){var e,t,r,n,o=30*pe+0,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,(t=Ee())!==i&&(r=we())!==i&&Ee()!==i?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(pe=e,e=i),e===i&&(e=pe,(t=Ee())!==i&&(t=void 0),e=t),ye[o]={nextPos:pe,result:e},e)}function Ee(){var e,r,n=30*pe+1,o=ye[n];if(o)return pe=o.nextPos,o.result;for(e=[],32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c));r!==i;)e.push(r),32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c));return ye[n]={nextPos:pe,result:e},e}function Se(){var e,r,n,o=30*pe+2,a=ye[o];if(a)return pe=a.nextPos,a.result;if(r=[],p.test(t.charAt(pe))?(n=t.charAt(pe),pe++):(n=i,Ae(f)),n!==i)for(;n!==i;)r.push(n),p.test(t.charAt(pe))?(n=t.charAt(pe),pe++):(n=i,Ae(f));else r=i;return r!==i&&(r=h(r)),e=r,ye[o]={nextPos:pe,result:e},e}function _e(){var e,r,n,o=30*pe+3,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,(r=Ee())!==i?(62===t.charCodeAt(pe)?(n=">",pe++):(n=i,Ae(d)),n!==i&&Ee()!==i?e=r="child":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=Ee())!==i?(126===t.charCodeAt(pe)?(n="~",pe++):(n=i,Ae(y)),n!==i&&Ee()!==i?e=r="sibling":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=Ee())!==i?(43===t.charCodeAt(pe)?(n="+",pe++):(n=i,Ae(m)),n!==i&&Ee()!==i?e=r="adjacent":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c)),r!==i&&(n=Ee())!==i?e=r="descendant":(pe=e,e=i)))),ye[o]={nextPos:pe,result:e},e)}function we(){var e,r,n,o,a,s,l,u,c=30*pe+4,p=ye[c];if(p)return pe=p.nextPos,p.result;if(e=pe,(r=Ce())!==i){for(n=[],o=pe,(a=Ee())!==i?(44===t.charCodeAt(pe)?(s=",",pe++):(s=i,Ae(x)),s!==i&&(l=Ee())!==i&&(u=Ce())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,(a=Ee())!==i?(44===t.charCodeAt(pe)?(s=",",pe++):(s=i,Ae(x)),s!==i&&(l=Ee())!==i&&(u=Ce())!==i?o=a=[a,s,l,u]:(pe=o,o=i)):(pe=o,o=i);n!==i?e=r=[r].concat(n.map((function(e){return e[3]}))):(pe=e,e=i)}else pe=e,e=i;return ye[c]={nextPos:pe,result:e},e}function Ce(){var e,t,r,n,o,a,s,l=30*pe+5,u=ye[l];if(u)return pe=u.nextPos,u.result;if(e=pe,(t=Pe())!==i){for(r=[],n=pe,(o=_e())!==i&&(a=Pe())!==i?n=o=[o,a]:(pe=n,n=i);n!==i;)r.push(n),n=pe,(o=_e())!==i&&(a=Pe())!==i?n=o=[o,a]:(pe=n,n=i);r!==i?(s=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),s)):(pe=e,e=i)}else pe=e,e=i;return ye[l]={nextPos:pe,result:e},e}function Pe(){var e,r,n,o,a,s,l,u=30*pe+6,c=ye[u];if(c)return pe=c.nextPos,c.result;if(e=pe,33===t.charCodeAt(pe)?(r="!",pe++):(r=i,Ae(g)),r===i&&(r=null),r!==i){if(n=[],(o=ke())!==i)for(;o!==i;)n.push(o),o=ke();else n=i;n!==i?(a=r,l=1===(s=n).length?s[0]:{type:"compound",selectors:s},a&&(l.subject=!0),e=r=l):(pe=e,e=i)}else pe=e,e=i;return ye[u]={nextPos:pe,result:e},e}function ke(){var e,r=30*pe+7,n=ye[r];return n?(pe=n.nextPos,n.result):((e=function(){var e,r,n=30*pe+8,o=ye[n];return o?(pe=o.nextPos,o.result):(42===t.charCodeAt(pe)?(r="*",pe++):(r=i,Ae(v)),r!==i&&(r={type:"wildcard",value:r}),e=r,ye[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o=30*pe+9,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,35===t.charCodeAt(pe)?(r="#",pe++):(r=i,Ae(A)),r===i&&(r=null),r!==i&&(n=Se())!==i?e=r={type:"identifier",value:n}:(pe=e,e=i),ye[o]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*pe+10,s=ye[a];return s?(pe=s.nextPos,s.result):(e=pe,91===t.charCodeAt(pe)?(r="[",pe++):(r=i,Ae(b)),r!==i&&Ee()!==i&&(n=function(){var e,r,n,o,a=30*pe+14,s=ye[a];return s?(pe=s.nextPos,s.result):(e=pe,(r=De())!==i&&Ee()!==i&&(n=function(){var e,r,n,o=30*pe+12,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,33===t.charCodeAt(pe)?(r="!",pe++):(r=i,Ae(g)),r===i&&(r=null),r!==i?(61===t.charCodeAt(pe)?(n="=",pe++):(n=i,Ae(w)),n!==i?(r=C(r),e=r):(pe=e,e=i)):(pe=e,e=i),ye[o]={nextPos:pe,result:e},e)}())!==i&&Ee()!==i?((o=function(){var e,r,n,o,a,s=30*pe+18,l=ye[s];if(l)return pe=l.nextPos,l.result;if(e=pe,"type("===t.substr(pe,5)?(r="type(",pe+=5):(r=i,Ae(W)),r!==i)if(Ee()!==i){if(n=[],G.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(z)),o!==i)for(;o!==i;)n.push(o),G.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(z));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(pe)?(a=")",pe++):(a=i,Ae(K)),a!==i?(r={type:"type",value:n.join("")},e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return ye[s]={nextPos:pe,result:e},e}())===i&&(o=function(){var e,r,n,o,a,s,l=30*pe+20,u=ye[l];if(u)return pe=u.nextPos,u.result;if(e=pe,47===t.charCodeAt(pe)?(r="/",pe++):(r=i,Ae($)),r!==i){if(n=[],J.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(Q)),o!==i)for(;o!==i;)n.push(o),J.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(Q));else n=i;n!==i?(47===t.charCodeAt(pe)?(o="/",pe++):(o=i,Ae($)),o!==i?((a=function(){var e,r,n=30*pe+19,o=ye[n];if(o)return pe=o.nextPos,o.result;if(e=[],H.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(Y)),r!==i)for(;r!==i;)e.push(r),H.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(Y));else e=i;return ye[n]={nextPos:pe,result:e},e}())===i&&(a=null),a!==i?(s=a,r={type:"regexp",value:new RegExp(n.join(""),s?s.join(""):"")},e=r):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;return ye[l]={nextPos:pe,result:e},e}()),o!==i?(r=I(r,n,o),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=De())!==i&&Ee()!==i&&(n=function(){var e,r,n,o=30*pe+11,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,S.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(_)),r===i&&(r=null),r!==i?(61===t.charCodeAt(pe)?(n="=",pe++):(n=i,Ae(w)),n!==i?(r=C(r),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(P.test(t.charAt(pe))?(e=t.charAt(pe),pe++):(e=i,Ae(k))),ye[o]={nextPos:pe,result:e},e)}())!==i&&Ee()!==i?((o=function(){var e,r,n,o,a,s,l=30*pe+15,u=ye[l];if(u)return pe=u.nextPos,u.result;if(e=pe,34===t.charCodeAt(pe)?(r='"',pe++):(r=i,Ae(j)),r!==i){for(n=[],F.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(T)),o===i&&(o=pe,92===t.charCodeAt(pe)?(a="\\",pe++):(a=i,Ae(L)),a!==i?(t.length>pe?(s=t.charAt(pe),pe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(pe=o,o=i)):(pe=o,o=i));o!==i;)n.push(o),F.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(T)),o===i&&(o=pe,92===t.charCodeAt(pe)?(a="\\",pe++):(a=i,Ae(L)),a!==i?(t.length>pe?(s=t.charAt(pe),pe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(pe=o,o=i)):(pe=o,o=i));n!==i?(34===t.charCodeAt(pe)?(o='"',pe++):(o=i,Ae(j)),o!==i?(r=B(n),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;if(e===i)if(e=pe,39===t.charCodeAt(pe)?(r="'",pe++):(r=i,Ae(M)),r!==i){for(n=[],U.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(V)),o===i&&(o=pe,92===t.charCodeAt(pe)?(a="\\",pe++):(a=i,Ae(L)),a!==i?(t.length>pe?(s=t.charAt(pe),pe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(pe=o,o=i)):(pe=o,o=i));o!==i;)n.push(o),U.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(V)),o===i&&(o=pe,92===t.charCodeAt(pe)?(a="\\",pe++):(a=i,Ae(L)),a!==i?(t.length>pe?(s=t.charAt(pe),pe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(pe=o,o=i)):(pe=o,o=i));n!==i?(39===t.charCodeAt(pe)?(o="'",pe++):(o=i,Ae(M)),o!==i?(r=B(n),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;return ye[l]={nextPos:pe,result:e},e}())===i&&(o=function(){var e,r,n,o,a,s,l,u=30*pe+16,c=ye[u];if(c)return pe=c.nextPos,c.result;for(e=pe,r=pe,n=[],q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N));o!==i;)n.push(o),q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N));if(n!==i?(46===t.charCodeAt(pe)?(o=".",pe++):(o=i,Ae(D)),o!==i?r=n=[n,o]:(pe=r,r=i)):(pe=r,r=i),r===i&&(r=null),r!==i){if(n=[],q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N));else n=i;n!==i?(s=n,l=(a=r)?[].concat.apply([],a).join(""):"",r={type:"literal",value:parseFloat(l+s.join(""))},e=r):(pe=e,e=i)}else pe=e,e=i;return ye[u]={nextPos:pe,result:e},e}())===i&&(o=function(){var e,t,r=30*pe+17,n=ye[r];return n?(pe=n.nextPos,n.result):((t=Se())!==i&&(t={type:"literal",value:t}),e=t,ye[r]={nextPos:pe,result:e},e)}()),o!==i?(r=I(r,n,o),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=De())!==i&&(r={type:"attribute",name:r}),e=r)),ye[a]={nextPos:pe,result:e},e)}())!==i&&Ee()!==i?(93===t.charCodeAt(pe)?(o="]",pe++):(o=i,Ae(E)),o!==i?e=r=n:(pe=e,e=i)):(pe=e,e=i),ye[a]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a,s,l,u,c=30*pe+21,p=ye[c];if(p)return pe=p.nextPos,p.result;if(e=pe,46===t.charCodeAt(pe)?(r=".",pe++):(r=i,Ae(D)),r!==i)if((n=Se())!==i){for(o=[],a=pe,46===t.charCodeAt(pe)?(s=".",pe++):(s=i,Ae(D)),s!==i&&(l=Se())!==i?a=s=[s,l]:(pe=a,a=i);a!==i;)o.push(a),a=pe,46===t.charCodeAt(pe)?(s=".",pe++):(s=i,Ae(D)),s!==i&&(l=Se())!==i?a=s=[s,l]:(pe=a,a=i);o!==i?(u=n,r={type:"field",name:o.reduce((function(e,t){return e+t[0]+t[1]}),u)},e=r):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return ye[c]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,o,a=30*pe+22,s=ye[a];return s?(pe=s.nextPos,s.result):(e=pe,":not("===t.substr(pe,5)?(r=":not(",pe+=5):(r=i,Ae(X)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(K)),o!==i?e=r={type:"not",selectors:n}:(pe=e,e=i)):(pe=e,e=i),ye[a]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*pe+23,s=ye[a];return s?(pe=s.nextPos,s.result):(e=pe,":matches("===t.substr(pe,9)?(r=":matches(",pe+=9):(r=i,Ae(Z)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(K)),o!==i?e=r={type:"matches",selectors:n}:(pe=e,e=i)):(pe=e,e=i),ye[a]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*pe+24,s=ye[a];return s?(pe=s.nextPos,s.result):(e=pe,":has("===t.substr(pe,5)?(r=":has(",pe+=5):(r=i,Ae(ee)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(K)),o!==i?e=r={type:"has",selectors:n}:(pe=e,e=i)):(pe=e,e=i),ye[a]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n=30*pe+25,o=ye[n];return o?(pe=o.nextPos,o.result):(":first-child"===t.substr(pe,12)?(r=":first-child",pe+=12):(r=i,Ae(te)),r!==i&&(r=Ie(1)),e=r,ye[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n=30*pe+26,o=ye[n];return o?(pe=o.nextPos,o.result):(":last-child"===t.substr(pe,11)?(r=":last-child",pe+=11):(r=i,Ae(re)),r!==i&&(r=je(1)),e=r,ye[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a,s=30*pe+27,l=ye[s];if(l)return pe=l.nextPos,l.result;if(e=pe,":nth-child("===t.substr(pe,11)?(r=":nth-child(",pe+=11):(r=i,Ae(ne)),r!==i)if(Ee()!==i){if(n=[],q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(pe)?(a=")",pe++):(a=i,Ae(K)),a!==i?(r=Ie(parseInt(n.join(""),10)),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return ye[s]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,o,a,s=30*pe+28,l=ye[s];if(l)return pe=l.nextPos,l.result;if(e=pe,":nth-last-child("===t.substr(pe,16)?(r=":nth-last-child(",pe+=16):(r=i,Ae(oe)),r!==i)if(Ee()!==i){if(n=[],q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,Ae(N));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(pe)?(a=")",pe++):(a=i,Ae(K)),a!==i?(r=je(parseInt(n.join(""),10)),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return ye[s]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,o=30*pe+29,a=ye[o];return a?(pe=a.nextPos,a.result):(e=pe,58===t.charCodeAt(pe)?(r=":",pe++):(r=i,Ae(ae)),r!==i?("statement"===t.substr(pe,9).toLowerCase()?(n=t.substr(pe,9),pe+=9):(n=i,Ae(se)),n===i&&("expression"===t.substr(pe,10).toLowerCase()?(n=t.substr(pe,10),pe+=10):(n=i,Ae(ie)),n===i&&("declaration"===t.substr(pe,11).toLowerCase()?(n=t.substr(pe,11),pe+=11):(n=i,Ae(le)),n===i&&("function"===t.substr(pe,8).toLowerCase()?(n=t.substr(pe,8),pe+=8):(n=i,Ae(ue)),n===i&&("pattern"===t.substr(pe,7).toLowerCase()?(n=t.substr(pe,7),pe+=7):(n=i,Ae(ce)))))),n!==i?e=r={type:"class",name:n}:(pe=e,e=i)):(pe=e,e=i),ye[o]={nextPos:pe,result:e},e)}()),ye[r]={nextPos:pe,result:e},e)}function De(){var e,r,n,o=30*pe+13,a=ye[o];if(a)return pe=a.nextPos,a.result;if(r=[],(n=Se())===i&&(46===t.charCodeAt(pe)?(n=".",pe++):(n=i,Ae(D))),n!==i)for(;n!==i;)r.push(n),(n=Se())===i&&(46===t.charCodeAt(pe)?(n=".",pe++):(n=i,Ae(D)));else r=i;return r!==i&&(r=h(r)),e=r,ye[o]={nextPos:pe,result:e},e}function Ie(e){return{type:"nth-child",index:{type:"literal",value:e}}}function je(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=u())!==i&&pe===t.length)return n;throw n!==i&&pe<t.length&&Ae({type:"end"}),o=de,a=he<t.length?t.charAt(he):null,s=he<t.length?ve(he,he+1):ve(he,he),new e(e.buildMessage(o,a),o,a,s)}}}())}));function l(t,r,n){if(!r)return!0;if(!t)return!1;switch(n||(n=[]),r.type){case"wildcard":return!0;case"identifier":return r.value.toLowerCase()===t.type.toLowerCase();case"field":var o=r.name.split("."),a=n[o.length-1];return function e(t,r,n){if(0===n.length)return t===r;if(null==r)return!1;var o=r[n[0]],a=n.slice(1);if(Array.isArray(o)){for(var s=0,i=o.length;s<i;++s)if(e(t,o[s],a))return!0;return!1}return e(t,o,a)}(t,a,o);case"matches":for(var i=0,f=r.selectors.length;i<f;++i)if(l(t,r.selectors[i],n))return!0;return!1;case"compound":for(var h=0,d=r.selectors.length;h<d;++h)if(!l(t,r.selectors[h],n))return!1;return!0;case"not":for(var y=0,m=r.selectors.length;y<m;++y)if(l(t,r.selectors[y],n))return!1;return!0;case"has":var x=function(){for(var e=[],n=function(n,o){var a=[];s.traverse(t,{enter:function(t,o){null!=o&&a.unshift(o),l(t,r.selectors[n],a)&&e.push(t)},leave:function(){a.shift()},fallback:"iteration"})},o=0,a=r.selectors.length;o<a;++o)n(o);return{v:0!==e.length}}();if("object"===e(x))return x.v;case"child":return!!l(t,r.right,n)&&l(n[0],r.left,n.slice(1));case"descendant":if(l(t,r.right,n))for(var g=0,v=n.length;g<v;++g)if(l(n[g],r.left,n.slice(g+1)))return!0;return!1;case"attribute":var A=function(e,t){for(var r=t.split("."),n=0;n<r.length;n++){if(null==e)return e;e=e[r[n]]}return e}(t,r.name);switch(r.operator){case void 0:return null!=A;case"=":switch(r.value.type){case"regexp":return"string"==typeof A&&r.value.value.test(A);case"literal":return"".concat(r.value.value)==="".concat(A);case"type":return r.value.value===e(A)}throw new Error("Unknown selector value type: ".concat(r.value.type));case"!=":switch(r.value.type){case"regexp":return!r.value.value.test(A);case"literal":return"".concat(r.value.value)!=="".concat(A);case"type":return r.value.value!==e(A)}throw new Error("Unknown selector value type: ".concat(r.value.type));case"<=":return A<=r.value.value;case"<":return A<r.value.value;case">":return A>r.value.value;case">=":return A>=r.value.value}throw new Error("Unknown operator: ".concat(r.operator));case"sibling":return l(t,r.right,n)&&u(t,r.left,n,"LEFT_SIDE")||r.left.subject&&l(t,r.left,n)&&u(t,r.right,n,"RIGHT_SIDE");case"adjacent":return l(t,r.right,n)&&c(t,r.left,n,"LEFT_SIDE")||r.right.subject&&l(t,r.left,n)&&c(t,r.right,n,"RIGHT_SIDE");case"nth-child":return l(t,r.right,n)&&p(t,n,(function(){return r.index.value-1}));case"nth-last-child":return l(t,r.right,n)&&p(t,n,(function(e){return e-r.index.value}));case"class":switch(r.name.toLowerCase()){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===n.length||"MetaProperty"!==n[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw new Error("Unknown class name: ".concat(r.name))}throw new Error("Unknown selector type: ".concat(r.type))}function u(e,r,n,o){var a=t(n,1)[0];if(!a)return!1;for(var i=s.VisitorKeys[a.type],u=0,c=i.length;u<c;++u){var p=a[i[u]];if(Array.isArray(p)){var f=p.indexOf(e);if(f<0)continue;var h=void 0,d=void 0;"LEFT_SIDE"===o?(h=0,d=f):(h=f+1,d=p.length);for(var y=h;y<d;++y)if(l(p[y],r,n))return!0}}return!1}function c(e,r,n,o){var a=t(n,1)[0];if(!a)return!1;for(var i=s.VisitorKeys[a.type],u=0,c=i.length;u<c;++u){var p=a[i[u]];if(Array.isArray(p)){var f=p.indexOf(e);if(f<0)continue;if("LEFT_SIDE"===o&&f>0&&l(p[f-1],r,n))return!0;if("RIGHT_SIDE"===o&&f<p.length-1&&l(p[f+1],r,n))return!0}}return!1}function p(e,r,n){var o=t(r,1)[0];if(!o)return!1;for(var a=s.VisitorKeys[o.type],i=0,l=a.length;i<l;++i){var u=o[a[i]];if(Array.isArray(u)){var c=u.indexOf(e);if(c>=0&&c===n(u.length))return!0}}return!1}function f(n,o){if(null==n||"object"!=e(n))return[];null==o&&(o=n);for(var a=n.subject?[o]:[],s=0,i=function(e){for(var t=[],r=Object.keys(e),n=0;n<r.length;n++)t.push([r[n],e[r[n]]]);return t}(n);s<i.length;s++){var l=t(i[s],2),u=l[0],c=l[1];a.push.apply(a,r(f(c,"left"===u?c:o)))}return a}function h(e,t,r){if(t){var n=[],o=f(t);s.traverse(e,{enter:function(e,a){if(null!=a&&n.unshift(a),l(e,t,n))if(o.length)for(var s=0,i=o.length;s<i;++s){l(e,o[s],n)&&r(e,a,n);for(var u=0,c=n.length;u<c;++u){var p=n.slice(u+1);l(n[u],o[s],p)&&r(n[u],a,p)}}else r(e,a,n)},leave:function(){n.shift()},fallback:"iteration"})}}function d(e,t){var r=[];return h(e,t,(function(e){r.push(e)})),r}function y(e){return i.parse(e)}function m(e,t){return d(e,y(t))}m.parse=y,m.match=d,m.traverse=h,m.matches=l,m.query=m;export default m;
//# sourceMappingURL=esquery.esm.min.js.map
diff --git a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.js b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.js
index e3836cd4a5..700b4ff054 100644
--- a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.js
+++ b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.js
@@ -1,3690 +1,4553 @@
(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global = global || self, global.esquery = factory());
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global = global || self, global.esquery = factory());
}(this, (function () { 'use strict';
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-
- function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
- }
-
- var estraverse = createCommonjsModule(function (module, exports) {
- /*
- Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
- Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- /*jslint vars:false, bitwise:true*/
- /*jshint indent:4*/
- /*global exports:true*/
- (function clone(exports) {
-
- var Syntax,
- VisitorOption,
- VisitorKeys,
- BREAK,
- SKIP,
- REMOVE;
-
- function deepCopy(obj) {
- var ret = {}, key, val;
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- val = obj[key];
- if (typeof val === 'object' && val !== null) {
- ret[key] = deepCopy(val);
- } else {
- ret[key] = val;
- }
- }
- }
- return ret;
- }
-
- // based on LLVM libc++ upper_bound / lower_bound
- // MIT License
-
- function upperBound(array, func) {
- var diff, len, i, current;
-
- len = array.length;
- i = 0;
-
- while (len) {
- diff = len >>> 1;
- current = i + diff;
- if (func(array[current])) {
- len = diff;
- } else {
- i = current + 1;
- len -= diff + 1;
- }
- }
- return i;
- }
-
- Syntax = {
- AssignmentExpression: 'AssignmentExpression',
- AssignmentPattern: 'AssignmentPattern',
- ArrayExpression: 'ArrayExpression',
- ArrayPattern: 'ArrayPattern',
- ArrowFunctionExpression: 'ArrowFunctionExpression',
- AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.
- BlockStatement: 'BlockStatement',
- BinaryExpression: 'BinaryExpression',
- BreakStatement: 'BreakStatement',
- CallExpression: 'CallExpression',
- CatchClause: 'CatchClause',
- ClassBody: 'ClassBody',
- ClassDeclaration: 'ClassDeclaration',
- ClassExpression: 'ClassExpression',
- ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7.
- ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7.
- ConditionalExpression: 'ConditionalExpression',
- ContinueStatement: 'ContinueStatement',
- DebuggerStatement: 'DebuggerStatement',
- DirectiveStatement: 'DirectiveStatement',
- DoWhileStatement: 'DoWhileStatement',
- EmptyStatement: 'EmptyStatement',
- ExportAllDeclaration: 'ExportAllDeclaration',
- ExportDefaultDeclaration: 'ExportDefaultDeclaration',
- ExportNamedDeclaration: 'ExportNamedDeclaration',
- ExportSpecifier: 'ExportSpecifier',
- ExpressionStatement: 'ExpressionStatement',
- ForStatement: 'ForStatement',
- ForInStatement: 'ForInStatement',
- ForOfStatement: 'ForOfStatement',
- FunctionDeclaration: 'FunctionDeclaration',
- FunctionExpression: 'FunctionExpression',
- GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7.
- Identifier: 'Identifier',
- IfStatement: 'IfStatement',
- ImportExpression: 'ImportExpression',
- ImportDeclaration: 'ImportDeclaration',
- ImportDefaultSpecifier: 'ImportDefaultSpecifier',
- ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
- ImportSpecifier: 'ImportSpecifier',
- Literal: 'Literal',
- LabeledStatement: 'LabeledStatement',
- LogicalExpression: 'LogicalExpression',
- MemberExpression: 'MemberExpression',
- MetaProperty: 'MetaProperty',
- MethodDefinition: 'MethodDefinition',
- ModuleSpecifier: 'ModuleSpecifier',
- NewExpression: 'NewExpression',
- ObjectExpression: 'ObjectExpression',
- ObjectPattern: 'ObjectPattern',
- Program: 'Program',
- Property: 'Property',
- RestElement: 'RestElement',
- ReturnStatement: 'ReturnStatement',
- SequenceExpression: 'SequenceExpression',
- SpreadElement: 'SpreadElement',
- Super: 'Super',
- SwitchStatement: 'SwitchStatement',
- SwitchCase: 'SwitchCase',
- TaggedTemplateExpression: 'TaggedTemplateExpression',
- TemplateElement: 'TemplateElement',
- TemplateLiteral: 'TemplateLiteral',
- ThisExpression: 'ThisExpression',
- ThrowStatement: 'ThrowStatement',
- TryStatement: 'TryStatement',
- UnaryExpression: 'UnaryExpression',
- UpdateExpression: 'UpdateExpression',
- VariableDeclaration: 'VariableDeclaration',
- VariableDeclarator: 'VariableDeclarator',
- WhileStatement: 'WhileStatement',
- WithStatement: 'WithStatement',
- YieldExpression: 'YieldExpression'
- };
-
- VisitorKeys = {
- AssignmentExpression: ['left', 'right'],
- AssignmentPattern: ['left', 'right'],
- ArrayExpression: ['elements'],
- ArrayPattern: ['elements'],
- ArrowFunctionExpression: ['params', 'body'],
- AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.
- BlockStatement: ['body'],
- BinaryExpression: ['left', 'right'],
- BreakStatement: ['label'],
- CallExpression: ['callee', 'arguments'],
- CatchClause: ['param', 'body'],
- ClassBody: ['body'],
- ClassDeclaration: ['id', 'superClass', 'body'],
- ClassExpression: ['id', 'superClass', 'body'],
- ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7.
- ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
- ConditionalExpression: ['test', 'consequent', 'alternate'],
- ContinueStatement: ['label'],
- DebuggerStatement: [],
- DirectiveStatement: [],
- DoWhileStatement: ['body', 'test'],
- EmptyStatement: [],
- ExportAllDeclaration: ['source'],
- ExportDefaultDeclaration: ['declaration'],
- ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
- ExportSpecifier: ['exported', 'local'],
- ExpressionStatement: ['expression'],
- ForStatement: ['init', 'test', 'update', 'body'],
- ForInStatement: ['left', 'right', 'body'],
- ForOfStatement: ['left', 'right', 'body'],
- FunctionDeclaration: ['id', 'params', 'body'],
- FunctionExpression: ['id', 'params', 'body'],
- GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
- Identifier: [],
- IfStatement: ['test', 'consequent', 'alternate'],
- ImportExpression: ['source'],
- ImportDeclaration: ['specifiers', 'source'],
- ImportDefaultSpecifier: ['local'],
- ImportNamespaceSpecifier: ['local'],
- ImportSpecifier: ['imported', 'local'],
- Literal: [],
- LabeledStatement: ['label', 'body'],
- LogicalExpression: ['left', 'right'],
- MemberExpression: ['object', 'property'],
- MetaProperty: ['meta', 'property'],
- MethodDefinition: ['key', 'value'],
- ModuleSpecifier: [],
- NewExpression: ['callee', 'arguments'],
- ObjectExpression: ['properties'],
- ObjectPattern: ['properties'],
- Program: ['body'],
- Property: ['key', 'value'],
- RestElement: [ 'argument' ],
- ReturnStatement: ['argument'],
- SequenceExpression: ['expressions'],
- SpreadElement: ['argument'],
- Super: [],
- SwitchStatement: ['discriminant', 'cases'],
- SwitchCase: ['test', 'consequent'],
- TaggedTemplateExpression: ['tag', 'quasi'],
- TemplateElement: [],
- TemplateLiteral: ['quasis', 'expressions'],
- ThisExpression: [],
- ThrowStatement: ['argument'],
- TryStatement: ['block', 'handler', 'finalizer'],
- UnaryExpression: ['argument'],
- UpdateExpression: ['argument'],
- VariableDeclaration: ['declarations'],
- VariableDeclarator: ['id', 'init'],
- WhileStatement: ['test', 'body'],
- WithStatement: ['object', 'body'],
- YieldExpression: ['argument']
- };
-
- // unique id
- BREAK = {};
- SKIP = {};
- REMOVE = {};
-
- VisitorOption = {
- Break: BREAK,
- Skip: SKIP,
- Remove: REMOVE
- };
-
- function Reference(parent, key) {
- this.parent = parent;
- this.key = key;
- }
-
- Reference.prototype.replace = function replace(node) {
- this.parent[this.key] = node;
- };
-
- Reference.prototype.remove = function remove() {
- if (Array.isArray(this.parent)) {
- this.parent.splice(this.key, 1);
- return true;
- } else {
- this.replace(null);
- return false;
- }
- };
-
- function Element(node, path, wrap, ref) {
- this.node = node;
- this.path = path;
- this.wrap = wrap;
- this.ref = ref;
- }
-
- function Controller() { }
-
- // API:
- // return property path array from root to current node
- Controller.prototype.path = function path() {
- var i, iz, j, jz, result, element;
-
- function addToPath(result, path) {
- if (Array.isArray(path)) {
- for (j = 0, jz = path.length; j < jz; ++j) {
- result.push(path[j]);
- }
- } else {
- result.push(path);
- }
- }
-
- // root node
- if (!this.__current.path) {
- return null;
- }
-
- // first node is sentinel, second node is root element
- result = [];
- for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
- element = this.__leavelist[i];
- addToPath(result, element.path);
- }
- addToPath(result, this.__current.path);
- return result;
- };
-
- // API:
- // return type of current node
- Controller.prototype.type = function () {
- var node = this.current();
- return node.type || this.__current.wrap;
- };
-
- // API:
- // return array of parent elements
- Controller.prototype.parents = function parents() {
- var i, iz, result;
-
- // first node is sentinel
- result = [];
- for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
- result.push(this.__leavelist[i].node);
- }
-
- return result;
- };
-
- // API:
- // return current node
- Controller.prototype.current = function current() {
- return this.__current.node;
- };
-
- Controller.prototype.__execute = function __execute(callback, element) {
- var previous, result;
-
- result = undefined;
-
- previous = this.__current;
- this.__current = element;
- this.__state = null;
- if (callback) {
- result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
- }
- this.__current = previous;
-
- return result;
- };
-
- // API:
- // notify control skip / break
- Controller.prototype.notify = function notify(flag) {
- this.__state = flag;
- };
-
- // API:
- // skip child nodes of current node
- Controller.prototype.skip = function () {
- this.notify(SKIP);
- };
-
- // API:
- // break traversals
- Controller.prototype['break'] = function () {
- this.notify(BREAK);
- };
-
- // API:
- // remove node
- Controller.prototype.remove = function () {
- this.notify(REMOVE);
- };
-
- Controller.prototype.__initialize = function(root, visitor) {
- this.visitor = visitor;
- this.root = root;
- this.__worklist = [];
- this.__leavelist = [];
- this.__current = null;
- this.__state = null;
- this.__fallback = null;
- if (visitor.fallback === 'iteration') {
- this.__fallback = Object.keys;
- } else if (typeof visitor.fallback === 'function') {
- this.__fallback = visitor.fallback;
- }
-
- this.__keys = VisitorKeys;
- if (visitor.keys) {
- this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
- }
- };
-
- function isNode(node) {
- if (node == null) {
- return false;
- }
- return typeof node === 'object' && typeof node.type === 'string';
- }
-
- function isProperty(nodeType, key) {
- return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
- }
-
- Controller.prototype.traverse = function traverse(root, visitor) {
- var worklist,
- leavelist,
- element,
- node,
- nodeType,
- ret,
- key,
- current,
- current2,
- candidates,
- candidate,
- sentinel;
-
- this.__initialize(root, visitor);
-
- sentinel = {};
-
- // reference
- worklist = this.__worklist;
- leavelist = this.__leavelist;
-
- // initialize
- worklist.push(new Element(root, null, null, null));
- leavelist.push(new Element(null, null, null, null));
-
- while (worklist.length) {
- element = worklist.pop();
-
- if (element === sentinel) {
- element = leavelist.pop();
-
- ret = this.__execute(visitor.leave, element);
-
- if (this.__state === BREAK || ret === BREAK) {
- return;
- }
- continue;
- }
-
- if (element.node) {
-
- ret = this.__execute(visitor.enter, element);
-
- if (this.__state === BREAK || ret === BREAK) {
- return;
- }
-
- worklist.push(sentinel);
- leavelist.push(element);
-
- if (this.__state === SKIP || ret === SKIP) {
- continue;
- }
-
- node = element.node;
- nodeType = node.type || element.wrap;
- candidates = this.__keys[nodeType];
- if (!candidates) {
- if (this.__fallback) {
- candidates = this.__fallback(node);
- } else {
- throw new Error('Unknown node type ' + nodeType + '.');
- }
- }
-
- current = candidates.length;
- while ((current -= 1) >= 0) {
- key = candidates[current];
- candidate = node[key];
- if (!candidate) {
- continue;
- }
-
- if (Array.isArray(candidate)) {
- current2 = candidate.length;
- while ((current2 -= 1) >= 0) {
- if (!candidate[current2]) {
- continue;
- }
- if (isProperty(nodeType, candidates[current])) {
- element = new Element(candidate[current2], [key, current2], 'Property', null);
- } else if (isNode(candidate[current2])) {
- element = new Element(candidate[current2], [key, current2], null, null);
- } else {
- continue;
- }
- worklist.push(element);
- }
- } else if (isNode(candidate)) {
- worklist.push(new Element(candidate, key, null, null));
- }
- }
- }
- }
- };
-
- Controller.prototype.replace = function replace(root, visitor) {
- var worklist,
- leavelist,
- node,
- nodeType,
- target,
- element,
- current,
- current2,
- candidates,
- candidate,
- sentinel,
- outer,
- key;
-
- function removeElem(element) {
- var i,
- key,
- nextElem,
- parent;
-
- if (element.ref.remove()) {
- // When the reference is an element of an array.
- key = element.ref.key;
- parent = element.ref.parent;
-
- // If removed from array, then decrease following items' keys.
- i = worklist.length;
- while (i--) {
- nextElem = worklist[i];
- if (nextElem.ref && nextElem.ref.parent === parent) {
- if (nextElem.ref.key < key) {
- break;
- }
- --nextElem.ref.key;
- }
- }
- }
- }
-
- this.__initialize(root, visitor);
-
- sentinel = {};
-
- // reference
- worklist = this.__worklist;
- leavelist = this.__leavelist;
-
- // initialize
- outer = {
- root: root
- };
- element = new Element(root, null, null, new Reference(outer, 'root'));
- worklist.push(element);
- leavelist.push(element);
-
- while (worklist.length) {
- element = worklist.pop();
-
- if (element === sentinel) {
- element = leavelist.pop();
-
- target = this.__execute(visitor.leave, element);
-
- // node may be replaced with null,
- // so distinguish between undefined and null in this place
- if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
- // replace
- element.ref.replace(target);
- }
-
- if (this.__state === REMOVE || target === REMOVE) {
- removeElem(element);
- }
-
- if (this.__state === BREAK || target === BREAK) {
- return outer.root;
- }
- continue;
- }
-
- target = this.__execute(visitor.enter, element);
-
- // node may be replaced with null,
- // so distinguish between undefined and null in this place
- if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
- // replace
- element.ref.replace(target);
- element.node = target;
- }
-
- if (this.__state === REMOVE || target === REMOVE) {
- removeElem(element);
- element.node = null;
- }
-
- if (this.__state === BREAK || target === BREAK) {
- return outer.root;
- }
-
- // node may be null
- node = element.node;
- if (!node) {
- continue;
- }
-
- worklist.push(sentinel);
- leavelist.push(element);
-
- if (this.__state === SKIP || target === SKIP) {
- continue;
- }
-
- nodeType = node.type || element.wrap;
- candidates = this.__keys[nodeType];
- if (!candidates) {
- if (this.__fallback) {
- candidates = this.__fallback(node);
- } else {
- throw new Error('Unknown node type ' + nodeType + '.');
- }
- }
-
- current = candidates.length;
- while ((current -= 1) >= 0) {
- key = candidates[current];
- candidate = node[key];
- if (!candidate) {
- continue;
- }
-
- if (Array.isArray(candidate)) {
- current2 = candidate.length;
- while ((current2 -= 1) >= 0) {
- if (!candidate[current2]) {
- continue;
- }
- if (isProperty(nodeType, candidates[current])) {
- element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
- } else if (isNode(candidate[current2])) {
- element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
- } else {
- continue;
- }
- worklist.push(element);
- }
- } else if (isNode(candidate)) {
- worklist.push(new Element(candidate, key, null, new Reference(node, key)));
- }
- }
- }
-
- return outer.root;
- };
-
- function traverse(root, visitor) {
- var controller = new Controller();
- return controller.traverse(root, visitor);
- }
-
- function replace(root, visitor) {
- var controller = new Controller();
- return controller.replace(root, visitor);
- }
-
- function extendCommentRange(comment, tokens) {
- var target;
-
- target = upperBound(tokens, function search(token) {
- return token.range[0] > comment.range[0];
- });
-
- comment.extendedRange = [comment.range[0], comment.range[1]];
-
- if (target !== tokens.length) {
- comment.extendedRange[1] = tokens[target].range[0];
- }
-
- target -= 1;
- if (target >= 0) {
- comment.extendedRange[0] = tokens[target].range[1];
- }
-
- return comment;
- }
-
- function attachComments(tree, providedComments, tokens) {
- // At first, we should calculate extended comment ranges.
- var comments = [], comment, len, i, cursor;
-
- if (!tree.range) {
- throw new Error('attachComments needs range information');
- }
-
- // tokens array is empty, we attach comments to tree as 'leadingComments'
- if (!tokens.length) {
- if (providedComments.length) {
- for (i = 0, len = providedComments.length; i < len; i += 1) {
- comment = deepCopy(providedComments[i]);
- comment.extendedRange = [0, tree.range[0]];
- comments.push(comment);
- }
- tree.leadingComments = comments;
- }
- return tree;
- }
-
- for (i = 0, len = providedComments.length; i < len; i += 1) {
- comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
- }
-
- // This is based on John Freeman's implementation.
- cursor = 0;
- traverse(tree, {
- enter: function (node) {
- var comment;
-
- while (cursor < comments.length) {
- comment = comments[cursor];
- if (comment.extendedRange[1] > node.range[0]) {
- break;
- }
-
- if (comment.extendedRange[1] === node.range[0]) {
- if (!node.leadingComments) {
- node.leadingComments = [];
- }
- node.leadingComments.push(comment);
- comments.splice(cursor, 1);
- } else {
- cursor += 1;
- }
- }
-
- // already out of owned node
- if (cursor === comments.length) {
- return VisitorOption.Break;
- }
-
- if (comments[cursor].extendedRange[0] > node.range[1]) {
- return VisitorOption.Skip;
- }
- }
- });
-
- cursor = 0;
- traverse(tree, {
- leave: function (node) {
- var comment;
-
- while (cursor < comments.length) {
- comment = comments[cursor];
- if (node.range[1] < comment.extendedRange[0]) {
- break;
- }
-
- if (node.range[1] === comment.extendedRange[0]) {
- if (!node.trailingComments) {
- node.trailingComments = [];
- }
- node.trailingComments.push(comment);
- comments.splice(cursor, 1);
- } else {
- cursor += 1;
- }
- }
-
- // already out of owned node
- if (cursor === comments.length) {
- return VisitorOption.Break;
- }
-
- if (comments[cursor].extendedRange[0] > node.range[1]) {
- return VisitorOption.Skip;
- }
- }
- });
-
- return tree;
- }
-
- exports.Syntax = Syntax;
- exports.traverse = traverse;
- exports.replace = replace;
- exports.attachComments = attachComments;
- exports.VisitorKeys = VisitorKeys;
- exports.VisitorOption = VisitorOption;
- exports.Controller = Controller;
- exports.cloneEnvironment = function () { return clone({}); };
-
- return exports;
- }(exports));
- /* vim: set sw=4 ts=4 et tw=80 : */
- });
-
- var parser = createCommonjsModule(function (module) {
- /*
- * Generated by PEG.js 0.10.0.
- *
- * http://pegjs.org/
- */
- (function(root, factory) {
- if ( module.exports) {
- module.exports = factory();
- }
- })(commonjsGlobal, function() {
-
- function peg$subclass(child, parent) {
- function ctor() { this.constructor = child; }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- }
-
- function peg$SyntaxError(message, expected, found, location) {
- this.message = message;
- this.expected = expected;
- this.found = found;
- this.location = location;
- this.name = "SyntaxError";
-
- if (typeof Error.captureStackTrace === "function") {
- Error.captureStackTrace(this, peg$SyntaxError);
- }
- }
-
- peg$subclass(peg$SyntaxError, Error);
-
- peg$SyntaxError.buildMessage = function(expected, found) {
- var DESCRIBE_EXPECTATION_FNS = {
- literal: function(expectation) {
- return "\"" + literalEscape(expectation.text) + "\"";
- },
-
- "class": function(expectation) {
- var escapedParts = "",
- i;
-
- for (i = 0; i < expectation.parts.length; i++) {
- escapedParts += expectation.parts[i] instanceof Array
- ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
- : classEscape(expectation.parts[i]);
- }
-
- return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
- },
-
- any: function(expectation) {
- return "any character";
- },
-
- end: function(expectation) {
- return "end of input";
- },
-
- other: function(expectation) {
- return expectation.description;
- }
- };
-
- function hex(ch) {
- return ch.charCodeAt(0).toString(16).toUpperCase();
- }
-
- function literalEscape(s) {
- return s
- .replace(/\\/g, '\\\\')
- .replace(/"/g, '\\"')
- .replace(/\0/g, '\\0')
- .replace(/\t/g, '\\t')
- .replace(/\n/g, '\\n')
- .replace(/\r/g, '\\r')
- .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
- }
-
- function classEscape(s) {
- return s
- .replace(/\\/g, '\\\\')
- .replace(/\]/g, '\\]')
- .replace(/\^/g, '\\^')
- .replace(/-/g, '\\-')
- .replace(/\0/g, '\\0')
- .replace(/\t/g, '\\t')
- .replace(/\n/g, '\\n')
- .replace(/\r/g, '\\r')
- .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
- }
-
- function describeExpectation(expectation) {
- return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
- }
-
- function describeExpected(expected) {
- var descriptions = new Array(expected.length),
- i, j;
-
- for (i = 0; i < expected.length; i++) {
- descriptions[i] = describeExpectation(expected[i]);
- }
-
- descriptions.sort();
-
- if (descriptions.length > 0) {
- for (i = 1, j = 1; i < descriptions.length; i++) {
- if (descriptions[i - 1] !== descriptions[i]) {
- descriptions[j] = descriptions[i];
- j++;
- }
- }
- descriptions.length = j;
- }
-
- switch (descriptions.length) {
- case 1:
- return descriptions[0];
-
- case 2:
- return descriptions[0] + " or " + descriptions[1];
-
- default:
- return descriptions.slice(0, -1).join(", ")
- + ", or "
- + descriptions[descriptions.length - 1];
- }
- }
-
- function describeFound(found) {
- return found ? "\"" + literalEscape(found) + "\"" : "end of input";
- }
-
- return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
- };
-
- function peg$parse(input, options) {
- options = options !== void 0 ? options : {};
-
- var peg$FAILED = {},
-
- peg$startRuleFunctions = { start: peg$parsestart },
- peg$startRuleFunction = peg$parsestart,
-
- peg$c0 = function(ss) {
- return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss };
- },
- peg$c1 = function() { return void 0; },
- peg$c2 = " ",
- peg$c3 = peg$literalExpectation(" ", false),
- peg$c4 = /^[^ [\],():#!=><~+.]/,
- peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false),
- peg$c6 = function(i) { return i.join(''); },
- peg$c7 = ">",
- peg$c8 = peg$literalExpectation(">", false),
- peg$c9 = function() { return 'child'; },
- peg$c10 = "~",
- peg$c11 = peg$literalExpectation("~", false),
- peg$c12 = function() { return 'sibling'; },
- peg$c13 = "+",
- peg$c14 = peg$literalExpectation("+", false),
- peg$c15 = function() { return 'adjacent'; },
- peg$c16 = function() { return 'descendant'; },
- peg$c17 = ",",
- peg$c18 = peg$literalExpectation(",", false),
- peg$c19 = function(s, ss) {
- return [s].concat(ss.map(function (s) { return s[3]; }));
- },
- peg$c20 = function(a, ops) {
- return ops.reduce(function (memo, rhs) {
- return { type: rhs[0], left: memo, right: rhs[1] };
- }, a);
- },
- peg$c21 = "!",
- peg$c22 = peg$literalExpectation("!", false),
- peg$c23 = function(subject, as) {
- const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as };
- if(subject) b.subject = true;
- return b;
- },
- peg$c24 = "*",
- peg$c25 = peg$literalExpectation("*", false),
- peg$c26 = function(a) { return { type: 'wildcard', value: a }; },
- peg$c27 = "#",
- peg$c28 = peg$literalExpectation("#", false),
- peg$c29 = function(i) { return { type: 'identifier', value: i }; },
- peg$c30 = "[",
- peg$c31 = peg$literalExpectation("[", false),
- peg$c32 = "]",
- peg$c33 = peg$literalExpectation("]", false),
- peg$c34 = function(v) { return v; },
- peg$c35 = /^[><!]/,
- peg$c36 = peg$classExpectation([">", "<", "!"], false, false),
- peg$c37 = "=",
- peg$c38 = peg$literalExpectation("=", false),
- peg$c39 = function(a) { return (a || '') + '='; },
- peg$c40 = /^[><]/,
- peg$c41 = peg$classExpectation([">", "<"], false, false),
- peg$c42 = ".",
- peg$c43 = peg$literalExpectation(".", false),
- peg$c44 = function(name, op, value) {
- return { type: 'attribute', name: name, operator: op, value: value };
- },
- peg$c45 = function(name) { return { type: 'attribute', name: name }; },
- peg$c46 = "\"",
- peg$c47 = peg$literalExpectation("\"", false),
- peg$c48 = /^[^\\"]/,
- peg$c49 = peg$classExpectation(["\\", "\""], true, false),
- peg$c50 = "\\",
- peg$c51 = peg$literalExpectation("\\", false),
- peg$c52 = peg$anyExpectation(),
- peg$c53 = function(a, b) { return a + b; },
- peg$c54 = function(d) {
- return { type: 'literal', value: strUnescape(d.join('')) };
- },
- peg$c55 = "'",
- peg$c56 = peg$literalExpectation("'", false),
- peg$c57 = /^[^\\']/,
- peg$c58 = peg$classExpectation(["\\", "'"], true, false),
- peg$c59 = /^[0-9]/,
- peg$c60 = peg$classExpectation([["0", "9"]], false, false),
- peg$c61 = function(a, b) {
- // Can use `a.flat().join('')` once supported
- const leadingDecimals = a ? [].concat.apply([], a).join('') : '';
- return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) };
- },
- peg$c62 = function(i) { return { type: 'literal', value: i }; },
- peg$c63 = "type(",
- peg$c64 = peg$literalExpectation("type(", false),
- peg$c65 = /^[^ )]/,
- peg$c66 = peg$classExpectation([" ", ")"], true, false),
- peg$c67 = ")",
- peg$c68 = peg$literalExpectation(")", false),
- peg$c69 = function(t) { return { type: 'type', value: t.join('') }; },
- peg$c70 = /^[imsu]/,
- peg$c71 = peg$classExpectation(["i", "m", "s", "u"], false, false),
- peg$c72 = "/",
- peg$c73 = peg$literalExpectation("/", false),
- peg$c74 = /^[^\/]/,
- peg$c75 = peg$classExpectation(["/"], true, false),
- peg$c76 = function(d, flgs) { return {
- type: 'regexp', value: new RegExp(d.join(''), flgs ? flgs.join('') : '') };
- },
- peg$c77 = function(i, is) {
- return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)};
- },
- peg$c78 = ":not(",
- peg$c79 = peg$literalExpectation(":not(", false),
- peg$c80 = function(ss) { return { type: 'not', selectors: ss }; },
- peg$c81 = ":matches(",
- peg$c82 = peg$literalExpectation(":matches(", false),
- peg$c83 = function(ss) { return { type: 'matches', selectors: ss }; },
- peg$c84 = ":has(",
- peg$c85 = peg$literalExpectation(":has(", false),
- peg$c86 = function(ss) { return { type: 'has', selectors: ss }; },
- peg$c87 = ":first-child",
- peg$c88 = peg$literalExpectation(":first-child", false),
- peg$c89 = function() { return nth(1); },
- peg$c90 = ":last-child",
- peg$c91 = peg$literalExpectation(":last-child", false),
- peg$c92 = function() { return nthLast(1); },
- peg$c93 = ":nth-child(",
- peg$c94 = peg$literalExpectation(":nth-child(", false),
- peg$c95 = function(n) { return nth(parseInt(n.join(''), 10)); },
- peg$c96 = ":nth-last-child(",
- peg$c97 = peg$literalExpectation(":nth-last-child(", false),
- peg$c98 = function(n) { return nthLast(parseInt(n.join(''), 10)); },
- peg$c99 = ":",
- peg$c100 = peg$literalExpectation(":", false),
- peg$c101 = "statement",
- peg$c102 = peg$literalExpectation("statement", true),
- peg$c103 = "expression",
- peg$c104 = peg$literalExpectation("expression", true),
- peg$c105 = "declaration",
- peg$c106 = peg$literalExpectation("declaration", true),
- peg$c107 = "function",
- peg$c108 = peg$literalExpectation("function", true),
- peg$c109 = "pattern",
- peg$c110 = peg$literalExpectation("pattern", true),
- peg$c111 = function(c) {
- return { type: 'class', name: c };
- },
-
- peg$currPos = 0,
- peg$posDetailsCache = [{ line: 1, column: 1 }],
- peg$maxFailPos = 0,
- peg$maxFailExpected = [],
- peg$resultsCache = {},
-
- peg$result;
-
- if ("startRule" in options) {
- if (!(options.startRule in peg$startRuleFunctions)) {
- throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
- }
-
- peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
- }
-
- function peg$literalExpectation(text, ignoreCase) {
- return { type: "literal", text: text, ignoreCase: ignoreCase };
- }
-
- function peg$classExpectation(parts, inverted, ignoreCase) {
- return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
- }
-
- function peg$anyExpectation() {
- return { type: "any" };
- }
-
- function peg$endExpectation() {
- return { type: "end" };
- }
-
- function peg$computePosDetails(pos) {
- var details = peg$posDetailsCache[pos], p;
-
- if (details) {
- return details;
- } else {
- p = pos - 1;
- while (!peg$posDetailsCache[p]) {
- p--;
- }
-
- details = peg$posDetailsCache[p];
- details = {
- line: details.line,
- column: details.column
- };
-
- while (p < pos) {
- if (input.charCodeAt(p) === 10) {
- details.line++;
- details.column = 1;
- } else {
- details.column++;
- }
-
- p++;
- }
-
- peg$posDetailsCache[pos] = details;
- return details;
- }
- }
-
- function peg$computeLocation(startPos, endPos) {
- var startPosDetails = peg$computePosDetails(startPos),
- endPosDetails = peg$computePosDetails(endPos);
-
- return {
- start: {
- offset: startPos,
- line: startPosDetails.line,
- column: startPosDetails.column
- },
- end: {
- offset: endPos,
- line: endPosDetails.line,
- column: endPosDetails.column
- }
- };
- }
-
- function peg$fail(expected) {
- if (peg$currPos < peg$maxFailPos) { return; }
-
- if (peg$currPos > peg$maxFailPos) {
- peg$maxFailPos = peg$currPos;
- peg$maxFailExpected = [];
- }
-
- peg$maxFailExpected.push(expected);
- }
-
- function peg$buildStructuredError(expected, found, location) {
- return new peg$SyntaxError(
- peg$SyntaxError.buildMessage(expected, found),
- expected,
- found,
- location
- );
- }
-
- function peg$parsestart() {
- var s0, s1, s2, s3;
-
- var key = peg$currPos * 30 + 0,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- s2 = peg$parseselectors();
- if (s2 !== peg$FAILED) {
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- s1 = peg$c0(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- s1 = peg$c1();
- }
- s0 = s1;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parse_() {
- var s0, s1;
-
- var key = peg$currPos * 30 + 1,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = [];
- if (input.charCodeAt(peg$currPos) === 32) {
- s1 = peg$c2;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c3); }
- }
- while (s1 !== peg$FAILED) {
- s0.push(s1);
- if (input.charCodeAt(peg$currPos) === 32) {
- s1 = peg$c2;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c3); }
- }
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseidentifierName() {
- var s0, s1, s2;
-
- var key = peg$currPos * 30 + 2,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- s1 = [];
- if (peg$c4.test(input.charAt(peg$currPos))) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c5); }
- }
- if (s2 !== peg$FAILED) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- if (peg$c4.test(input.charAt(peg$currPos))) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c5); }
- }
- }
- } else {
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- s1 = peg$c6(s1);
- }
- s0 = s1;
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsebinaryOp() {
- var s0, s1, s2, s3;
-
- var key = peg$currPos * 30 + 3,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 62) {
- s2 = peg$c7;
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c8); }
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- s1 = peg$c9();
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 126) {
- s2 = peg$c10;
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c11); }
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- s1 = peg$c12();
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 43) {
- s2 = peg$c13;
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c14); }
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- s1 = peg$c15();
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 32) {
- s1 = peg$c2;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c3); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s1 = peg$c16();
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- }
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseselectors() {
- var s0, s1, s2, s3, s4, s5, s6, s7;
-
- var key = peg$currPos * 30 + 4,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- s1 = peg$parseselector();
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$currPos;
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s5 = peg$c17;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c18); }
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parse_();
- if (s6 !== peg$FAILED) {
- s7 = peg$parseselector();
- if (s7 !== peg$FAILED) {
- s4 = [s4, s5, s6, s7];
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$currPos;
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s5 = peg$c17;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c18); }
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parse_();
- if (s6 !== peg$FAILED) {
- s7 = peg$parseselector();
- if (s7 !== peg$FAILED) {
- s4 = [s4, s5, s6, s7];
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c19(s1, s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseselector() {
- var s0, s1, s2, s3, s4, s5;
-
- var key = peg$currPos * 30 + 5,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- s1 = peg$parsesequence();
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$currPos;
- s4 = peg$parsebinaryOp();
- if (s4 !== peg$FAILED) {
- s5 = peg$parsesequence();
- if (s5 !== peg$FAILED) {
- s4 = [s4, s5];
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$currPos;
- s4 = peg$parsebinaryOp();
- if (s4 !== peg$FAILED) {
- s5 = peg$parsesequence();
- if (s5 !== peg$FAILED) {
- s4 = [s4, s5];
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c20(s1, s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsesequence() {
- var s0, s1, s2, s3;
-
- var key = peg$currPos * 30 + 6,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 33) {
- s1 = peg$c21;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c22); }
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parseatom();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parseatom();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c23(s1, s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseatom() {
- var s0;
-
- var key = peg$currPos * 30 + 7,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$parsewildcard();
- if (s0 === peg$FAILED) {
- s0 = peg$parseidentifier();
- if (s0 === peg$FAILED) {
- s0 = peg$parseattr();
- if (s0 === peg$FAILED) {
- s0 = peg$parsefield();
- if (s0 === peg$FAILED) {
- s0 = peg$parsenegation();
- if (s0 === peg$FAILED) {
- s0 = peg$parsematches();
- if (s0 === peg$FAILED) {
- s0 = peg$parsehas();
- if (s0 === peg$FAILED) {
- s0 = peg$parsefirstChild();
- if (s0 === peg$FAILED) {
- s0 = peg$parselastChild();
- if (s0 === peg$FAILED) {
- s0 = peg$parsenthChild();
- if (s0 === peg$FAILED) {
- s0 = peg$parsenthLastChild();
- if (s0 === peg$FAILED) {
- s0 = peg$parseclass();
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsewildcard() {
- var s0, s1;
-
- var key = peg$currPos * 30 + 8,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 42) {
- s1 = peg$c24;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c25); }
- }
- if (s1 !== peg$FAILED) {
- s1 = peg$c26(s1);
- }
- s0 = s1;
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseidentifier() {
- var s0, s1, s2;
-
- var key = peg$currPos * 30 + 9,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 35) {
- s1 = peg$c27;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c28); }
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parseidentifierName();
- if (s2 !== peg$FAILED) {
- s1 = peg$c29(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseattr() {
- var s0, s1, s2, s3, s4, s5;
-
- var key = peg$currPos * 30 + 10,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 91) {
- s1 = peg$c30;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c31); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseattrValue();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 93) {
- s5 = peg$c32;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c33); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c34(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseattrOps() {
- var s0, s1, s2;
-
- var key = peg$currPos * 30 + 11,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (peg$c35.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c36); }
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 61) {
- s2 = peg$c37;
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c38); }
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c39(s1);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- if (peg$c40.test(input.charAt(peg$currPos))) {
- s0 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s0 = peg$FAILED;
- { peg$fail(peg$c41); }
- }
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseattrEqOps() {
- var s0, s1, s2;
-
- var key = peg$currPos * 30 + 12,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 33) {
- s1 = peg$c21;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c22); }
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 61) {
- s2 = peg$c37;
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c38); }
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c39(s1);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseattrName() {
- var s0, s1, s2;
-
- var key = peg$currPos * 30 + 13,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$parseidentifierName();
- if (s2 === peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 46) {
- s2 = peg$c42;
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c43); }
- }
- }
- if (s2 !== peg$FAILED) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$parseidentifierName();
- if (s2 === peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 46) {
- s2 = peg$c42;
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c43); }
- }
- }
- }
- } else {
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- s1 = peg$c6(s1);
- }
- s0 = s1;
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseattrValue() {
- var s0, s1, s2, s3, s4, s5;
-
- var key = peg$currPos * 30 + 14,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- s1 = peg$parseattrName();
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseattrEqOps();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- s5 = peg$parsetype();
- if (s5 === peg$FAILED) {
- s5 = peg$parseregex();
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c44(s1, s3, s5);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parseattrName();
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseattrOps();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- s5 = peg$parsestring();
- if (s5 === peg$FAILED) {
- s5 = peg$parsenumber();
- if (s5 === peg$FAILED) {
- s5 = peg$parsepath();
- }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c44(s1, s3, s5);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parseattrName();
- if (s1 !== peg$FAILED) {
- s1 = peg$c45(s1);
- }
- s0 = s1;
- }
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsestring() {
- var s0, s1, s2, s3, s4, s5;
-
- var key = peg$currPos * 30 + 15,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 34) {
- s1 = peg$c46;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c47); }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- if (peg$c48.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c49); }
- }
- if (s3 === peg$FAILED) {
- s3 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 92) {
- s4 = peg$c50;
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c51); }
- }
- if (s4 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s5 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c52); }
- }
- if (s5 !== peg$FAILED) {
- s4 = peg$c53(s4, s5);
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- }
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- if (peg$c48.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c49); }
- }
- if (s3 === peg$FAILED) {
- s3 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 92) {
- s4 = peg$c50;
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c51); }
- }
- if (s4 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s5 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c52); }
- }
- if (s5 !== peg$FAILED) {
- s4 = peg$c53(s4, s5);
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- }
- }
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 34) {
- s3 = peg$c46;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c47); }
- }
- if (s3 !== peg$FAILED) {
- s1 = peg$c54(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 39) {
- s1 = peg$c55;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c56); }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- if (peg$c57.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c58); }
- }
- if (s3 === peg$FAILED) {
- s3 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 92) {
- s4 = peg$c50;
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c51); }
- }
- if (s4 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s5 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c52); }
- }
- if (s5 !== peg$FAILED) {
- s4 = peg$c53(s4, s5);
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- }
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- if (peg$c57.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c58); }
- }
- if (s3 === peg$FAILED) {
- s3 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 92) {
- s4 = peg$c50;
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c51); }
- }
- if (s4 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s5 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c52); }
- }
- if (s5 !== peg$FAILED) {
- s4 = peg$c53(s4, s5);
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- }
- }
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 39) {
- s3 = peg$c55;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c56); }
- }
- if (s3 !== peg$FAILED) {
- s1 = peg$c54(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsenumber() {
- var s0, s1, s2, s3;
-
- var key = peg$currPos * 30 + 16,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- s1 = peg$currPos;
- s2 = [];
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c60); }
- }
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c60); }
- }
- }
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 46) {
- s3 = peg$c42;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c43); }
- }
- if (s3 !== peg$FAILED) {
- s2 = [s2, s3];
- s1 = s2;
- } else {
- peg$currPos = s1;
- s1 = peg$FAILED;
- }
- } else {
- peg$currPos = s1;
- s1 = peg$FAILED;
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c60); }
- }
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c60); }
- }
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c61(s1, s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsepath() {
- var s0, s1;
-
- var key = peg$currPos * 30 + 17,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- s1 = peg$parseidentifierName();
- if (s1 !== peg$FAILED) {
- s1 = peg$c62(s1);
- }
- s0 = s1;
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsetype() {
- var s0, s1, s2, s3, s4, s5;
-
- var key = peg$currPos * 30 + 18,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 5) === peg$c63) {
- s1 = peg$c63;
- peg$currPos += 5;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c64); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = [];
- if (peg$c65.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c66); }
- }
- if (s4 !== peg$FAILED) {
- while (s4 !== peg$FAILED) {
- s3.push(s4);
- if (peg$c65.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c66); }
- }
- }
- } else {
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c69(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseflags() {
- var s0, s1;
-
- var key = peg$currPos * 30 + 19,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = [];
- if (peg$c70.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c71); }
- }
- if (s1 !== peg$FAILED) {
- while (s1 !== peg$FAILED) {
- s0.push(s1);
- if (peg$c70.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c71); }
- }
- }
- } else {
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseregex() {
- var s0, s1, s2, s3, s4;
-
- var key = peg$currPos * 30 + 20,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 47) {
- s1 = peg$c72;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c73); }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- if (peg$c74.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c75); }
- }
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- if (peg$c74.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c75); }
- }
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 47) {
- s3 = peg$c72;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- { peg$fail(peg$c73); }
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parseflags();
- if (s4 === peg$FAILED) {
- s4 = null;
- }
- if (s4 !== peg$FAILED) {
- s1 = peg$c76(s2, s4);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsefield() {
- var s0, s1, s2, s3, s4, s5, s6;
-
- var key = peg$currPos * 30 + 21,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 46) {
- s1 = peg$c42;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c43); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parseidentifierName();
- if (s2 !== peg$FAILED) {
- s3 = [];
- s4 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 46) {
- s5 = peg$c42;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c43); }
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parseidentifierName();
- if (s6 !== peg$FAILED) {
- s5 = [s5, s6];
- s4 = s5;
- } else {
- peg$currPos = s4;
- s4 = peg$FAILED;
- }
- } else {
- peg$currPos = s4;
- s4 = peg$FAILED;
- }
- while (s4 !== peg$FAILED) {
- s3.push(s4);
- s4 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 46) {
- s5 = peg$c42;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c43); }
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parseidentifierName();
- if (s6 !== peg$FAILED) {
- s5 = [s5, s6];
- s4 = s5;
- } else {
- peg$currPos = s4;
- s4 = peg$FAILED;
- }
- } else {
- peg$currPos = s4;
- s4 = peg$FAILED;
- }
- }
- if (s3 !== peg$FAILED) {
- s1 = peg$c77(s2, s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsenegation() {
- var s0, s1, s2, s3, s4, s5;
-
- var key = peg$currPos * 30 + 22,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 5) === peg$c78) {
- s1 = peg$c78;
- peg$currPos += 5;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c79); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseselectors();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c80(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsematches() {
- var s0, s1, s2, s3, s4, s5;
-
- var key = peg$currPos * 30 + 23,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 9) === peg$c81) {
- s1 = peg$c81;
- peg$currPos += 9;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c82); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseselectors();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c83(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsehas() {
- var s0, s1, s2, s3, s4, s5;
-
- var key = peg$currPos * 30 + 24,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 5) === peg$c84) {
- s1 = peg$c84;
- peg$currPos += 5;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c85); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseselectors();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c86(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsefirstChild() {
- var s0, s1;
-
- var key = peg$currPos * 30 + 25,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 12) === peg$c87) {
- s1 = peg$c87;
- peg$currPos += 12;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c88); }
- }
- if (s1 !== peg$FAILED) {
- s1 = peg$c89();
- }
- s0 = s1;
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parselastChild() {
- var s0, s1;
-
- var key = peg$currPos * 30 + 26,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 11) === peg$c90) {
- s1 = peg$c90;
- peg$currPos += 11;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c91); }
- }
- if (s1 !== peg$FAILED) {
- s1 = peg$c92();
- }
- s0 = s1;
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsenthChild() {
- var s0, s1, s2, s3, s4, s5;
-
- var key = peg$currPos * 30 + 27,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 11) === peg$c93) {
- s1 = peg$c93;
- peg$currPos += 11;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c94); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = [];
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c60); }
- }
- if (s4 !== peg$FAILED) {
- while (s4 !== peg$FAILED) {
- s3.push(s4);
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c60); }
- }
- }
- } else {
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c95(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parsenthLastChild() {
- var s0, s1, s2, s3, s4, s5;
-
- var key = peg$currPos * 30 + 28,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 16) === peg$c96) {
- s1 = peg$c96;
- peg$currPos += 16;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c97); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = [];
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c60); }
- }
- if (s4 !== peg$FAILED) {
- while (s4 !== peg$FAILED) {
- s3.push(s4);
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- { peg$fail(peg$c60); }
- }
- }
- } else {
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c67;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- { peg$fail(peg$c68); }
- }
- if (s5 !== peg$FAILED) {
- s1 = peg$c98(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
- function peg$parseclass() {
- var s0, s1, s2;
-
- var key = peg$currPos * 30 + 29,
- cached = peg$resultsCache[key];
-
- if (cached) {
- peg$currPos = cached.nextPos;
-
- return cached.result;
- }
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 58) {
- s1 = peg$c99;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- { peg$fail(peg$c100); }
- }
- if (s1 !== peg$FAILED) {
- if (input.substr(peg$currPos, 9).toLowerCase() === peg$c101) {
- s2 = input.substr(peg$currPos, 9);
- peg$currPos += 9;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c102); }
- }
- if (s2 === peg$FAILED) {
- if (input.substr(peg$currPos, 10).toLowerCase() === peg$c103) {
- s2 = input.substr(peg$currPos, 10);
- peg$currPos += 10;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c104); }
- }
- if (s2 === peg$FAILED) {
- if (input.substr(peg$currPos, 11).toLowerCase() === peg$c105) {
- s2 = input.substr(peg$currPos, 11);
- peg$currPos += 11;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c106); }
- }
- if (s2 === peg$FAILED) {
- if (input.substr(peg$currPos, 8).toLowerCase() === peg$c107) {
- s2 = input.substr(peg$currPos, 8);
- peg$currPos += 8;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c108); }
- }
- if (s2 === peg$FAILED) {
- if (input.substr(peg$currPos, 7).toLowerCase() === peg$c109) {
- s2 = input.substr(peg$currPos, 7);
- peg$currPos += 7;
- } else {
- s2 = peg$FAILED;
- { peg$fail(peg$c110); }
- }
- }
- }
- }
- }
- if (s2 !== peg$FAILED) {
- s1 = peg$c111(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
-
- return s0;
- }
-
-
- function nth(n) { return { type: 'nth-child', index: { type: 'literal', value: n } }; }
- function nthLast(n) { return { type: 'nth-last-child', index: { type: 'literal', value: n } }; }
- function strUnescape(s) {
- return s.replace(/\\(.)/g, function(match, ch) {
- switch(ch) {
- case 'b': return '\b';
- case 'f': return '\f';
- case 'n': return '\n';
- case 'r': return '\r';
- case 't': return '\t';
- case 'v': return '\v';
- default: return ch;
- }
- });
- }
-
-
- peg$result = peg$startRuleFunction();
-
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
- return peg$result;
- } else {
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
- peg$fail(peg$endExpectation());
- }
-
- throw peg$buildStructuredError(
- peg$maxFailExpected,
- peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
- peg$maxFailPos < input.length
- ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
- : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
- );
- }
- }
-
- return {
- SyntaxError: peg$SyntaxError,
- parse: peg$parse
- };
- });
- });
-
- /* vim: set sw=4 sts=4 : */
-
- /**
- * @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side
- */
-
- const LEFT_SIDE = 'LEFT_SIDE';
- const RIGHT_SIDE = 'RIGHT_SIDE';
-
- /**
- * @external AST
- * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html
- */
-
- /**
- * One of the rules of `grammar.pegjs`
- * @typedef {PlainObject} SelectorAST
- * @see grammar.pegjs
- */
-
- /**
- * The `sequence` production of `grammar.pegjs`
- * @typedef {PlainObject} SelectorSequenceAST
- */
-
- /**
- * Get the value of a property which may be multiple levels down
- * in the object.
- * @param {?PlainObject} obj
- * @param {string} key
- * @returns {undefined|boolean|string|number|external:AST}
- */
- function getPath(obj, key) {
- const keys = key.split('.');
- for (let i = 0; i < keys.length; i++) {
- if (obj == null) { return obj; }
- obj = obj[keys[i]];
- }
- return obj;
- }
-
- /**
- * Determine whether `node` can be reached by following `path`,
- * starting at `ancestor`.
- * @param {?external:AST} node
- * @param {?external:AST} ancestor
- * @param {string[]} path
- * @returns {boolean}
- */
- function inPath(node, ancestor, path) {
- if (path.length === 0) { return node === ancestor; }
- if (ancestor == null) { return false; }
- const field = ancestor[path[0]];
- const remainingPath = path.slice(1);
- if (Array.isArray(field)) {
- for (let i = 0, l = field.length; i < l; ++i) {
- if (inPath(node, field[i], remainingPath)) { return true; }
- }
- return false;
- } else {
- return inPath(node, field, remainingPath);
- }
- }
-
- /**
- * Given a `node` and its ancestors, determine if `node` is matched
- * by `selector`.
- * @param {?external:AST} node
- * @param {?SelectorAST} selector
- * @param {external:AST[]} [ancestry=[]]
- * @throws {Error} Unknowns (operator, class name, selector type, or
- * selector value type)
- * @returns {boolean}
- */
- function matches(node, selector, ancestry) {
- if (!selector) { return true; }
- if (!node) { return false; }
- if (!ancestry) { ancestry = []; }
-
- switch(selector.type) {
- case 'wildcard':
- return true;
-
- case 'identifier':
- return selector.value.toLowerCase() === node.type.toLowerCase();
-
- case 'field': {
- const path = selector.name.split('.');
- const ancestor = ancestry[path.length - 1];
- return inPath(node, ancestor, path);
-
- }
- case 'matches':
- for (let i = 0, l = selector.selectors.length; i < l; ++i) {
- if (matches(node, selector.selectors[i], ancestry)) { return true; }
- }
- return false;
-
- case 'compound':
- for (let i = 0, l = selector.selectors.length; i < l; ++i) {
- if (!matches(node, selector.selectors[i], ancestry)) { return false; }
- }
- return true;
-
- case 'not':
- for (let i = 0, l = selector.selectors.length; i < l; ++i) {
- if (matches(node, selector.selectors[i], ancestry)) { return false; }
- }
- return true;
-
- case 'has': {
- const collector = [];
- for (let i = 0, l = selector.selectors.length; i < l; ++i) {
- const a = [];
- estraverse.traverse(node, {
- enter (node, parent) {
- if (parent != null) { a.unshift(parent); }
- if (matches(node, selector.selectors[i], a)) {
- collector.push(node);
- }
- },
- leave () { a.shift(); },
- fallback: 'iteration'
- });
- }
- return collector.length !== 0;
-
- }
- case 'child':
- if (matches(node, selector.right, ancestry)) {
- return matches(ancestry[0], selector.left, ancestry.slice(1));
- }
- return false;
-
- case 'descendant':
- if (matches(node, selector.right, ancestry)) {
- for (let i = 0, l = ancestry.length; i < l; ++i) {
- if (matches(ancestry[i], selector.left, ancestry.slice(i + 1))) {
- return true;
- }
- }
- }
- return false;
-
- case 'attribute': {
- const p = getPath(node, selector.name);
- switch (selector.operator) {
- case void 0:
- return p != null;
- case '=':
- switch (selector.value.type) {
- case 'regexp': return typeof p === 'string' && selector.value.value.test(p);
- case 'literal': return `${selector.value.value}` === `${p}`;
- case 'type': return selector.value.value === typeof p;
- }
- throw new Error(`Unknown selector value type: ${selector.value.type}`);
- case '!=':
- switch (selector.value.type) {
- case 'regexp': return !selector.value.value.test(p);
- case 'literal': return `${selector.value.value}` !== `${p}`;
- case 'type': return selector.value.value !== typeof p;
- }
- throw new Error(`Unknown selector value type: ${selector.value.type}`);
- case '<=': return p <= selector.value.value;
- case '<': return p < selector.value.value;
- case '>': return p > selector.value.value;
- case '>=': return p >= selector.value.value;
- }
- throw new Error(`Unknown operator: ${selector.operator}`);
- }
- case 'sibling':
- return matches(node, selector.right, ancestry) &&
- sibling(node, selector.left, ancestry, LEFT_SIDE) ||
- selector.left.subject &&
- matches(node, selector.left, ancestry) &&
- sibling(node, selector.right, ancestry, RIGHT_SIDE);
- case 'adjacent':
- return matches(node, selector.right, ancestry) &&
- adjacent(node, selector.left, ancestry, LEFT_SIDE) ||
- selector.right.subject &&
- matches(node, selector.left, ancestry) &&
- adjacent(node, selector.right, ancestry, RIGHT_SIDE);
-
- case 'nth-child':
- return matches(node, selector.right, ancestry) &&
- nthChild(node, ancestry, function () {
- return selector.index.value - 1;
- });
-
- case 'nth-last-child':
- return matches(node, selector.right, ancestry) &&
- nthChild(node, ancestry, function (length) {
- return length - selector.index.value;
- });
-
- case 'class':
- switch(selector.name.toLowerCase()){
- case 'statement':
- if(node.type.slice(-9) === 'Statement') return true;
- // fallthrough: interface Declaration <: Statement { }
- case 'declaration':
- return node.type.slice(-11) === 'Declaration';
- case 'pattern':
- if(node.type.slice(-7) === 'Pattern') return true;
- // fallthrough: interface Expression <: Node, Pattern { }
- case 'expression':
- return node.type.slice(-10) === 'Expression' ||
- node.type.slice(-7) === 'Literal' ||
- (
- node.type === 'Identifier' &&
- (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty')
- ) ||
- node.type === 'MetaProperty';
- case 'function':
- return node.type === 'FunctionDeclaration' ||
- node.type === 'FunctionExpression' ||
- node.type === 'ArrowFunctionExpression';
- }
- throw new Error(`Unknown class name: ${selector.name}`);
- }
-
- throw new Error(`Unknown selector type: ${selector.type}`);
- }
-
- /**
- * Determines if the given node has a sibling that matches the
- * given selector.
- * @param {external:AST} node
- * @param {SelectorSequenceAST} selector
- * @param {external:AST[]} ancestry
- * @param {Side} side
- * @returns {boolean}
- */
- function sibling(node, selector, ancestry, side) {
- const [parent] = ancestry;
- if (!parent) { return false; }
- const keys = estraverse.VisitorKeys[parent.type];
- for (let i = 0, l = keys.length; i < l; ++i) {
- const listProp = parent[keys[i]];
- if (Array.isArray(listProp)) {
- const startIndex = listProp.indexOf(node);
- if (startIndex < 0) { continue; }
- let lowerBound, upperBound;
- if (side === LEFT_SIDE) {
- lowerBound = 0;
- upperBound = startIndex;
- } else {
- lowerBound = startIndex + 1;
- upperBound = listProp.length;
- }
- for (let k = lowerBound; k < upperBound; ++k) {
- if (matches(listProp[k], selector, ancestry)) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Determines if the given node has an adjacent sibling that matches
- * the given selector.
- * @param {external:AST} node
- * @param {SelectorSequenceAST} selector
- * @param {external:AST[]} ancestry
- * @param {Side} side
- * @returns {boolean}
- */
- function adjacent(node, selector, ancestry, side) {
- const [parent] = ancestry;
- if (!parent) { return false; }
- const keys = estraverse.VisitorKeys[parent.type];
- for (let i = 0, l = keys.length; i < l; ++i) {
- const listProp = parent[keys[i]];
- if (Array.isArray(listProp)) {
- const idx = listProp.indexOf(node);
- if (idx < 0) { continue; }
- if (side === LEFT_SIDE && idx > 0 && matches(listProp[idx - 1], selector, ancestry)) {
- return true;
- }
- if (side === RIGHT_SIDE && idx < listProp.length - 1 && matches(listProp[idx + 1], selector, ancestry)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * @callback IndexFunction
- * @param {Integer} len Containing list's length
- * @returns {Integer}
- */
-
- /**
- * Determines if the given node is the nth child, determined by
- * `idxFn`, which is given the containing list's length.
- * @param {external:AST} node
- * @param {external:AST[]} ancestry
- * @param {IndexFunction} idxFn
- * @returns {boolean}
- */
- function nthChild(node, ancestry, idxFn) {
- const [parent] = ancestry;
- if (!parent) { return false; }
- const keys = estraverse.VisitorKeys[parent.type];
- for (let i = 0, l = keys.length; i < l; ++i) {
- const listProp = parent[keys[i]];
- if (Array.isArray(listProp)) {
- const idx = listProp.indexOf(node);
- if (idx >= 0 && idx === idxFn(listProp.length)) { return true; }
- }
- }
- return false;
- }
-
- /**
- * For each selector node marked as a subject, find the portion of the
- * selector that the subject must match.
- * @param {SelectorAST} selector
- * @param {SelectorAST} [ancestor] Defaults to `selector`
- * @returns {SelectorAST[]}
- */
- function subjects(selector, ancestor) {
- if (selector == null || typeof selector != 'object') { return []; }
- if (ancestor == null) { ancestor = selector; }
- const results = selector.subject ? [ancestor] : [];
- for (const [p, sel] of Object.entries(selector)) {
- results.push(...subjects(sel, p === 'left' ? sel : ancestor));
- }
- return results;
- }
-
- /**
- * From a JS AST and a selector AST, collect all JS AST nodes that
- * match the selector.
- * @param {external:AST} ast
- * @param {?SelectorAST} selector
- * @returns {external:AST[]}
- */
- function match(ast, selector) {
- const ancestry = [], results = [];
- if (!selector) { return results; }
- const altSubjects = subjects(selector);
- estraverse.traverse(ast, {
- enter (node, parent) {
- if (parent != null) { ancestry.unshift(parent); }
- if (matches(node, selector, ancestry)) {
- if (altSubjects.length) {
- for (let i = 0, l = altSubjects.length; i < l; ++i) {
- if (matches(node, altSubjects[i], ancestry)) { results.push(node); }
- for (let k = 0, m = ancestry.length; k < m; ++k) {
- if (matches(ancestry[k], altSubjects[i], ancestry.slice(k + 1))) {
- results.push(ancestry[k]);
- }
- }
- }
- } else {
- results.push(node);
- }
- }
- },
- leave () { ancestry.shift(); },
- fallback: 'iteration'
- });
- return results;
- }
-
- /**
- * Parse a selector string and return its AST.
- * @param {string} selector
- * @returns {SelectorAST}
- */
- function parse(selector) {
- return parser.parse(selector);
- }
-
- /**
- * Query the code AST using the selector string.
- * @param {external:AST} ast
- * @param {string} selector
- * @returns {external:AST[]}
- */
- function query(ast, selector) {
- return match(ast, parse(selector));
- }
-
- query.parse = parse;
- query.match = match;
- query.matches = matches;
- query.query = query;
-
- return query;
+ function _typeof(obj) {
+ "@babel/helpers - typeof";
+
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function (obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function (obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+ }
+
+ function _slicedToArray(arr, i) {
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
+ }
+
+ function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+ }
+
+ function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+ }
+
+ function _arrayWithHoles(arr) {
+ if (Array.isArray(arr)) return arr;
+ }
+
+ function _iterableToArray(iter) {
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
+ }
+
+ function _iterableToArrayLimit(arr, i) {
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
+ var _arr = [];
+ var _n = true;
+ var _d = false;
+ var _e = undefined;
+
+ try {
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
+ _arr.push(_s.value);
+
+ if (i && _arr.length === i) break;
+ }
+ } catch (err) {
+ _d = true;
+ _e = err;
+ } finally {
+ try {
+ if (!_n && _i["return"] != null) _i["return"]();
+ } finally {
+ if (_d) throw _e;
+ }
+ }
+
+ return _arr;
+ }
+
+ function _unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(n);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+ }
+
+ function _arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+
+ return arr2;
+ }
+
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+
+ function _nonIterableRest() {
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
+
+ function createCommonjsModule(fn, module) {
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
+ }
+
+ var estraverse = createCommonjsModule(function (module, exports) {
+ /*
+ Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
+ Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ /*jslint vars:false, bitwise:true*/
+
+ /*jshint indent:4*/
+
+ /*global exports:true*/
+ (function clone(exports) {
+
+ var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE;
+
+ function deepCopy(obj) {
+ var ret = {},
+ key,
+ val;
+
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ val = obj[key];
+
+ if (typeof val === 'object' && val !== null) {
+ ret[key] = deepCopy(val);
+ } else {
+ ret[key] = val;
+ }
+ }
+ }
+
+ return ret;
+ } // based on LLVM libc++ upper_bound / lower_bound
+ // MIT License
+
+
+ function upperBound(array, func) {
+ var diff, len, i, current;
+ len = array.length;
+ i = 0;
+
+ while (len) {
+ diff = len >>> 1;
+ current = i + diff;
+
+ if (func(array[current])) {
+ len = diff;
+ } else {
+ i = current + 1;
+ len -= diff + 1;
+ }
+ }
+
+ return i;
+ }
+
+ Syntax = {
+ AssignmentExpression: 'AssignmentExpression',
+ AssignmentPattern: 'AssignmentPattern',
+ ArrayExpression: 'ArrayExpression',
+ ArrayPattern: 'ArrayPattern',
+ ArrowFunctionExpression: 'ArrowFunctionExpression',
+ AwaitExpression: 'AwaitExpression',
+ // CAUTION: It's deferred to ES7.
+ BlockStatement: 'BlockStatement',
+ BinaryExpression: 'BinaryExpression',
+ BreakStatement: 'BreakStatement',
+ CallExpression: 'CallExpression',
+ CatchClause: 'CatchClause',
+ ClassBody: 'ClassBody',
+ ClassDeclaration: 'ClassDeclaration',
+ ClassExpression: 'ClassExpression',
+ ComprehensionBlock: 'ComprehensionBlock',
+ // CAUTION: It's deferred to ES7.
+ ComprehensionExpression: 'ComprehensionExpression',
+ // CAUTION: It's deferred to ES7.
+ ConditionalExpression: 'ConditionalExpression',
+ ContinueStatement: 'ContinueStatement',
+ DebuggerStatement: 'DebuggerStatement',
+ DirectiveStatement: 'DirectiveStatement',
+ DoWhileStatement: 'DoWhileStatement',
+ EmptyStatement: 'EmptyStatement',
+ ExportAllDeclaration: 'ExportAllDeclaration',
+ ExportDefaultDeclaration: 'ExportDefaultDeclaration',
+ ExportNamedDeclaration: 'ExportNamedDeclaration',
+ ExportSpecifier: 'ExportSpecifier',
+ ExpressionStatement: 'ExpressionStatement',
+ ForStatement: 'ForStatement',
+ ForInStatement: 'ForInStatement',
+ ForOfStatement: 'ForOfStatement',
+ FunctionDeclaration: 'FunctionDeclaration',
+ FunctionExpression: 'FunctionExpression',
+ GeneratorExpression: 'GeneratorExpression',
+ // CAUTION: It's deferred to ES7.
+ Identifier: 'Identifier',
+ IfStatement: 'IfStatement',
+ ImportExpression: 'ImportExpression',
+ ImportDeclaration: 'ImportDeclaration',
+ ImportDefaultSpecifier: 'ImportDefaultSpecifier',
+ ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
+ ImportSpecifier: 'ImportSpecifier',
+ Literal: 'Literal',
+ LabeledStatement: 'LabeledStatement',
+ LogicalExpression: 'LogicalExpression',
+ MemberExpression: 'MemberExpression',
+ MetaProperty: 'MetaProperty',
+ MethodDefinition: 'MethodDefinition',
+ ModuleSpecifier: 'ModuleSpecifier',
+ NewExpression: 'NewExpression',
+ ObjectExpression: 'ObjectExpression',
+ ObjectPattern: 'ObjectPattern',
+ Program: 'Program',
+ Property: 'Property',
+ RestElement: 'RestElement',
+ ReturnStatement: 'ReturnStatement',
+ SequenceExpression: 'SequenceExpression',
+ SpreadElement: 'SpreadElement',
+ Super: 'Super',
+ SwitchStatement: 'SwitchStatement',
+ SwitchCase: 'SwitchCase',
+ TaggedTemplateExpression: 'TaggedTemplateExpression',
+ TemplateElement: 'TemplateElement',
+ TemplateLiteral: 'TemplateLiteral',
+ ThisExpression: 'ThisExpression',
+ ThrowStatement: 'ThrowStatement',
+ TryStatement: 'TryStatement',
+ UnaryExpression: 'UnaryExpression',
+ UpdateExpression: 'UpdateExpression',
+ VariableDeclaration: 'VariableDeclaration',
+ VariableDeclarator: 'VariableDeclarator',
+ WhileStatement: 'WhileStatement',
+ WithStatement: 'WithStatement',
+ YieldExpression: 'YieldExpression'
+ };
+ VisitorKeys = {
+ AssignmentExpression: ['left', 'right'],
+ AssignmentPattern: ['left', 'right'],
+ ArrayExpression: ['elements'],
+ ArrayPattern: ['elements'],
+ ArrowFunctionExpression: ['params', 'body'],
+ AwaitExpression: ['argument'],
+ // CAUTION: It's deferred to ES7.
+ BlockStatement: ['body'],
+ BinaryExpression: ['left', 'right'],
+ BreakStatement: ['label'],
+ CallExpression: ['callee', 'arguments'],
+ CatchClause: ['param', 'body'],
+ ClassBody: ['body'],
+ ClassDeclaration: ['id', 'superClass', 'body'],
+ ClassExpression: ['id', 'superClass', 'body'],
+ ComprehensionBlock: ['left', 'right'],
+ // CAUTION: It's deferred to ES7.
+ ComprehensionExpression: ['blocks', 'filter', 'body'],
+ // CAUTION: It's deferred to ES7.
+ ConditionalExpression: ['test', 'consequent', 'alternate'],
+ ContinueStatement: ['label'],
+ DebuggerStatement: [],
+ DirectiveStatement: [],
+ DoWhileStatement: ['body', 'test'],
+ EmptyStatement: [],
+ ExportAllDeclaration: ['source'],
+ ExportDefaultDeclaration: ['declaration'],
+ ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
+ ExportSpecifier: ['exported', 'local'],
+ ExpressionStatement: ['expression'],
+ ForStatement: ['init', 'test', 'update', 'body'],
+ ForInStatement: ['left', 'right', 'body'],
+ ForOfStatement: ['left', 'right', 'body'],
+ FunctionDeclaration: ['id', 'params', 'body'],
+ FunctionExpression: ['id', 'params', 'body'],
+ GeneratorExpression: ['blocks', 'filter', 'body'],
+ // CAUTION: It's deferred to ES7.
+ Identifier: [],
+ IfStatement: ['test', 'consequent', 'alternate'],
+ ImportExpression: ['source'],
+ ImportDeclaration: ['specifiers', 'source'],
+ ImportDefaultSpecifier: ['local'],
+ ImportNamespaceSpecifier: ['local'],
+ ImportSpecifier: ['imported', 'local'],
+ Literal: [],
+ LabeledStatement: ['label', 'body'],
+ LogicalExpression: ['left', 'right'],
+ MemberExpression: ['object', 'property'],
+ MetaProperty: ['meta', 'property'],
+ MethodDefinition: ['key', 'value'],
+ ModuleSpecifier: [],
+ NewExpression: ['callee', 'arguments'],
+ ObjectExpression: ['properties'],
+ ObjectPattern: ['properties'],
+ Program: ['body'],
+ Property: ['key', 'value'],
+ RestElement: ['argument'],
+ ReturnStatement: ['argument'],
+ SequenceExpression: ['expressions'],
+ SpreadElement: ['argument'],
+ Super: [],
+ SwitchStatement: ['discriminant', 'cases'],
+ SwitchCase: ['test', 'consequent'],
+ TaggedTemplateExpression: ['tag', 'quasi'],
+ TemplateElement: [],
+ TemplateLiteral: ['quasis', 'expressions'],
+ ThisExpression: [],
+ ThrowStatement: ['argument'],
+ TryStatement: ['block', 'handler', 'finalizer'],
+ UnaryExpression: ['argument'],
+ UpdateExpression: ['argument'],
+ VariableDeclaration: ['declarations'],
+ VariableDeclarator: ['id', 'init'],
+ WhileStatement: ['test', 'body'],
+ WithStatement: ['object', 'body'],
+ YieldExpression: ['argument']
+ }; // unique id
+
+ BREAK = {};
+ SKIP = {};
+ REMOVE = {};
+ VisitorOption = {
+ Break: BREAK,
+ Skip: SKIP,
+ Remove: REMOVE
+ };
+
+ function Reference(parent, key) {
+ this.parent = parent;
+ this.key = key;
+ }
+
+ Reference.prototype.replace = function replace(node) {
+ this.parent[this.key] = node;
+ };
+
+ Reference.prototype.remove = function remove() {
+ if (Array.isArray(this.parent)) {
+ this.parent.splice(this.key, 1);
+ return true;
+ } else {
+ this.replace(null);
+ return false;
+ }
+ };
+
+ function Element(node, path, wrap, ref) {
+ this.node = node;
+ this.path = path;
+ this.wrap = wrap;
+ this.ref = ref;
+ }
+
+ function Controller() {} // API:
+ // return property path array from root to current node
+
+
+ Controller.prototype.path = function path() {
+ var i, iz, j, jz, result, element;
+
+ function addToPath(result, path) {
+ if (Array.isArray(path)) {
+ for (j = 0, jz = path.length; j < jz; ++j) {
+ result.push(path[j]);
+ }
+ } else {
+ result.push(path);
+ }
+ } // root node
+
+
+ if (!this.__current.path) {
+ return null;
+ } // first node is sentinel, second node is root element
+
+
+ result = [];
+
+ for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
+ element = this.__leavelist[i];
+ addToPath(result, element.path);
+ }
+
+ addToPath(result, this.__current.path);
+ return result;
+ }; // API:
+ // return type of current node
+
+
+ Controller.prototype.type = function () {
+ var node = this.current();
+ return node.type || this.__current.wrap;
+ }; // API:
+ // return array of parent elements
+
+
+ Controller.prototype.parents = function parents() {
+ var i, iz, result; // first node is sentinel
+
+ result = [];
+
+ for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
+ result.push(this.__leavelist[i].node);
+ }
+
+ return result;
+ }; // API:
+ // return current node
+
+
+ Controller.prototype.current = function current() {
+ return this.__current.node;
+ };
+
+ Controller.prototype.__execute = function __execute(callback, element) {
+ var previous, result;
+ result = undefined;
+ previous = this.__current;
+ this.__current = element;
+ this.__state = null;
+
+ if (callback) {
+ result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
+ }
+
+ this.__current = previous;
+ return result;
+ }; // API:
+ // notify control skip / break
+
+
+ Controller.prototype.notify = function notify(flag) {
+ this.__state = flag;
+ }; // API:
+ // skip child nodes of current node
+
+
+ Controller.prototype.skip = function () {
+ this.notify(SKIP);
+ }; // API:
+ // break traversals
+
+
+ Controller.prototype['break'] = function () {
+ this.notify(BREAK);
+ }; // API:
+ // remove node
+
+
+ Controller.prototype.remove = function () {
+ this.notify(REMOVE);
+ };
+
+ Controller.prototype.__initialize = function (root, visitor) {
+ this.visitor = visitor;
+ this.root = root;
+ this.__worklist = [];
+ this.__leavelist = [];
+ this.__current = null;
+ this.__state = null;
+ this.__fallback = null;
+
+ if (visitor.fallback === 'iteration') {
+ this.__fallback = Object.keys;
+ } else if (typeof visitor.fallback === 'function') {
+ this.__fallback = visitor.fallback;
+ }
+
+ this.__keys = VisitorKeys;
+
+ if (visitor.keys) {
+ this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
+ }
+ };
+
+ function isNode(node) {
+ if (node == null) {
+ return false;
+ }
+
+ return typeof node === 'object' && typeof node.type === 'string';
+ }
+
+ function isProperty(nodeType, key) {
+ return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
+ }
+
+ function candidateExistsInLeaveList(leavelist, candidate) {
+ for (var i = leavelist.length - 1; i >= 0; --i) {
+ if (leavelist[i].node === candidate) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ Controller.prototype.traverse = function traverse(root, visitor) {
+ var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel;
+
+ this.__initialize(root, visitor);
+
+ sentinel = {}; // reference
+
+ worklist = this.__worklist;
+ leavelist = this.__leavelist; // initialize
+
+ worklist.push(new Element(root, null, null, null));
+ leavelist.push(new Element(null, null, null, null));
+
+ while (worklist.length) {
+ element = worklist.pop();
+
+ if (element === sentinel) {
+ element = leavelist.pop();
+ ret = this.__execute(visitor.leave, element);
+
+ if (this.__state === BREAK || ret === BREAK) {
+ return;
+ }
+
+ continue;
+ }
+
+ if (element.node) {
+ ret = this.__execute(visitor.enter, element);
+
+ if (this.__state === BREAK || ret === BREAK) {
+ return;
+ }
+
+ worklist.push(sentinel);
+ leavelist.push(element);
+
+ if (this.__state === SKIP || ret === SKIP) {
+ continue;
+ }
+
+ node = element.node;
+ nodeType = node.type || element.wrap;
+ candidates = this.__keys[nodeType];
+
+ if (!candidates) {
+ if (this.__fallback) {
+ candidates = this.__fallback(node);
+ } else {
+ throw new Error('Unknown node type ' + nodeType + '.');
+ }
+ }
+
+ current = candidates.length;
+
+ while ((current -= 1) >= 0) {
+ key = candidates[current];
+ candidate = node[key];
+
+ if (!candidate) {
+ continue;
+ }
+
+ if (Array.isArray(candidate)) {
+ current2 = candidate.length;
+
+ while ((current2 -= 1) >= 0) {
+ if (!candidate[current2]) {
+ continue;
+ }
+
+ if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
+ continue;
+ }
+
+ if (isProperty(nodeType, candidates[current])) {
+ element = new Element(candidate[current2], [key, current2], 'Property', null);
+ } else if (isNode(candidate[current2])) {
+ element = new Element(candidate[current2], [key, current2], null, null);
+ } else {
+ continue;
+ }
+
+ worklist.push(element);
+ }
+ } else if (isNode(candidate)) {
+ if (candidateExistsInLeaveList(leavelist, candidate)) {
+ continue;
+ }
+
+ worklist.push(new Element(candidate, key, null, null));
+ }
+ }
+ }
+ }
+ };
+
+ Controller.prototype.replace = function replace(root, visitor) {
+ var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key;
+
+ function removeElem(element) {
+ var i, key, nextElem, parent;
+
+ if (element.ref.remove()) {
+ // When the reference is an element of an array.
+ key = element.ref.key;
+ parent = element.ref.parent; // If removed from array, then decrease following items' keys.
+
+ i = worklist.length;
+
+ while (i--) {
+ nextElem = worklist[i];
+
+ if (nextElem.ref && nextElem.ref.parent === parent) {
+ if (nextElem.ref.key < key) {
+ break;
+ }
+
+ --nextElem.ref.key;
+ }
+ }
+ }
+ }
+
+ this.__initialize(root, visitor);
+
+ sentinel = {}; // reference
+
+ worklist = this.__worklist;
+ leavelist = this.__leavelist; // initialize
+
+ outer = {
+ root: root
+ };
+ element = new Element(root, null, null, new Reference(outer, 'root'));
+ worklist.push(element);
+ leavelist.push(element);
+
+ while (worklist.length) {
+ element = worklist.pop();
+
+ if (element === sentinel) {
+ element = leavelist.pop();
+ target = this.__execute(visitor.leave, element); // node may be replaced with null,
+ // so distinguish between undefined and null in this place
+
+ if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
+ // replace
+ element.ref.replace(target);
+ }
+
+ if (this.__state === REMOVE || target === REMOVE) {
+ removeElem(element);
+ }
+
+ if (this.__state === BREAK || target === BREAK) {
+ return outer.root;
+ }
+
+ continue;
+ }
+
+ target = this.__execute(visitor.enter, element); // node may be replaced with null,
+ // so distinguish between undefined and null in this place
+
+ if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
+ // replace
+ element.ref.replace(target);
+ element.node = target;
+ }
+
+ if (this.__state === REMOVE || target === REMOVE) {
+ removeElem(element);
+ element.node = null;
+ }
+
+ if (this.__state === BREAK || target === BREAK) {
+ return outer.root;
+ } // node may be null
+
+
+ node = element.node;
+
+ if (!node) {
+ continue;
+ }
+
+ worklist.push(sentinel);
+ leavelist.push(element);
+
+ if (this.__state === SKIP || target === SKIP) {
+ continue;
+ }
+
+ nodeType = node.type || element.wrap;
+ candidates = this.__keys[nodeType];
+
+ if (!candidates) {
+ if (this.__fallback) {
+ candidates = this.__fallback(node);
+ } else {
+ throw new Error('Unknown node type ' + nodeType + '.');
+ }
+ }
+
+ current = candidates.length;
+
+ while ((current -= 1) >= 0) {
+ key = candidates[current];
+ candidate = node[key];
+
+ if (!candidate) {
+ continue;
+ }
+
+ if (Array.isArray(candidate)) {
+ current2 = candidate.length;
+
+ while ((current2 -= 1) >= 0) {
+ if (!candidate[current2]) {
+ continue;
+ }
+
+ if (isProperty(nodeType, candidates[current])) {
+ element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
+ } else if (isNode(candidate[current2])) {
+ element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
+ } else {
+ continue;
+ }
+
+ worklist.push(element);
+ }
+ } else if (isNode(candidate)) {
+ worklist.push(new Element(candidate, key, null, new Reference(node, key)));
+ }
+ }
+ }
+
+ return outer.root;
+ };
+
+ function traverse(root, visitor) {
+ var controller = new Controller();
+ return controller.traverse(root, visitor);
+ }
+
+ function replace(root, visitor) {
+ var controller = new Controller();
+ return controller.replace(root, visitor);
+ }
+
+ function extendCommentRange(comment, tokens) {
+ var target;
+ target = upperBound(tokens, function search(token) {
+ return token.range[0] > comment.range[0];
+ });
+ comment.extendedRange = [comment.range[0], comment.range[1]];
+
+ if (target !== tokens.length) {
+ comment.extendedRange[1] = tokens[target].range[0];
+ }
+
+ target -= 1;
+
+ if (target >= 0) {
+ comment.extendedRange[0] = tokens[target].range[1];
+ }
+
+ return comment;
+ }
+
+ function attachComments(tree, providedComments, tokens) {
+ // At first, we should calculate extended comment ranges.
+ var comments = [],
+ comment,
+ len,
+ i,
+ cursor;
+
+ if (!tree.range) {
+ throw new Error('attachComments needs range information');
+ } // tokens array is empty, we attach comments to tree as 'leadingComments'
+
+
+ if (!tokens.length) {
+ if (providedComments.length) {
+ for (i = 0, len = providedComments.length; i < len; i += 1) {
+ comment = deepCopy(providedComments[i]);
+ comment.extendedRange = [0, tree.range[0]];
+ comments.push(comment);
+ }
+
+ tree.leadingComments = comments;
+ }
+
+ return tree;
+ }
+
+ for (i = 0, len = providedComments.length; i < len; i += 1) {
+ comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
+ } // This is based on John Freeman's implementation.
+
+
+ cursor = 0;
+ traverse(tree, {
+ enter: function (node) {
+ var comment;
+
+ while (cursor < comments.length) {
+ comment = comments[cursor];
+
+ if (comment.extendedRange[1] > node.range[0]) {
+ break;
+ }
+
+ if (comment.extendedRange[1] === node.range[0]) {
+ if (!node.leadingComments) {
+ node.leadingComments = [];
+ }
+
+ node.leadingComments.push(comment);
+ comments.splice(cursor, 1);
+ } else {
+ cursor += 1;
+ }
+ } // already out of owned node
+
+
+ if (cursor === comments.length) {
+ return VisitorOption.Break;
+ }
+
+ if (comments[cursor].extendedRange[0] > node.range[1]) {
+ return VisitorOption.Skip;
+ }
+ }
+ });
+ cursor = 0;
+ traverse(tree, {
+ leave: function (node) {
+ var comment;
+
+ while (cursor < comments.length) {
+ comment = comments[cursor];
+
+ if (node.range[1] < comment.extendedRange[0]) {
+ break;
+ }
+
+ if (node.range[1] === comment.extendedRange[0]) {
+ if (!node.trailingComments) {
+ node.trailingComments = [];
+ }
+
+ node.trailingComments.push(comment);
+ comments.splice(cursor, 1);
+ } else {
+ cursor += 1;
+ }
+ } // already out of owned node
+
+
+ if (cursor === comments.length) {
+ return VisitorOption.Break;
+ }
+
+ if (comments[cursor].extendedRange[0] > node.range[1]) {
+ return VisitorOption.Skip;
+ }
+ }
+ });
+ return tree;
+ }
+
+ exports.Syntax = Syntax;
+ exports.traverse = traverse;
+ exports.replace = replace;
+ exports.attachComments = attachComments;
+ exports.VisitorKeys = VisitorKeys;
+ exports.VisitorOption = VisitorOption;
+ exports.Controller = Controller;
+
+ exports.cloneEnvironment = function () {
+ return clone({});
+ };
+
+ return exports;
+ })(exports);
+ /* vim: set sw=4 ts=4 et tw=80 : */
+
+ });
+
+ var parser = createCommonjsModule(function (module) {
+ /*
+ * Generated by PEG.js 0.10.0.
+ *
+ * http://pegjs.org/
+ */
+ (function (root, factory) {
+ if ( module.exports) {
+ module.exports = factory();
+ }
+ })(commonjsGlobal, function () {
+
+ function peg$subclass(child, parent) {
+ function ctor() {
+ this.constructor = child;
+ }
+
+ ctor.prototype = parent.prototype;
+ child.prototype = new ctor();
+ }
+
+ function peg$SyntaxError(message, expected, found, location) {
+ this.message = message;
+ this.expected = expected;
+ this.found = found;
+ this.location = location;
+ this.name = "SyntaxError";
+
+ if (typeof Error.captureStackTrace === "function") {
+ Error.captureStackTrace(this, peg$SyntaxError);
+ }
+ }
+
+ peg$subclass(peg$SyntaxError, Error);
+
+ peg$SyntaxError.buildMessage = function (expected, found) {
+ var DESCRIBE_EXPECTATION_FNS = {
+ literal: function literal(expectation) {
+ return "\"" + literalEscape(expectation.text) + "\"";
+ },
+ "class": function _class(expectation) {
+ var escapedParts = "",
+ i;
+
+ for (i = 0; i < expectation.parts.length; i++) {
+ escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]);
+ }
+
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
+ },
+ any: function any(expectation) {
+ return "any character";
+ },
+ end: function end(expectation) {
+ return "end of input";
+ },
+ other: function other(expectation) {
+ return expectation.description;
+ }
+ };
+
+ function hex(ch) {
+ return ch.charCodeAt(0).toString(16).toUpperCase();
+ }
+
+ function literalEscape(s) {
+ return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
+ return '\\x0' + hex(ch);
+ }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
+ return '\\x' + hex(ch);
+ });
+ }
+
+ function classEscape(s) {
+ return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
+ return '\\x0' + hex(ch);
+ }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
+ return '\\x' + hex(ch);
+ });
+ }
+
+ function describeExpectation(expectation) {
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
+ }
+
+ function describeExpected(expected) {
+ var descriptions = new Array(expected.length),
+ i,
+ j;
+
+ for (i = 0; i < expected.length; i++) {
+ descriptions[i] = describeExpectation(expected[i]);
+ }
+
+ descriptions.sort();
+
+ if (descriptions.length > 0) {
+ for (i = 1, j = 1; i < descriptions.length; i++) {
+ if (descriptions[i - 1] !== descriptions[i]) {
+ descriptions[j] = descriptions[i];
+ j++;
+ }
+ }
+
+ descriptions.length = j;
+ }
+
+ switch (descriptions.length) {
+ case 1:
+ return descriptions[0];
+
+ case 2:
+ return descriptions[0] + " or " + descriptions[1];
+
+ default:
+ return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
+ }
+ }
+
+ function describeFound(found) {
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
+ }
+
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
+ };
+
+ function peg$parse(input, options) {
+ options = options !== void 0 ? options : {};
+
+ var peg$FAILED = {},
+ peg$startRuleFunctions = {
+ start: peg$parsestart
+ },
+ peg$startRuleFunction = peg$parsestart,
+ peg$c0 = function peg$c0(ss) {
+ return ss.length === 1 ? ss[0] : {
+ type: 'matches',
+ selectors: ss
+ };
+ },
+ peg$c1 = function peg$c1() {
+ return void 0;
+ },
+ peg$c2 = " ",
+ peg$c3 = peg$literalExpectation(" ", false),
+ peg$c4 = /^[^ [\],():#!=><~+.]/,
+ peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false),
+ peg$c6 = function peg$c6(i) {
+ return i.join('');
+ },
+ peg$c7 = ">",
+ peg$c8 = peg$literalExpectation(">", false),
+ peg$c9 = function peg$c9() {
+ return 'child';
+ },
+ peg$c10 = "~",
+ peg$c11 = peg$literalExpectation("~", false),
+ peg$c12 = function peg$c12() {
+ return 'sibling';
+ },
+ peg$c13 = "+",
+ peg$c14 = peg$literalExpectation("+", false),
+ peg$c15 = function peg$c15() {
+ return 'adjacent';
+ },
+ peg$c16 = function peg$c16() {
+ return 'descendant';
+ },
+ peg$c17 = ",",
+ peg$c18 = peg$literalExpectation(",", false),
+ peg$c19 = function peg$c19(s, ss) {
+ return [s].concat(ss.map(function (s) {
+ return s[3];
+ }));
+ },
+ peg$c20 = function peg$c20(a, ops) {
+ return ops.reduce(function (memo, rhs) {
+ return {
+ type: rhs[0],
+ left: memo,
+ right: rhs[1]
+ };
+ }, a);
+ },
+ peg$c21 = "!",
+ peg$c22 = peg$literalExpectation("!", false),
+ peg$c23 = function peg$c23(subject, as) {
+ var b = as.length === 1 ? as[0] : {
+ type: 'compound',
+ selectors: as
+ };
+ if (subject) b.subject = true;
+ return b;
+ },
+ peg$c24 = "*",
+ peg$c25 = peg$literalExpectation("*", false),
+ peg$c26 = function peg$c26(a) {
+ return {
+ type: 'wildcard',
+ value: a
+ };
+ },
+ peg$c27 = "#",
+ peg$c28 = peg$literalExpectation("#", false),
+ peg$c29 = function peg$c29(i) {
+ return {
+ type: 'identifier',
+ value: i
+ };
+ },
+ peg$c30 = "[",
+ peg$c31 = peg$literalExpectation("[", false),
+ peg$c32 = "]",
+ peg$c33 = peg$literalExpectation("]", false),
+ peg$c34 = function peg$c34(v) {
+ return v;
+ },
+ peg$c35 = /^[><!]/,
+ peg$c36 = peg$classExpectation([">", "<", "!"], false, false),
+ peg$c37 = "=",
+ peg$c38 = peg$literalExpectation("=", false),
+ peg$c39 = function peg$c39(a) {
+ return (a || '') + '=';
+ },
+ peg$c40 = /^[><]/,
+ peg$c41 = peg$classExpectation([">", "<"], false, false),
+ peg$c42 = ".",
+ peg$c43 = peg$literalExpectation(".", false),
+ peg$c44 = function peg$c44(name, op, value) {
+ return {
+ type: 'attribute',
+ name: name,
+ operator: op,
+ value: value
+ };
+ },
+ peg$c45 = function peg$c45(name) {
+ return {
+ type: 'attribute',
+ name: name
+ };
+ },
+ peg$c46 = "\"",
+ peg$c47 = peg$literalExpectation("\"", false),
+ peg$c48 = /^[^\\"]/,
+ peg$c49 = peg$classExpectation(["\\", "\""], true, false),
+ peg$c50 = "\\",
+ peg$c51 = peg$literalExpectation("\\", false),
+ peg$c52 = peg$anyExpectation(),
+ peg$c53 = function peg$c53(a, b) {
+ return a + b;
+ },
+ peg$c54 = function peg$c54(d) {
+ return {
+ type: 'literal',
+ value: strUnescape(d.join(''))
+ };
+ },
+ peg$c55 = "'",
+ peg$c56 = peg$literalExpectation("'", false),
+ peg$c57 = /^[^\\']/,
+ peg$c58 = peg$classExpectation(["\\", "'"], true, false),
+ peg$c59 = /^[0-9]/,
+ peg$c60 = peg$classExpectation([["0", "9"]], false, false),
+ peg$c61 = function peg$c61(a, b) {
+ // Can use `a.flat().join('')` once supported
+ var leadingDecimals = a ? [].concat.apply([], a).join('') : '';
+ return {
+ type: 'literal',
+ value: parseFloat(leadingDecimals + b.join(''))
+ };
+ },
+ peg$c62 = function peg$c62(i) {
+ return {
+ type: 'literal',
+ value: i
+ };
+ },
+ peg$c63 = "type(",
+ peg$c64 = peg$literalExpectation("type(", false),
+ peg$c65 = /^[^ )]/,
+ peg$c66 = peg$classExpectation([" ", ")"], true, false),
+ peg$c67 = ")",
+ peg$c68 = peg$literalExpectation(")", false),
+ peg$c69 = function peg$c69(t) {
+ return {
+ type: 'type',
+ value: t.join('')
+ };
+ },
+ peg$c70 = /^[imsu]/,
+ peg$c71 = peg$classExpectation(["i", "m", "s", "u"], false, false),
+ peg$c72 = "/",
+ peg$c73 = peg$literalExpectation("/", false),
+ peg$c74 = /^[^\/]/,
+ peg$c75 = peg$classExpectation(["/"], true, false),
+ peg$c76 = function peg$c76(d, flgs) {
+ return {
+ type: 'regexp',
+ value: new RegExp(d.join(''), flgs ? flgs.join('') : '')
+ };
+ },
+ peg$c77 = function peg$c77(i, is) {
+ return {
+ type: 'field',
+ name: is.reduce(function (memo, p) {
+ return memo + p[0] + p[1];
+ }, i)
+ };
+ },
+ peg$c78 = ":not(",
+ peg$c79 = peg$literalExpectation(":not(", false),
+ peg$c80 = function peg$c80(ss) {
+ return {
+ type: 'not',
+ selectors: ss
+ };
+ },
+ peg$c81 = ":matches(",
+ peg$c82 = peg$literalExpectation(":matches(", false),
+ peg$c83 = function peg$c83(ss) {
+ return {
+ type: 'matches',
+ selectors: ss
+ };
+ },
+ peg$c84 = ":has(",
+ peg$c85 = peg$literalExpectation(":has(", false),
+ peg$c86 = function peg$c86(ss) {
+ return {
+ type: 'has',
+ selectors: ss
+ };
+ },
+ peg$c87 = ":first-child",
+ peg$c88 = peg$literalExpectation(":first-child", false),
+ peg$c89 = function peg$c89() {
+ return nth(1);
+ },
+ peg$c90 = ":last-child",
+ peg$c91 = peg$literalExpectation(":last-child", false),
+ peg$c92 = function peg$c92() {
+ return nthLast(1);
+ },
+ peg$c93 = ":nth-child(",
+ peg$c94 = peg$literalExpectation(":nth-child(", false),
+ peg$c95 = function peg$c95(n) {
+ return nth(parseInt(n.join(''), 10));
+ },
+ peg$c96 = ":nth-last-child(",
+ peg$c97 = peg$literalExpectation(":nth-last-child(", false),
+ peg$c98 = function peg$c98(n) {
+ return nthLast(parseInt(n.join(''), 10));
+ },
+ peg$c99 = ":",
+ peg$c100 = peg$literalExpectation(":", false),
+ peg$c101 = "statement",
+ peg$c102 = peg$literalExpectation("statement", true),
+ peg$c103 = "expression",
+ peg$c104 = peg$literalExpectation("expression", true),
+ peg$c105 = "declaration",
+ peg$c106 = peg$literalExpectation("declaration", true),
+ peg$c107 = "function",
+ peg$c108 = peg$literalExpectation("function", true),
+ peg$c109 = "pattern",
+ peg$c110 = peg$literalExpectation("pattern", true),
+ peg$c111 = function peg$c111(c) {
+ return {
+ type: 'class',
+ name: c
+ };
+ },
+ peg$currPos = 0,
+ peg$posDetailsCache = [{
+ line: 1,
+ column: 1
+ }],
+ peg$maxFailPos = 0,
+ peg$maxFailExpected = [],
+ peg$resultsCache = {},
+ peg$result;
+
+ if ("startRule" in options) {
+ if (!(options.startRule in peg$startRuleFunctions)) {
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
+ }
+
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
+ }
+
+ function peg$literalExpectation(text, ignoreCase) {
+ return {
+ type: "literal",
+ text: text,
+ ignoreCase: ignoreCase
+ };
+ }
+
+ function peg$classExpectation(parts, inverted, ignoreCase) {
+ return {
+ type: "class",
+ parts: parts,
+ inverted: inverted,
+ ignoreCase: ignoreCase
+ };
+ }
+
+ function peg$anyExpectation() {
+ return {
+ type: "any"
+ };
+ }
+
+ function peg$endExpectation() {
+ return {
+ type: "end"
+ };
+ }
+
+ function peg$computePosDetails(pos) {
+ var details = peg$posDetailsCache[pos],
+ p;
+
+ if (details) {
+ return details;
+ } else {
+ p = pos - 1;
+
+ while (!peg$posDetailsCache[p]) {
+ p--;
+ }
+
+ details = peg$posDetailsCache[p];
+ details = {
+ line: details.line,
+ column: details.column
+ };
+
+ while (p < pos) {
+ if (input.charCodeAt(p) === 10) {
+ details.line++;
+ details.column = 1;
+ } else {
+ details.column++;
+ }
+
+ p++;
+ }
+
+ peg$posDetailsCache[pos] = details;
+ return details;
+ }
+ }
+
+ function peg$computeLocation(startPos, endPos) {
+ var startPosDetails = peg$computePosDetails(startPos),
+ endPosDetails = peg$computePosDetails(endPos);
+ return {
+ start: {
+ offset: startPos,
+ line: startPosDetails.line,
+ column: startPosDetails.column
+ },
+ end: {
+ offset: endPos,
+ line: endPosDetails.line,
+ column: endPosDetails.column
+ }
+ };
+ }
+
+ function peg$fail(expected) {
+ if (peg$currPos < peg$maxFailPos) {
+ return;
+ }
+
+ if (peg$currPos > peg$maxFailPos) {
+ peg$maxFailPos = peg$currPos;
+ peg$maxFailExpected = [];
+ }
+
+ peg$maxFailExpected.push(expected);
+ }
+
+ function peg$buildStructuredError(expected, found, location) {
+ return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
+ }
+
+ function peg$parsestart() {
+ var s0, s1, s2, s3;
+ var key = peg$currPos * 30 + 0,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = peg$parse_();
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parseselectors();
+
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parse_();
+
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c0(s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
+ s1 = peg$parse_();
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c1();
+ }
+
+ s0 = s1;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parse_() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 1,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = [];
+
+ if (input.charCodeAt(peg$currPos) === 32) {
+ s1 = peg$c2;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c3);
+ }
+ }
+
+ while (s1 !== peg$FAILED) {
+ s0.push(s1);
+
+ if (input.charCodeAt(peg$currPos) === 32) {
+ s1 = peg$c2;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c3);
+ }
+ }
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseidentifierName() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 2,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = [];
+
+ if (peg$c4.test(input.charAt(peg$currPos))) {
+ s2 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c5);
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ while (s2 !== peg$FAILED) {
+ s1.push(s2);
+
+ if (peg$c4.test(input.charAt(peg$currPos))) {
+ s2 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c5);
+ }
+ }
+ }
+ } else {
+ s1 = peg$FAILED;
+ }
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c6(s1);
+ }
+
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsebinaryOp() {
+ var s0, s1, s2, s3;
+ var key = peg$currPos * 30 + 3,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = peg$parse_();
+
+ if (s1 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 62) {
+ s2 = peg$c7;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c8);
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parse_();
+
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c9();
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
+ s1 = peg$parse_();
+
+ if (s1 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 126) {
+ s2 = peg$c10;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c11);
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parse_();
+
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c12();
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
+ s1 = peg$parse_();
+
+ if (s1 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 43) {
+ s2 = peg$c13;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c14);
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parse_();
+
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c15();
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 32) {
+ s1 = peg$c2;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c3);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c16();
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ }
+ }
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseselectors() {
+ var s0, s1, s2, s3, s4, s5, s6, s7;
+ var key = peg$currPos * 30 + 4,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = peg$parseselector();
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
+ s3 = peg$currPos;
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 44) {
+ s5 = peg$c17;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c18);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s6 = peg$parse_();
+
+ if (s6 !== peg$FAILED) {
+ s7 = peg$parseselector();
+
+ if (s7 !== peg$FAILED) {
+ s4 = [s4, s5, s6, s7];
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+ s3 = peg$currPos;
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 44) {
+ s5 = peg$c17;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c18);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s6 = peg$parse_();
+
+ if (s6 !== peg$FAILED) {
+ s7 = peg$parseselector();
+
+ if (s7 !== peg$FAILED) {
+ s4 = [s4, s5, s6, s7];
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c19(s1, s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseselector() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 5,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = peg$parsesequence();
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
+ s3 = peg$currPos;
+ s4 = peg$parsebinaryOp();
+
+ if (s4 !== peg$FAILED) {
+ s5 = peg$parsesequence();
+
+ if (s5 !== peg$FAILED) {
+ s4 = [s4, s5];
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+ s3 = peg$currPos;
+ s4 = peg$parsebinaryOp();
+
+ if (s4 !== peg$FAILED) {
+ s5 = peg$parsesequence();
+
+ if (s5 !== peg$FAILED) {
+ s4 = [s4, s5];
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c20(s1, s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsesequence() {
+ var s0, s1, s2, s3;
+ var key = peg$currPos * 30 + 6,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 33) {
+ s1 = peg$c21;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c22);
+ }
+ }
+
+ if (s1 === peg$FAILED) {
+ s1 = null;
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
+ s3 = peg$parseatom();
+
+ if (s3 !== peg$FAILED) {
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+ s3 = peg$parseatom();
+ }
+ } else {
+ s2 = peg$FAILED;
+ }
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c23(s1, s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseatom() {
+ var s0;
+ var key = peg$currPos * 30 + 7,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$parsewildcard();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parseidentifier();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parseattr();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parsefield();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parsenegation();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parsematches();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parsehas();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parsefirstChild();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parselastChild();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parsenthChild();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parsenthLastChild();
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$parseclass();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsewildcard() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 8,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 42) {
+ s1 = peg$c24;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c25);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c26(s1);
+ }
+
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseidentifier() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 9,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 35) {
+ s1 = peg$c27;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c28);
+ }
+ }
+
+ if (s1 === peg$FAILED) {
+ s1 = null;
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parseidentifierName();
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c29(s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseattr() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 10,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 91) {
+ s1 = peg$c30;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c31);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
+
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseattrValue();
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 93) {
+ s5 = peg$c32;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c33);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c34(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseattrOps() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 11,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (peg$c35.test(input.charAt(peg$currPos))) {
+ s1 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c36);
+ }
+ }
+
+ if (s1 === peg$FAILED) {
+ s1 = null;
+ }
+
+ if (s1 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 61) {
+ s2 = peg$c37;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c38);
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c39(s1);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ if (s0 === peg$FAILED) {
+ if (peg$c40.test(input.charAt(peg$currPos))) {
+ s0 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s0 = peg$FAILED;
+
+ {
+ peg$fail(peg$c41);
+ }
+ }
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseattrEqOps() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 12,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 33) {
+ s1 = peg$c21;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c22);
+ }
+ }
+
+ if (s1 === peg$FAILED) {
+ s1 = null;
+ }
+
+ if (s1 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 61) {
+ s2 = peg$c37;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c38);
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c39(s1);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseattrName() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 13,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = [];
+ s2 = peg$parseidentifierName();
+
+ if (s2 === peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s2 = peg$c42;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c43);
+ }
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ while (s2 !== peg$FAILED) {
+ s1.push(s2);
+ s2 = peg$parseidentifierName();
+
+ if (s2 === peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s2 = peg$c42;
+ peg$currPos++;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c43);
+ }
+ }
+ }
+ }
+ } else {
+ s1 = peg$FAILED;
+ }
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c6(s1);
+ }
+
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseattrValue() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 14,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = peg$parseattrName();
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
+
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseattrEqOps();
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ s5 = peg$parsetype();
+
+ if (s5 === peg$FAILED) {
+ s5 = peg$parseregex();
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c44(s1, s3, s5);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
+ s1 = peg$parseattrName();
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
+
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseattrOps();
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ s5 = peg$parsestring();
+
+ if (s5 === peg$FAILED) {
+ s5 = peg$parsenumber();
+
+ if (s5 === peg$FAILED) {
+ s5 = peg$parsepath();
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c44(s1, s3, s5);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
+ s1 = peg$parseattrName();
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c45(s1);
+ }
+
+ s0 = s1;
+ }
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsestring() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 15,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 34) {
+ s1 = peg$c46;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c47);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
+
+ if (peg$c48.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c49);
+ }
+ }
+
+ if (s3 === peg$FAILED) {
+ s3 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 92) {
+ s4 = peg$c50;
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c51);
+ }
+ }
+
+ if (s4 !== peg$FAILED) {
+ if (input.length > peg$currPos) {
+ s5 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c52);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s4 = peg$c53(s4, s5);
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ }
+
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+
+ if (peg$c48.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c49);
+ }
+ }
+
+ if (s3 === peg$FAILED) {
+ s3 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 92) {
+ s4 = peg$c50;
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c51);
+ }
+ }
+
+ if (s4 !== peg$FAILED) {
+ if (input.length > peg$currPos) {
+ s5 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c52);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s4 = peg$c53(s4, s5);
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 34) {
+ s3 = peg$c46;
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c47);
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c54(s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ if (s0 === peg$FAILED) {
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 39) {
+ s1 = peg$c55;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c56);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
+
+ if (peg$c57.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c58);
+ }
+ }
+
+ if (s3 === peg$FAILED) {
+ s3 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 92) {
+ s4 = peg$c50;
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c51);
+ }
+ }
+
+ if (s4 !== peg$FAILED) {
+ if (input.length > peg$currPos) {
+ s5 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c52);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s4 = peg$c53(s4, s5);
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ }
+
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+
+ if (peg$c57.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c58);
+ }
+ }
+
+ if (s3 === peg$FAILED) {
+ s3 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 92) {
+ s4 = peg$c50;
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c51);
+ }
+ }
+
+ if (s4 !== peg$FAILED) {
+ if (input.length > peg$currPos) {
+ s5 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c52);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s4 = peg$c53(s4, s5);
+ s3 = s4;
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s3;
+ s3 = peg$FAILED;
+ }
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 39) {
+ s3 = peg$c55;
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c56);
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c54(s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsenumber() {
+ var s0, s1, s2, s3;
+ var key = peg$currPos * 30 + 16,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = peg$currPos;
+ s2 = [];
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
+
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s3 = peg$c42;
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c43);
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ s2 = [s2, s3];
+ s1 = s2;
+ } else {
+ peg$currPos = s1;
+ s1 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s1;
+ s1 = peg$FAILED;
+ }
+
+ if (s1 === peg$FAILED) {
+ s1 = null;
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
+ }
+ } else {
+ s2 = peg$FAILED;
+ }
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c61(s1, s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsepath() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 17,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+ s1 = peg$parseidentifierName();
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c62(s1);
+ }
+
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsetype() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 18,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.substr(peg$currPos, 5) === peg$c63) {
+ s1 = peg$c63;
+ peg$currPos += 5;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c64);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
+
+ if (s2 !== peg$FAILED) {
+ s3 = [];
+
+ if (peg$c65.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c66);
+ }
+ }
+
+ if (s4 !== peg$FAILED) {
+ while (s4 !== peg$FAILED) {
+ s3.push(s4);
+
+ if (peg$c65.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c66);
+ }
+ }
+ }
+ } else {
+ s3 = peg$FAILED;
+ }
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c69(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseflags() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 19,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = [];
+
+ if (peg$c70.test(input.charAt(peg$currPos))) {
+ s1 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c71);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ while (s1 !== peg$FAILED) {
+ s0.push(s1);
+
+ if (peg$c70.test(input.charAt(peg$currPos))) {
+ s1 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c71);
+ }
+ }
+ }
+ } else {
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseregex() {
+ var s0, s1, s2, s3, s4;
+ var key = peg$currPos * 30 + 20,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 47) {
+ s1 = peg$c72;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c73);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = [];
+
+ if (peg$c74.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c75);
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ while (s3 !== peg$FAILED) {
+ s2.push(s3);
+
+ if (peg$c74.test(input.charAt(peg$currPos))) {
+ s3 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c75);
+ }
+ }
+ }
+ } else {
+ s2 = peg$FAILED;
+ }
+
+ if (s2 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 47) {
+ s3 = peg$c72;
+ peg$currPos++;
+ } else {
+ s3 = peg$FAILED;
+
+ {
+ peg$fail(peg$c73);
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parseflags();
+
+ if (s4 === peg$FAILED) {
+ s4 = null;
+ }
+
+ if (s4 !== peg$FAILED) {
+ s1 = peg$c76(s2, s4);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsefield() {
+ var s0, s1, s2, s3, s4, s5, s6;
+ var key = peg$currPos * 30 + 21,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s1 = peg$c42;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c43);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parseidentifierName();
+
+ if (s2 !== peg$FAILED) {
+ s3 = [];
+ s4 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s5 = peg$c42;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c43);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s6 = peg$parseidentifierName();
+
+ if (s6 !== peg$FAILED) {
+ s5 = [s5, s6];
+ s4 = s5;
+ } else {
+ peg$currPos = s4;
+ s4 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s4;
+ s4 = peg$FAILED;
+ }
+
+ while (s4 !== peg$FAILED) {
+ s3.push(s4);
+ s4 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 46) {
+ s5 = peg$c42;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c43);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s6 = peg$parseidentifierName();
+
+ if (s6 !== peg$FAILED) {
+ s5 = [s5, s6];
+ s4 = s5;
+ } else {
+ peg$currPos = s4;
+ s4 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s4;
+ s4 = peg$FAILED;
+ }
+ }
+
+ if (s3 !== peg$FAILED) {
+ s1 = peg$c77(s2, s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsenegation() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 22,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.substr(peg$currPos, 5) === peg$c78) {
+ s1 = peg$c78;
+ peg$currPos += 5;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c79);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
+
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseselectors();
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c80(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsematches() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 23,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.substr(peg$currPos, 9) === peg$c81) {
+ s1 = peg$c81;
+ peg$currPos += 9;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c82);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
+
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseselectors();
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c83(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsehas() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 24,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.substr(peg$currPos, 5) === peg$c84) {
+ s1 = peg$c84;
+ peg$currPos += 5;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c85);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
+
+ if (s2 !== peg$FAILED) {
+ s3 = peg$parseselectors();
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c86(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsefirstChild() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 25,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.substr(peg$currPos, 12) === peg$c87) {
+ s1 = peg$c87;
+ peg$currPos += 12;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c88);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c89();
+ }
+
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parselastChild() {
+ var s0, s1;
+ var key = peg$currPos * 30 + 26,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.substr(peg$currPos, 11) === peg$c90) {
+ s1 = peg$c90;
+ peg$currPos += 11;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c91);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s1 = peg$c92();
+ }
+
+ s0 = s1;
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsenthChild() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 27,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.substr(peg$currPos, 11) === peg$c93) {
+ s1 = peg$c93;
+ peg$currPos += 11;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c94);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
+
+ if (s2 !== peg$FAILED) {
+ s3 = [];
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
+
+ if (s4 !== peg$FAILED) {
+ while (s4 !== peg$FAILED) {
+ s3.push(s4);
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
+ }
+ } else {
+ s3 = peg$FAILED;
+ }
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c95(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parsenthLastChild() {
+ var s0, s1, s2, s3, s4, s5;
+ var key = peg$currPos * 30 + 28,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.substr(peg$currPos, 16) === peg$c96) {
+ s1 = peg$c96;
+ peg$currPos += 16;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c97);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ s2 = peg$parse_();
+
+ if (s2 !== peg$FAILED) {
+ s3 = [];
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
+
+ if (s4 !== peg$FAILED) {
+ while (s4 !== peg$FAILED) {
+ s3.push(s4);
+
+ if (peg$c59.test(input.charAt(peg$currPos))) {
+ s4 = input.charAt(peg$currPos);
+ peg$currPos++;
+ } else {
+ s4 = peg$FAILED;
+
+ {
+ peg$fail(peg$c60);
+ }
+ }
+ }
+ } else {
+ s3 = peg$FAILED;
+ }
+
+ if (s3 !== peg$FAILED) {
+ s4 = peg$parse_();
+
+ if (s4 !== peg$FAILED) {
+ if (input.charCodeAt(peg$currPos) === 41) {
+ s5 = peg$c67;
+ peg$currPos++;
+ } else {
+ s5 = peg$FAILED;
+
+ {
+ peg$fail(peg$c68);
+ }
+ }
+
+ if (s5 !== peg$FAILED) {
+ s1 = peg$c98(s3);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function peg$parseclass() {
+ var s0, s1, s2;
+ var key = peg$currPos * 30 + 29,
+ cached = peg$resultsCache[key];
+
+ if (cached) {
+ peg$currPos = cached.nextPos;
+ return cached.result;
+ }
+
+ s0 = peg$currPos;
+
+ if (input.charCodeAt(peg$currPos) === 58) {
+ s1 = peg$c99;
+ peg$currPos++;
+ } else {
+ s1 = peg$FAILED;
+
+ {
+ peg$fail(peg$c100);
+ }
+ }
+
+ if (s1 !== peg$FAILED) {
+ if (input.substr(peg$currPos, 9).toLowerCase() === peg$c101) {
+ s2 = input.substr(peg$currPos, 9);
+ peg$currPos += 9;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c102);
+ }
+ }
+
+ if (s2 === peg$FAILED) {
+ if (input.substr(peg$currPos, 10).toLowerCase() === peg$c103) {
+ s2 = input.substr(peg$currPos, 10);
+ peg$currPos += 10;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c104);
+ }
+ }
+
+ if (s2 === peg$FAILED) {
+ if (input.substr(peg$currPos, 11).toLowerCase() === peg$c105) {
+ s2 = input.substr(peg$currPos, 11);
+ peg$currPos += 11;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c106);
+ }
+ }
+
+ if (s2 === peg$FAILED) {
+ if (input.substr(peg$currPos, 8).toLowerCase() === peg$c107) {
+ s2 = input.substr(peg$currPos, 8);
+ peg$currPos += 8;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c108);
+ }
+ }
+
+ if (s2 === peg$FAILED) {
+ if (input.substr(peg$currPos, 7).toLowerCase() === peg$c109) {
+ s2 = input.substr(peg$currPos, 7);
+ peg$currPos += 7;
+ } else {
+ s2 = peg$FAILED;
+
+ {
+ peg$fail(peg$c110);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (s2 !== peg$FAILED) {
+ s1 = peg$c111(s2);
+ s0 = s1;
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+ } else {
+ peg$currPos = s0;
+ s0 = peg$FAILED;
+ }
+
+ peg$resultsCache[key] = {
+ nextPos: peg$currPos,
+ result: s0
+ };
+ return s0;
+ }
+
+ function nth(n) {
+ return {
+ type: 'nth-child',
+ index: {
+ type: 'literal',
+ value: n
+ }
+ };
+ }
+
+ function nthLast(n) {
+ return {
+ type: 'nth-last-child',
+ index: {
+ type: 'literal',
+ value: n
+ }
+ };
+ }
+
+ function strUnescape(s) {
+ return s.replace(/\\(.)/g, function (match, ch) {
+ switch (ch) {
+ case 'b':
+ return '\b';
+
+ case 'f':
+ return '\f';
+
+ case 'n':
+ return '\n';
+
+ case 'r':
+ return '\r';
+
+ case 't':
+ return '\t';
+
+ case 'v':
+ return '\v';
+
+ default:
+ return ch;
+ }
+ });
+ }
+
+ peg$result = peg$startRuleFunction();
+
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
+ return peg$result;
+ } else {
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
+ peg$fail(peg$endExpectation());
+ }
+
+ throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
+ }
+ }
+
+ return {
+ SyntaxError: peg$SyntaxError,
+ parse: peg$parse
+ };
+ });
+ });
+
+ function _objectEntries(obj) {
+ var entries = [];
+ var keys = Object.keys(obj);
+
+ for (var k = 0; k < keys.length; k++) entries.push([keys[k], obj[keys[k]]]);
+
+ return entries;
+ }
+ /**
+ * @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side
+ */
+
+ var LEFT_SIDE = 'LEFT_SIDE';
+ var RIGHT_SIDE = 'RIGHT_SIDE';
+ /**
+ * @external AST
+ * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html
+ */
+
+ /**
+ * One of the rules of `grammar.pegjs`
+ * @typedef {PlainObject} SelectorAST
+ * @see grammar.pegjs
+ */
+
+ /**
+ * The `sequence` production of `grammar.pegjs`
+ * @typedef {PlainObject} SelectorSequenceAST
+ */
+
+ /**
+ * Get the value of a property which may be multiple levels down
+ * in the object.
+ * @param {?PlainObject} obj
+ * @param {string} key
+ * @returns {undefined|boolean|string|number|external:AST}
+ */
+
+ function getPath(obj, key) {
+ var keys = key.split('.');
+
+ for (var i = 0; i < keys.length; i++) {
+ if (obj == null) {
+ return obj;
+ }
+
+ obj = obj[keys[i]];
+ }
+
+ return obj;
+ }
+ /**
+ * Determine whether `node` can be reached by following `path`,
+ * starting at `ancestor`.
+ * @param {?external:AST} node
+ * @param {?external:AST} ancestor
+ * @param {string[]} path
+ * @returns {boolean}
+ */
+
+
+ function inPath(node, ancestor, path) {
+ if (path.length === 0) {
+ return node === ancestor;
+ }
+
+ if (ancestor == null) {
+ return false;
+ }
+
+ var field = ancestor[path[0]];
+ var remainingPath = path.slice(1);
+
+ if (Array.isArray(field)) {
+ for (var i = 0, l = field.length; i < l; ++i) {
+ if (inPath(node, field[i], remainingPath)) {
+ return true;
+ }
+ }
+
+ return false;
+ } else {
+ return inPath(node, field, remainingPath);
+ }
+ }
+ /**
+ * Given a `node` and its ancestors, determine if `node` is matched
+ * by `selector`.
+ * @param {?external:AST} node
+ * @param {?SelectorAST} selector
+ * @param {external:AST[]} [ancestry=[]]
+ * @throws {Error} Unknowns (operator, class name, selector type, or
+ * selector value type)
+ * @returns {boolean}
+ */
+
+
+ function matches(node, selector, ancestry) {
+ if (!selector) {
+ return true;
+ }
+
+ if (!node) {
+ return false;
+ }
+
+ if (!ancestry) {
+ ancestry = [];
+ }
+
+ switch (selector.type) {
+ case 'wildcard':
+ return true;
+
+ case 'identifier':
+ return selector.value.toLowerCase() === node.type.toLowerCase();
+
+ case 'field':
+ {
+ var path = selector.name.split('.');
+ var ancestor = ancestry[path.length - 1];
+ return inPath(node, ancestor, path);
+ }
+
+ case 'matches':
+ for (var i = 0, l = selector.selectors.length; i < l; ++i) {
+ if (matches(node, selector.selectors[i], ancestry)) {
+ return true;
+ }
+ }
+
+ return false;
+
+ case 'compound':
+ for (var _i = 0, _l = selector.selectors.length; _i < _l; ++_i) {
+ if (!matches(node, selector.selectors[_i], ancestry)) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case 'not':
+ for (var _i2 = 0, _l2 = selector.selectors.length; _i2 < _l2; ++_i2) {
+ if (matches(node, selector.selectors[_i2], ancestry)) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case 'has':
+ {
+ var _ret = function () {
+ var collector = [];
+
+ var _loop = function _loop(_i3, _l3) {
+ var a = [];
+ estraverse.traverse(node, {
+ enter: function enter(node, parent) {
+ if (parent != null) {
+ a.unshift(parent);
+ }
+
+ if (matches(node, selector.selectors[_i3], a)) {
+ collector.push(node);
+ }
+ },
+ leave: function leave() {
+ a.shift();
+ },
+ fallback: 'iteration'
+ });
+ };
+
+ for (var _i3 = 0, _l3 = selector.selectors.length; _i3 < _l3; ++_i3) {
+ _loop(_i3);
+ }
+
+ return {
+ v: collector.length !== 0
+ };
+ }();
+
+ if (_typeof(_ret) === "object") return _ret.v;
+ }
+
+ case 'child':
+ if (matches(node, selector.right, ancestry)) {
+ return matches(ancestry[0], selector.left, ancestry.slice(1));
+ }
+
+ return false;
+
+ case 'descendant':
+ if (matches(node, selector.right, ancestry)) {
+ for (var _i4 = 0, _l4 = ancestry.length; _i4 < _l4; ++_i4) {
+ if (matches(ancestry[_i4], selector.left, ancestry.slice(_i4 + 1))) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+
+ case 'attribute':
+ {
+ var p = getPath(node, selector.name);
+
+ switch (selector.operator) {
+ case void 0:
+ return p != null;
+
+ case '=':
+ switch (selector.value.type) {
+ case 'regexp':
+ return typeof p === 'string' && selector.value.value.test(p);
+
+ case 'literal':
+ return "".concat(selector.value.value) === "".concat(p);
+
+ case 'type':
+ return selector.value.value === _typeof(p);
+ }
+
+ throw new Error("Unknown selector value type: ".concat(selector.value.type));
+
+ case '!=':
+ switch (selector.value.type) {
+ case 'regexp':
+ return !selector.value.value.test(p);
+
+ case 'literal':
+ return "".concat(selector.value.value) !== "".concat(p);
+
+ case 'type':
+ return selector.value.value !== _typeof(p);
+ }
+
+ throw new Error("Unknown selector value type: ".concat(selector.value.type));
+
+ case '<=':
+ return p <= selector.value.value;
+
+ case '<':
+ return p < selector.value.value;
+
+ case '>':
+ return p > selector.value.value;
+
+ case '>=':
+ return p >= selector.value.value;
+ }
+
+ throw new Error("Unknown operator: ".concat(selector.operator));
+ }
+
+ case 'sibling':
+ return matches(node, selector.right, ancestry) && sibling(node, selector.left, ancestry, LEFT_SIDE) || selector.left.subject && matches(node, selector.left, ancestry) && sibling(node, selector.right, ancestry, RIGHT_SIDE);
+
+ case 'adjacent':
+ return matches(node, selector.right, ancestry) && adjacent(node, selector.left, ancestry, LEFT_SIDE) || selector.right.subject && matches(node, selector.left, ancestry) && adjacent(node, selector.right, ancestry, RIGHT_SIDE);
+
+ case 'nth-child':
+ return matches(node, selector.right, ancestry) && nthChild(node, ancestry, function () {
+ return selector.index.value - 1;
+ });
+
+ case 'nth-last-child':
+ return matches(node, selector.right, ancestry) && nthChild(node, ancestry, function (length) {
+ return length - selector.index.value;
+ });
+
+ case 'class':
+ switch (selector.name.toLowerCase()) {
+ case 'statement':
+ if (node.type.slice(-9) === 'Statement') return true;
+ // fallthrough: interface Declaration <: Statement { }
+
+ case 'declaration':
+ return node.type.slice(-11) === 'Declaration';
+
+ case 'pattern':
+ if (node.type.slice(-7) === 'Pattern') return true;
+ // fallthrough: interface Expression <: Node, Pattern { }
+
+ case 'expression':
+ return node.type.slice(-10) === 'Expression' || node.type.slice(-7) === 'Literal' || node.type === 'Identifier' && (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty') || node.type === 'MetaProperty';
+
+ case 'function':
+ return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression';
+ }
+
+ throw new Error("Unknown class name: ".concat(selector.name));
+ }
+
+ throw new Error("Unknown selector type: ".concat(selector.type));
+ }
+ /**
+ * Determines if the given node has a sibling that matches the
+ * given selector.
+ * @param {external:AST} node
+ * @param {SelectorSequenceAST} selector
+ * @param {external:AST[]} ancestry
+ * @param {Side} side
+ * @returns {boolean}
+ */
+
+
+ function sibling(node, selector, ancestry, side) {
+ var _ancestry = _slicedToArray(ancestry, 1),
+ parent = _ancestry[0];
+
+ if (!parent) {
+ return false;
+ }
+
+ var keys = estraverse.VisitorKeys[parent.type];
+
+ for (var i = 0, l = keys.length; i < l; ++i) {
+ var listProp = parent[keys[i]];
+
+ if (Array.isArray(listProp)) {
+ var startIndex = listProp.indexOf(node);
+
+ if (startIndex < 0) {
+ continue;
+ }
+
+ var lowerBound = void 0,
+ upperBound = void 0;
+
+ if (side === LEFT_SIDE) {
+ lowerBound = 0;
+ upperBound = startIndex;
+ } else {
+ lowerBound = startIndex + 1;
+ upperBound = listProp.length;
+ }
+
+ for (var k = lowerBound; k < upperBound; ++k) {
+ if (matches(listProp[k], selector, ancestry)) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+ /**
+ * Determines if the given node has an adjacent sibling that matches
+ * the given selector.
+ * @param {external:AST} node
+ * @param {SelectorSequenceAST} selector
+ * @param {external:AST[]} ancestry
+ * @param {Side} side
+ * @returns {boolean}
+ */
+
+
+ function adjacent(node, selector, ancestry, side) {
+ var _ancestry2 = _slicedToArray(ancestry, 1),
+ parent = _ancestry2[0];
+
+ if (!parent) {
+ return false;
+ }
+
+ var keys = estraverse.VisitorKeys[parent.type];
+
+ for (var i = 0, l = keys.length; i < l; ++i) {
+ var listProp = parent[keys[i]];
+
+ if (Array.isArray(listProp)) {
+ var idx = listProp.indexOf(node);
+
+ if (idx < 0) {
+ continue;
+ }
+
+ if (side === LEFT_SIDE && idx > 0 && matches(listProp[idx - 1], selector, ancestry)) {
+ return true;
+ }
+
+ if (side === RIGHT_SIDE && idx < listProp.length - 1 && matches(listProp[idx + 1], selector, ancestry)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+ /**
+ * @callback IndexFunction
+ * @param {Integer} len Containing list's length
+ * @returns {Integer}
+ */
+
+ /**
+ * Determines if the given node is the nth child, determined by
+ * `idxFn`, which is given the containing list's length.
+ * @param {external:AST} node
+ * @param {external:AST[]} ancestry
+ * @param {IndexFunction} idxFn
+ * @returns {boolean}
+ */
+
+
+ function nthChild(node, ancestry, idxFn) {
+ var _ancestry3 = _slicedToArray(ancestry, 1),
+ parent = _ancestry3[0];
+
+ if (!parent) {
+ return false;
+ }
+
+ var keys = estraverse.VisitorKeys[parent.type];
+
+ for (var i = 0, l = keys.length; i < l; ++i) {
+ var listProp = parent[keys[i]];
+
+ if (Array.isArray(listProp)) {
+ var idx = listProp.indexOf(node);
+
+ if (idx >= 0 && idx === idxFn(listProp.length)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+ /**
+ * For each selector node marked as a subject, find the portion of the
+ * selector that the subject must match.
+ * @param {SelectorAST} selector
+ * @param {SelectorAST} [ancestor] Defaults to `selector`
+ * @returns {SelectorAST[]}
+ */
+
+
+ function subjects(selector, ancestor) {
+ if (selector == null || _typeof(selector) != 'object') {
+ return [];
+ }
+
+ if (ancestor == null) {
+ ancestor = selector;
+ }
+
+ var results = selector.subject ? [ancestor] : [];
+
+ for (var _i5 = 0, _Object$entries = _objectEntries(selector); _i5 < _Object$entries.length; _i5++) {
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i5], 2),
+ p = _Object$entries$_i[0],
+ sel = _Object$entries$_i[1];
+
+ results.push.apply(results, _toConsumableArray(subjects(sel, p === 'left' ? sel : ancestor)));
+ }
+
+ return results;
+ }
+ /**
+ * @callback TraverseVisitor
+ * @param {?external:AST} node
+ * @param {?external:AST} parent
+ * @param {external:AST[]} ancestry
+ */
+
+ /**
+ * From a JS AST and a selector AST, collect all JS AST nodes that
+ * match the selector.
+ * @param {external:AST} ast
+ * @param {?SelectorAST} selector
+ * @param {TraverseVisitor} visitor
+ * @returns {external:AST[]}
+ */
+
+
+ function traverse(ast, selector, visitor) {
+ if (!selector) {
+ return;
+ }
+
+ var ancestry = [];
+ var altSubjects = subjects(selector);
+ estraverse.traverse(ast, {
+ enter: function enter(node, parent) {
+ if (parent != null) {
+ ancestry.unshift(parent);
+ }
+
+ if (matches(node, selector, ancestry)) {
+ if (altSubjects.length) {
+ for (var i = 0, l = altSubjects.length; i < l; ++i) {
+ if (matches(node, altSubjects[i], ancestry)) {
+ visitor(node, parent, ancestry);
+ }
+
+ for (var k = 0, m = ancestry.length; k < m; ++k) {
+ var succeedingAncestry = ancestry.slice(k + 1);
+
+ if (matches(ancestry[k], altSubjects[i], succeedingAncestry)) {
+ visitor(ancestry[k], parent, succeedingAncestry);
+ }
+ }
+ }
+ } else {
+ visitor(node, parent, ancestry);
+ }
+ }
+ },
+ leave: function leave() {
+ ancestry.shift();
+ },
+ fallback: 'iteration'
+ });
+ }
+ /**
+ * From a JS AST and a selector AST, collect all JS AST nodes that
+ * match the selector.
+ * @param {external:AST} ast
+ * @param {?SelectorAST} selector
+ * @returns {external:AST[]}
+ */
+
+
+ function match(ast, selector) {
+ var results = [];
+ traverse(ast, selector, function (node) {
+ results.push(node);
+ });
+ return results;
+ }
+ /**
+ * Parse a selector string and return its AST.
+ * @param {string} selector
+ * @returns {SelectorAST}
+ */
+
+
+ function parse(selector) {
+ return parser.parse(selector);
+ }
+ /**
+ * Query the code AST using the selector string.
+ * @param {external:AST} ast
+ * @param {string} selector
+ * @returns {external:AST[]}
+ */
+
+
+ function query(ast, selector) {
+ return match(ast, parse(selector));
+ }
+
+ query.parse = parse;
+ query.match = match;
+ query.traverse = traverse;
+ query.matches = matches;
+ query.query = query;
+
+ return query;
})));
diff --git a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.min.js b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.min.js
index eb2665517e..e0f73217da 100644
--- a/tools/node_modules/eslint/node_modules/esquery/dist/esquery.min.js
+++ b/tools/node_modules/eslint/node_modules/esquery/dist/esquery.min.js
@@ -1,2 +1,2 @@
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).esquery=t()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e,t){return e(t={exports:{}},t.exports),t.exports}var t=e((function(e,t){!function e(t){var r,n,s,o,a,i;function l(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?l(r):r);return n}function u(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function p(){}function f(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function d(e,t){return(new p).traverse(e,t)}function x(e,t){var r;return r=function(e,t){var r,n,s,o;for(n=e.length,s=0;n;)t(e[o=s+(r=n>>>1)])?n=r:(s=o+1,n-=r+1);return s}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},s={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:o={},Skip:a={},Remove:i={}},u.prototype.replace=function(e){this.parent[this.key]=e},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},p.prototype.path=function(){var e,t,r,n,s;function o(e,t){if(Array.isArray(t))for(r=0,n=t.length;r<n;++r)e.push(t[r]);else e.push(t)}if(!this.__current.path)return null;for(s=[],e=2,t=this.__leavelist.length;e<t;++e)o(s,this.__leavelist[e].path);return o(s,this.__current.path),s},p.prototype.type=function(){return this.current().type||this.__current.wrap},p.prototype.parents=function(){var e,t,r;for(r=[],e=1,t=this.__leavelist.length;e<t;++e)r.push(this.__leavelist[e].node);return r},p.prototype.current=function(){return this.__current.node},p.prototype.__execute=function(e,t){var r,n;return n=void 0,r=this.__current,this.__current=t,this.__state=null,e&&(n=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=r,n},p.prototype.notify=function(e){this.__state=e},p.prototype.skip=function(){this.notify(a)},p.prototype.break=function(){this.notify(o)},p.prototype.remove=function(){this.notify(i)},p.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,"iteration"===t.fallback?this.__fallback=Object.keys:"function"==typeof t.fallback&&(this.__fallback=t.fallback),this.__keys=s,t.keys&&(this.__keys=Object.assign(Object.create(this.__keys),t.keys))},p.prototype.traverse=function(e,t){var r,n,s,i,l,u,p,d,x,m,y,g;for(this.__initialize(e,t),g={},r=this.__worklist,n=this.__leavelist,r.push(new c(e,null,null,null)),n.push(new c(null,null,null,null));r.length;)if((s=r.pop())!==g){if(s.node){if(u=this.__execute(t.enter,s),this.__state===o||u===o)return;if(r.push(g),n.push(s),this.__state===a||u===a)continue;if(l=(i=s.node).type||s.wrap,!(m=this.__keys[l])){if(!this.__fallback)throw new Error("Unknown node type "+l+".");m=this.__fallback(i)}for(d=m.length;(d-=1)>=0;)if(y=i[p=m[d]])if(Array.isArray(y)){for(x=y.length;(x-=1)>=0;)if(y[x]){if(h(l,m[d]))s=new c(y[x],[p,x],"Property",null);else{if(!f(y[x]))continue;s=new c(y[x],[p,x],null,null)}r.push(s)}}else f(y)&&r.push(new c(y,p,null,null))}}else if(s=n.pop(),u=this.__execute(t.leave,s),this.__state===o||u===o)return},p.prototype.replace=function(e,t){var r,n,s,l,p,d,x,m,y,g,v,A,E;function _(e){var t,n,s,o;if(e.ref.remove())for(n=e.ref.key,o=e.ref.parent,t=r.length;t--;)if((s=r[t]).ref&&s.ref.parent===o){if(s.ref.key<n)break;--s.ref.key}}for(this.__initialize(e,t),v={},r=this.__worklist,n=this.__leavelist,d=new c(e,null,null,new u(A={root:e},"root")),r.push(d),n.push(d);r.length;)if((d=r.pop())!==v){if(void 0!==(p=this.__execute(t.enter,d))&&p!==o&&p!==a&&p!==i&&(d.ref.replace(p),d.node=p),this.__state!==i&&p!==i||(_(d),d.node=null),this.__state===o||p===o)return A.root;if((s=d.node)&&(r.push(v),n.push(d),this.__state!==a&&p!==a)){if(l=s.type||d.wrap,!(y=this.__keys[l])){if(!this.__fallback)throw new Error("Unknown node type "+l+".");y=this.__fallback(s)}for(x=y.length;(x-=1)>=0;)if(g=s[E=y[x]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]){if(h(l,y[x]))d=new c(g[m],[E,m],"Property",new u(g,m));else{if(!f(g[m]))continue;d=new c(g[m],[E,m],null,new u(g,m))}r.push(d)}}else f(g)&&r.push(new c(g,E,null,new u(s,E)))}}else if(d=n.pop(),void 0!==(p=this.__execute(t.leave,d))&&p!==o&&p!==a&&p!==i&&d.ref.replace(p),this.__state!==i&&p!==i||_(d),this.__state===o||p===o)return A.root;return A.root},t.Syntax=r,t.traverse=d,t.replace=function(e,t){return(new p).replace(e,t)},t.attachComments=function(e,t,r){var s,o,a,i,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(a=0,o=t.length;a<o;a+=1)(s=l(t[a])).extendedRange=[0,e.range[0]],u.push(s);e.leadingComments=u}return e}for(a=0,o=t.length;a<o;a+=1)u.push(x(l(t[a]),r));return i=0,d(e,{enter:function(e){for(var t;i<u.length&&!((t=u[i]).extendedRange[1]>e.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(i,1)):i+=1;return i===u.length?n.Break:u[i].extendedRange[0]>e.range[1]?n.Skip:void 0}}),i=0,d(e,{leave:function(e){for(var t;i<u.length&&(t=u[i],!(e.range[1]<t.extendedRange[0]));)e.range[1]===t.extendedRange[0]?(e.trailingComments||(e.trailingComments=[]),e.trailingComments.push(t),u.splice(i,1)):i+=1;return i===u.length?n.Break:u[i].extendedRange[0]>e.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=s,t.VisitorOption=n,t.Controller=p,t.cloneEnvironment=function(){return e({})},t}(t)})),r=e((function(e){e.exports&&(e.exports=function(){function e(t,r,n,s){this.message=t,this.expected=r,this.found=n,this.location=s,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+s(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+r+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function s(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}return"Expected "+function(e){var t,n,s,o=new Array(e.length);for(t=0;t<e.length;t++)o[t]=(s=e[t],r[s.type](s));if(o.sort(),o.length>0){for(t=1,n=1;t<o.length;t++)o[t-1]!==o[t]&&(o[n]=o[t],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+s(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){r=void 0!==r?r:{};var n,s,o,a,i={},l={start:Ee},u=Ee,c=me(" ",!1),p=/^[^ [\],():#!=><~+.]/,f=ye([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=function(e){return e.join("")},d=me(">",!1),x=me("~",!1),m=me("+",!1),y=me(",",!1),g=me("!",!1),v=me("*",!1),A=me("#",!1),E=me("[",!1),_=me("]",!1),b=/^[><!]/,S=ye([">","<","!"],!1,!1),C=me("=",!1),w=function(e){return(e||"")+"="},P=/^[><]/,k=ye([">","<"],!1,!1),D=me(".",!1),I=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=me('"',!1),F=/^[^\\"]/,T=ye(["\\",'"'],!0,!1),L=me("\\",!1),R={type:"any"},O=function(e,t){return e+t},B=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},M=me("'",!1),U=/^[^\\']/,V=ye(["\\","'"],!0,!1),q=/^[0-9]/,N=ye([["0","9"]],!1,!1),W=me("type(",!1),$=/^[^ )]/,G=ye([" ",")"],!0,!1),z=me(")",!1),K=/^[imsu]/,H=ye(["i","m","s","u"],!1,!1),Y=me("/",!1),J=/^[^\/]/,Q=ye(["/"],!0,!1),X=me(":not(",!1),Z=me(":matches(",!1),ee=me(":has(",!1),te=me(":first-child",!1),re=me(":last-child",!1),ne=me(":nth-child(",!1),se=me(":nth-last-child(",!1),oe=me(":",!1),ae=me("statement",!0),ie=me("expression",!0),le=me("declaration",!0),ue=me("function",!0),ce=me("pattern",!0),pe=0,fe=[{line:1,column:1}],he=0,de=[],xe={};if("startRule"in r){if(!(r.startRule in l))throw new Error("Can't start parsing from rule \""+r.startRule+'".');u=l[r.startRule]}function me(e,t){return{type:"literal",text:e,ignoreCase:t}}function ye(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function ge(e){var r,n=fe[e];if(n)return n;for(r=e-1;!fe[r];)r--;for(n={line:(n=fe[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return fe[e]=n,n}function ve(e,t){var r=ge(e),n=ge(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function Ae(e){pe<he||(pe>he&&(he=pe,de=[]),de.push(e))}function Ee(){var e,t,r,n,s=30*pe+0,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,(t=_e())!==i&&(r=Ce())!==i&&_e()!==i?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(pe=e,e=i),e===i&&(e=pe,(t=_e())!==i&&(t=void 0),e=t),xe[s]={nextPos:pe,result:e},e)}function _e(){var e,r,n=30*pe+1,s=xe[n];if(s)return pe=s.nextPos,s.result;for(e=[],32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c));r!==i;)e.push(r),32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c));return xe[n]={nextPos:pe,result:e},e}function be(){var e,r,n,s=30*pe+2,o=xe[s];if(o)return pe=o.nextPos,o.result;if(r=[],p.test(t.charAt(pe))?(n=t.charAt(pe),pe++):(n=i,Ae(f)),n!==i)for(;n!==i;)r.push(n),p.test(t.charAt(pe))?(n=t.charAt(pe),pe++):(n=i,Ae(f));else r=i;return r!==i&&(r=h(r)),e=r,xe[s]={nextPos:pe,result:e},e}function Se(){var e,r,n,s=30*pe+3,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,(r=_e())!==i?(62===t.charCodeAt(pe)?(n=">",pe++):(n=i,Ae(d)),n!==i&&_e()!==i?e=r="child":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=_e())!==i?(126===t.charCodeAt(pe)?(n="~",pe++):(n=i,Ae(x)),n!==i&&_e()!==i?e=r="sibling":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=_e())!==i?(43===t.charCodeAt(pe)?(n="+",pe++):(n=i,Ae(m)),n!==i&&_e()!==i?e=r="adjacent":(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,32===t.charCodeAt(pe)?(r=" ",pe++):(r=i,Ae(c)),r!==i&&(n=_e())!==i?e=r="descendant":(pe=e,e=i)))),xe[s]={nextPos:pe,result:e},e)}function Ce(){var e,r,n,s,o,a,l,u,c=30*pe+4,p=xe[c];if(p)return pe=p.nextPos,p.result;if(e=pe,(r=we())!==i){for(n=[],s=pe,(o=_e())!==i?(44===t.charCodeAt(pe)?(a=",",pe++):(a=i,Ae(y)),a!==i&&(l=_e())!==i&&(u=we())!==i?s=o=[o,a,l,u]:(pe=s,s=i)):(pe=s,s=i);s!==i;)n.push(s),s=pe,(o=_e())!==i?(44===t.charCodeAt(pe)?(a=",",pe++):(a=i,Ae(y)),a!==i&&(l=_e())!==i&&(u=we())!==i?s=o=[o,a,l,u]:(pe=s,s=i)):(pe=s,s=i);n!==i?e=r=[r].concat(n.map((function(e){return e[3]}))):(pe=e,e=i)}else pe=e,e=i;return xe[c]={nextPos:pe,result:e},e}function we(){var e,t,r,n,s,o,a,l=30*pe+5,u=xe[l];if(u)return pe=u.nextPos,u.result;if(e=pe,(t=Pe())!==i){for(r=[],n=pe,(s=Se())!==i&&(o=Pe())!==i?n=s=[s,o]:(pe=n,n=i);n!==i;)r.push(n),n=pe,(s=Se())!==i&&(o=Pe())!==i?n=s=[s,o]:(pe=n,n=i);r!==i?(a=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),a)):(pe=e,e=i)}else pe=e,e=i;return xe[l]={nextPos:pe,result:e},e}function Pe(){var e,r,n,s,o=30*pe+6,a=xe[o];if(a)return pe=a.nextPos,a.result;if(e=pe,33===t.charCodeAt(pe)?(r="!",pe++):(r=i,Ae(g)),r===i&&(r=null),r!==i){if(n=[],(s=ke())!==i)for(;s!==i;)n.push(s),s=ke();else n=i;n!==i?e=r=function(e,t){const r=1===t.length?t[0]:{type:"compound",selectors:t};return e&&(r.subject=!0),r}(r,n):(pe=e,e=i)}else pe=e,e=i;return xe[o]={nextPos:pe,result:e},e}function ke(){var e,r=30*pe+7,n=xe[r];return n?(pe=n.nextPos,n.result):((e=function(){var e,r,n=30*pe+8,s=xe[n];return s?(pe=s.nextPos,s.result):(42===t.charCodeAt(pe)?(r="*",pe++):(r=i,Ae(v)),r!==i&&(r={type:"wildcard",value:r}),e=r,xe[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s=30*pe+9,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,35===t.charCodeAt(pe)?(r="#",pe++):(r=i,Ae(A)),r===i&&(r=null),r!==i&&(n=be())!==i?e=r={type:"identifier",value:n}:(pe=e,e=i),xe[s]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s,o=30*pe+10,a=xe[o];return a?(pe=a.nextPos,a.result):(e=pe,91===t.charCodeAt(pe)?(r="[",pe++):(r=i,Ae(E)),r!==i&&_e()!==i&&(n=function(){var e,r,n,s,o=30*pe+14,a=xe[o];return a?(pe=a.nextPos,a.result):(e=pe,(r=De())!==i&&_e()!==i&&(n=function(){var e,r,n,s=30*pe+12,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,33===t.charCodeAt(pe)?(r="!",pe++):(r=i,Ae(g)),r===i&&(r=null),r!==i?(61===t.charCodeAt(pe)?(n="=",pe++):(n=i,Ae(C)),n!==i?(r=w(r),e=r):(pe=e,e=i)):(pe=e,e=i),xe[s]={nextPos:pe,result:e},e)}())!==i&&_e()!==i?((s=function(){var e,r,n,s,o,a=30*pe+18,l=xe[a];if(l)return pe=l.nextPos,l.result;if(e=pe,"type("===t.substr(pe,5)?(r="type(",pe+=5):(r=i,Ae(W)),r!==i)if(_e()!==i){if(n=[],$.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(G)),s!==i)for(;s!==i;)n.push(s),$.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(G));else n=i;n!==i&&(s=_e())!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(z)),o!==i?(r={type:"type",value:n.join("")},e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return xe[a]={nextPos:pe,result:e},e}())===i&&(s=function(){var e,r,n,s,o,a,l=30*pe+20,u=xe[l];if(u)return pe=u.nextPos,u.result;if(e=pe,47===t.charCodeAt(pe)?(r="/",pe++):(r=i,Ae(Y)),r!==i){if(n=[],J.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(Q)),s!==i)for(;s!==i;)n.push(s),J.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(Q));else n=i;n!==i?(47===t.charCodeAt(pe)?(s="/",pe++):(s=i,Ae(Y)),s!==i?((o=function(){var e,r,n=30*pe+19,s=xe[n];if(s)return pe=s.nextPos,s.result;if(e=[],K.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(H)),r!==i)for(;r!==i;)e.push(r),K.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(H));else e=i;return xe[n]={nextPos:pe,result:e},e}())===i&&(o=null),o!==i?(a=o,r={type:"regexp",value:new RegExp(n.join(""),a?a.join(""):"")},e=r):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;return xe[l]={nextPos:pe,result:e},e}()),s!==i?(r=I(r,n,s),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=De())!==i&&_e()!==i&&(n=function(){var e,r,n,s=30*pe+11,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,b.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,Ae(S)),r===i&&(r=null),r!==i?(61===t.charCodeAt(pe)?(n="=",pe++):(n=i,Ae(C)),n!==i?(r=w(r),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(P.test(t.charAt(pe))?(e=t.charAt(pe),pe++):(e=i,Ae(k))),xe[s]={nextPos:pe,result:e},e)}())!==i&&_e()!==i?((s=function(){var e,r,n,s,o,a,l=30*pe+15,u=xe[l];if(u)return pe=u.nextPos,u.result;if(e=pe,34===t.charCodeAt(pe)?(r='"',pe++):(r=i,Ae(j)),r!==i){for(n=[],F.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(T)),s===i&&(s=pe,92===t.charCodeAt(pe)?(o="\\",pe++):(o=i,Ae(L)),o!==i?(t.length>pe?(a=t.charAt(pe),pe++):(a=i,Ae(R)),a!==i?(o=O(o,a),s=o):(pe=s,s=i)):(pe=s,s=i));s!==i;)n.push(s),F.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(T)),s===i&&(s=pe,92===t.charCodeAt(pe)?(o="\\",pe++):(o=i,Ae(L)),o!==i?(t.length>pe?(a=t.charAt(pe),pe++):(a=i,Ae(R)),a!==i?(o=O(o,a),s=o):(pe=s,s=i)):(pe=s,s=i));n!==i?(34===t.charCodeAt(pe)?(s='"',pe++):(s=i,Ae(j)),s!==i?(r=B(n),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;if(e===i)if(e=pe,39===t.charCodeAt(pe)?(r="'",pe++):(r=i,Ae(M)),r!==i){for(n=[],U.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(V)),s===i&&(s=pe,92===t.charCodeAt(pe)?(o="\\",pe++):(o=i,Ae(L)),o!==i?(t.length>pe?(a=t.charAt(pe),pe++):(a=i,Ae(R)),a!==i?(o=O(o,a),s=o):(pe=s,s=i)):(pe=s,s=i));s!==i;)n.push(s),U.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(V)),s===i&&(s=pe,92===t.charCodeAt(pe)?(o="\\",pe++):(o=i,Ae(L)),o!==i?(t.length>pe?(a=t.charAt(pe),pe++):(a=i,Ae(R)),a!==i?(o=O(o,a),s=o):(pe=s,s=i)):(pe=s,s=i));n!==i?(39===t.charCodeAt(pe)?(s="'",pe++):(s=i,Ae(M)),s!==i?(r=B(n),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;return xe[l]={nextPos:pe,result:e},e}())===i&&(s=function(){var e,r,n,s,o=30*pe+16,a=xe[o];if(a)return pe=a.nextPos,a.result;for(e=pe,r=pe,n=[],q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N));s!==i;)n.push(s),q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N));if(n!==i?(46===t.charCodeAt(pe)?(s=".",pe++):(s=i,Ae(D)),s!==i?r=n=[n,s]:(pe=r,r=i)):(pe=r,r=i),r===i&&(r=null),r!==i){if(n=[],q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N)),s!==i)for(;s!==i;)n.push(s),q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N));else n=i;n!==i?(r=function(e,t){const r=e?[].concat.apply([],e).join(""):"";return{type:"literal",value:parseFloat(r+t.join(""))}}(r,n),e=r):(pe=e,e=i)}else pe=e,e=i;return xe[o]={nextPos:pe,result:e},e}())===i&&(s=function(){var e,t,r=30*pe+17,n=xe[r];return n?(pe=n.nextPos,n.result):((t=be())!==i&&(t={type:"literal",value:t}),e=t,xe[r]={nextPos:pe,result:e},e)}()),s!==i?(r=I(r,n,s),e=r):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=De())!==i&&(r={type:"attribute",name:r}),e=r)),xe[o]={nextPos:pe,result:e},e)}())!==i&&_e()!==i?(93===t.charCodeAt(pe)?(s="]",pe++):(s=i,Ae(_)),s!==i?e=r=n:(pe=e,e=i)):(pe=e,e=i),xe[o]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s,o,a,l,u,c=30*pe+21,p=xe[c];if(p)return pe=p.nextPos,p.result;if(e=pe,46===t.charCodeAt(pe)?(r=".",pe++):(r=i,Ae(D)),r!==i)if((n=be())!==i){for(s=[],o=pe,46===t.charCodeAt(pe)?(a=".",pe++):(a=i,Ae(D)),a!==i&&(l=be())!==i?o=a=[a,l]:(pe=o,o=i);o!==i;)s.push(o),o=pe,46===t.charCodeAt(pe)?(a=".",pe++):(a=i,Ae(D)),a!==i&&(l=be())!==i?o=a=[a,l]:(pe=o,o=i);s!==i?(u=n,r={type:"field",name:s.reduce((function(e,t){return e+t[0]+t[1]}),u)},e=r):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return xe[c]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,s,o=30*pe+22,a=xe[o];return a?(pe=a.nextPos,a.result):(e=pe,":not("===t.substr(pe,5)?(r=":not(",pe+=5):(r=i,Ae(X)),r!==i&&_e()!==i&&(n=Ce())!==i&&_e()!==i?(41===t.charCodeAt(pe)?(s=")",pe++):(s=i,Ae(z)),s!==i?e=r={type:"not",selectors:n}:(pe=e,e=i)):(pe=e,e=i),xe[o]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s,o=30*pe+23,a=xe[o];return a?(pe=a.nextPos,a.result):(e=pe,":matches("===t.substr(pe,9)?(r=":matches(",pe+=9):(r=i,Ae(Z)),r!==i&&_e()!==i&&(n=Ce())!==i&&_e()!==i?(41===t.charCodeAt(pe)?(s=")",pe++):(s=i,Ae(z)),s!==i?e=r={type:"matches",selectors:n}:(pe=e,e=i)):(pe=e,e=i),xe[o]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s,o=30*pe+24,a=xe[o];return a?(pe=a.nextPos,a.result):(e=pe,":has("===t.substr(pe,5)?(r=":has(",pe+=5):(r=i,Ae(ee)),r!==i&&_e()!==i&&(n=Ce())!==i&&_e()!==i?(41===t.charCodeAt(pe)?(s=")",pe++):(s=i,Ae(z)),s!==i?e=r={type:"has",selectors:n}:(pe=e,e=i)):(pe=e,e=i),xe[o]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n=30*pe+25,s=xe[n];return s?(pe=s.nextPos,s.result):(":first-child"===t.substr(pe,12)?(r=":first-child",pe+=12):(r=i,Ae(te)),r!==i&&(r=Ie(1)),e=r,xe[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n=30*pe+26,s=xe[n];return s?(pe=s.nextPos,s.result):(":last-child"===t.substr(pe,11)?(r=":last-child",pe+=11):(r=i,Ae(re)),r!==i&&(r=je(1)),e=r,xe[n]={nextPos:pe,result:e},e)}())===i&&(e=function(){var e,r,n,s,o,a=30*pe+27,l=xe[a];if(l)return pe=l.nextPos,l.result;if(e=pe,":nth-child("===t.substr(pe,11)?(r=":nth-child(",pe+=11):(r=i,Ae(ne)),r!==i)if(_e()!==i){if(n=[],q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N)),s!==i)for(;s!==i;)n.push(s),q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N));else n=i;n!==i&&(s=_e())!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(z)),o!==i?(r=Ie(parseInt(n.join(""),10)),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return xe[a]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,s,o,a=30*pe+28,l=xe[a];if(l)return pe=l.nextPos,l.result;if(e=pe,":nth-last-child("===t.substr(pe,16)?(r=":nth-last-child(",pe+=16):(r=i,Ae(se)),r!==i)if(_e()!==i){if(n=[],q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N)),s!==i)for(;s!==i;)n.push(s),q.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,Ae(N));else n=i;n!==i&&(s=_e())!==i?(41===t.charCodeAt(pe)?(o=")",pe++):(o=i,Ae(z)),o!==i?(r=je(parseInt(n.join(""),10)),e=r):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i;return xe[a]={nextPos:pe,result:e},e}())===i&&(e=function(){var e,r,n,s=30*pe+29,o=xe[s];return o?(pe=o.nextPos,o.result):(e=pe,58===t.charCodeAt(pe)?(r=":",pe++):(r=i,Ae(oe)),r!==i?("statement"===t.substr(pe,9).toLowerCase()?(n=t.substr(pe,9),pe+=9):(n=i,Ae(ae)),n===i&&("expression"===t.substr(pe,10).toLowerCase()?(n=t.substr(pe,10),pe+=10):(n=i,Ae(ie)),n===i&&("declaration"===t.substr(pe,11).toLowerCase()?(n=t.substr(pe,11),pe+=11):(n=i,Ae(le)),n===i&&("function"===t.substr(pe,8).toLowerCase()?(n=t.substr(pe,8),pe+=8):(n=i,Ae(ue)),n===i&&("pattern"===t.substr(pe,7).toLowerCase()?(n=t.substr(pe,7),pe+=7):(n=i,Ae(ce)))))),n!==i?e=r={type:"class",name:n}:(pe=e,e=i)):(pe=e,e=i),xe[s]={nextPos:pe,result:e},e)}()),xe[r]={nextPos:pe,result:e},e)}function De(){var e,r,n,s=30*pe+13,o=xe[s];if(o)return pe=o.nextPos,o.result;if(r=[],(n=be())===i&&(46===t.charCodeAt(pe)?(n=".",pe++):(n=i,Ae(D))),n!==i)for(;n!==i;)r.push(n),(n=be())===i&&(46===t.charCodeAt(pe)?(n=".",pe++):(n=i,Ae(D)));else r=i;return r!==i&&(r=h(r)),e=r,xe[s]={nextPos:pe,result:e},e}function Ie(e){return{type:"nth-child",index:{type:"literal",value:e}}}function je(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=u())!==i&&pe===t.length)return n;throw n!==i&&pe<t.length&&Ae({type:"end"}),s=de,o=he<t.length?t.charAt(he):null,a=he<t.length?ve(he,he+1):ve(he,he),new e(e.buildMessage(s,o),s,o,a)}}}())}));function n(e,r,i){if(!r)return!0;if(!e)return!1;switch(i||(i=[]),r.type){case"wildcard":return!0;case"identifier":return r.value.toLowerCase()===e.type.toLowerCase();case"field":{const t=r.name.split(".");return function e(t,r,n){if(0===n.length)return t===r;if(null==r)return!1;const s=r[n[0]],o=n.slice(1);if(Array.isArray(s)){for(let r=0,n=s.length;r<n;++r)if(e(t,s[r],o))return!0;return!1}return e(t,s,o)}(e,i[t.length-1],t)}case"matches":for(let t=0,s=r.selectors.length;t<s;++t)if(n(e,r.selectors[t],i))return!0;return!1;case"compound":for(let t=0,s=r.selectors.length;t<s;++t)if(!n(e,r.selectors[t],i))return!1;return!0;case"not":for(let t=0,s=r.selectors.length;t<s;++t)if(n(e,r.selectors[t],i))return!1;return!0;case"has":{const s=[];for(let o=0,a=r.selectors.length;o<a;++o){const a=[];t.traverse(e,{enter(e,t){null!=t&&a.unshift(t),n(e,r.selectors[o],a)&&s.push(e)},leave(){a.shift()},fallback:"iteration"})}return 0!==s.length}case"child":return!!n(e,r.right,i)&&n(i[0],r.left,i.slice(1));case"descendant":if(n(e,r.right,i))for(let e=0,t=i.length;e<t;++e)if(n(i[e],r.left,i.slice(e+1)))return!0;return!1;case"attribute":{const t=function(e,t){const r=t.split(".");for(let t=0;t<r.length;t++){if(null==e)return e;e=e[r[t]]}return e}(e,r.name);switch(r.operator){case void 0:return null!=t;case"=":switch(r.value.type){case"regexp":return"string"==typeof t&&r.value.value.test(t);case"literal":return`${r.value.value}`===`${t}`;case"type":return r.value.value===typeof t}throw new Error(`Unknown selector value type: ${r.value.type}`);case"!=":switch(r.value.type){case"regexp":return!r.value.value.test(t);case"literal":return`${r.value.value}`!==`${t}`;case"type":return r.value.value!==typeof t}throw new Error(`Unknown selector value type: ${r.value.type}`);case"<=":return t<=r.value.value;case"<":return t<r.value.value;case">":return t>r.value.value;case">=":return t>=r.value.value}throw new Error(`Unknown operator: ${r.operator}`)}case"sibling":return n(e,r.right,i)&&s(e,r.left,i,"LEFT_SIDE")||r.left.subject&&n(e,r.left,i)&&s(e,r.right,i,"RIGHT_SIDE");case"adjacent":return n(e,r.right,i)&&o(e,r.left,i,"LEFT_SIDE")||r.right.subject&&n(e,r.left,i)&&o(e,r.right,i,"RIGHT_SIDE");case"nth-child":return n(e,r.right,i)&&a(e,i,(function(){return r.index.value-1}));case"nth-last-child":return n(e,r.right,i)&&a(e,i,(function(e){return e-r.index.value}));case"class":switch(r.name.toLowerCase()){case"statement":if("Statement"===e.type.slice(-9))return!0;case"declaration":return"Declaration"===e.type.slice(-11);case"pattern":if("Pattern"===e.type.slice(-7))return!0;case"expression":return"Expression"===e.type.slice(-10)||"Literal"===e.type.slice(-7)||"Identifier"===e.type&&(0===i.length||"MetaProperty"!==i[0].type)||"MetaProperty"===e.type;case"function":return"FunctionDeclaration"===e.type||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type}throw new Error(`Unknown class name: ${r.name}`)}throw new Error(`Unknown selector type: ${r.type}`)}function s(e,r,s,o){const[a]=s;if(!a)return!1;const i=t.VisitorKeys[a.type];for(let t=0,l=i.length;t<l;++t){const l=a[i[t]];if(Array.isArray(l)){const t=l.indexOf(e);if(t<0)continue;let a,i;"LEFT_SIDE"===o?(a=0,i=t):(a=t+1,i=l.length);for(let e=a;e<i;++e)if(n(l[e],r,s))return!0}}return!1}function o(e,r,s,o){const[a]=s;if(!a)return!1;const i=t.VisitorKeys[a.type];for(let t=0,l=i.length;t<l;++t){const l=a[i[t]];if(Array.isArray(l)){const t=l.indexOf(e);if(t<0)continue;if("LEFT_SIDE"===o&&t>0&&n(l[t-1],r,s))return!0;if("RIGHT_SIDE"===o&&t<l.length-1&&n(l[t+1],r,s))return!0}}return!1}function a(e,r,n){const[s]=r;if(!s)return!1;const o=t.VisitorKeys[s.type];for(let t=0,r=o.length;t<r;++t){const r=s[o[t]];if(Array.isArray(r)){const t=r.indexOf(e);if(t>=0&&t===n(r.length))return!0}}return!1}function i(e,r){const s=[],o=[];if(!r)return o;const a=function e(t,r){if(null==t||"object"!=typeof t)return[];null==r&&(r=t);const n=t.subject?[r]:[];for(const[s,o]of Object.entries(t))n.push(...e(o,"left"===s?o:r));return n}(r);return t.traverse(e,{enter(e,t){if(null!=t&&s.unshift(t),n(e,r,s))if(a.length)for(let t=0,r=a.length;t<r;++t){n(e,a[t],s)&&o.push(e);for(let e=0,r=s.length;e<r;++e)n(s[e],a[t],s.slice(e+1))&&o.push(s[e])}else o.push(e)},leave(){s.shift()},fallback:"iteration"}),o}function l(e){return r.parse(e)}function u(e,t){return i(e,l(t))}return u.parse=l,u.match=i,u.matches=n,u.query=u,u}));
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).esquery=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var s,i=e[Symbol.iterator]();!(n=(s=i.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return r}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function a(e,t){return e(t={exports:{}},t.exports),t.exports}var s=a((function(e,t){!function e(t){var r,n,o,a,s,i;function l(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?l(r):r);return n}function u(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function f(){}function p(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function d(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return!0;return!1}function y(e,t){return(new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},o={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:s={},Remove:i={}},u.prototype.replace=function(e){this.parent[this.key]=e},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},f.prototype.path=function(){var e,t,r,n,o;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r<n;++r)e.push(t[r]);else e.push(t)}if(!this.__current.path)return null;for(o=[],e=2,t=this.__leavelist.length;e<t;++e)a(o,this.__leavelist[e].path);return a(o,this.__current.path),o},f.prototype.type=function(){return this.current().type||this.__current.wrap},f.prototype.parents=function(){var e,t,r;for(r=[],e=1,t=this.__leavelist.length;e<t;++e)r.push(this.__leavelist[e].node);return r},f.prototype.current=function(){return this.__current.node},f.prototype.__execute=function(e,t){var r,n;return n=void 0,r=this.__current,this.__current=t,this.__state=null,e&&(n=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=r,n},f.prototype.notify=function(e){this.__state=e},f.prototype.skip=function(){this.notify(s)},f.prototype.break=function(){this.notify(a)},f.prototype.remove=function(){this.notify(i)},f.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,"iteration"===t.fallback?this.__fallback=Object.keys:"function"==typeof t.fallback&&(this.__fallback=t.fallback),this.__keys=o,t.keys&&(this.__keys=Object.assign(Object.create(this.__keys),t.keys))},f.prototype.traverse=function(e,t){var r,n,o,i,l,u,f,y,m,x,g,v;for(this.__initialize(e,t),v={},r=this.__worklist,n=this.__leavelist,r.push(new c(e,null,null,null)),n.push(new c(null,null,null,null));r.length;)if((o=r.pop())!==v){if(o.node){if(u=this.__execute(t.enter,o),this.__state===a||u===a)return;if(r.push(v),n.push(o),this.__state===s||u===s)continue;if(l=(i=o.node).type||o.wrap,!(x=this.__keys[l])){if(!this.__fallback)throw new Error("Unknown node type "+l+".");x=this.__fallback(i)}for(y=x.length;(y-=1)>=0;)if(g=i[f=x[y]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]&&!d(n,g[m])){if(h(l,x[y]))o=new c(g[m],[f,m],"Property",null);else{if(!p(g[m]))continue;o=new c(g[m],[f,m],null,null)}r.push(o)}}else if(p(g)){if(d(n,g))continue;r.push(new c(g,f,null,null))}}}else if(o=n.pop(),u=this.__execute(t.leave,o),this.__state===a||u===a)return},f.prototype.replace=function(e,t){var r,n,o,l,f,d,y,m,x,g,v,A,b;function E(e){var t,n,o,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((o=r[t]).ref&&o.ref.parent===a){if(o.ref.key<n)break;--o.ref.key}}for(this.__initialize(e,t),v={},r=this.__worklist,n=this.__leavelist,d=new c(e,null,null,new u(A={root:e},"root")),r.push(d),n.push(d);r.length;)if((d=r.pop())!==v){if(void 0!==(f=this.__execute(t.enter,d))&&f!==a&&f!==s&&f!==i&&(d.ref.replace(f),d.node=f),this.__state!==i&&f!==i||(E(d),d.node=null),this.__state===a||f===a)return A.root;if((o=d.node)&&(r.push(v),n.push(d),this.__state!==s&&f!==s)){if(l=o.type||d.wrap,!(x=this.__keys[l])){if(!this.__fallback)throw new Error("Unknown node type "+l+".");x=this.__fallback(o)}for(y=x.length;(y-=1)>=0;)if(g=o[b=x[y]])if(Array.isArray(g)){for(m=g.length;(m-=1)>=0;)if(g[m]){if(h(l,x[y]))d=new c(g[m],[b,m],"Property",new u(g,m));else{if(!p(g[m]))continue;d=new c(g[m],[b,m],null,new u(g,m))}r.push(d)}}else p(g)&&r.push(new c(g,b,null,new u(o,b)))}}else if(d=n.pop(),void 0!==(f=this.__execute(t.leave,d))&&f!==a&&f!==s&&f!==i&&d.ref.replace(f),this.__state!==i&&f!==i||E(d),this.__state===a||f===a)return A.root;return A.root},t.Syntax=r,t.traverse=y,t.replace=function(e,t){return(new f).replace(e,t)},t.attachComments=function(e,t,r){var o,a,s,i,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(s=0,a=t.length;s<a;s+=1)(o=l(t[s])).extendedRange=[0,e.range[0]],u.push(o);e.leadingComments=u}return e}for(s=0,a=t.length;s<a;s+=1)u.push(m(l(t[s]),r));return i=0,y(e,{enter:function(e){for(var t;i<u.length&&!((t=u[i]).extendedRange[1]>e.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(i,1)):i+=1;return i===u.length?n.Break:u[i].extendedRange[0]>e.range[1]?n.Skip:void 0}}),i=0,y(e,{leave:function(e){for(var t;i<u.length&&(t=u[i],!(e.range[1]<t.extendedRange[0]));)e.range[1]===t.extendedRange[0]?(e.trailingComments||(e.trailingComments=[]),e.trailingComments.push(t),u.splice(i,1)):i+=1;return i===u.length?n.Break:u[i].extendedRange[0]>e.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=o,t.VisitorOption=n,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t)})),i=a((function(e){e.exports&&(e.exports=function(){function e(t,r,n,o){this.message=t,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?a(e.parts[t][0])+"-"+a(e.parts[t][1]):a(e.parts[t]);return"["+(e.inverted?"^":"")+r+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function a(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}return"Expected "+function(e){var t,n,o,a=new Array(e.length);for(t=0;t<e.length;t++)a[t]=(o=e[t],r[o.type](o));if(a.sort(),a.length>0){for(t=1,n=1;t<a.length;t++)a[t-1]!==a[t]&&(a[n]=a[t],n++);a.length=n}switch(a.length){case 1:return a[0];case 2:return a[0]+" or "+a[1];default:return a.slice(0,-1).join(", ")+", or "+a[a.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){r=void 0!==r?r:{};var n,o,a,s,i={},l={start:be},u=be,c=me(" ",!1),f=/^[^ [\],():#!=><~+.]/,p=xe([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=function(e){return e.join("")},d=me(">",!1),y=me("~",!1),m=me("+",!1),x=me(",",!1),g=me("!",!1),v=me("*",!1),A=me("#",!1),b=me("[",!1),E=me("]",!1),S=/^[><!]/,_=xe([">","<","!"],!1,!1),w=me("=",!1),C=function(e){return(e||"")+"="},P=/^[><]/,k=xe([">","<"],!1,!1),D=me(".",!1),I=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=me('"',!1),F=/^[^\\"]/,T=xe(["\\",'"'],!0,!1),L=me("\\",!1),R={type:"any"},O=function(e,t){return e+t},B=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},M=me("'",!1),U=/^[^\\']/,V=xe(["\\","'"],!0,!1),q=/^[0-9]/,N=xe([["0","9"]],!1,!1),W=me("type(",!1),G=/^[^ )]/,z=xe([" ",")"],!0,!1),K=me(")",!1),H=/^[imsu]/,Y=xe(["i","m","s","u"],!1,!1),$=me("/",!1),J=/^[^\/]/,Q=xe(["/"],!0,!1),X=me(":not(",!1),Z=me(":matches(",!1),ee=me(":has(",!1),te=me(":first-child",!1),re=me(":last-child",!1),ne=me(":nth-child(",!1),oe=me(":nth-last-child(",!1),ae=me(":",!1),se=me("statement",!0),ie=me("expression",!0),le=me("declaration",!0),ue=me("function",!0),ce=me("pattern",!0),fe=0,pe=[{line:1,column:1}],he=0,de=[],ye={};if("startRule"in r){if(!(r.startRule in l))throw new Error("Can't start parsing from rule \""+r.startRule+'".');u=l[r.startRule]}function me(e,t){return{type:"literal",text:e,ignoreCase:t}}function xe(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function ge(e){var r,n=pe[e];if(n)return n;for(r=e-1;!pe[r];)r--;for(n={line:(n=pe[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return pe[e]=n,n}function ve(e,t){var r=ge(e),n=ge(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function Ae(e){fe<he||(fe>he&&(he=fe,de=[]),de.push(e))}function be(){var e,t,r,n,o=30*fe+0,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,(t=Ee())!==i&&(r=we())!==i&&Ee()!==i?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(fe=e,e=i),e===i&&(e=fe,(t=Ee())!==i&&(t=void 0),e=t),ye[o]={nextPos:fe,result:e},e)}function Ee(){var e,r,n=30*fe+1,o=ye[n];if(o)return fe=o.nextPos,o.result;for(e=[],32===t.charCodeAt(fe)?(r=" ",fe++):(r=i,Ae(c));r!==i;)e.push(r),32===t.charCodeAt(fe)?(r=" ",fe++):(r=i,Ae(c));return ye[n]={nextPos:fe,result:e},e}function Se(){var e,r,n,o=30*fe+2,a=ye[o];if(a)return fe=a.nextPos,a.result;if(r=[],f.test(t.charAt(fe))?(n=t.charAt(fe),fe++):(n=i,Ae(p)),n!==i)for(;n!==i;)r.push(n),f.test(t.charAt(fe))?(n=t.charAt(fe),fe++):(n=i,Ae(p));else r=i;return r!==i&&(r=h(r)),e=r,ye[o]={nextPos:fe,result:e},e}function _e(){var e,r,n,o=30*fe+3,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,(r=Ee())!==i?(62===t.charCodeAt(fe)?(n=">",fe++):(n=i,Ae(d)),n!==i&&Ee()!==i?e=r="child":(fe=e,e=i)):(fe=e,e=i),e===i&&(e=fe,(r=Ee())!==i?(126===t.charCodeAt(fe)?(n="~",fe++):(n=i,Ae(y)),n!==i&&Ee()!==i?e=r="sibling":(fe=e,e=i)):(fe=e,e=i),e===i&&(e=fe,(r=Ee())!==i?(43===t.charCodeAt(fe)?(n="+",fe++):(n=i,Ae(m)),n!==i&&Ee()!==i?e=r="adjacent":(fe=e,e=i)):(fe=e,e=i),e===i&&(e=fe,32===t.charCodeAt(fe)?(r=" ",fe++):(r=i,Ae(c)),r!==i&&(n=Ee())!==i?e=r="descendant":(fe=e,e=i)))),ye[o]={nextPos:fe,result:e},e)}function we(){var e,r,n,o,a,s,l,u,c=30*fe+4,f=ye[c];if(f)return fe=f.nextPos,f.result;if(e=fe,(r=Ce())!==i){for(n=[],o=fe,(a=Ee())!==i?(44===t.charCodeAt(fe)?(s=",",fe++):(s=i,Ae(x)),s!==i&&(l=Ee())!==i&&(u=Ce())!==i?o=a=[a,s,l,u]:(fe=o,o=i)):(fe=o,o=i);o!==i;)n.push(o),o=fe,(a=Ee())!==i?(44===t.charCodeAt(fe)?(s=",",fe++):(s=i,Ae(x)),s!==i&&(l=Ee())!==i&&(u=Ce())!==i?o=a=[a,s,l,u]:(fe=o,o=i)):(fe=o,o=i);n!==i?e=r=[r].concat(n.map((function(e){return e[3]}))):(fe=e,e=i)}else fe=e,e=i;return ye[c]={nextPos:fe,result:e},e}function Ce(){var e,t,r,n,o,a,s,l=30*fe+5,u=ye[l];if(u)return fe=u.nextPos,u.result;if(e=fe,(t=Pe())!==i){for(r=[],n=fe,(o=_e())!==i&&(a=Pe())!==i?n=o=[o,a]:(fe=n,n=i);n!==i;)r.push(n),n=fe,(o=_e())!==i&&(a=Pe())!==i?n=o=[o,a]:(fe=n,n=i);r!==i?(s=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),s)):(fe=e,e=i)}else fe=e,e=i;return ye[l]={nextPos:fe,result:e},e}function Pe(){var e,r,n,o,a,s,l,u=30*fe+6,c=ye[u];if(c)return fe=c.nextPos,c.result;if(e=fe,33===t.charCodeAt(fe)?(r="!",fe++):(r=i,Ae(g)),r===i&&(r=null),r!==i){if(n=[],(o=ke())!==i)for(;o!==i;)n.push(o),o=ke();else n=i;n!==i?(a=r,l=1===(s=n).length?s[0]:{type:"compound",selectors:s},a&&(l.subject=!0),e=r=l):(fe=e,e=i)}else fe=e,e=i;return ye[u]={nextPos:fe,result:e},e}function ke(){var e,r=30*fe+7,n=ye[r];return n?(fe=n.nextPos,n.result):((e=function(){var e,r,n=30*fe+8,o=ye[n];return o?(fe=o.nextPos,o.result):(42===t.charCodeAt(fe)?(r="*",fe++):(r=i,Ae(v)),r!==i&&(r={type:"wildcard",value:r}),e=r,ye[n]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o=30*fe+9,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,35===t.charCodeAt(fe)?(r="#",fe++):(r=i,Ae(A)),r===i&&(r=null),r!==i&&(n=Se())!==i?e=r={type:"identifier",value:n}:(fe=e,e=i),ye[o]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*fe+10,s=ye[a];return s?(fe=s.nextPos,s.result):(e=fe,91===t.charCodeAt(fe)?(r="[",fe++):(r=i,Ae(b)),r!==i&&Ee()!==i&&(n=function(){var e,r,n,o,a=30*fe+14,s=ye[a];return s?(fe=s.nextPos,s.result):(e=fe,(r=De())!==i&&Ee()!==i&&(n=function(){var e,r,n,o=30*fe+12,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,33===t.charCodeAt(fe)?(r="!",fe++):(r=i,Ae(g)),r===i&&(r=null),r!==i?(61===t.charCodeAt(fe)?(n="=",fe++):(n=i,Ae(w)),n!==i?(r=C(r),e=r):(fe=e,e=i)):(fe=e,e=i),ye[o]={nextPos:fe,result:e},e)}())!==i&&Ee()!==i?((o=function(){var e,r,n,o,a,s=30*fe+18,l=ye[s];if(l)return fe=l.nextPos,l.result;if(e=fe,"type("===t.substr(fe,5)?(r="type(",fe+=5):(r=i,Ae(W)),r!==i)if(Ee()!==i){if(n=[],G.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(z)),o!==i)for(;o!==i;)n.push(o),G.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(z));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(fe)?(a=")",fe++):(a=i,Ae(K)),a!==i?(r={type:"type",value:n.join("")},e=r):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;else fe=e,e=i;return ye[s]={nextPos:fe,result:e},e}())===i&&(o=function(){var e,r,n,o,a,s,l=30*fe+20,u=ye[l];if(u)return fe=u.nextPos,u.result;if(e=fe,47===t.charCodeAt(fe)?(r="/",fe++):(r=i,Ae($)),r!==i){if(n=[],J.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(Q)),o!==i)for(;o!==i;)n.push(o),J.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(Q));else n=i;n!==i?(47===t.charCodeAt(fe)?(o="/",fe++):(o=i,Ae($)),o!==i?((a=function(){var e,r,n=30*fe+19,o=ye[n];if(o)return fe=o.nextPos,o.result;if(e=[],H.test(t.charAt(fe))?(r=t.charAt(fe),fe++):(r=i,Ae(Y)),r!==i)for(;r!==i;)e.push(r),H.test(t.charAt(fe))?(r=t.charAt(fe),fe++):(r=i,Ae(Y));else e=i;return ye[n]={nextPos:fe,result:e},e}())===i&&(a=null),a!==i?(s=a,r={type:"regexp",value:new RegExp(n.join(""),s?s.join(""):"")},e=r):(fe=e,e=i)):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;return ye[l]={nextPos:fe,result:e},e}()),o!==i?(r=I(r,n,o),e=r):(fe=e,e=i)):(fe=e,e=i),e===i&&(e=fe,(r=De())!==i&&Ee()!==i&&(n=function(){var e,r,n,o=30*fe+11,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,S.test(t.charAt(fe))?(r=t.charAt(fe),fe++):(r=i,Ae(_)),r===i&&(r=null),r!==i?(61===t.charCodeAt(fe)?(n="=",fe++):(n=i,Ae(w)),n!==i?(r=C(r),e=r):(fe=e,e=i)):(fe=e,e=i),e===i&&(P.test(t.charAt(fe))?(e=t.charAt(fe),fe++):(e=i,Ae(k))),ye[o]={nextPos:fe,result:e},e)}())!==i&&Ee()!==i?((o=function(){var e,r,n,o,a,s,l=30*fe+15,u=ye[l];if(u)return fe=u.nextPos,u.result;if(e=fe,34===t.charCodeAt(fe)?(r='"',fe++):(r=i,Ae(j)),r!==i){for(n=[],F.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(T)),o===i&&(o=fe,92===t.charCodeAt(fe)?(a="\\",fe++):(a=i,Ae(L)),a!==i?(t.length>fe?(s=t.charAt(fe),fe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(fe=o,o=i)):(fe=o,o=i));o!==i;)n.push(o),F.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(T)),o===i&&(o=fe,92===t.charCodeAt(fe)?(a="\\",fe++):(a=i,Ae(L)),a!==i?(t.length>fe?(s=t.charAt(fe),fe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(fe=o,o=i)):(fe=o,o=i));n!==i?(34===t.charCodeAt(fe)?(o='"',fe++):(o=i,Ae(j)),o!==i?(r=B(n),e=r):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;if(e===i)if(e=fe,39===t.charCodeAt(fe)?(r="'",fe++):(r=i,Ae(M)),r!==i){for(n=[],U.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(V)),o===i&&(o=fe,92===t.charCodeAt(fe)?(a="\\",fe++):(a=i,Ae(L)),a!==i?(t.length>fe?(s=t.charAt(fe),fe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(fe=o,o=i)):(fe=o,o=i));o!==i;)n.push(o),U.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(V)),o===i&&(o=fe,92===t.charCodeAt(fe)?(a="\\",fe++):(a=i,Ae(L)),a!==i?(t.length>fe?(s=t.charAt(fe),fe++):(s=i,Ae(R)),s!==i?(a=O(a,s),o=a):(fe=o,o=i)):(fe=o,o=i));n!==i?(39===t.charCodeAt(fe)?(o="'",fe++):(o=i,Ae(M)),o!==i?(r=B(n),e=r):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;return ye[l]={nextPos:fe,result:e},e}())===i&&(o=function(){var e,r,n,o,a,s,l,u=30*fe+16,c=ye[u];if(c)return fe=c.nextPos,c.result;for(e=fe,r=fe,n=[],q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N));o!==i;)n.push(o),q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N));if(n!==i?(46===t.charCodeAt(fe)?(o=".",fe++):(o=i,Ae(D)),o!==i?r=n=[n,o]:(fe=r,r=i)):(fe=r,r=i),r===i&&(r=null),r!==i){if(n=[],q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N));else n=i;n!==i?(s=n,l=(a=r)?[].concat.apply([],a).join(""):"",r={type:"literal",value:parseFloat(l+s.join(""))},e=r):(fe=e,e=i)}else fe=e,e=i;return ye[u]={nextPos:fe,result:e},e}())===i&&(o=function(){var e,t,r=30*fe+17,n=ye[r];return n?(fe=n.nextPos,n.result):((t=Se())!==i&&(t={type:"literal",value:t}),e=t,ye[r]={nextPos:fe,result:e},e)}()),o!==i?(r=I(r,n,o),e=r):(fe=e,e=i)):(fe=e,e=i),e===i&&(e=fe,(r=De())!==i&&(r={type:"attribute",name:r}),e=r)),ye[a]={nextPos:fe,result:e},e)}())!==i&&Ee()!==i?(93===t.charCodeAt(fe)?(o="]",fe++):(o=i,Ae(E)),o!==i?e=r=n:(fe=e,e=i)):(fe=e,e=i),ye[a]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a,s,l,u,c=30*fe+21,f=ye[c];if(f)return fe=f.nextPos,f.result;if(e=fe,46===t.charCodeAt(fe)?(r=".",fe++):(r=i,Ae(D)),r!==i)if((n=Se())!==i){for(o=[],a=fe,46===t.charCodeAt(fe)?(s=".",fe++):(s=i,Ae(D)),s!==i&&(l=Se())!==i?a=s=[s,l]:(fe=a,a=i);a!==i;)o.push(a),a=fe,46===t.charCodeAt(fe)?(s=".",fe++):(s=i,Ae(D)),s!==i&&(l=Se())!==i?a=s=[s,l]:(fe=a,a=i);o!==i?(u=n,r={type:"field",name:o.reduce((function(e,t){return e+t[0]+t[1]}),u)},e=r):(fe=e,e=i)}else fe=e,e=i;else fe=e,e=i;return ye[c]={nextPos:fe,result:e},e}())===i&&(e=function(){var e,r,n,o,a=30*fe+22,s=ye[a];return s?(fe=s.nextPos,s.result):(e=fe,":not("===t.substr(fe,5)?(r=":not(",fe+=5):(r=i,Ae(X)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(fe)?(o=")",fe++):(o=i,Ae(K)),o!==i?e=r={type:"not",selectors:n}:(fe=e,e=i)):(fe=e,e=i),ye[a]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*fe+23,s=ye[a];return s?(fe=s.nextPos,s.result):(e=fe,":matches("===t.substr(fe,9)?(r=":matches(",fe+=9):(r=i,Ae(Z)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(fe)?(o=")",fe++):(o=i,Ae(K)),o!==i?e=r={type:"matches",selectors:n}:(fe=e,e=i)):(fe=e,e=i),ye[a]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a=30*fe+24,s=ye[a];return s?(fe=s.nextPos,s.result):(e=fe,":has("===t.substr(fe,5)?(r=":has(",fe+=5):(r=i,Ae(ee)),r!==i&&Ee()!==i&&(n=we())!==i&&Ee()!==i?(41===t.charCodeAt(fe)?(o=")",fe++):(o=i,Ae(K)),o!==i?e=r={type:"has",selectors:n}:(fe=e,e=i)):(fe=e,e=i),ye[a]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n=30*fe+25,o=ye[n];return o?(fe=o.nextPos,o.result):(":first-child"===t.substr(fe,12)?(r=":first-child",fe+=12):(r=i,Ae(te)),r!==i&&(r=Ie(1)),e=r,ye[n]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n=30*fe+26,o=ye[n];return o?(fe=o.nextPos,o.result):(":last-child"===t.substr(fe,11)?(r=":last-child",fe+=11):(r=i,Ae(re)),r!==i&&(r=je(1)),e=r,ye[n]={nextPos:fe,result:e},e)}())===i&&(e=function(){var e,r,n,o,a,s=30*fe+27,l=ye[s];if(l)return fe=l.nextPos,l.result;if(e=fe,":nth-child("===t.substr(fe,11)?(r=":nth-child(",fe+=11):(r=i,Ae(ne)),r!==i)if(Ee()!==i){if(n=[],q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(fe)?(a=")",fe++):(a=i,Ae(K)),a!==i?(r=Ie(parseInt(n.join(""),10)),e=r):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;else fe=e,e=i;return ye[s]={nextPos:fe,result:e},e}())===i&&(e=function(){var e,r,n,o,a,s=30*fe+28,l=ye[s];if(l)return fe=l.nextPos,l.result;if(e=fe,":nth-last-child("===t.substr(fe,16)?(r=":nth-last-child(",fe+=16):(r=i,Ae(oe)),r!==i)if(Ee()!==i){if(n=[],q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N)),o!==i)for(;o!==i;)n.push(o),q.test(t.charAt(fe))?(o=t.charAt(fe),fe++):(o=i,Ae(N));else n=i;n!==i&&(o=Ee())!==i?(41===t.charCodeAt(fe)?(a=")",fe++):(a=i,Ae(K)),a!==i?(r=je(parseInt(n.join(""),10)),e=r):(fe=e,e=i)):(fe=e,e=i)}else fe=e,e=i;else fe=e,e=i;return ye[s]={nextPos:fe,result:e},e}())===i&&(e=function(){var e,r,n,o=30*fe+29,a=ye[o];return a?(fe=a.nextPos,a.result):(e=fe,58===t.charCodeAt(fe)?(r=":",fe++):(r=i,Ae(ae)),r!==i?("statement"===t.substr(fe,9).toLowerCase()?(n=t.substr(fe,9),fe+=9):(n=i,Ae(se)),n===i&&("expression"===t.substr(fe,10).toLowerCase()?(n=t.substr(fe,10),fe+=10):(n=i,Ae(ie)),n===i&&("declaration"===t.substr(fe,11).toLowerCase()?(n=t.substr(fe,11),fe+=11):(n=i,Ae(le)),n===i&&("function"===t.substr(fe,8).toLowerCase()?(n=t.substr(fe,8),fe+=8):(n=i,Ae(ue)),n===i&&("pattern"===t.substr(fe,7).toLowerCase()?(n=t.substr(fe,7),fe+=7):(n=i,Ae(ce)))))),n!==i?e=r={type:"class",name:n}:(fe=e,e=i)):(fe=e,e=i),ye[o]={nextPos:fe,result:e},e)}()),ye[r]={nextPos:fe,result:e},e)}function De(){var e,r,n,o=30*fe+13,a=ye[o];if(a)return fe=a.nextPos,a.result;if(r=[],(n=Se())===i&&(46===t.charCodeAt(fe)?(n=".",fe++):(n=i,Ae(D))),n!==i)for(;n!==i;)r.push(n),(n=Se())===i&&(46===t.charCodeAt(fe)?(n=".",fe++):(n=i,Ae(D)));else r=i;return r!==i&&(r=h(r)),e=r,ye[o]={nextPos:fe,result:e},e}function Ie(e){return{type:"nth-child",index:{type:"literal",value:e}}}function je(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=u())!==i&&fe===t.length)return n;throw n!==i&&fe<t.length&&Ae({type:"end"}),o=de,a=he<t.length?t.charAt(he):null,s=he<t.length?ve(he,he+1):ve(he,he),new e(e.buildMessage(o,a),o,a,s)}}}())}));function l(t,r,n){if(!r)return!0;if(!t)return!1;switch(n||(n=[]),r.type){case"wildcard":return!0;case"identifier":return r.value.toLowerCase()===t.type.toLowerCase();case"field":var o=r.name.split("."),a=n[o.length-1];return function e(t,r,n){if(0===n.length)return t===r;if(null==r)return!1;var o=r[n[0]],a=n.slice(1);if(Array.isArray(o)){for(var s=0,i=o.length;s<i;++s)if(e(t,o[s],a))return!0;return!1}return e(t,o,a)}(t,a,o);case"matches":for(var i=0,p=r.selectors.length;i<p;++i)if(l(t,r.selectors[i],n))return!0;return!1;case"compound":for(var h=0,d=r.selectors.length;h<d;++h)if(!l(t,r.selectors[h],n))return!1;return!0;case"not":for(var y=0,m=r.selectors.length;y<m;++y)if(l(t,r.selectors[y],n))return!1;return!0;case"has":var x=function(){for(var e=[],n=function(n,o){var a=[];s.traverse(t,{enter:function(t,o){null!=o&&a.unshift(o),l(t,r.selectors[n],a)&&e.push(t)},leave:function(){a.shift()},fallback:"iteration"})},o=0,a=r.selectors.length;o<a;++o)n(o);return{v:0!==e.length}}();if("object"===e(x))return x.v;case"child":return!!l(t,r.right,n)&&l(n[0],r.left,n.slice(1));case"descendant":if(l(t,r.right,n))for(var g=0,v=n.length;g<v;++g)if(l(n[g],r.left,n.slice(g+1)))return!0;return!1;case"attribute":var A=function(e,t){for(var r=t.split("."),n=0;n<r.length;n++){if(null==e)return e;e=e[r[n]]}return e}(t,r.name);switch(r.operator){case void 0:return null!=A;case"=":switch(r.value.type){case"regexp":return"string"==typeof A&&r.value.value.test(A);case"literal":return"".concat(r.value.value)==="".concat(A);case"type":return r.value.value===e(A)}throw new Error("Unknown selector value type: ".concat(r.value.type));case"!=":switch(r.value.type){case"regexp":return!r.value.value.test(A);case"literal":return"".concat(r.value.value)!=="".concat(A);case"type":return r.value.value!==e(A)}throw new Error("Unknown selector value type: ".concat(r.value.type));case"<=":return A<=r.value.value;case"<":return A<r.value.value;case">":return A>r.value.value;case">=":return A>=r.value.value}throw new Error("Unknown operator: ".concat(r.operator));case"sibling":return l(t,r.right,n)&&u(t,r.left,n,"LEFT_SIDE")||r.left.subject&&l(t,r.left,n)&&u(t,r.right,n,"RIGHT_SIDE");case"adjacent":return l(t,r.right,n)&&c(t,r.left,n,"LEFT_SIDE")||r.right.subject&&l(t,r.left,n)&&c(t,r.right,n,"RIGHT_SIDE");case"nth-child":return l(t,r.right,n)&&f(t,n,(function(){return r.index.value-1}));case"nth-last-child":return l(t,r.right,n)&&f(t,n,(function(e){return e-r.index.value}));case"class":switch(r.name.toLowerCase()){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===n.length||"MetaProperty"!==n[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw new Error("Unknown class name: ".concat(r.name))}throw new Error("Unknown selector type: ".concat(r.type))}function u(e,r,n,o){var a=t(n,1)[0];if(!a)return!1;for(var i=s.VisitorKeys[a.type],u=0,c=i.length;u<c;++u){var f=a[i[u]];if(Array.isArray(f)){var p=f.indexOf(e);if(p<0)continue;var h=void 0,d=void 0;"LEFT_SIDE"===o?(h=0,d=p):(h=p+1,d=f.length);for(var y=h;y<d;++y)if(l(f[y],r,n))return!0}}return!1}function c(e,r,n,o){var a=t(n,1)[0];if(!a)return!1;for(var i=s.VisitorKeys[a.type],u=0,c=i.length;u<c;++u){var f=a[i[u]];if(Array.isArray(f)){var p=f.indexOf(e);if(p<0)continue;if("LEFT_SIDE"===o&&p>0&&l(f[p-1],r,n))return!0;if("RIGHT_SIDE"===o&&p<f.length-1&&l(f[p+1],r,n))return!0}}return!1}function f(e,r,n){var o=t(r,1)[0];if(!o)return!1;for(var a=s.VisitorKeys[o.type],i=0,l=a.length;i<l;++i){var u=o[a[i]];if(Array.isArray(u)){var c=u.indexOf(e);if(c>=0&&c===n(u.length))return!0}}return!1}function p(n,o){if(null==n||"object"!=e(n))return[];null==o&&(o=n);for(var a=n.subject?[o]:[],s=0,i=function(e){for(var t=[],r=Object.keys(e),n=0;n<r.length;n++)t.push([r[n],e[r[n]]]);return t}(n);s<i.length;s++){var l=t(i[s],2),u=l[0],c=l[1];a.push.apply(a,r(p(c,"left"===u?c:o)))}return a}function h(e,t,r){if(t){var n=[],o=p(t);s.traverse(e,{enter:function(e,a){if(null!=a&&n.unshift(a),l(e,t,n))if(o.length)for(var s=0,i=o.length;s<i;++s){l(e,o[s],n)&&r(e,a,n);for(var u=0,c=n.length;u<c;++u){var f=n.slice(u+1);l(n[u],o[s],f)&&r(n[u],a,f)}}else r(e,a,n)},leave:function(){n.shift()},fallback:"iteration"})}}function d(e,t){var r=[];return h(e,t,(function(e){r.push(e)})),r}function y(e){return i.parse(e)}function m(e,t){return d(e,y(t))}return m.parse=y,m.match=d,m.traverse=h,m.matches=l,m.query=m,m}));
//# sourceMappingURL=esquery.min.js.map
diff --git a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/estraverse.js b/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/estraverse.js
index 6e28ca02f1..1bd3a92126 100644
--- a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/estraverse.js
+++ b/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/estraverse.js
@@ -389,6 +389,15 @@
return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
}
+ function candidateExistsInLeaveList(leavelist, candidate) {
+ for (var i = leavelist.length - 1; i >= 0; --i) {
+ if (leavelist[i].node === candidate) {
+ return true;
+ }
+ }
+ return false;
+ }
+
Controller.prototype.traverse = function traverse(root, visitor) {
var worklist,
leavelist,
@@ -469,6 +478,11 @@
if (!candidate[current2]) {
continue;
}
+
+ if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
+ continue;
+ }
+
if (isProperty(nodeType, candidates[current])) {
element = new Element(candidate[current2], [key, current2], 'Property', null);
} else if (isNode(candidate[current2])) {
@@ -479,6 +493,10 @@
worklist.push(element);
}
} else if (isNode(candidate)) {
+ if (candidateExistsInLeaveList(leavelist, candidate)) {
+ continue;
+ }
+
worklist.push(new Element(candidate, key, null, null));
}
}
diff --git a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json b/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json
index f4cce047d0..8affb3d090 100644
--- a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json
+++ b/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json
@@ -41,5 +41,5 @@
"test": "npm run-script lint && npm run-script unit-test",
"unit-test": "mocha --compilers js:babel-register"
},
- "version": "5.0.0"
+ "version": "5.1.0"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/esquery/package.json b/tools/node_modules/eslint/node_modules/esquery/package.json
index 8d19ba0442..eac205c94b 100644
--- a/tools/node_modules/eslint/node_modules/esquery/package.json
+++ b/tools/node_modules/eslint/node_modules/esquery/package.json
@@ -9,26 +9,30 @@
"bundleDependencies": false,
"contributors": [],
"dependencies": {
- "estraverse": "^5.0.0"
+ "estraverse": "^5.1.0"
},
"deprecated": false,
"description": "A query library for ECMAScript AST using a CSS selector like query language.",
"devDependencies": {
- "@rollup/plugin-commonjs": "^11.0.2",
+ "@babel/core": "^7.9.0",
+ "@babel/preset-env": "^7.9.5",
+ "@babel/register": "^7.9.0",
+ "@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-json": "^4.0.2",
- "@rollup/plugin-node-resolve": "^7.1.1",
+ "@rollup/plugin-node-resolve": "^7.1.3",
+ "babel-plugin-transform-es2017-object-entries": "0.0.5",
"chai": "^4.2.0",
"eslint": "^6.8.0",
- "esm": "^3.2.25",
"esprima": "~4.0.1",
"mocha": "^7.1.1",
- "nyc": "^15.0.0",
+ "nyc": "^15.0.1",
"pegjs": "~0.10.0",
- "rollup": "^1.32.0",
- "rollup-plugin-terser": "^5.2.0"
+ "rollup": "^1.32.1",
+ "rollup-plugin-babel": "^4.4.0",
+ "rollup-plugin-terser": "^5.3.0"
},
"engines": {
- "node": ">=8.0"
+ "node": ">=0.10"
},
"files": [
"dist/*.js",
@@ -72,10 +76,10 @@
"build:browser": "rollup -c",
"build:parser": "rm parser.js && pegjs --cache --format umd -o \"parser.js\" \"grammar.pegjs\"",
"lint": "eslint .",
- "mocha": "mocha --require chai/register-assert --require esm tests",
+ "mocha": "mocha --require chai/register-assert --require @babel/register tests",
"prepublishOnly": "npm run build && npm test",
"test": "nyc npm run mocha && npm run lint",
"test:ci": "npm run mocha"
},
- "version": "1.2.0"
+ "version": "1.3.1"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/flatted/README.md b/tools/node_modules/eslint/node_modules/flatted/README.md
index 990144117e..8441593391 100644
--- a/tools/node_modules/eslint/node_modules/flatted/README.md
+++ b/tools/node_modules/eslint/node_modules/flatted/README.md
@@ -4,6 +4,10 @@
A super light (0.5K) and fast circular JSON parser, directly from the creator of [CircularJSON](https://github.com/WebReflection/circular-json/#circularjson).
+```js
+npm i flatted
+```
+
Usable via [CDN](https://unpkg.com/flatted) or as regular module.
```js
@@ -20,6 +24,15 @@ a.push(a);
stringify(a); // [["1","0"],{"a":"0"}]
```
+## Flatted VS JSON
+
+As it is for every other specialized format capable of serializing and deserializing circular data, you should never `JSON.parse(Flatted.stringify(data))`, and you should never `Flatted.parse(JSON.stringify(data))`.
+
+The only way this could work is to `Flatted.parse(Flatted.stringify(data))`, as it is also for _CircularJSON_ or any other, otherwise there's no granted data integrity.
+
+Also please note this project serializes and deserializes only data compatible with JSON, so that sockets, or anything else with internal classes different from those allowed by JSON standard, won't be serialized and unserialized as expected.
+
+
### New in V1: Exact same JSON API
* Added a [reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Syntax) parameter to `.parse(string, reviver)` and revive your own objects.
diff --git a/tools/node_modules/eslint/node_modules/flatted/cjs/index.js b/tools/node_modules/eslint/node_modules/flatted/cjs/index.js
index f312b06fb6..a09c80cda7 100644
--- a/tools/node_modules/eslint/node_modules/flatted/cjs/index.js
+++ b/tools/node_modules/eslint/node_modules/flatted/cjs/index.js
@@ -46,8 +46,6 @@ var Flatted = (function (Primitive, primitive) {
if (firstRun) {
firstRun = !firstRun;
return value;
- // this was invoking twice each root object
- // return i < 1 ? value : $.call(this, key, value);
}
var after = $.call(this, key, value);
switch (typeof after) {
diff --git a/tools/node_modules/eslint/node_modules/flatted/esm/index.js b/tools/node_modules/eslint/node_modules/flatted/esm/index.js
index de15869e64..4392ca2bfe 100644
--- a/tools/node_modules/eslint/node_modules/flatted/esm/index.js
+++ b/tools/node_modules/eslint/node_modules/flatted/esm/index.js
@@ -46,8 +46,6 @@ var Flatted = (function (Primitive, primitive) {
if (firstRun) {
firstRun = !firstRun;
return value;
- // this was invoking twice each root object
- // return i < 1 ? value : $.call(this, key, value);
}
var after = $.call(this, key, value);
switch (typeof after) {
diff --git a/tools/node_modules/eslint/node_modules/flatted/index.js b/tools/node_modules/eslint/node_modules/flatted/index.js
index 1df9db3084..1eca303c6d 100644
--- a/tools/node_modules/eslint/node_modules/flatted/index.js
+++ b/tools/node_modules/eslint/node_modules/flatted/index.js
@@ -46,8 +46,6 @@ var Flatted = (function (Primitive, primitive) {
if (firstRun) {
firstRun = !firstRun;
return value;
- // this was invoking twice each root object
- // return i < 1 ? value : $.call(this, key, value);
}
var after = $.call(this, key, value);
switch (typeof after) {
diff --git a/tools/node_modules/eslint/node_modules/flatted/package.json b/tools/node_modules/eslint/node_modules/flatted/package.json
index 1cd0c25fce..45bbe7d9c6 100644
--- a/tools/node_modules/eslint/node_modules/flatted/package.json
+++ b/tools/node_modules/eslint/node_modules/flatted/package.json
@@ -9,12 +9,12 @@
"deprecated": false,
"description": "A super light and fast circular JSON parser.",
"devDependencies": {
- "circular-json": "latest",
- "circular-json-es6": "latest",
- "coveralls": "latest",
- "istanbul": "latest",
- "jsan": "latest",
- "uglify-js": "latest"
+ "circular-json": "^0.5.9",
+ "circular-json-es6": "^2.0.2",
+ "coveralls": "^3.0.11",
+ "jsan": "^3.1.13",
+ "nyc": "^15.0.0",
+ "uglify-js": "^3.8.1"
},
"homepage": "https://github.com/WebReflection/flatted#readme",
"keywords": [
@@ -36,13 +36,13 @@
"bench": "node test/bench.js",
"build": "npm run cjs && npm test && npm run esm && npm run min && npm run size",
"cjs": "cp index.js cjs/index.js; echo 'module.exports = Flatted;' >> cjs/index.js",
- "coveralls": "cat ./coverage/lcov.info | coveralls",
+ "coveralls": "nyc report --reporter=text-lcov | coveralls",
"esm": "cp index.js esm/index.js; echo 'export default Flatted;' >> esm/index.js; echo 'export var parse = Flatted.parse;' >> esm/index.js; echo 'export var stringify = Flatted.stringify;' >> esm/index.js",
"min": "echo '/*! (c) 2018, Andrea Giammarchi, (ISC) */'>min.js && uglifyjs index.js --support-ie8 -c -m >> min.js",
"size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c9 min.js | wc -c;cat min.js | brotli | wc -c",
- "test": "istanbul cover test/index.js"
+ "test": "nyc node test/index.js"
},
"types": "types.d.ts",
"unpkg": "min.js",
- "version": "2.0.1"
+ "version": "2.0.2"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/is-promise/index.js b/tools/node_modules/eslint/node_modules/is-promise/index.js
index ca2444c6f6..1bed0871bc 100644
--- a/tools/node_modules/eslint/node_modules/is-promise/index.js
+++ b/tools/node_modules/eslint/node_modules/is-promise/index.js
@@ -1,4 +1,5 @@
module.exports = isPromise;
+module.exports.default = isPromise;
function isPromise(obj) {
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
diff --git a/tools/node_modules/eslint/node_modules/is-promise/package.json b/tools/node_modules/eslint/node_modules/is-promise/package.json
index a690496718..2cf80cb17f 100644
--- a/tools/node_modules/eslint/node_modules/is-promise/package.json
+++ b/tools/node_modules/eslint/node_modules/is-promise/package.json
@@ -9,9 +9,16 @@
"deprecated": false,
"description": "Test whether an object looks like a promises-a+ promise",
"devDependencies": {
- "better-assert": "~0.1.0",
- "mocha": "~1.7.4"
+ "better-assert": "^1.0.2",
+ "mocha": "^7.1.1"
},
+ "exports": {
+ "import": "index.mjs",
+ "require": "index.js"
+ },
+ "files": [
+ "index.js"
+ ],
"homepage": "https://github.com/then/is-promise#readme",
"license": "MIT",
"main": "index.js",
@@ -23,5 +30,6 @@
"scripts": {
"test": "mocha -R spec"
},
- "version": "2.1.0"
+ "type": "module",
+ "version": "2.2.0"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/is-promise/readme.md b/tools/node_modules/eslint/node_modules/is-promise/readme.md
index 50d5d98911..d53d34bd59 100644
--- a/tools/node_modules/eslint/node_modules/is-promise/readme.md
+++ b/tools/node_modules/eslint/node_modules/is-promise/readme.md
@@ -1,12 +1,15 @@
-<a href="http://promises-aplus.github.com/promises-spec"><img src="http://promises-aplus.github.com/promises-spec/assets/logo-small.png" align="right" /></a>
+<a href="https://promisesaplus.com/"><img src="https://promisesaplus.com/assets/logo-small.png" align="right" /></a>
+
# is-promise
Test whether an object looks like a promises-a+ promise
[![Build Status](https://img.shields.io/travis/then/is-promise/master.svg)](https://travis-ci.org/then/is-promise)
- [![Dependency Status](https://img.shields.io/gemnasium/then/is-promise.svg)](https://gemnasium.com/then/is-promise)
+ [![Dependency Status](https://img.shields.io/david/then/is-promise.svg)](https://david-dm.org/then/is-promise)
[![NPM version](https://img.shields.io/npm/v/is-promise.svg)](https://www.npmjs.org/package/is-promise)
+
+
## Installation
$ npm install is-promise
@@ -15,9 +18,10 @@ You can also use it client side via npm.
## API
-```javascript
-var isPromise = require('is-promise');
+```typescript
+import isPromise from 'is-promise';
+isPromise(Promise.resolve());//=>true
isPromise({then:function () {...}});//=>true
isPromise(null);//=>false
isPromise({});//=>false
diff --git a/tools/node_modules/eslint/node_modules/levn/README.md b/tools/node_modules/eslint/node_modules/levn/README.md
index bb9ffea055..7ab008d666 100644
--- a/tools/node_modules/eslint/node_modules/levn/README.md
+++ b/tools/node_modules/eslint/node_modules/levn/README.md
@@ -2,7 +2,7 @@
__Light ECMAScript (JavaScript) Value Notation__
Levn is a library which allows you to parse a string into a JavaScript value based on an expected type. It is meant for short amounts of human entered data (eg. config files, command line arguments).
-Levn aims to concisely describe JavaScript values in text, and allow for the extraction and validation of those values. Levn uses [type-check](https://github.com/gkz/type-check) for its type format, and to validate the results. MIT license. Version 0.3.0.
+Levn aims to concisely describe JavaScript values in text, and allow for the extraction and validation of those values. Levn uses [type-check](https://github.com/gkz/type-check) for its type format, and to validate the results. MIT license. Version 0.4.1.
__How is this different than JSON?__ levn is meant to be written by humans only, is (due to the previous point) much more concise, can be validated against supplied types, has regex and date literals, and can easily be extended with custom types. On the other hand, it is probably slower and thus less efficient at transporting large amounts of data, which is fine since this is not its purpose.
diff --git a/tools/node_modules/eslint/node_modules/levn/lib/cast.js b/tools/node_modules/eslint/node_modules/levn/lib/cast.js
index 411e29d400..92cb9a6d79 100644
--- a/tools/node_modules/eslint/node_modules/levn/lib/cast.js
+++ b/tools/node_modules/eslint/node_modules/levn/lib/cast.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.4.0
+// Generated by LiveScript 1.6.0
(function(){
var parsedTypeCheck, types, toString$ = {}.toString;
parsedTypeCheck = require('type-check').parsedTypeCheck;
@@ -162,21 +162,45 @@
}, options);
},
String: function(it){
- var that;
+ var replace, that;
if (toString$.call(it).slice(8, -1) !== 'String') {
return {
type: 'Nothing'
};
}
+ replace = function(value, quote){
+ return value.replace(/\\([^u]|u[0-9a-fA-F]{4})/g, function(all, escaped){
+ switch (escaped[0]) {
+ case quote:
+ return quote;
+ case '\\':
+ return '\\';
+ case 'b':
+ return '\b';
+ case 'f':
+ return '\f';
+ case 'n':
+ return '\n';
+ case 'r':
+ return '\r';
+ case 't':
+ return '\t';
+ case 'u':
+ return JSON.parse("\"" + all + "\"");
+ default:
+ return escaped;
+ }
+ });
+ };
if (that = it.match(/^'([\s\S]*)'$/)) {
return {
type: 'Just',
- value: that[1].replace(/\\'/g, "'")
+ value: replace(that[1], "'")
};
} else if (that = it.match(/^"([\s\S]*)"$/)) {
return {
type: 'Just',
- value: that[1].replace(/\\"/g, '"')
+ value: replace(that[1], '"')
};
} else {
return {
@@ -294,5 +318,10 @@
}
throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + ".");
}
- module.exports = typesCast;
+ module.exports = function(node, types, options){
+ if (!options.explicit && types.length === 1 && types[0].type === 'String') {
+ return node;
+ }
+ return typesCast(node, types, options);
+ };
}).call(this);
diff --git a/tools/node_modules/eslint/node_modules/levn/lib/coerce.js b/tools/node_modules/eslint/node_modules/levn/lib/coerce.js
deleted file mode 100644
index 027b6da022..0000000000
--- a/tools/node_modules/eslint/node_modules/levn/lib/coerce.js
+++ /dev/null
@@ -1,285 +0,0 @@
-// Generated by LiveScript 1.2.0
-(function(){
- var parsedTypeCheck, types, toString$ = {}.toString;
- parsedTypeCheck = require('type-check').parsedTypeCheck;
- types = {
- '*': function(it){
- switch (toString$.call(it).slice(8, -1)) {
- case 'Array':
- return coerceType(it, {
- type: 'Array'
- });
- case 'Object':
- return coerceType(it, {
- type: 'Object'
- });
- default:
- return {
- type: 'Just',
- value: coerceTypes(it, [
- {
- type: 'Undefined'
- }, {
- type: 'Null'
- }, {
- type: 'NaN'
- }, {
- type: 'Boolean'
- }, {
- type: 'Number'
- }, {
- type: 'Date'
- }, {
- type: 'RegExp'
- }, {
- type: 'Array'
- }, {
- type: 'Object'
- }, {
- type: 'String'
- }
- ], {
- explicit: true
- })
- };
- }
- },
- Undefined: function(it){
- if (it === 'undefined' || it === void 8) {
- return {
- type: 'Just',
- value: void 8
- };
- } else {
- return {
- type: 'Nothing'
- };
- }
- },
- Null: function(it){
- if (it === 'null') {
- return {
- type: 'Just',
- value: null
- };
- } else {
- return {
- type: 'Nothing'
- };
- }
- },
- NaN: function(it){
- if (it === 'NaN') {
- return {
- type: 'Just',
- value: NaN
- };
- } else {
- return {
- type: 'Nothing'
- };
- }
- },
- Boolean: function(it){
- if (it === 'true') {
- return {
- type: 'Just',
- value: true
- };
- } else if (it === 'false') {
- return {
- type: 'Just',
- value: false
- };
- } else {
- return {
- type: 'Nothing'
- };
- }
- },
- Number: function(it){
- return {
- type: 'Just',
- value: +it
- };
- },
- Int: function(it){
- return {
- type: 'Just',
- value: parseInt(it)
- };
- },
- Float: function(it){
- return {
- type: 'Just',
- value: parseFloat(it)
- };
- },
- Date: function(value, options){
- var that;
- if (that = /^\#(.*)\#$/.exec(value)) {
- return {
- type: 'Just',
- value: new Date(+that[1] || that[1])
- };
- } else if (options.explicit) {
- return {
- type: 'Nothing'
- };
- } else {
- return {
- type: 'Just',
- value: new Date(+value || value)
- };
- }
- },
- RegExp: function(value, options){
- var that;
- if (that = /^\/(.*)\/([gimy]*)$/.exec(value)) {
- return {
- type: 'Just',
- value: new RegExp(that[1], that[2])
- };
- } else if (options.explicit) {
- return {
- type: 'Nothing'
- };
- } else {
- return {
- type: 'Just',
- value: new RegExp(value)
- };
- }
- },
- Array: function(it){
- return coerceArray(it, {
- of: [{
- type: '*'
- }]
- });
- },
- Object: function(it){
- return coerceFields(it, {
- of: {}
- });
- },
- String: function(it){
- var that;
- if (toString$.call(it).slice(8, -1) !== 'String') {
- return {
- type: 'Nothing'
- };
- }
- if (that = it.match(/^'(.*)'$/)) {
- return {
- type: 'Just',
- value: that[1]
- };
- } else if (that = it.match(/^"(.*)"$/)) {
- return {
- type: 'Just',
- value: that[1]
- };
- } else {
- return {
- type: 'Just',
- value: it
- };
- }
- }
- };
- function coerceArray(node, type){
- var typeOf, element;
- if (toString$.call(node).slice(8, -1) !== 'Array') {
- return {
- type: 'Nothing'
- };
- }
- typeOf = type.of;
- return {
- type: 'Just',
- value: (function(){
- var i$, ref$, len$, results$ = [];
- for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) {
- element = ref$[i$];
- results$.push(coerceTypes(element, typeOf));
- }
- return results$;
- }())
- };
- }
- function coerceTuple(node, type){
- var result, i$, ref$, len$, i, types, that;
- if (toString$.call(node).slice(8, -1) !== 'Array') {
- return {
- type: 'Nothing'
- };
- }
- result = [];
- for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) {
- i = i$;
- types = ref$[i$];
- if (that = coerceTypes(node[i], types)) {
- result.push(that);
- }
- }
- return {
- type: 'Just',
- value: result
- };
- }
- function coerceFields(node, type){
- var typeOf, key, value;
- if (toString$.call(node).slice(8, -1) !== 'Object') {
- return {
- type: 'Nothing'
- };
- }
- typeOf = type.of;
- return {
- type: 'Just',
- value: (function(){
- var ref$, results$ = {};
- for (key in ref$ = node) {
- value = ref$[key];
- results$[key] = coerceTypes(value, typeOf[key] || [{
- type: '*'
- }]);
- }
- return results$;
- }())
- };
- }
- function coerceType(node, typeObj, options){
- var type, structure, coerceFunc;
- type = typeObj.type, structure = typeObj.structure;
- if (type) {
- coerceFunc = types[type];
- return coerceFunc(node, options);
- } else {
- switch (structure) {
- case 'array':
- return coerceArray(node, typeObj);
- case 'tuple':
- return coerceTuple(node, typeObj);
- case 'fields':
- return coerceFields(node, typeObj);
- }
- }
- }
- function coerceTypes(node, types, options){
- var i$, len$, type, ref$, valueType, value;
- for (i$ = 0, len$ = types.length; i$ < len$; ++i$) {
- type = types[i$];
- ref$ = coerceType(node, type, options), valueType = ref$.type, value = ref$.value;
- if (valueType === 'Nothing') {
- continue;
- }
- if (parsedTypeCheck([type], value)) {
- return value;
- }
- }
- throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + ".");
- }
- module.exports = coerceTypes;
-}).call(this);
diff --git a/tools/node_modules/eslint/node_modules/levn/lib/index.js b/tools/node_modules/eslint/node_modules/levn/lib/index.js
index 4adae30c80..b8b668409d 100644
--- a/tools/node_modules/eslint/node_modules/levn/lib/index.js
+++ b/tools/node_modules/eslint/node_modules/levn/lib/index.js
@@ -1,10 +1,10 @@
-// Generated by LiveScript 1.4.0
+// Generated by LiveScript 1.6.0
(function(){
var parseString, cast, parseType, VERSION, parsedTypeParse, parse;
parseString = require('./parse-string');
cast = require('./cast');
parseType = require('type-check').parseType;
- VERSION = '0.3.0';
+ VERSION = '0.4.1';
parsedTypeParse = function(parsedType, string, options){
options == null && (options = {});
options.explicit == null && (options.explicit = false);
diff --git a/tools/node_modules/eslint/node_modules/levn/lib/parse-string.js b/tools/node_modules/eslint/node_modules/levn/lib/parse-string.js
index d573975fc2..eaed2f06d5 100644
--- a/tools/node_modules/eslint/node_modules/levn/lib/parse-string.js
+++ b/tools/node_modules/eslint/node_modules/levn/lib/parse-string.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.4.0
+// Generated by LiveScript 1.6.0
(function(){
var reject, special, tokenRegex;
reject = require('prelude-ls').reject;
@@ -100,7 +100,7 @@
var tokens, node;
options == null && (options = {});
if (!options.explicit && types.length === 1 && types[0].type === 'String') {
- return "'" + string.replace(/\\'/g, "\\\\'") + "'";
+ return string;
}
tokens = reject(not$, string.split(tokenRegex));
node = consumeTopLevel(tokens, types, options);
diff --git a/tools/node_modules/eslint/node_modules/levn/lib/parse.js b/tools/node_modules/eslint/node_modules/levn/lib/parse.js
deleted file mode 100644
index 2beff0f479..0000000000
--- a/tools/node_modules/eslint/node_modules/levn/lib/parse.js
+++ /dev/null
@@ -1,102 +0,0 @@
-// Generated by LiveScript 1.2.0
-(function(){
- var reject, special, tokenRegex;
- reject = require('prelude-ls').reject;
- function consumeOp(tokens, op){
- if (tokens[0] === op) {
- return tokens.shift();
- } else {
- throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + ".");
- }
- }
- function maybeConsumeOp(tokens, op){
- if (tokens[0] === op) {
- return tokens.shift();
- }
- }
- function consumeList(tokens, delimiters, hasDelimiters){
- var result;
- if (hasDelimiters) {
- consumeOp(tokens, delimiters[0]);
- }
- result = [];
- while (tokens.length && tokens[0] !== delimiters[1]) {
- result.push(consumeElement(tokens));
- maybeConsumeOp(tokens, ',');
- }
- if (hasDelimiters) {
- consumeOp(tokens, delimiters[1]);
- }
- return result;
- }
- function consumeArray(tokens, hasDelimiters){
- return consumeList(tokens, ['[', ']'], hasDelimiters);
- }
- function consumeTuple(tokens, hasDelimiters){
- return consumeList(tokens, ['(', ')'], hasDelimiters);
- }
- function consumeFields(tokens, hasDelimiters){
- var result, key;
- if (hasDelimiters) {
- consumeOp(tokens, '{');
- }
- result = {};
- while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) {
- key = tokens.shift();
- consumeOp(tokens, ':');
- result[key] = consumeElement(tokens);
- maybeConsumeOp(tokens, ',');
- }
- if (hasDelimiters) {
- consumeOp(tokens, '}');
- }
- return result;
- }
- function consumeElement(tokens){
- switch (tokens[0]) {
- case '[':
- return consumeArray(tokens, true);
- case '(':
- return consumeTuple(tokens, true);
- case '{':
- return consumeFields(tokens, true);
- default:
- return tokens.shift();
- }
- }
- function consumeTopLevel(tokens, types){
- var ref$, type, structure, origTokens, result, finalResult, x$, y$;
- ref$ = types[0], type = ref$.type, structure = ref$.structure;
- origTokens = tokens.concat();
- if (types.length === 1 && (structure || (type === 'Array' || type === 'Object'))) {
- result = structure === 'array' || type === 'Array'
- ? consumeArray(tokens, tokens[0] === '[')
- : structure === 'tuple'
- ? consumeTuple(tokens, tokens[0] === '(')
- : consumeFields(tokens, tokens[0] === '{');
- finalResult = tokens.length ? consumeElement(structure === 'array' || type === 'Array'
- ? (x$ = origTokens, x$.unshift('['), x$.push(']'), x$)
- : (y$ = origTokens, y$.unshift('('), y$.push(')'), y$)) : result;
- } else {
- finalResult = consumeElement(tokens);
- }
- if (tokens.length && origTokens.length) {
- throw new Error("Unable to parse " + JSON.stringify(origTokens) + " of type " + JSON.stringify(types) + ".");
- } else {
- return finalResult;
- }
- }
- special = /\[\]\(\)}{:,/.source;
- tokenRegex = RegExp('("(?:[^"]|\\\\")*")|(\'(?:[^\']|\\\\\')*\')|(#.*#)|(/(?:\\\\/|[^/])*/[gimy]*)|([' + special + '])|([^\\s' + special + ']+)|\\s*');
- module.exports = function(string, types){
- var tokens, node;
- tokens = reject(function(it){
- return !it || /^\s+$/.test(it);
- }, string.split(tokenRegex));
- node = consumeTopLevel(tokens, types);
- if (!node) {
- throw new Error("Error parsing '" + string + "'.");
- }
- return node;
- };
-}).call(this);
diff --git a/tools/node_modules/eslint/node_modules/levn/package.json b/tools/node_modules/eslint/node_modules/levn/package.json
index 3f44a60a2f..a9868ae588 100644
--- a/tools/node_modules/eslint/node_modules/levn/package.json
+++ b/tools/node_modules/eslint/node_modules/levn/package.json
@@ -8,15 +8,14 @@
},
"bundleDependencies": false,
"dependencies": {
- "prelude-ls": "~1.1.2",
- "type-check": "~0.3.2"
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
},
"deprecated": false,
"description": "Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible",
"devDependencies": {
- "istanbul": "~0.4.1",
- "livescript": "~1.4.0",
- "mocha": "~2.3.4"
+ "livescript": "^1.6.0",
+ "mocha": "^7.1.1"
},
"engines": {
"node": ">= 0.8.0"
@@ -50,5 +49,5 @@
"scripts": {
"test": "make test"
},
- "version": "0.3.0"
+ "version": "0.4.1"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/mkdirp/index.js b/tools/node_modules/eslint/node_modules/mkdirp/index.js
index 2f1287071f..468d7cd8df 100644
--- a/tools/node_modules/eslint/node_modules/mkdirp/index.js
+++ b/tools/node_modules/eslint/node_modules/mkdirp/index.js
@@ -17,7 +17,7 @@ function mkdirP (p, opts, f, made) {
var xfs = opts.fs || fs;
if (mode === undefined) {
- mode = _0777 & (~process.umask());
+ mode = _0777
}
if (!made) made = null;
@@ -62,7 +62,7 @@ mkdirP.sync = function sync (p, opts, made) {
var xfs = opts.fs || fs;
if (mode === undefined) {
- mode = _0777 & (~process.umask());
+ mode = _0777
}
if (!made) made = null;
diff --git a/tools/node_modules/eslint/node_modules/mkdirp/package.json b/tools/node_modules/eslint/node_modules/mkdirp/package.json
index c92cb45442..3b84c16505 100644
--- a/tools/node_modules/eslint/node_modules/mkdirp/package.json
+++ b/tools/node_modules/eslint/node_modules/mkdirp/package.json
@@ -14,7 +14,7 @@
"dependencies": {
"minimist": "^1.2.5"
},
- "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)",
+ "deprecated": false,
"description": "Recursively mkdir, like `mkdir -p`",
"devDependencies": {
"mock-fs": "^3.7.0",
@@ -42,5 +42,5 @@
"scripts": {
"test": "tap test/*.js"
},
- "version": "0.5.4"
+ "version": "0.5.5"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/mkdirp/readme.markdown b/tools/node_modules/eslint/node_modules/mkdirp/readme.markdown
index 3cc1315385..fc314bfbd6 100644
--- a/tools/node_modules/eslint/node_modules/mkdirp/readme.markdown
+++ b/tools/node_modules/eslint/node_modules/mkdirp/readme.markdown
@@ -37,7 +37,7 @@ Create a new directory and any necessary subdirectories at `dir` with octal
permission string `opts.mode`. If `opts` is a non-object, it will be treated as
the `opts.mode`.
-If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+If `opts.mode` isn't specified, it defaults to `0777`.
`cb(err, made)` fires with the error or the first directory `made`
that had to be created, if any.
@@ -52,7 +52,7 @@ Synchronously create a new directory and any necessary subdirectories at `dir`
with octal permission string `opts.mode`. If `opts` is a non-object, it will be
treated as the `opts.mode`.
-If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+If `opts.mode` isn't specified, it defaults to `0777`.
Returns the first directory that had to be created, if any.
diff --git a/tools/node_modules/eslint/node_modules/optionator/README.md b/tools/node_modules/eslint/node_modules/optionator/README.md
index 8e4ba42452..b1c53918f3 100644
--- a/tools/node_modules/eslint/node_modules/optionator/README.md
+++ b/tools/node_modules/eslint/node_modules/optionator/README.md
@@ -23,7 +23,7 @@ Other helpful features include reformatting the help text based on the size of t
## About
Optionator uses [type-check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) behind the scenes to cast and verify input according the specified types.
-MIT license. Version 0.8.3
+MIT license. Version 0.9.1
npm install optionator
diff --git a/tools/node_modules/eslint/node_modules/optionator/lib/index.js b/tools/node_modules/eslint/node_modules/optionator/lib/index.js
index 7ce37b23b0..20d914b2a2 100644
--- a/tools/node_modules/eslint/node_modules/optionator/lib/index.js
+++ b/tools/node_modules/eslint/node_modules/optionator/lib/index.js
@@ -1,7 +1,7 @@
// Generated by LiveScript 1.6.0
(function(){
var VERSION, ref$, id, map, compact, any, groupBy, partition, chars, isItNaN, keys, Obj, camelize, deepIs, closestString, nameToRaw, dasherize, naturalJoin, generateHelp, generateHelpForOption, parsedTypeCheck, parseType, parseLevn, camelizeKeys, parseString, main, toString$ = {}.toString, slice$ = [].slice, arrayFrom$ = Array.from || function(x){return slice$.call(x);};
- VERSION = '0.8.3';
+ VERSION = '0.9.1';
ref$ = require('prelude-ls'), id = ref$.id, map = ref$.map, compact = ref$.compact, any = ref$.any, groupBy = ref$.groupBy, partition = ref$.partition, chars = ref$.chars, isItNaN = ref$.isItNaN, keys = ref$.keys, Obj = ref$.Obj, camelize = ref$.camelize;
deepIs = require('deep-is');
ref$ = require('./util'), closestString = ref$.closestString, nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize, naturalJoin = ref$.naturalJoin;
diff --git a/tools/node_modules/eslint/node_modules/optionator/package.json b/tools/node_modules/eslint/node_modules/optionator/package.json
index b69935ea0e..b76e0b4f4c 100644
--- a/tools/node_modules/eslint/node_modules/optionator/package.json
+++ b/tools/node_modules/eslint/node_modules/optionator/package.json
@@ -8,19 +8,18 @@
},
"bundleDependencies": false,
"dependencies": {
- "deep-is": "~0.1.3",
- "fast-levenshtein": "~2.0.6",
- "levn": "~0.3.0",
- "prelude-ls": "~1.1.2",
- "type-check": "~0.3.2",
- "word-wrap": "~1.2.3"
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.3"
},
"deprecated": false,
"description": "option parsing and help generation",
"devDependencies": {
- "istanbul": "~0.4.5",
- "livescript": "~1.6.0",
- "mocha": "~6.2.2"
+ "livescript": "^1.6.0",
+ "mocha": "^7.1.1"
},
"engines": {
"node": ">= 0.8.0"
@@ -47,5 +46,5 @@
"scripts": {
"test": "make test"
},
- "version": "0.8.3"
+ "version": "0.9.1"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/prelude-ls/lib/Func.js b/tools/node_modules/eslint/node_modules/prelude-ls/lib/Func.js
index b80c9b13d0..09777a8c78 100644
--- a/tools/node_modules/eslint/node_modules/prelude-ls/lib/Func.js
+++ b/tools/node_modules/eslint/node_modules/prelude-ls/lib/Func.js
@@ -1,5 +1,5 @@
-// Generated by LiveScript 1.4.0
-var apply, curry, flip, fix, over, memoize, slice$ = [].slice, toString$ = {}.toString;
+// Generated by LiveScript 1.6.0
+var apply, curry, flip, fix, over, memoize, toString$ = {}.toString;
apply = curry$(function(f, list){
return f.apply(null, list);
});
@@ -27,8 +27,12 @@ memoize = function(f){
var memo;
memo = {};
return function(){
- var args, key, arg;
- args = slice$.call(arguments);
+ var args, res$, i$, to$, key, arg;
+ res$ = [];
+ for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) {
+ res$.push(arguments[i$]);
+ }
+ args = res$;
key = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) {
diff --git a/tools/node_modules/eslint/node_modules/prelude-ls/lib/List.js b/tools/node_modules/eslint/node_modules/prelude-ls/lib/List.js
index 5790816b1a..d2e41ab1f2 100644
--- a/tools/node_modules/eslint/node_modules/prelude-ls/lib/List.js
+++ b/tools/node_modules/eslint/node_modules/prelude-ls/lib/List.js
@@ -1,5 +1,5 @@
-// Generated by LiveScript 1.4.0
-var each, map, compact, filter, reject, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, concat, concatMap, flatten, difference, intersection, union, countBy, groupBy, andList, orList, any, all, sort, sortWith, sortBy, sum, product, mean, average, maximum, minimum, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, zipWith, zipAll, zipAllWith, at, elemIndex, elemIndices, findIndex, findIndices, toString$ = {}.toString, slice$ = [].slice;
+// Generated by LiveScript 1.6.0
+var each, map, compact, filter, reject, remove, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, concat, concatMap, flatten, difference, intersection, union, countBy, groupBy, andList, orList, any, all, sort, sortWith, sortBy, sum, product, mean, average, maximum, minimum, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, zipWith, zipAll, zipAllWith, at, elemIndex, elemIndices, findIndex, findIndices, toString$ = {}.toString;
each = curry$(function(f, xs){
var i$, len$, x;
for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
@@ -46,6 +46,15 @@ reject = curry$(function(f, xs){
}
return results$;
});
+remove = curry$(function(el, xs){
+ var i, x$;
+ i = elemIndex(el, xs);
+ x$ = xs.slice();
+ if (i != null) {
+ x$.splice(i, 1);
+ }
+ return x$;
+});
partition = curry$(function(f, xs){
var passed, failed, i$, len$, x;
passed = [];
@@ -176,8 +185,12 @@ flatten = function(xs){
}()));
};
difference = function(xs){
- var yss, results, i$, len$, x, j$, len1$, ys;
- yss = slice$.call(arguments, 1);
+ var yss, res$, i$, to$, results, len$, x, j$, len1$, ys;
+ res$ = [];
+ for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) {
+ res$.push(arguments[i$]);
+ }
+ yss = res$;
results = [];
outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
x = xs[i$];
@@ -192,8 +205,12 @@ difference = function(xs){
return results;
};
intersection = function(xs){
- var yss, results, i$, len$, x, j$, len1$, ys;
- yss = slice$.call(arguments, 1);
+ var yss, res$, i$, to$, results, len$, x, j$, len1$, ys;
+ res$ = [];
+ for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) {
+ res$.push(arguments[i$]);
+ }
+ yss = res$;
results = [];
outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
x = xs[i$];
@@ -208,8 +225,12 @@ intersection = function(xs){
return results;
};
union = function(){
- var xss, results, i$, len$, xs, j$, len1$, x;
- xss = slice$.call(arguments);
+ var xss, res$, i$, to$, results, len$, xs, j$, len1$, x;
+ res$ = [];
+ for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) {
+ res$.push(arguments[i$]);
+ }
+ xss = res$;
results = [];
for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
xs = xss[i$];
@@ -494,8 +515,12 @@ zipWith = curry$(function(f, xs, ys){
return result;
});
zipAll = function(){
- var xss, minLength, i$, len$, xs, ref$, i, lresult$, j$, results$ = [];
- xss = slice$.call(arguments);
+ var xss, res$, i$, to$, minLength, len$, xs, ref$, i, lresult$, j$, results$ = [];
+ res$ = [];
+ for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) {
+ res$.push(arguments[i$]);
+ }
+ xss = res$;
minLength = undefined;
for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
xs = xss[i$];
@@ -513,8 +538,12 @@ zipAll = function(){
return results$;
};
zipAllWith = function(f){
- var xss, minLength, i$, len$, xs, ref$, i, results$ = [];
- xss = slice$.call(arguments, 1);
+ var xss, res$, i$, to$, minLength, len$, xs, ref$, i, results$ = [];
+ res$ = [];
+ for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) {
+ res$.push(arguments[i$]);
+ }
+ xss = res$;
minLength = undefined;
for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
xs = xss[i$];
@@ -589,6 +618,7 @@ module.exports = {
filter: filter,
compact: compact,
reject: reject,
+ remove: remove,
partition: partition,
find: find,
head: head,
diff --git a/tools/node_modules/eslint/node_modules/prelude-ls/lib/Num.js b/tools/node_modules/eslint/node_modules/prelude-ls/lib/Num.js
index 0e25be7b38..f6b5319397 100644
--- a/tools/node_modules/eslint/node_modules/prelude-ls/lib/Num.js
+++ b/tools/node_modules/eslint/node_modules/prelude-ls/lib/Num.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.4.0
+// Generated by LiveScript 1.6.0
var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm;
max = curry$(function(x$, y$){
return x$ > y$ ? x$ : y$;
@@ -30,7 +30,7 @@ div = curry$(function(x, y){
});
mod = curry$(function(x$, y$){
var ref$;
- return (((x$) % (ref$ = y$) + ref$) % ref$);
+ return ((x$) % (ref$ = y$) + ref$) % ref$;
});
recip = (function(it){
return 1 / it;
diff --git a/tools/node_modules/eslint/node_modules/prelude-ls/lib/Obj.js b/tools/node_modules/eslint/node_modules/prelude-ls/lib/Obj.js
index f0a921ffd1..0b8d321614 100644
--- a/tools/node_modules/eslint/node_modules/prelude-ls/lib/Obj.js
+++ b/tools/node_modules/eslint/node_modules/prelude-ls/lib/Obj.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.4.0
+// Generated by LiveScript 1.6.0
var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find;
values = function(object){
var i$, x, results$ = [];
diff --git a/tools/node_modules/eslint/node_modules/prelude-ls/lib/Str.js b/tools/node_modules/eslint/node_modules/prelude-ls/lib/Str.js
index eb9a1ac085..59406d6026 100644
--- a/tools/node_modules/eslint/node_modules/prelude-ls/lib/Str.js
+++ b/tools/node_modules/eslint/node_modules/prelude-ls/lib/Str.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.4.0
+// Generated by LiveScript 1.6.0
var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize;
split = curry$(function(sep, str){
return str.split(sep);
diff --git a/tools/node_modules/eslint/node_modules/prelude-ls/lib/index.js b/tools/node_modules/eslint/node_modules/prelude-ls/lib/index.js
index 391cb2ee3b..9dcbed46a3 100644
--- a/tools/node_modules/eslint/node_modules/prelude-ls/lib/index.js
+++ b/tools/node_modules/eslint/node_modules/prelude-ls/lib/index.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.4.0
+// Generated by LiveScript 1.6.0
var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString;
Func = require('./Func.js');
List = require('./List.js');
@@ -161,7 +161,7 @@ prelude.even = Num.even;
prelude.odd = Num.odd;
prelude.gcd = Num.gcd;
prelude.lcm = Num.lcm;
-prelude.VERSION = '1.1.2';
+prelude.VERSION = '1.2.1';
module.exports = prelude;
function curry$(f, bound){
var context,
diff --git a/tools/node_modules/eslint/node_modules/prelude-ls/package.json b/tools/node_modules/eslint/node_modules/prelude-ls/package.json
index 9dfe180325..ff1fcd6e1a 100644
--- a/tools/node_modules/eslint/node_modules/prelude-ls/package.json
+++ b/tools/node_modules/eslint/node_modules/prelude-ls/package.json
@@ -10,12 +10,11 @@
"deprecated": false,
"description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.",
"devDependencies": {
- "browserify": "~3.24.13",
- "istanbul": "~0.2.4",
- "livescript": "~1.4.0",
- "mocha": "~2.2.4",
- "sinon": "~1.10.2",
- "uglify-js": "~2.4.12"
+ "browserify": "^16.5.1",
+ "livescript": "^1.6.0",
+ "mocha": "^7.1.1",
+ "sinon": "~8.0.1",
+ "uglify-js": "^3.8.1"
},
"engines": {
"node": ">= 0.8.0"
@@ -40,12 +39,7 @@
"object",
"string"
],
- "licenses": [
- {
- "type": "MIT",
- "url": "https://raw.github.com/gkz/prelude-ls/master/LICENSE"
- }
- ],
+ "license": "MIT",
"main": "lib/",
"name": "prelude-ls",
"repository": {
@@ -55,5 +49,5 @@
"scripts": {
"test": "make test"
},
- "version": "1.1.2"
+ "version": "1.2.1"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/regexpp/index.js b/tools/node_modules/eslint/node_modules/regexpp/index.js
index e7dbd127d9..12b4a5f406 100644
--- a/tools/node_modules/eslint/node_modules/regexpp/index.js
+++ b/tools/node_modules/eslint/node_modules/regexpp/index.js
@@ -9,8 +9,8 @@ var ast = /*#__PURE__*/Object.freeze({
});
-let largeIdStartPattern = null;
-let largeIdContinuePattern = null;
+let largeIdStartRanges = undefined;
+let largeIdContinueRanges = undefined;
function isIdStart(cp) {
if (cp < 0x41)
return false;
@@ -40,406 +40,77 @@ function isIdContinue(cp) {
return isLargeIdStart(cp) || isLargeIdContinue(cp);
}
function isLargeIdStart(cp) {
- if (!largeIdStartPattern) {
- largeIdStartPattern = new RegExp("^[\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\u08a0-\u08b4\u08b6-\u08bd" +
- "\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" +
- "\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8" +
- "\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1" +
- "\u0cf1\u0cf2\u0d05-\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-\u170c\u170e-\u1711\u1720-\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-\u1b4b\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-\u2c2e\u2c30-\u2c5e\u2c60-\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-\u31ba" +
- "\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c" +
- "\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b" +
- "\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f" +
- "\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\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-\uab67\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" +
- "\u{10000}-\u{1000b}\u{1000d}-\u{10026}\u{10028}-\u{1003a}" +
- "\u{1003c}\u{1003d}\u{1003f}-\u{1004d}\u{10050}-\u{1005d}" +
- "\u{10080}-\u{100fa}\u{10140}-\u{10174}\u{10280}-\u{1029c}" +
- "\u{102a0}-\u{102d0}\u{10300}-\u{1031f}\u{1032d}-\u{1034a}" +
- "\u{10350}-\u{10375}\u{10380}-\u{1039d}\u{103a0}-\u{103c3}" +
- "\u{103c8}-\u{103cf}\u{103d1}-\u{103d5}\u{10400}-\u{1049d}" +
- "\u{104b0}-\u{104d3}\u{104d8}-\u{104fb}\u{10500}-\u{10527}" +
- "\u{10530}-\u{10563}\u{10600}-\u{10736}\u{10740}-\u{10755}" +
- "\u{10760}-\u{10767}\u{10800}-\u{10805}\u{10808}" +
- "\u{1080a}-\u{10835}\u{10837}\u{10838}\u{1083c}" +
- "\u{1083f}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089e}" +
- "\u{108e0}-\u{108f2}\u{108f4}\u{108f5}\u{10900}-\u{10915}" +
- "\u{10920}-\u{10939}\u{10980}-\u{109b7}\u{109be}\u{109bf}" +
- "\u{10a00}\u{10a10}-\u{10a13}\u{10a15}-\u{10a17}" +
- "\u{10a19}-\u{10a35}\u{10a60}-\u{10a7c}\u{10a80}-\u{10a9c}" +
- "\u{10ac0}-\u{10ac7}\u{10ac9}-\u{10ae4}\u{10b00}-\u{10b35}" +
- "\u{10b40}-\u{10b55}\u{10b60}-\u{10b72}\u{10b80}-\u{10b91}" +
- "\u{10c00}-\u{10c48}\u{10c80}-\u{10cb2}\u{10cc0}-\u{10cf2}" +
- "\u{10d00}-\u{10d23}\u{10f00}-\u{10f1c}\u{10f27}" +
- "\u{10f30}-\u{10f45}\u{10fe0}-\u{10ff6}\u{11003}-\u{11037}" +
- "\u{11083}-\u{110af}\u{110d0}-\u{110e8}\u{11103}-\u{11126}" +
- "\u{11144}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111b2}" +
- "\u{111c1}-\u{111c4}\u{111da}\u{111dc}\u{11200}-\u{11211}" +
- "\u{11213}-\u{1122b}\u{11280}-\u{11286}\u{11288}" +
- "\u{1128a}-\u{1128d}\u{1128f}-\u{1129d}\u{1129f}-\u{112a8}" +
- "\u{112b0}-\u{112de}\u{11305}-\u{1130c}\u{1130f}\u{11310}" +
- "\u{11313}-\u{11328}\u{1132a}-\u{11330}\u{11332}\u{11333}" +
- "\u{11335}-\u{11339}\u{1133d}\u{11350}\u{1135d}-\u{11361}" +
- "\u{11400}-\u{11434}\u{11447}-\u{1144a}\u{1145f}" +
- "\u{11480}-\u{114af}\u{114c4}\u{114c5}\u{114c7}" +
- "\u{11580}-\u{115ae}\u{115d8}-\u{115db}\u{11600}-\u{1162f}" +
- "\u{11644}\u{11680}-\u{116aa}\u{116b8}\u{11700}-\u{1171a}" +
- "\u{11800}-\u{1182b}\u{118a0}-\u{118df}\u{118ff}" +
- "\u{119a0}-\u{119a7}\u{119aa}-\u{119d0}\u{119e1}\u{119e3}" +
- "\u{11a00}\u{11a0b}-\u{11a32}\u{11a3a}\u{11a50}" +
- "\u{11a5c}-\u{11a89}\u{11a9d}\u{11ac0}-\u{11af8}" +
- "\u{11c00}-\u{11c08}\u{11c0a}-\u{11c2e}\u{11c40}" +
- "\u{11c72}-\u{11c8f}\u{11d00}-\u{11d06}\u{11d08}\u{11d09}" +
- "\u{11d0b}-\u{11d30}\u{11d46}\u{11d60}-\u{11d65}" +
- "\u{11d67}\u{11d68}\u{11d6a}-\u{11d89}\u{11d98}" +
- "\u{11ee0}-\u{11ef2}\u{12000}-\u{12399}\u{12400}-\u{1246e}" +
- "\u{12480}-\u{12543}\u{13000}-\u{1342e}\u{14400}-\u{14646}" +
- "\u{16800}-\u{16a38}\u{16a40}-\u{16a5e}\u{16ad0}-\u{16aed}" +
- "\u{16b00}-\u{16b2f}\u{16b40}-\u{16b43}\u{16b63}-\u{16b77}" +
- "\u{16b7d}-\u{16b8f}\u{16e40}-\u{16e7f}\u{16f00}-\u{16f4a}" +
- "\u{16f50}\u{16f93}-\u{16f9f}\u{16fe0}\u{16fe1}\u{16fe3}" +
- "\u{17000}-\u{187f7}\u{18800}-\u{18af2}\u{1b000}-\u{1b11e}" +
- "\u{1b150}-\u{1b152}\u{1b164}-\u{1b167}\u{1b170}-\u{1b2fb}" +
- "\u{1bc00}-\u{1bc6a}\u{1bc70}-\u{1bc7c}\u{1bc80}-\u{1bc88}" +
- "\u{1bc90}-\u{1bc99}\u{1d400}-\u{1d454}\u{1d456}-\u{1d49c}" +
- "\u{1d49e}\u{1d49f}\u{1d4a2}\u{1d4a5}\u{1d4a6}" +
- "\u{1d4a9}-\u{1d4ac}\u{1d4ae}-\u{1d4b9}\u{1d4bb}" +
- "\u{1d4bd}-\u{1d4c3}\u{1d4c5}-\u{1d505}\u{1d507}-\u{1d50a}" +
- "\u{1d50d}-\u{1d514}\u{1d516}-\u{1d51c}\u{1d51e}-\u{1d539}" +
- "\u{1d53b}-\u{1d53e}\u{1d540}-\u{1d544}\u{1d546}" +
- "\u{1d54a}-\u{1d550}\u{1d552}-\u{1d6a5}\u{1d6a8}-\u{1d6c0}" +
- "\u{1d6c2}-\u{1d6da}\u{1d6dc}-\u{1d6fa}\u{1d6fc}-\u{1d714}" +
- "\u{1d716}-\u{1d734}\u{1d736}-\u{1d74e}\u{1d750}-\u{1d76e}" +
- "\u{1d770}-\u{1d788}\u{1d78a}-\u{1d7a8}\u{1d7aa}-\u{1d7c2}" +
- "\u{1d7c4}-\u{1d7cb}\u{1e100}-\u{1e12c}\u{1e137}-\u{1e13d}" +
- "\u{1e14e}\u{1e2c0}-\u{1e2eb}\u{1e800}-\u{1e8c4}" +
- "\u{1e900}-\u{1e943}\u{1e94b}\u{1ee00}-\u{1ee03}" +
- "\u{1ee05}-\u{1ee1f}\u{1ee21}\u{1ee22}\u{1ee24}\u{1ee27}" +
- "\u{1ee29}-\u{1ee32}\u{1ee34}-\u{1ee37}\u{1ee39}\u{1ee3b}" +
- "\u{1ee42}\u{1ee47}\u{1ee49}\u{1ee4b}\u{1ee4d}-\u{1ee4f}" +
- "\u{1ee51}\u{1ee52}\u{1ee54}\u{1ee57}\u{1ee59}\u{1ee5b}" +
- "\u{1ee5d}\u{1ee5f}\u{1ee61}\u{1ee62}\u{1ee64}" +
- "\u{1ee67}-\u{1ee6a}\u{1ee6c}-\u{1ee72}\u{1ee74}-\u{1ee77}" +
- "\u{1ee79}-\u{1ee7c}\u{1ee7e}\u{1ee80}-\u{1ee89}" +
- "\u{1ee8b}-\u{1ee9b}\u{1eea1}-\u{1eea3}\u{1eea5}-\u{1eea9}" +
- "\u{1eeab}-\u{1eebb}\u{20000}-\u{2a6d6}\u{2a700}-\u{2b734}" +
- "\u{2b740}-\u{2b81d}\u{2b820}-\u{2cea1}\u{2ceb0}-\u{2ebe0}" +
- "\u{2f800}-\u{2fa1d}]$", "u");
- }
- return largeIdStartPattern.test(String.fromCodePoint(cp));
+ return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges()));
}
function isLargeIdContinue(cp) {
- if (!largeIdContinuePattern) {
- largeIdContinuePattern = new RegExp("^[\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\u08d3-\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\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82" +
- "\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef" +
- "\u0c00-\u0c04\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\u0d82\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-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773" +
- "\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819" +
- "\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da" +
- "\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89" +
- "\u1a90-\u1a99\u1ab0-\u1abd\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-\u1df9\u1dfb-\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\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\u{101fd}\u{102e0}" +
- "\u{10376}-\u{1037a}\u{104a0}-\u{104a9}\u{10a01}-\u{10a03}" +
- "\u{10a05}\u{10a06}\u{10a0c}-\u{10a0f}\u{10a38}-\u{10a3a}" +
- "\u{10a3f}\u{10ae5}\u{10ae6}\u{10d24}-\u{10d27}" +
- "\u{10d30}-\u{10d39}\u{10f46}-\u{10f50}\u{11000}-\u{11002}" +
- "\u{11038}-\u{11046}\u{11066}-\u{1106f}\u{1107f}-\u{11082}" +
- "\u{110b0}-\u{110ba}\u{110f0}-\u{110f9}\u{11100}-\u{11102}" +
- "\u{11127}-\u{11134}\u{11136}-\u{1113f}\u{11145}\u{11146}" +
- "\u{11173}\u{11180}-\u{11182}\u{111b3}-\u{111c0}" +
- "\u{111c9}-\u{111cc}\u{111d0}-\u{111d9}\u{1122c}-\u{11237}" +
- "\u{1123e}\u{112df}-\u{112ea}\u{112f0}-\u{112f9}" +
- "\u{11300}-\u{11303}\u{1133b}\u{1133c}\u{1133e}-\u{11344}" +
- "\u{11347}\u{11348}\u{1134b}-\u{1134d}\u{11357}" +
- "\u{11362}\u{11363}\u{11366}-\u{1136c}\u{11370}-\u{11374}" +
- "\u{11435}-\u{11446}\u{11450}-\u{11459}\u{1145e}" +
- "\u{114b0}-\u{114c3}\u{114d0}-\u{114d9}\u{115af}-\u{115b5}" +
- "\u{115b8}-\u{115c0}\u{115dc}\u{115dd}\u{11630}-\u{11640}" +
- "\u{11650}-\u{11659}\u{116ab}-\u{116b7}\u{116c0}-\u{116c9}" +
- "\u{1171d}-\u{1172b}\u{11730}-\u{11739}\u{1182c}-\u{1183a}" +
- "\u{118e0}-\u{118e9}\u{119d1}-\u{119d7}\u{119da}-\u{119e0}" +
- "\u{119e4}\u{11a01}-\u{11a0a}\u{11a33}-\u{11a39}" +
- "\u{11a3b}-\u{11a3e}\u{11a47}\u{11a51}-\u{11a5b}" +
- "\u{11a8a}-\u{11a99}\u{11c2f}-\u{11c36}\u{11c38}-\u{11c3f}" +
- "\u{11c50}-\u{11c59}\u{11c92}-\u{11ca7}\u{11ca9}-\u{11cb6}" +
- "\u{11d31}-\u{11d36}\u{11d3a}\u{11d3c}\u{11d3d}" +
- "\u{11d3f}-\u{11d45}\u{11d47}\u{11d50}-\u{11d59}" +
- "\u{11d8a}-\u{11d8e}\u{11d90}\u{11d91}\u{11d93}-\u{11d97}" +
- "\u{11da0}-\u{11da9}\u{11ef3}-\u{11ef6}\u{16a60}-\u{16a69}" +
- "\u{16af0}-\u{16af4}\u{16b30}-\u{16b36}\u{16b50}-\u{16b59}" +
- "\u{16f4f}\u{16f51}-\u{16f87}\u{16f8f}-\u{16f92}" +
- "\u{1bc9d}\u{1bc9e}\u{1d165}-\u{1d169}\u{1d16d}-\u{1d172}" +
- "\u{1d17b}-\u{1d182}\u{1d185}-\u{1d18b}\u{1d1aa}-\u{1d1ad}" +
- "\u{1d242}-\u{1d244}\u{1d7ce}-\u{1d7ff}\u{1da00}-\u{1da36}" +
- "\u{1da3b}-\u{1da6c}\u{1da75}\u{1da84}\u{1da9b}-\u{1da9f}" +
- "\u{1daa1}-\u{1daaf}\u{1e000}-\u{1e006}\u{1e008}-\u{1e018}" +
- "\u{1e01b}-\u{1e021}\u{1e023}\u{1e024}\u{1e026}-\u{1e02a}" +
- "\u{1e130}-\u{1e136}\u{1e140}-\u{1e149}\u{1e2ec}-\u{1e2f9}" +
- "\u{1e8d0}-\u{1e8d6}\u{1e944}-\u{1e94a}\u{1e950}-\u{1e959}" +
- "\u{e0100}-\u{e01ef}]$", "u");
- }
- return largeIdContinuePattern.test(String.fromCodePoint(cp));
+ return isInRange(cp, largeIdContinueRanges ||
+ (largeIdContinueRanges = initLargeIdContinueRanges()));
}
-
-const gcNamePattern = /^(?:General_Category|gc)$/u;
-const scNamePattern = /^(?:Script(?:_Extensions)?|scx?)$/u;
-const gcValuePatterns = {
- es2018: null,
- es2019: null,
- es2020: null,
-};
-const scValuePatterns = {
- es2018: null,
- es2019: null,
- es2020: null,
-};
-const binPropertyPatterns = {
- es2018: null,
- es2019: null,
- es2020: null,
-};
-function isValidUnicodeProperty(version, name, value) {
- if (gcNamePattern.test(name)) {
- if (version >= 2018) {
- if (!gcValuePatterns.es2018) {
- gcValuePatterns.es2018 = new RegExp("^(?:C|Cased_Letter|Cc|Cf|Close_Punctuation|Cn|Co|" +
- "Combining_Mark|Connector_Punctuation|Control|Cs|" +
- "Currency_Symbol|Dash_Punctuation|Decimal_Number|" +
- "Enclosing_Mark|Final_Punctuation|Format|" +
- "Initial_Punctuation|L|LC|Letter|Letter_Number|" +
- "Line_Separator|Ll|Lm|Lo|Lowercase_Letter|Lt|Lu|M|" +
- "Mark|Math_Symbol|Mc|Me|Mn|Modifier_Letter|" +
- "Modifier_Symbol|N|Nd|Nl|No|Nonspacing_Mark|Number|" +
- "Open_Punctuation|Other|Other_Letter|Other_Number|" +
- "Other_Punctuation|Other_Symbol|P|" +
- "Paragraph_Separator|Pc|Pd|Pe|Pf|Pi|Po|Private_Use|" +
- "Ps|Punctuation|S|Sc|Separator|Sk|Sm|So|" +
- "Space_Separator|Spacing_Mark|Surrogate|Symbol|" +
- "Titlecase_Letter|Unassigned|Uppercase_Letter|Z|Zl|" +
- "Zp|Zs|cntrl|digit|punct)$", "u");
- }
- if (gcValuePatterns.es2018.test(value)) {
- return true;
- }
- }
- }
- if (scNamePattern.test(name)) {
- if (version >= 2018) {
- if (!scValuePatterns.es2018) {
- scValuePatterns.es2018 = new RegExp("^(?:Adlam|Adlm|Aghb|Ahom|Anatolian_Hieroglyphs|Arab|" +
- "Arabic|Armenian|Armi|Armn|Avestan|Avst|Bali|" +
- "Balinese|Bamu|Bamum|Bass|Bassa_Vah|Batak|Batk|Beng|" +
- "Bengali|Bhaiksuki|Bhks|Bopo|Bopomofo|Brah|Brahmi|" +
- "Brai|Braille|Bugi|Buginese|Buhd|Buhid|Cakm|" +
- "Canadian_Aboriginal|Cans|Cari|Carian|" +
- "Caucasian_Albanian|Chakma|Cham|Cher|Cherokee|Common|" +
- "Copt|Coptic|Cprt|Cuneiform|Cypriot|Cyrillic|Cyrl|" +
- "Deseret|Deva|Devanagari|Dsrt|Dupl|Duployan|Egyp|" +
- "Egyptian_Hieroglyphs|Elba|Elbasan|Ethi|Ethiopic|" +
- "Geor|Georgian|Glag|Glagolitic|Gonm|Goth|Gothic|Gran|" +
- "Grantha|Greek|Grek|Gujarati|Gujr|Gurmukhi|Guru|Han|" +
- "Hang|Hangul|Hani|Hano|Hanunoo|Hatr|Hatran|Hebr|" +
- "Hebrew|Hira|Hiragana|Hluw|Hmng|Hung|" +
- "Imperial_Aramaic|Inherited|Inscriptional_Pahlavi|" +
- "Inscriptional_Parthian|Ital|Java|Javanese|Kaithi|" +
- "Kali|Kana|Kannada|Katakana|Kayah_Li|Khar|Kharoshthi|" +
- "Khmer|Khmr|Khoj|Khojki|Khudawadi|Knda|Kthi|Lana|Lao|" +
- "Laoo|Latin|Latn|Lepc|Lepcha|Limb|Limbu|Lina|Linb|" +
- "Linear_A|Linear_B|Lisu|Lyci|Lycian|Lydi|Lydian|" +
- "Mahajani|Mahj|Malayalam|Mand|Mandaic|Mani|" +
- "Manichaean|Marc|Marchen|Masaram_Gondi|Meetei_Mayek|" +
- "Mend|Mende_Kikakui|Merc|Mero|Meroitic_Cursive|" +
- "Meroitic_Hieroglyphs|Miao|Mlym|Modi|Mong|Mongolian|" +
- "Mro|Mroo|Mtei|Mult|Multani|Myanmar|Mymr|Nabataean|" +
- "Narb|Nbat|New_Tai_Lue|Newa|Nko|Nkoo|Nshu|Nushu|Ogam|" +
- "Ogham|Ol_Chiki|Olck|Old_Hungarian|Old_Italic|" +
- "Old_North_Arabian|Old_Permic|Old_Persian|" +
- "Old_South_Arabian|Old_Turkic|Oriya|Orkh|Orya|Osage|" +
- "Osge|Osma|Osmanya|Pahawh_Hmong|Palm|Palmyrene|" +
- "Pau_Cin_Hau|Pauc|Perm|Phag|Phags_Pa|Phli|Phlp|Phnx|" +
- "Phoenician|Plrd|Prti|Psalter_Pahlavi|Qaac|Qaai|" +
- "Rejang|Rjng|Runic|Runr|Samaritan|Samr|Sarb|Saur|" +
- "Saurashtra|Sgnw|Sharada|Shavian|Shaw|Shrd|Sidd|" +
- "Siddham|SignWriting|Sind|Sinh|Sinhala|Sora|" +
- "Sora_Sompeng|Soyo|Soyombo|Sund|Sundanese|Sylo|" +
- "Syloti_Nagri|Syrc|Syriac|Tagalog|Tagb|Tagbanwa|" +
- "Tai_Le|Tai_Tham|Tai_Viet|Takr|Takri|Tale|Talu|Tamil|" +
- "Taml|Tang|Tangut|Tavt|Telu|Telugu|Tfng|Tglg|Thaa|" +
- "Thaana|Thai|Tibetan|Tibt|Tifinagh|Tirh|Tirhuta|Ugar|" +
- "Ugaritic|Vai|Vaii|Wara|Warang_Citi|Xpeo|Xsux|Yi|" +
- "Yiii|Zanabazar_Square|Zanb|Zinh|Zyyy)$", "u");
- }
- if (scValuePatterns.es2018.test(value)) {
- return true;
- }
- }
- if (version >= 2019) {
- if (!scValuePatterns.es2019) {
- scValuePatterns.es2019 = new RegExp("^(?:Dogr|Dogra|Gong|Gunjala_Gondi|Hanifi_Rohingya|" +
- "Maka|Makasar|Medefaidrin|Medf|Old_Sogdian|Rohg|Sogd|" +
- "Sogdian|Sogo)$", "u");
- }
- if (scValuePatterns.es2019.test(value)) {
- return true;
- }
+function initLargeIdStartRanges() {
+ return restoreRanges("170 0 11 0 5 0 6 22 2 30 2 457 5 11 15 4 8 0 2 0 130 4 2 1 3 3 2 0 7 0 2 2 2 0 2 19 2 82 2 138 9 165 2 37 3 0 7 40 72 26 5 3 46 42 36 1 2 98 2 0 16 1 8 1 11 2 3 0 17 0 2 29 30 88 12 0 25 32 10 1 5 0 6 21 5 0 10 0 4 0 24 24 8 10 54 20 2 17 61 53 4 0 19 0 8 9 16 15 5 7 3 1 3 21 2 6 2 0 4 3 4 0 17 0 14 1 2 2 15 1 11 0 9 5 5 1 3 21 2 6 2 1 2 1 2 1 32 3 2 0 20 2 17 8 2 2 2 21 2 6 2 1 2 4 4 0 19 0 16 1 24 0 12 7 3 1 3 21 2 6 2 1 2 4 4 0 31 1 2 2 16 0 18 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 11 23 0 53 7 2 2 2 22 2 15 4 0 27 2 6 1 31 0 5 7 2 2 2 22 2 9 2 4 4 0 33 0 2 1 16 1 18 8 2 2 2 40 3 0 17 0 6 2 9 2 25 5 6 17 4 23 2 8 2 0 3 6 59 47 2 1 13 6 59 1 2 0 2 4 2 23 2 0 2 9 2 1 10 0 3 4 2 0 22 3 33 0 64 7 2 35 28 4 116 42 21 0 17 5 5 3 4 0 4 1 8 2 5 12 13 0 18 37 2 0 6 0 3 42 2 332 2 3 3 6 2 0 2 3 3 40 2 3 3 32 2 3 3 6 2 0 2 3 3 14 2 56 2 3 3 66 38 15 17 85 3 5 4 619 3 16 2 25 6 74 4 10 8 12 2 3 15 17 15 17 15 12 2 2 16 51 36 0 5 0 68 88 8 40 2 0 6 69 11 30 50 29 3 4 12 43 5 25 55 22 10 52 83 0 94 46 18 6 56 29 14 1 11 43 27 35 42 2 11 35 3 8 8 42 3 2 42 3 2 5 2 1 4 0 6 191 65 277 3 5 3 37 3 5 3 7 2 0 2 0 2 0 2 30 3 52 2 6 2 0 4 2 2 6 4 3 3 5 5 12 6 2 2 6 117 0 14 0 17 12 102 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 15 3 3 6 4 5 0 18 40 2680 46 2 46 2 132 7 3 4 1 13 37 2 0 6 0 3 55 8 0 17 22 10 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 551 2 26 8 8 4 3 4 5 85 5 4 2 89 2 3 6 42 2 93 18 31 49 15 513 6591 65 20988 4 1164 68 45 3 268 4 15 11 1 21 46 17 30 3 79 40 8 3 102 3 52 3 8 43 12 2 2 2 3 2 22 30 51 15 49 63 5 4 0 2 1 12 27 11 22 26 28 8 46 29 0 17 4 2 9 11 4 2 40 24 2 2 7 21 22 4 0 4 49 2 0 4 1 3 4 3 0 2 0 25 2 3 10 8 2 13 5 3 5 3 5 10 6 2 6 2 42 2 13 7 114 30 11171 13 22 5 48 8453 365 3 105 39 6 13 4 6 0 2 9 2 12 2 4 2 0 2 1 2 1 2 107 34 362 19 63 3 53 41 11 117 4 2 134 37 25 7 25 12 88 4 5 3 5 3 5 3 2 36 11 2 25 2 18 2 1 2 14 3 13 35 122 70 52 268 28 4 48 48 31 14 29 6 37 11 29 3 35 5 7 2 4 43 157 19 35 5 35 5 39 9 51 157 310 10 21 11 7 153 5 3 0 2 43 2 1 4 0 3 22 11 22 10 30 66 18 2 1 11 21 11 25 71 55 7 1 65 0 16 3 2 2 2 28 43 28 4 28 36 7 2 27 28 53 11 21 11 18 14 17 111 72 56 50 14 50 14 35 349 41 7 1 79 28 11 0 9 21 107 20 28 22 13 52 76 44 33 24 27 35 30 0 3 0 9 34 4 0 13 47 15 3 22 0 2 0 36 17 2 24 85 6 2 0 2 3 2 14 2 9 8 46 39 7 3 1 3 21 2 6 2 1 2 4 4 0 19 0 13 4 159 52 19 3 21 2 31 47 21 1 2 0 185 46 42 3 37 47 21 0 60 42 14 0 72 26 230 43 117 63 32 7 3 0 3 7 2 1 2 23 16 0 2 0 95 7 3 38 17 0 2 0 29 0 11 39 8 0 22 0 12 45 20 0 35 56 264 8 2 36 18 0 50 29 113 6 2 1 2 37 22 0 26 5 2 1 2 31 15 0 328 18 190 0 80 921 103 110 18 195 2749 1070 4050 582 8634 568 8 30 114 29 19 47 17 3 32 20 6 18 689 63 129 74 6 0 67 12 65 1 2 0 29 6135 9 1237 43 8 8952 286 50 2 18 3 9 395 2309 106 6 12 4 8 8 9 5991 84 2 70 2 1 3 0 3 1 3 3 2 11 2 0 2 6 2 64 2 3 3 7 2 6 2 27 2 3 2 4 2 0 4 6 2 339 3 24 2 24 2 30 2 24 2 30 2 24 2 30 2 24 2 30 2 24 2 7 2357 44 11 6 17 0 370 43 1301 196 60 67 8 0 1205 3 2 26 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 16 6 2 2 4 2 16 4421 42717 35 4148 12 221 3 5761 15 7472 3104 541 1507 4938");
+}
+function initLargeIdContinueRanges() {
+ return restoreRanges("183 0 585 111 24 0 252 4 266 44 2 0 2 1 2 1 2 0 73 10 49 30 7 0 102 6 3 5 3 1 2 3 3 9 24 0 31 26 92 10 16 9 34 8 10 0 25 3 2 8 2 2 2 4 44 2 120 14 2 32 55 2 2 17 2 6 11 1 3 9 18 2 57 0 2 6 3 1 3 2 10 0 11 1 3 9 15 0 3 2 57 0 2 4 5 1 3 2 4 0 21 11 4 0 12 2 57 0 2 7 2 2 2 2 21 1 3 9 11 5 2 2 57 0 2 6 3 1 3 2 8 2 11 1 3 9 19 0 60 4 4 2 2 3 10 0 15 9 17 4 58 6 2 2 2 3 8 1 12 1 3 9 18 2 57 0 2 6 2 2 2 3 8 1 12 1 3 9 17 3 56 1 2 6 2 2 2 3 10 0 11 1 3 9 18 2 71 0 5 5 2 0 2 7 7 9 3 1 62 0 3 6 13 7 2 9 88 0 3 8 12 5 3 9 63 1 7 9 12 0 2 0 2 0 5 1 50 19 2 1 6 10 2 35 10 0 101 19 2 9 13 3 5 2 2 2 3 6 4 3 14 11 2 14 704 2 10 8 929 2 30 2 30 1 31 1 65 31 10 0 3 9 34 2 3 9 144 0 119 11 5 11 11 9 129 10 61 4 58 9 2 28 3 10 7 9 23 13 2 1 64 4 48 16 12 9 18 8 13 2 31 12 3 9 45 13 49 19 9 9 7 9 119 2 2 20 5 0 7 0 3 2 199 57 2 4 576 1 20 0 124 12 5 0 4 11 3071 2 142 0 97 31 555 5 106 1 30086 9 70 0 5 9 33 1 81 1 273 0 4 0 5 0 24 4 5 0 84 1 51 17 11 9 7 17 14 10 29 7 26 12 45 3 48 13 16 9 12 0 11 9 48 13 13 0 9 1 3 9 34 2 51 0 2 2 3 1 6 1 2 0 42 4 6 1 237 7 2 1 3 9 20261 0 738 15 17 15 4 1 25 2 193 9 38 0 702 0 227 0 150 4 294 9 1368 2 2 1 6 3 41 2 5 0 166 1 574 3 9 9 370 1 154 10 176 2 54 14 32 9 16 3 46 10 54 9 7 2 37 13 2 9 6 1 45 0 13 2 49 13 9 3 2 11 83 11 7 0 161 11 6 9 7 3 56 1 2 6 3 1 3 2 10 0 11 1 3 6 4 4 193 17 10 9 5 0 82 19 13 9 214 6 3 8 28 1 83 16 16 9 82 12 9 9 84 14 5 9 243 14 166 9 71 5 2 1 3 3 2 0 2 1 13 9 120 6 3 6 4 0 29 9 41 6 2 3 9 0 10 10 47 15 406 7 2 7 17 9 57 21 2 13 123 5 4 0 2 1 2 6 2 0 9 9 49 4 2 1 2 4 9 9 330 3 19306 9 135 4 60 6 26 9 1014 0 2 54 8 3 82 0 12 1 19628 1 5319 4 4 5 9 7 3 6 31 3 149 2 1418 49 513 54 5 49 9 0 15 0 23 4 2 14 1361 6 2 16 3 6 2 1 2 4 262 6 10 9 419 13 1495 6 110 6 6 9 4759 9 787719 239");
+}
+function isInRange(cp, ranges) {
+ let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0;
+ while (l < r) {
+ i = ((l + r) / 2) | 0;
+ min = ranges[2 * i];
+ max = ranges[2 * i + 1];
+ if (cp < min) {
+ r = i;
+ }
+ else if (cp > max) {
+ l = i + 1;
}
- if (version >= 2020) {
- if (!scValuePatterns.es2020) {
- scValuePatterns.es2020 = new RegExp("^(?:Hmnp|Nand|Nandinagari|Nyiakeng_Puachue_Hmong|" +
- "Wancho|Wcho)$", "u");
- }
- if (scValuePatterns.es2020.test(value)) {
- return true;
- }
+ else {
+ return true;
}
}
return false;
}
-function isValidLoneUnicodeProperty(version, value) {
- if (version >= 2018) {
- if (!binPropertyPatterns.es2018) {
- binPropertyPatterns.es2018 = new RegExp("^(?:AHex|ASCII|ASCII_Hex_Digit|Alpha|Alphabetic|Any|" +
- "Assigned|Bidi_C|Bidi_Control|Bidi_M|Bidi_Mirrored|CI|" +
- "CWCF|CWCM|CWKCF|CWL|CWT|CWU|Case_Ignorable|Cased|" +
- "Changes_When_Casefolded|Changes_When_Casemapped|" +
- "Changes_When_Lowercased|Changes_When_NFKC_Casefolded|" +
- "Changes_When_Titlecased|Changes_When_Uppercased|DI|Dash|" +
- "Default_Ignorable_Code_Point|Dep|Deprecated|Dia|" +
- "Diacritic|Emoji|Emoji_Component|Emoji_Modifier|" +
- "Emoji_Modifier_Base|Emoji_Presentation|Ext|Extender|" +
- "Gr_Base|Gr_Ext|Grapheme_Base|Grapheme_Extend|Hex|" +
- "Hex_Digit|IDC|IDS|IDSB|IDST|IDS_Binary_Operator|" +
- "IDS_Trinary_Operator|ID_Continue|ID_Start|Ideo|" +
- "Ideographic|Join_C|Join_Control|LOE|" +
- "Logical_Order_Exception|Lower|Lowercase|Math|NChar|" +
- "Noncharacter_Code_Point|Pat_Syn|Pat_WS|Pattern_Syntax|" +
- "Pattern_White_Space|QMark|Quotation_Mark|RI|Radical|" +
- "Regional_Indicator|SD|STerm|Sentence_Terminal|" +
- "Soft_Dotted|Term|Terminal_Punctuation|UIdeo|" +
- "Unified_Ideograph|Upper|Uppercase|VS|Variation_Selector|" +
- "White_Space|XIDC|XIDS|XID_Continue|XID_Start|space)$", "u");
- }
- if (binPropertyPatterns.es2018.test(value)) {
- return true;
- }
+function restoreRanges(data) {
+ let last = 0;
+ return data.split(" ").map(s => (last += parseInt(s, 10) | 0));
+}
+
+class DataSet {
+ constructor(raw2018, raw2019, raw2020) {
+ this._raw2018 = raw2018;
+ this._raw2019 = raw2019;
+ this._raw2020 = raw2020;
}
- if (version >= 2019) {
- if (!binPropertyPatterns.es2019) {
- binPropertyPatterns.es2019 = new RegExp("^(?:Extended_Pictographic)$", "u");
- }
- if (binPropertyPatterns.es2019.test(value)) {
- return true;
- }
+ get es2018() {
+ return (this._set2018 || (this._set2018 = new Set(this._raw2018.split(" "))));
+ }
+ get es2019() {
+ return (this._set2019 || (this._set2019 = new Set(this._raw2019.split(" "))));
+ }
+ get es2020() {
+ return (this._set2020 || (this._set2020 = new Set(this._raw2020.split(" "))));
+ }
+}
+const gcNameSet = new Set(["General_Category", "gc"]);
+const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]);
+const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "");
+const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho");
+const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "");
+function isValidUnicodeProperty(version, name, value) {
+ if (gcNameSet.has(name)) {
+ return version >= 2018 && gcValueSets.es2018.has(value);
+ }
+ if (scNameSet.has(name)) {
+ return ((version >= 2018 && scValueSets.es2018.has(value)) ||
+ (version >= 2019 && scValueSets.es2019.has(value)) ||
+ (version >= 2020 && scValueSets.es2020.has(value)));
}
return false;
}
+function isValidLoneUnicodeProperty(version, value) {
+ return ((version >= 2018 && binPropertySets.es2018.has(value)) ||
+ (version >= 2019 && binPropertySets.es2019.has(value)));
+}
const Backspace = 0x08;
const CharacterTabulation = 0x09;
@@ -541,6 +212,15 @@ function digitToInt(code) {
}
return code - DigitZero;
}
+function isLeadSurrogate(code) {
+ return code >= 0xd800 && code <= 0xdbff;
+}
+function isTrailSurrogate(code) {
+ return code >= 0xdc00 && code <= 0xdfff;
+}
+function combineSurrogatePair(lead, trail) {
+ return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000;
+}
const legacyImpl = {
at(s, end, i) {
@@ -769,13 +449,13 @@ class RegExpValidator {
this._uFlag = uFlag && this.ecmaVersion >= 2015;
this._nFlag = uFlag && this.ecmaVersion >= 2018;
this.reset(source, start, end);
- this.pattern();
+ this.consumePattern();
if (!this._nFlag &&
this.ecmaVersion >= 2018 &&
this._groupNames.size > 0) {
this._nFlag = true;
this.rewind(start);
- this.pattern();
+ this.consumePattern();
}
}
get strict() {
@@ -983,13 +663,13 @@ class RegExpValidator {
}
return this.index !== start;
}
- pattern() {
+ consumePattern() {
const start = this.index;
this._numCapturingParens = this.countCapturingParens();
this._groupNames.clear();
this._backreferenceNames.clear();
this.onPatternEnter(start);
- this.disjunction();
+ this.consumeDisjunction();
const cp = this.currentCodePoint;
if (this.currentCodePoint !== -1) {
if (cp === RightParenthesis) {
@@ -1043,15 +723,14 @@ class RegExpValidator {
this.rewind(start);
return count;
}
- disjunction() {
+ consumeDisjunction() {
const start = this.index;
let i = 0;
this.onDisjunctionEnter(start);
- this.alternative(i++);
- while (this.eat(VerticalLine)) {
- this.alternative(i++);
- }
- if (this.eatQuantifier(true)) {
+ do {
+ this.consumeAlternative(i++);
+ } while (this.eat(VerticalLine));
+ if (this.consumeQuantifier(true)) {
this.raise("Nothing to repeat");
}
if (this.eat(LeftCurlyBracket)) {
@@ -1059,27 +738,28 @@ class RegExpValidator {
}
this.onDisjunctionLeave(start, this.index);
}
- alternative(i) {
+ consumeAlternative(i) {
const start = this.index;
this.onAlternativeEnter(start, i);
- while (this.currentCodePoint !== -1 && this.eatTerm()) {
+ while (this.currentCodePoint !== -1 && this.consumeTerm()) {
}
this.onAlternativeLeave(start, this.index, i);
}
- eatTerm() {
- if (this.eatAssertion()) {
- if (this._lastAssertionIsQuantifiable) {
- this.eatQuantifier();
- }
- return true;
+ consumeTerm() {
+ if (this._uFlag || this.strict) {
+ return (this.consumeAssertion() ||
+ (this.consumeAtom() && this.consumeOptionalQuantifier()));
}
- if (this.strict ? this.eatAtom() : this.eatExtendedAtom()) {
- this.eatQuantifier();
- return true;
- }
- return false;
+ return ((this.consumeAssertion() &&
+ (!this._lastAssertionIsQuantifiable ||
+ this.consumeOptionalQuantifier())) ||
+ (this.consumeExtendedAtom() && this.consumeOptionalQuantifier()));
}
- eatAssertion() {
+ consumeOptionalQuantifier() {
+ this.consumeQuantifier();
+ return true;
+ }
+ consumeAssertion() {
const start = this.index;
this._lastAssertionIsQuantifiable = false;
if (this.eat(CircumflexAccent)) {
@@ -1104,7 +784,7 @@ class RegExpValidator {
if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) {
const kind = lookbehind ? "lookbehind" : "lookahead";
this.onLookaroundAssertionEnter(start, kind, negate);
- this.disjunction();
+ this.consumeDisjunction();
if (!this.eat(RightParenthesis)) {
this.raise("Unterminated group");
}
@@ -1116,7 +796,7 @@ class RegExpValidator {
}
return false;
}
- eatQuantifier(noError = false) {
+ consumeQuantifier(noConsume = false) {
const start = this.index;
let min = 0;
let max = 0;
@@ -1133,7 +813,7 @@ class RegExpValidator {
min = 0;
max = 1;
}
- else if (this.eatBracedQuantifier(noError)) {
+ else if (this.eatBracedQuantifier(noConsume)) {
min = this._lastMinValue;
max = this._lastMaxValue;
}
@@ -1141,7 +821,7 @@ class RegExpValidator {
return false;
}
greedy = !this.eat(QuestionMark);
- if (!noError) {
+ if (!noConsume) {
this.onQuantifier(start, this.index, min, max, greedy);
}
return true;
@@ -1165,43 +845,43 @@ class RegExpValidator {
return true;
}
}
- if (!noError && this.strict) {
+ if (!noError && (this._uFlag || this.strict)) {
this.raise("Incomplete quantifier");
}
this.rewind(start);
}
return false;
}
- eatAtom() {
- return (this.eatPatternCharacter() ||
- this.eatDot() ||
- this.eatReverseSolidusAtomEscape() ||
- this.eatCharacterClass() ||
- this.eatUncapturingGroup() ||
- this.eatCapturingGroup());
+ consumeAtom() {
+ return (this.consumePatternCharacter() ||
+ this.consumeDot() ||
+ this.consumeReverseSolidusAtomEscape() ||
+ this.consumeCharacterClass() ||
+ this.consumeUncapturingGroup() ||
+ this.consumeCapturingGroup());
}
- eatDot() {
+ consumeDot() {
if (this.eat(FullStop)) {
this.onAnyCharacterSet(this.index - 1, this.index, "any");
return true;
}
return false;
}
- eatReverseSolidusAtomEscape() {
+ consumeReverseSolidusAtomEscape() {
const start = this.index;
if (this.eat(ReverseSolidus)) {
- if (this.eatAtomEscape()) {
+ if (this.consumeAtomEscape()) {
return true;
}
this.rewind(start);
}
return false;
}
- eatUncapturingGroup() {
+ consumeUncapturingGroup() {
const start = this.index;
if (this.eat3(LeftParenthesis, QuestionMark, Colon)) {
this.onGroupEnter(start);
- this.disjunction();
+ this.consumeDisjunction();
if (!this.eat(RightParenthesis)) {
this.raise("Unterminated group");
}
@@ -1210,19 +890,20 @@ class RegExpValidator {
}
return false;
}
- eatCapturingGroup() {
+ consumeCapturingGroup() {
const start = this.index;
if (this.eat(LeftParenthesis)) {
- this._lastStrValue = "";
+ let name = null;
if (this.ecmaVersion >= 2018) {
- this.groupSpecifier();
+ if (this.consumeGroupSpecifier()) {
+ name = this._lastStrValue;
+ }
}
else if (this.currentCodePoint === QuestionMark) {
this.raise("Invalid group");
}
- const name = this._lastStrValue || null;
this.onCapturingGroupEnter(start, name);
- this.disjunction();
+ this.consumeDisjunction();
if (!this.eat(RightParenthesis)) {
this.raise("Unterminated group");
}
@@ -1231,41 +912,34 @@ class RegExpValidator {
}
return false;
}
- eatExtendedAtom() {
- return (this.eatDot() ||
- this.eatReverseSolidusAtomEscape() ||
- this.eatReverseSolidusFollowedByC() ||
- this.eatCharacterClass() ||
- this.eatUncapturingGroup() ||
- this.eatCapturingGroup() ||
- this.eatInvalidBracedQuantifier() ||
- this.eatExtendedPatternCharacter());
- }
- eatReverseSolidusFollowedByC() {
+ consumeExtendedAtom() {
+ return (this.consumeDot() ||
+ this.consumeReverseSolidusAtomEscape() ||
+ this.consumeReverseSolidusFollowedByC() ||
+ this.consumeCharacterClass() ||
+ this.consumeUncapturingGroup() ||
+ this.consumeCapturingGroup() ||
+ this.consumeInvalidBracedQuantifier() ||
+ this.consumeExtendedPatternCharacter());
+ }
+ consumeReverseSolidusFollowedByC() {
+ const start = this.index;
if (this.currentCodePoint === ReverseSolidus &&
this.nextCodePoint === LatinSmallLetterC) {
this._lastIntValue = this.currentCodePoint;
this.advance();
- this.onCharacter(this.index - 1, this.index, ReverseSolidus);
+ this.onCharacter(start, this.index, ReverseSolidus);
return true;
}
return false;
}
- eatInvalidBracedQuantifier() {
+ consumeInvalidBracedQuantifier() {
if (this.eatBracedQuantifier(true)) {
this.raise("Nothing to repeat");
}
return false;
}
- eatSyntaxCharacter() {
- if (isSyntaxCharacter(this.currentCodePoint)) {
- this._lastIntValue = this.currentCodePoint;
- this.advance();
- return true;
- }
- return false;
- }
- eatPatternCharacter() {
+ consumePatternCharacter() {
const start = this.index;
const cp = this.currentCodePoint;
if (cp !== -1 && !isSyntaxCharacter(cp)) {
@@ -1275,7 +949,7 @@ class RegExpValidator {
}
return false;
}
- eatExtendedPatternCharacter() {
+ consumeExtendedPatternCharacter() {
const start = this.index;
const cp = this.currentCodePoint;
if (cp !== -1 &&
@@ -1296,21 +970,216 @@ class RegExpValidator {
}
return false;
}
- groupSpecifier() {
- this._lastStrValue = "";
+ consumeGroupSpecifier() {
if (this.eat(QuestionMark)) {
if (this.eatGroupName()) {
if (!this._groupNames.has(this._lastStrValue)) {
this._groupNames.add(this._lastStrValue);
- return;
+ return true;
}
this.raise("Duplicate capture group name");
}
this.raise("Invalid group");
}
+ return false;
+ }
+ consumeAtomEscape() {
+ if (this.consumeBackreference() ||
+ this.consumeCharacterClassEscape() ||
+ this.consumeCharacterEscape() ||
+ (this._nFlag && this.consumeKGroupName())) {
+ return true;
+ }
+ if (this.strict || this._uFlag) {
+ this.raise("Invalid escape");
+ }
+ return false;
+ }
+ consumeBackreference() {
+ const start = this.index;
+ if (this.eatDecimalEscape()) {
+ const n = this._lastIntValue;
+ if (n <= this._numCapturingParens) {
+ this.onBackreference(start - 1, this.index, n);
+ return true;
+ }
+ if (this.strict || this._uFlag) {
+ this.raise("Invalid escape");
+ }
+ this.rewind(start);
+ }
+ return false;
+ }
+ consumeCharacterClassEscape() {
+ const start = this.index;
+ if (this.eat(LatinSmallLetterD)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "digit", false);
+ return true;
+ }
+ if (this.eat(LatinCapitalLetterD)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "digit", true);
+ return true;
+ }
+ if (this.eat(LatinSmallLetterS)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "space", false);
+ return true;
+ }
+ if (this.eat(LatinCapitalLetterS)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "space", true);
+ return true;
+ }
+ if (this.eat(LatinSmallLetterW)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "word", false);
+ return true;
+ }
+ if (this.eat(LatinCapitalLetterW)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "word", true);
+ return true;
+ }
+ let negate = false;
+ if (this._uFlag &&
+ this.ecmaVersion >= 2018 &&
+ (this.eat(LatinSmallLetterP) ||
+ (negate = this.eat(LatinCapitalLetterP)))) {
+ this._lastIntValue = -1;
+ if (this.eat(LeftCurlyBracket) &&
+ this.eatUnicodePropertyValueExpression() &&
+ this.eat(RightCurlyBracket)) {
+ this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate);
+ return true;
+ }
+ this.raise("Invalid property name");
+ }
+ return false;
+ }
+ consumeCharacterEscape() {
+ const start = this.index;
+ if (this.eatControlEscape() ||
+ this.eatCControlLetter() ||
+ this.eatZero() ||
+ this.eatHexEscapeSequence() ||
+ this.eatRegExpUnicodeEscapeSequence() ||
+ (!this.strict &&
+ !this._uFlag &&
+ this.eatLegacyOctalEscapeSequence()) ||
+ this.eatIdentityEscape()) {
+ this.onCharacter(start - 1, this.index, this._lastIntValue);
+ return true;
+ }
+ return false;
+ }
+ consumeKGroupName() {
+ const start = this.index;
+ if (this.eat(LatinSmallLetterK)) {
+ if (this.eatGroupName()) {
+ const groupName = this._lastStrValue;
+ this._backreferenceNames.add(groupName);
+ this.onBackreference(start - 1, this.index, groupName);
+ return true;
+ }
+ this.raise("Invalid named reference");
+ }
+ return false;
+ }
+ consumeCharacterClass() {
+ const start = this.index;
+ if (this.eat(LeftSquareBracket)) {
+ const negate = this.eat(CircumflexAccent);
+ this.onCharacterClassEnter(start, negate);
+ this.consumeClassRanges();
+ if (!this.eat(RightSquareBracket)) {
+ this.raise("Unterminated character class");
+ }
+ this.onCharacterClassLeave(start, this.index, negate);
+ return true;
+ }
+ return false;
+ }
+ consumeClassRanges() {
+ const strict = this.strict || this._uFlag;
+ for (;;) {
+ const rangeStart = this.index;
+ if (!this.consumeClassAtom()) {
+ break;
+ }
+ const min = this._lastIntValue;
+ if (!this.eat(HyphenMinus)) {
+ continue;
+ }
+ this.onCharacter(this.index - 1, this.index, HyphenMinus);
+ if (!this.consumeClassAtom()) {
+ break;
+ }
+ const max = this._lastIntValue;
+ if (min === -1 || max === -1) {
+ if (strict) {
+ this.raise("Invalid character class");
+ }
+ continue;
+ }
+ if (min > max) {
+ this.raise("Range out of order in character class");
+ }
+ this.onCharacterClassRange(rangeStart, this.index, min, max);
+ }
+ }
+ consumeClassAtom() {
+ const start = this.index;
+ const cp = this.currentCodePoint;
+ if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) {
+ this.advance();
+ this._lastIntValue = cp;
+ this.onCharacter(start, this.index, this._lastIntValue);
+ return true;
+ }
+ if (this.eat(ReverseSolidus)) {
+ if (this.consumeClassEscape()) {
+ return true;
+ }
+ if (!this.strict && this.currentCodePoint === LatinSmallLetterC) {
+ this._lastIntValue = ReverseSolidus;
+ this.onCharacter(start, this.index, this._lastIntValue);
+ return true;
+ }
+ if (this.strict || this._uFlag) {
+ this.raise("Invalid escape");
+ }
+ this.rewind(start);
+ }
+ return false;
+ }
+ consumeClassEscape() {
+ const start = this.index;
+ if (this.eat(LatinSmallLetterB)) {
+ this._lastIntValue = Backspace;
+ this.onCharacter(start - 1, this.index, this._lastIntValue);
+ return true;
+ }
+ if (this._uFlag && this.eat(HyphenMinus)) {
+ this._lastIntValue = HyphenMinus;
+ this.onCharacter(start - 1, this.index, this._lastIntValue);
+ return true;
+ }
+ let cp = 0;
+ if (!this.strict &&
+ !this._uFlag &&
+ this.currentCodePoint === LatinSmallLetterC &&
+ (isDecimalDigit((cp = this.nextCodePoint)) || cp === LowLine)) {
+ this.advance();
+ this.advance();
+ this._lastIntValue = cp % 0x20;
+ this.onCharacter(start - 1, this.index, this._lastIntValue);
+ return true;
+ }
+ return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape());
}
eatGroupName() {
- this._lastStrValue = "";
if (this.eat(LessThanSign)) {
if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) {
return true;
@@ -1320,9 +1189,8 @@ class RegExpValidator {
return false;
}
eatRegExpIdentifierName() {
- this._lastStrValue = "";
if (this.eatRegExpIdentifierStart()) {
- this._lastStrValue += String.fromCodePoint(this._lastIntValue);
+ this._lastStrValue = String.fromCodePoint(this._lastIntValue);
while (this.eatRegExpIdentifierPart()) {
this._lastStrValue += String.fromCodePoint(this._lastIntValue);
}
@@ -1332,11 +1200,19 @@ class RegExpValidator {
}
eatRegExpIdentifierStart() {
const start = this.index;
+ const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020;
let cp = this.currentCodePoint;
this.advance();
- if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence()) {
+ if (cp === ReverseSolidus &&
+ this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
cp = this._lastIntValue;
}
+ else if (forceUFlag &&
+ isLeadSurrogate(cp) &&
+ isTrailSurrogate(this.currentCodePoint)) {
+ cp = combineSurrogatePair(cp, this.currentCodePoint);
+ this.advance();
+ }
if (isRegExpIdentifierStart(cp)) {
this._lastIntValue = cp;
return true;
@@ -1348,11 +1224,19 @@ class RegExpValidator {
}
eatRegExpIdentifierPart() {
const start = this.index;
+ const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020;
let cp = this.currentCodePoint;
this.advance();
- if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence()) {
+ if (cp === ReverseSolidus &&
+ this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
cp = this._lastIntValue;
}
+ else if (forceUFlag &&
+ isLeadSurrogate(cp) &&
+ isTrailSurrogate(this.currentCodePoint)) {
+ cp = combineSurrogatePair(cp, this.currentCodePoint);
+ this.advance();
+ }
if (isRegExpIdentifierPart(cp)) {
this._lastIntValue = cp;
return true;
@@ -1362,60 +1246,6 @@ class RegExpValidator {
}
return false;
}
- eatAtomEscape() {
- if (this.eatBackreference() ||
- this.eatCharacterClassEscape() ||
- this.eatCharacterEscape() ||
- (this._nFlag && this.eatKGroupName())) {
- return true;
- }
- if (this.strict || this._uFlag) {
- this.raise("Invalid escape");
- }
- return false;
- }
- eatBackreference() {
- const start = this.index;
- if (this.eatDecimalEscape()) {
- const n = this._lastIntValue;
- if (n <= this._numCapturingParens) {
- this.onBackreference(start - 1, this.index, n);
- return true;
- }
- if (this.strict) {
- this.raise("Invalid escape");
- }
- this.rewind(start);
- }
- return false;
- }
- eatKGroupName() {
- const start = this.index;
- if (this.eat(LatinSmallLetterK)) {
- if (this.eatGroupName()) {
- const groupName = this._lastStrValue;
- this._backreferenceNames.add(groupName);
- this.onBackreference(start - 1, this.index, groupName);
- return true;
- }
- this.raise("Invalid named reference");
- }
- return false;
- }
- eatCharacterEscape() {
- const start = this.index;
- if (this.eatControlEscape() ||
- this.eatCControlLetter() ||
- this.eatZero() ||
- this.eatHexEscapeSequence() ||
- this.eatRegExpUnicodeEscapeSequence() ||
- (!this.strict && this.eatLegacyOctalEscapeSequence()) ||
- this.eatIdentityEscape()) {
- this.onCharacter(start - 1, this.index, this._lastIntValue);
- return true;
- }
- return false;
- }
eatCControlLetter() {
const start = this.index;
if (this.eat(LatinSmallLetterC)) {
@@ -1436,24 +1266,24 @@ class RegExpValidator {
return false;
}
eatControlEscape() {
- if (this.eat(LatinSmallLetterT)) {
- this._lastIntValue = CharacterTabulation;
+ if (this.eat(LatinSmallLetterF)) {
+ this._lastIntValue = FormFeed;
return true;
}
if (this.eat(LatinSmallLetterN)) {
this._lastIntValue = LineFeed;
return true;
}
- if (this.eat(LatinSmallLetterV)) {
- this._lastIntValue = LineTabulation;
+ if (this.eat(LatinSmallLetterR)) {
+ this._lastIntValue = CarriageReturn;
return true;
}
- if (this.eat(LatinSmallLetterF)) {
- this._lastIntValue = FormFeed;
+ if (this.eat(LatinSmallLetterT)) {
+ this._lastIntValue = CharacterTabulation;
return true;
}
- if (this.eat(LatinSmallLetterR)) {
- this._lastIntValue = CarriageReturn;
+ if (this.eat(LatinSmallLetterV)) {
+ this._lastIntValue = LineTabulation;
return true;
}
return false;
@@ -1467,57 +1297,55 @@ class RegExpValidator {
}
return false;
}
- eatRegExpUnicodeEscapeSequence() {
+ eatRegExpUnicodeEscapeSequence(forceUFlag = false) {
const start = this.index;
+ const uFlag = forceUFlag || this._uFlag;
if (this.eat(LatinSmallLetterU)) {
- if (this.eatFixedHexDigits(4)) {
- const lead = this._lastIntValue;
- if (this._uFlag && lead >= 0xd800 && lead <= 0xdbff) {
- const leadSurrogateEnd = this.index;
- if (this.eat(ReverseSolidus) &&
- this.eat(LatinSmallLetterU) &&
- this.eatFixedHexDigits(4)) {
- const trail = this._lastIntValue;
- if (trail >= 0xdc00 && trail <= 0xdfff) {
- this._lastIntValue =
- (lead - 0xd800) * 0x400 +
- (trail - 0xdc00) +
- 0x10000;
- return true;
- }
- }
- this.rewind(leadSurrogateEnd);
- this._lastIntValue = lead;
- }
+ if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) ||
+ this.eatFixedHexDigits(4) ||
+ (uFlag && this.eatRegExpUnicodeCodePointEscape())) {
return true;
}
- if (this._uFlag &&
- this.eat(LeftCurlyBracket) &&
- this.eatHexDigits() &&
- this.eat(RightCurlyBracket) &&
- isValidUnicode(this._lastIntValue)) {
- return true;
- }
- if (this.strict || this._uFlag) {
+ if (this.strict || uFlag) {
this.raise("Invalid unicode escape");
}
this.rewind(start);
}
return false;
}
- eatIdentityEscape() {
- if (this._uFlag) {
- if (this.eatSyntaxCharacter()) {
- return true;
- }
- if (this.eat(Solidus)) {
- this._lastIntValue = Solidus;
- return true;
+ eatRegExpUnicodeSurrogatePairEscape() {
+ const start = this.index;
+ if (this.eatFixedHexDigits(4)) {
+ const lead = this._lastIntValue;
+ if (isLeadSurrogate(lead) &&
+ this.eat(ReverseSolidus) &&
+ this.eat(LatinSmallLetterU) &&
+ this.eatFixedHexDigits(4)) {
+ const trail = this._lastIntValue;
+ if (isTrailSurrogate(trail)) {
+ this._lastIntValue = combineSurrogatePair(lead, trail);
+ return true;
+ }
}
- return false;
+ this.rewind(start);
}
- if (this.isValidIdentityEscape(this.currentCodePoint)) {
- this._lastIntValue = this.currentCodePoint;
+ return false;
+ }
+ eatRegExpUnicodeCodePointEscape() {
+ const start = this.index;
+ if (this.eat(LeftCurlyBracket) &&
+ this.eatHexDigits() &&
+ this.eat(RightCurlyBracket) &&
+ isValidUnicode(this._lastIntValue)) {
+ return true;
+ }
+ this.rewind(start);
+ return false;
+ }
+ eatIdentityEscape() {
+ const cp = this.currentCodePoint;
+ if (this.isValidIdentityEscape(cp)) {
+ this._lastIntValue = cp;
this.advance();
return true;
}
@@ -1527,11 +1355,16 @@ class RegExpValidator {
if (cp === -1) {
return false;
}
+ if (this._uFlag) {
+ return isSyntaxCharacter(cp) || cp === Solidus;
+ }
if (this.strict) {
return !isIdContinue(cp);
}
- return (cp !== LatinSmallLetterC &&
- (!this._nFlag || cp !== LatinSmallLetterK));
+ if (this._nFlag) {
+ return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK);
+ }
+ return cp !== LatinSmallLetterC;
}
eatDecimalEscape() {
this._lastIntValue = 0;
@@ -1546,54 +1379,6 @@ class RegExpValidator {
}
return false;
}
- eatCharacterClassEscape() {
- const start = this.index;
- if (this.eat(LatinSmallLetterD)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "digit", false);
- return true;
- }
- if (this.eat(LatinCapitalLetterD)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "digit", true);
- return true;
- }
- if (this.eat(LatinSmallLetterS)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "space", false);
- return true;
- }
- if (this.eat(LatinCapitalLetterS)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "space", true);
- return true;
- }
- if (this.eat(LatinSmallLetterW)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "word", false);
- return true;
- }
- if (this.eat(LatinCapitalLetterW)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "word", true);
- return true;
- }
- let negate = false;
- if (this._uFlag &&
- this.ecmaVersion >= 2018 &&
- (this.eat(LatinSmallLetterP) ||
- (negate = this.eat(LatinCapitalLetterP)))) {
- this._lastIntValue = -1;
- if (this.eat(LeftCurlyBracket) &&
- this.eatUnicodePropertyValueExpression() &&
- this.eat(RightCurlyBracket)) {
- this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate);
- return true;
- }
- this.raise("Invalid property name");
- }
- return false;
- }
eatUnicodePropertyValueExpression() {
const start = this.index;
if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) {
@@ -1642,102 +1427,13 @@ class RegExpValidator {
eatLoneUnicodePropertyNameOrValue() {
return this.eatUnicodePropertyValue();
}
- eatCharacterClass() {
- const start = this.index;
- if (this.eat(LeftSquareBracket)) {
- const negate = this.eat(CircumflexAccent);
- this.onCharacterClassEnter(start, negate);
- this.classRanges();
- if (!this.eat(RightSquareBracket)) {
- this.raise("Unterminated character class");
- }
- this.onCharacterClassLeave(start, this.index, negate);
- return true;
- }
- return false;
- }
- classRanges() {
- let start = this.index;
- while (this.eatClassAtom()) {
- const left = this._lastIntValue;
- const hyphenStart = this.index;
- if (this.eat(HyphenMinus)) {
- this.onCharacter(hyphenStart, this.index, HyphenMinus);
- if (this.eatClassAtom()) {
- const right = this._lastIntValue;
- if (left === -1 || right === -1) {
- if (this.strict) {
- this.raise("Invalid character class");
- }
- }
- else if (left > right) {
- this.raise("Range out of order in character class");
- }
- else {
- this.onCharacterClassRange(start, this.index, left, right);
- }
- }
- }
- start = this.index;
- }
- }
- eatClassAtom() {
- const start = this.index;
- if (this.eat(ReverseSolidus)) {
- if (this.eatClassEscape()) {
- return true;
- }
- if (this._uFlag) {
- this.raise("Invalid escape");
- }
- this.rewind(start);
- }
- const cp = this.currentCodePoint;
- if (cp !== -1 && cp !== RightSquareBracket) {
- this.advance();
- this._lastIntValue = cp;
- this.onCharacter(start, this.index, cp);
- return true;
- }
- return false;
- }
- eatClassEscape() {
- const start = this.index;
- if (this.eat(LatinSmallLetterB)) {
- this._lastIntValue = Backspace;
- this.onCharacter(start - 1, this.index, Backspace);
- return true;
- }
- if (this._uFlag && this.eat(HyphenMinus)) {
- this._lastIntValue = HyphenMinus;
- this.onCharacter(start - 1, this.index, HyphenMinus);
- return true;
- }
- if (!this._uFlag && this.eat(LatinSmallLetterC)) {
- if (this.eatClassControlLetter()) {
- this.onCharacter(start - 1, this.index, this._lastIntValue);
- return true;
- }
- this.rewind(start);
- }
- return this.eatCharacterClassEscape() || this.eatCharacterEscape();
- }
- eatClassControlLetter() {
- const cp = this.currentCodePoint;
- if (isDecimalDigit(cp) || cp === LowLine) {
- this.advance();
- this._lastIntValue = cp % 0x20;
- return true;
- }
- return false;
- }
eatHexEscapeSequence() {
const start = this.index;
if (this.eat(LatinSmallLetterX)) {
if (this.eatFixedHexDigits(2)) {
return true;
}
- if (this._uFlag) {
+ if (this._uFlag || this.strict) {
this.raise("Invalid escape");
}
this.rewind(start);
diff --git a/tools/node_modules/eslint/node_modules/regexpp/index.mjs b/tools/node_modules/eslint/node_modules/regexpp/index.mjs
index 1dc97d4a8d..d02491f0da 100644
--- a/tools/node_modules/eslint/node_modules/regexpp/index.mjs
+++ b/tools/node_modules/eslint/node_modules/regexpp/index.mjs
@@ -5,8 +5,8 @@ var ast = /*#__PURE__*/Object.freeze({
});
-let largeIdStartPattern = null;
-let largeIdContinuePattern = null;
+let largeIdStartRanges = undefined;
+let largeIdContinueRanges = undefined;
function isIdStart(cp) {
if (cp < 0x41)
return false;
@@ -36,406 +36,77 @@ function isIdContinue(cp) {
return isLargeIdStart(cp) || isLargeIdContinue(cp);
}
function isLargeIdStart(cp) {
- if (!largeIdStartPattern) {
- largeIdStartPattern = new RegExp("^[\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\u08a0-\u08b4\u08b6-\u08bd" +
- "\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" +
- "\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8" +
- "\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1" +
- "\u0cf1\u0cf2\u0d05-\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-\u170c\u170e-\u1711\u1720-\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-\u1b4b\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-\u2c2e\u2c30-\u2c5e\u2c60-\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-\u31ba" +
- "\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c" +
- "\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b" +
- "\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f" +
- "\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\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-\uab67\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" +
- "\u{10000}-\u{1000b}\u{1000d}-\u{10026}\u{10028}-\u{1003a}" +
- "\u{1003c}\u{1003d}\u{1003f}-\u{1004d}\u{10050}-\u{1005d}" +
- "\u{10080}-\u{100fa}\u{10140}-\u{10174}\u{10280}-\u{1029c}" +
- "\u{102a0}-\u{102d0}\u{10300}-\u{1031f}\u{1032d}-\u{1034a}" +
- "\u{10350}-\u{10375}\u{10380}-\u{1039d}\u{103a0}-\u{103c3}" +
- "\u{103c8}-\u{103cf}\u{103d1}-\u{103d5}\u{10400}-\u{1049d}" +
- "\u{104b0}-\u{104d3}\u{104d8}-\u{104fb}\u{10500}-\u{10527}" +
- "\u{10530}-\u{10563}\u{10600}-\u{10736}\u{10740}-\u{10755}" +
- "\u{10760}-\u{10767}\u{10800}-\u{10805}\u{10808}" +
- "\u{1080a}-\u{10835}\u{10837}\u{10838}\u{1083c}" +
- "\u{1083f}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089e}" +
- "\u{108e0}-\u{108f2}\u{108f4}\u{108f5}\u{10900}-\u{10915}" +
- "\u{10920}-\u{10939}\u{10980}-\u{109b7}\u{109be}\u{109bf}" +
- "\u{10a00}\u{10a10}-\u{10a13}\u{10a15}-\u{10a17}" +
- "\u{10a19}-\u{10a35}\u{10a60}-\u{10a7c}\u{10a80}-\u{10a9c}" +
- "\u{10ac0}-\u{10ac7}\u{10ac9}-\u{10ae4}\u{10b00}-\u{10b35}" +
- "\u{10b40}-\u{10b55}\u{10b60}-\u{10b72}\u{10b80}-\u{10b91}" +
- "\u{10c00}-\u{10c48}\u{10c80}-\u{10cb2}\u{10cc0}-\u{10cf2}" +
- "\u{10d00}-\u{10d23}\u{10f00}-\u{10f1c}\u{10f27}" +
- "\u{10f30}-\u{10f45}\u{10fe0}-\u{10ff6}\u{11003}-\u{11037}" +
- "\u{11083}-\u{110af}\u{110d0}-\u{110e8}\u{11103}-\u{11126}" +
- "\u{11144}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111b2}" +
- "\u{111c1}-\u{111c4}\u{111da}\u{111dc}\u{11200}-\u{11211}" +
- "\u{11213}-\u{1122b}\u{11280}-\u{11286}\u{11288}" +
- "\u{1128a}-\u{1128d}\u{1128f}-\u{1129d}\u{1129f}-\u{112a8}" +
- "\u{112b0}-\u{112de}\u{11305}-\u{1130c}\u{1130f}\u{11310}" +
- "\u{11313}-\u{11328}\u{1132a}-\u{11330}\u{11332}\u{11333}" +
- "\u{11335}-\u{11339}\u{1133d}\u{11350}\u{1135d}-\u{11361}" +
- "\u{11400}-\u{11434}\u{11447}-\u{1144a}\u{1145f}" +
- "\u{11480}-\u{114af}\u{114c4}\u{114c5}\u{114c7}" +
- "\u{11580}-\u{115ae}\u{115d8}-\u{115db}\u{11600}-\u{1162f}" +
- "\u{11644}\u{11680}-\u{116aa}\u{116b8}\u{11700}-\u{1171a}" +
- "\u{11800}-\u{1182b}\u{118a0}-\u{118df}\u{118ff}" +
- "\u{119a0}-\u{119a7}\u{119aa}-\u{119d0}\u{119e1}\u{119e3}" +
- "\u{11a00}\u{11a0b}-\u{11a32}\u{11a3a}\u{11a50}" +
- "\u{11a5c}-\u{11a89}\u{11a9d}\u{11ac0}-\u{11af8}" +
- "\u{11c00}-\u{11c08}\u{11c0a}-\u{11c2e}\u{11c40}" +
- "\u{11c72}-\u{11c8f}\u{11d00}-\u{11d06}\u{11d08}\u{11d09}" +
- "\u{11d0b}-\u{11d30}\u{11d46}\u{11d60}-\u{11d65}" +
- "\u{11d67}\u{11d68}\u{11d6a}-\u{11d89}\u{11d98}" +
- "\u{11ee0}-\u{11ef2}\u{12000}-\u{12399}\u{12400}-\u{1246e}" +
- "\u{12480}-\u{12543}\u{13000}-\u{1342e}\u{14400}-\u{14646}" +
- "\u{16800}-\u{16a38}\u{16a40}-\u{16a5e}\u{16ad0}-\u{16aed}" +
- "\u{16b00}-\u{16b2f}\u{16b40}-\u{16b43}\u{16b63}-\u{16b77}" +
- "\u{16b7d}-\u{16b8f}\u{16e40}-\u{16e7f}\u{16f00}-\u{16f4a}" +
- "\u{16f50}\u{16f93}-\u{16f9f}\u{16fe0}\u{16fe1}\u{16fe3}" +
- "\u{17000}-\u{187f7}\u{18800}-\u{18af2}\u{1b000}-\u{1b11e}" +
- "\u{1b150}-\u{1b152}\u{1b164}-\u{1b167}\u{1b170}-\u{1b2fb}" +
- "\u{1bc00}-\u{1bc6a}\u{1bc70}-\u{1bc7c}\u{1bc80}-\u{1bc88}" +
- "\u{1bc90}-\u{1bc99}\u{1d400}-\u{1d454}\u{1d456}-\u{1d49c}" +
- "\u{1d49e}\u{1d49f}\u{1d4a2}\u{1d4a5}\u{1d4a6}" +
- "\u{1d4a9}-\u{1d4ac}\u{1d4ae}-\u{1d4b9}\u{1d4bb}" +
- "\u{1d4bd}-\u{1d4c3}\u{1d4c5}-\u{1d505}\u{1d507}-\u{1d50a}" +
- "\u{1d50d}-\u{1d514}\u{1d516}-\u{1d51c}\u{1d51e}-\u{1d539}" +
- "\u{1d53b}-\u{1d53e}\u{1d540}-\u{1d544}\u{1d546}" +
- "\u{1d54a}-\u{1d550}\u{1d552}-\u{1d6a5}\u{1d6a8}-\u{1d6c0}" +
- "\u{1d6c2}-\u{1d6da}\u{1d6dc}-\u{1d6fa}\u{1d6fc}-\u{1d714}" +
- "\u{1d716}-\u{1d734}\u{1d736}-\u{1d74e}\u{1d750}-\u{1d76e}" +
- "\u{1d770}-\u{1d788}\u{1d78a}-\u{1d7a8}\u{1d7aa}-\u{1d7c2}" +
- "\u{1d7c4}-\u{1d7cb}\u{1e100}-\u{1e12c}\u{1e137}-\u{1e13d}" +
- "\u{1e14e}\u{1e2c0}-\u{1e2eb}\u{1e800}-\u{1e8c4}" +
- "\u{1e900}-\u{1e943}\u{1e94b}\u{1ee00}-\u{1ee03}" +
- "\u{1ee05}-\u{1ee1f}\u{1ee21}\u{1ee22}\u{1ee24}\u{1ee27}" +
- "\u{1ee29}-\u{1ee32}\u{1ee34}-\u{1ee37}\u{1ee39}\u{1ee3b}" +
- "\u{1ee42}\u{1ee47}\u{1ee49}\u{1ee4b}\u{1ee4d}-\u{1ee4f}" +
- "\u{1ee51}\u{1ee52}\u{1ee54}\u{1ee57}\u{1ee59}\u{1ee5b}" +
- "\u{1ee5d}\u{1ee5f}\u{1ee61}\u{1ee62}\u{1ee64}" +
- "\u{1ee67}-\u{1ee6a}\u{1ee6c}-\u{1ee72}\u{1ee74}-\u{1ee77}" +
- "\u{1ee79}-\u{1ee7c}\u{1ee7e}\u{1ee80}-\u{1ee89}" +
- "\u{1ee8b}-\u{1ee9b}\u{1eea1}-\u{1eea3}\u{1eea5}-\u{1eea9}" +
- "\u{1eeab}-\u{1eebb}\u{20000}-\u{2a6d6}\u{2a700}-\u{2b734}" +
- "\u{2b740}-\u{2b81d}\u{2b820}-\u{2cea1}\u{2ceb0}-\u{2ebe0}" +
- "\u{2f800}-\u{2fa1d}]$", "u");
- }
- return largeIdStartPattern.test(String.fromCodePoint(cp));
+ return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges()));
}
function isLargeIdContinue(cp) {
- if (!largeIdContinuePattern) {
- largeIdContinuePattern = new RegExp("^[\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\u08d3-\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\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82" +
- "\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef" +
- "\u0c00-\u0c04\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\u0d82\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-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773" +
- "\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819" +
- "\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da" +
- "\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89" +
- "\u1a90-\u1a99\u1ab0-\u1abd\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-\u1df9\u1dfb-\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\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\u{101fd}\u{102e0}" +
- "\u{10376}-\u{1037a}\u{104a0}-\u{104a9}\u{10a01}-\u{10a03}" +
- "\u{10a05}\u{10a06}\u{10a0c}-\u{10a0f}\u{10a38}-\u{10a3a}" +
- "\u{10a3f}\u{10ae5}\u{10ae6}\u{10d24}-\u{10d27}" +
- "\u{10d30}-\u{10d39}\u{10f46}-\u{10f50}\u{11000}-\u{11002}" +
- "\u{11038}-\u{11046}\u{11066}-\u{1106f}\u{1107f}-\u{11082}" +
- "\u{110b0}-\u{110ba}\u{110f0}-\u{110f9}\u{11100}-\u{11102}" +
- "\u{11127}-\u{11134}\u{11136}-\u{1113f}\u{11145}\u{11146}" +
- "\u{11173}\u{11180}-\u{11182}\u{111b3}-\u{111c0}" +
- "\u{111c9}-\u{111cc}\u{111d0}-\u{111d9}\u{1122c}-\u{11237}" +
- "\u{1123e}\u{112df}-\u{112ea}\u{112f0}-\u{112f9}" +
- "\u{11300}-\u{11303}\u{1133b}\u{1133c}\u{1133e}-\u{11344}" +
- "\u{11347}\u{11348}\u{1134b}-\u{1134d}\u{11357}" +
- "\u{11362}\u{11363}\u{11366}-\u{1136c}\u{11370}-\u{11374}" +
- "\u{11435}-\u{11446}\u{11450}-\u{11459}\u{1145e}" +
- "\u{114b0}-\u{114c3}\u{114d0}-\u{114d9}\u{115af}-\u{115b5}" +
- "\u{115b8}-\u{115c0}\u{115dc}\u{115dd}\u{11630}-\u{11640}" +
- "\u{11650}-\u{11659}\u{116ab}-\u{116b7}\u{116c0}-\u{116c9}" +
- "\u{1171d}-\u{1172b}\u{11730}-\u{11739}\u{1182c}-\u{1183a}" +
- "\u{118e0}-\u{118e9}\u{119d1}-\u{119d7}\u{119da}-\u{119e0}" +
- "\u{119e4}\u{11a01}-\u{11a0a}\u{11a33}-\u{11a39}" +
- "\u{11a3b}-\u{11a3e}\u{11a47}\u{11a51}-\u{11a5b}" +
- "\u{11a8a}-\u{11a99}\u{11c2f}-\u{11c36}\u{11c38}-\u{11c3f}" +
- "\u{11c50}-\u{11c59}\u{11c92}-\u{11ca7}\u{11ca9}-\u{11cb6}" +
- "\u{11d31}-\u{11d36}\u{11d3a}\u{11d3c}\u{11d3d}" +
- "\u{11d3f}-\u{11d45}\u{11d47}\u{11d50}-\u{11d59}" +
- "\u{11d8a}-\u{11d8e}\u{11d90}\u{11d91}\u{11d93}-\u{11d97}" +
- "\u{11da0}-\u{11da9}\u{11ef3}-\u{11ef6}\u{16a60}-\u{16a69}" +
- "\u{16af0}-\u{16af4}\u{16b30}-\u{16b36}\u{16b50}-\u{16b59}" +
- "\u{16f4f}\u{16f51}-\u{16f87}\u{16f8f}-\u{16f92}" +
- "\u{1bc9d}\u{1bc9e}\u{1d165}-\u{1d169}\u{1d16d}-\u{1d172}" +
- "\u{1d17b}-\u{1d182}\u{1d185}-\u{1d18b}\u{1d1aa}-\u{1d1ad}" +
- "\u{1d242}-\u{1d244}\u{1d7ce}-\u{1d7ff}\u{1da00}-\u{1da36}" +
- "\u{1da3b}-\u{1da6c}\u{1da75}\u{1da84}\u{1da9b}-\u{1da9f}" +
- "\u{1daa1}-\u{1daaf}\u{1e000}-\u{1e006}\u{1e008}-\u{1e018}" +
- "\u{1e01b}-\u{1e021}\u{1e023}\u{1e024}\u{1e026}-\u{1e02a}" +
- "\u{1e130}-\u{1e136}\u{1e140}-\u{1e149}\u{1e2ec}-\u{1e2f9}" +
- "\u{1e8d0}-\u{1e8d6}\u{1e944}-\u{1e94a}\u{1e950}-\u{1e959}" +
- "\u{e0100}-\u{e01ef}]$", "u");
- }
- return largeIdContinuePattern.test(String.fromCodePoint(cp));
+ return isInRange(cp, largeIdContinueRanges ||
+ (largeIdContinueRanges = initLargeIdContinueRanges()));
}
-
-const gcNamePattern = /^(?:General_Category|gc)$/u;
-const scNamePattern = /^(?:Script(?:_Extensions)?|scx?)$/u;
-const gcValuePatterns = {
- es2018: null,
- es2019: null,
- es2020: null,
-};
-const scValuePatterns = {
- es2018: null,
- es2019: null,
- es2020: null,
-};
-const binPropertyPatterns = {
- es2018: null,
- es2019: null,
- es2020: null,
-};
-function isValidUnicodeProperty(version, name, value) {
- if (gcNamePattern.test(name)) {
- if (version >= 2018) {
- if (!gcValuePatterns.es2018) {
- gcValuePatterns.es2018 = new RegExp("^(?:C|Cased_Letter|Cc|Cf|Close_Punctuation|Cn|Co|" +
- "Combining_Mark|Connector_Punctuation|Control|Cs|" +
- "Currency_Symbol|Dash_Punctuation|Decimal_Number|" +
- "Enclosing_Mark|Final_Punctuation|Format|" +
- "Initial_Punctuation|L|LC|Letter|Letter_Number|" +
- "Line_Separator|Ll|Lm|Lo|Lowercase_Letter|Lt|Lu|M|" +
- "Mark|Math_Symbol|Mc|Me|Mn|Modifier_Letter|" +
- "Modifier_Symbol|N|Nd|Nl|No|Nonspacing_Mark|Number|" +
- "Open_Punctuation|Other|Other_Letter|Other_Number|" +
- "Other_Punctuation|Other_Symbol|P|" +
- "Paragraph_Separator|Pc|Pd|Pe|Pf|Pi|Po|Private_Use|" +
- "Ps|Punctuation|S|Sc|Separator|Sk|Sm|So|" +
- "Space_Separator|Spacing_Mark|Surrogate|Symbol|" +
- "Titlecase_Letter|Unassigned|Uppercase_Letter|Z|Zl|" +
- "Zp|Zs|cntrl|digit|punct)$", "u");
- }
- if (gcValuePatterns.es2018.test(value)) {
- return true;
- }
- }
- }
- if (scNamePattern.test(name)) {
- if (version >= 2018) {
- if (!scValuePatterns.es2018) {
- scValuePatterns.es2018 = new RegExp("^(?:Adlam|Adlm|Aghb|Ahom|Anatolian_Hieroglyphs|Arab|" +
- "Arabic|Armenian|Armi|Armn|Avestan|Avst|Bali|" +
- "Balinese|Bamu|Bamum|Bass|Bassa_Vah|Batak|Batk|Beng|" +
- "Bengali|Bhaiksuki|Bhks|Bopo|Bopomofo|Brah|Brahmi|" +
- "Brai|Braille|Bugi|Buginese|Buhd|Buhid|Cakm|" +
- "Canadian_Aboriginal|Cans|Cari|Carian|" +
- "Caucasian_Albanian|Chakma|Cham|Cher|Cherokee|Common|" +
- "Copt|Coptic|Cprt|Cuneiform|Cypriot|Cyrillic|Cyrl|" +
- "Deseret|Deva|Devanagari|Dsrt|Dupl|Duployan|Egyp|" +
- "Egyptian_Hieroglyphs|Elba|Elbasan|Ethi|Ethiopic|" +
- "Geor|Georgian|Glag|Glagolitic|Gonm|Goth|Gothic|Gran|" +
- "Grantha|Greek|Grek|Gujarati|Gujr|Gurmukhi|Guru|Han|" +
- "Hang|Hangul|Hani|Hano|Hanunoo|Hatr|Hatran|Hebr|" +
- "Hebrew|Hira|Hiragana|Hluw|Hmng|Hung|" +
- "Imperial_Aramaic|Inherited|Inscriptional_Pahlavi|" +
- "Inscriptional_Parthian|Ital|Java|Javanese|Kaithi|" +
- "Kali|Kana|Kannada|Katakana|Kayah_Li|Khar|Kharoshthi|" +
- "Khmer|Khmr|Khoj|Khojki|Khudawadi|Knda|Kthi|Lana|Lao|" +
- "Laoo|Latin|Latn|Lepc|Lepcha|Limb|Limbu|Lina|Linb|" +
- "Linear_A|Linear_B|Lisu|Lyci|Lycian|Lydi|Lydian|" +
- "Mahajani|Mahj|Malayalam|Mand|Mandaic|Mani|" +
- "Manichaean|Marc|Marchen|Masaram_Gondi|Meetei_Mayek|" +
- "Mend|Mende_Kikakui|Merc|Mero|Meroitic_Cursive|" +
- "Meroitic_Hieroglyphs|Miao|Mlym|Modi|Mong|Mongolian|" +
- "Mro|Mroo|Mtei|Mult|Multani|Myanmar|Mymr|Nabataean|" +
- "Narb|Nbat|New_Tai_Lue|Newa|Nko|Nkoo|Nshu|Nushu|Ogam|" +
- "Ogham|Ol_Chiki|Olck|Old_Hungarian|Old_Italic|" +
- "Old_North_Arabian|Old_Permic|Old_Persian|" +
- "Old_South_Arabian|Old_Turkic|Oriya|Orkh|Orya|Osage|" +
- "Osge|Osma|Osmanya|Pahawh_Hmong|Palm|Palmyrene|" +
- "Pau_Cin_Hau|Pauc|Perm|Phag|Phags_Pa|Phli|Phlp|Phnx|" +
- "Phoenician|Plrd|Prti|Psalter_Pahlavi|Qaac|Qaai|" +
- "Rejang|Rjng|Runic|Runr|Samaritan|Samr|Sarb|Saur|" +
- "Saurashtra|Sgnw|Sharada|Shavian|Shaw|Shrd|Sidd|" +
- "Siddham|SignWriting|Sind|Sinh|Sinhala|Sora|" +
- "Sora_Sompeng|Soyo|Soyombo|Sund|Sundanese|Sylo|" +
- "Syloti_Nagri|Syrc|Syriac|Tagalog|Tagb|Tagbanwa|" +
- "Tai_Le|Tai_Tham|Tai_Viet|Takr|Takri|Tale|Talu|Tamil|" +
- "Taml|Tang|Tangut|Tavt|Telu|Telugu|Tfng|Tglg|Thaa|" +
- "Thaana|Thai|Tibetan|Tibt|Tifinagh|Tirh|Tirhuta|Ugar|" +
- "Ugaritic|Vai|Vaii|Wara|Warang_Citi|Xpeo|Xsux|Yi|" +
- "Yiii|Zanabazar_Square|Zanb|Zinh|Zyyy)$", "u");
- }
- if (scValuePatterns.es2018.test(value)) {
- return true;
- }
- }
- if (version >= 2019) {
- if (!scValuePatterns.es2019) {
- scValuePatterns.es2019 = new RegExp("^(?:Dogr|Dogra|Gong|Gunjala_Gondi|Hanifi_Rohingya|" +
- "Maka|Makasar|Medefaidrin|Medf|Old_Sogdian|Rohg|Sogd|" +
- "Sogdian|Sogo)$", "u");
- }
- if (scValuePatterns.es2019.test(value)) {
- return true;
- }
+function initLargeIdStartRanges() {
+ return restoreRanges("170 0 11 0 5 0 6 22 2 30 2 457 5 11 15 4 8 0 2 0 130 4 2 1 3 3 2 0 7 0 2 2 2 0 2 19 2 82 2 138 9 165 2 37 3 0 7 40 72 26 5 3 46 42 36 1 2 98 2 0 16 1 8 1 11 2 3 0 17 0 2 29 30 88 12 0 25 32 10 1 5 0 6 21 5 0 10 0 4 0 24 24 8 10 54 20 2 17 61 53 4 0 19 0 8 9 16 15 5 7 3 1 3 21 2 6 2 0 4 3 4 0 17 0 14 1 2 2 15 1 11 0 9 5 5 1 3 21 2 6 2 1 2 1 2 1 32 3 2 0 20 2 17 8 2 2 2 21 2 6 2 1 2 4 4 0 19 0 16 1 24 0 12 7 3 1 3 21 2 6 2 1 2 4 4 0 31 1 2 2 16 0 18 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 11 23 0 53 7 2 2 2 22 2 15 4 0 27 2 6 1 31 0 5 7 2 2 2 22 2 9 2 4 4 0 33 0 2 1 16 1 18 8 2 2 2 40 3 0 17 0 6 2 9 2 25 5 6 17 4 23 2 8 2 0 3 6 59 47 2 1 13 6 59 1 2 0 2 4 2 23 2 0 2 9 2 1 10 0 3 4 2 0 22 3 33 0 64 7 2 35 28 4 116 42 21 0 17 5 5 3 4 0 4 1 8 2 5 12 13 0 18 37 2 0 6 0 3 42 2 332 2 3 3 6 2 0 2 3 3 40 2 3 3 32 2 3 3 6 2 0 2 3 3 14 2 56 2 3 3 66 38 15 17 85 3 5 4 619 3 16 2 25 6 74 4 10 8 12 2 3 15 17 15 17 15 12 2 2 16 51 36 0 5 0 68 88 8 40 2 0 6 69 11 30 50 29 3 4 12 43 5 25 55 22 10 52 83 0 94 46 18 6 56 29 14 1 11 43 27 35 42 2 11 35 3 8 8 42 3 2 42 3 2 5 2 1 4 0 6 191 65 277 3 5 3 37 3 5 3 7 2 0 2 0 2 0 2 30 3 52 2 6 2 0 4 2 2 6 4 3 3 5 5 12 6 2 2 6 117 0 14 0 17 12 102 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 15 3 3 6 4 5 0 18 40 2680 46 2 46 2 132 7 3 4 1 13 37 2 0 6 0 3 55 8 0 17 22 10 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 551 2 26 8 8 4 3 4 5 85 5 4 2 89 2 3 6 42 2 93 18 31 49 15 513 6591 65 20988 4 1164 68 45 3 268 4 15 11 1 21 46 17 30 3 79 40 8 3 102 3 52 3 8 43 12 2 2 2 3 2 22 30 51 15 49 63 5 4 0 2 1 12 27 11 22 26 28 8 46 29 0 17 4 2 9 11 4 2 40 24 2 2 7 21 22 4 0 4 49 2 0 4 1 3 4 3 0 2 0 25 2 3 10 8 2 13 5 3 5 3 5 10 6 2 6 2 42 2 13 7 114 30 11171 13 22 5 48 8453 365 3 105 39 6 13 4 6 0 2 9 2 12 2 4 2 0 2 1 2 1 2 107 34 362 19 63 3 53 41 11 117 4 2 134 37 25 7 25 12 88 4 5 3 5 3 5 3 2 36 11 2 25 2 18 2 1 2 14 3 13 35 122 70 52 268 28 4 48 48 31 14 29 6 37 11 29 3 35 5 7 2 4 43 157 19 35 5 35 5 39 9 51 157 310 10 21 11 7 153 5 3 0 2 43 2 1 4 0 3 22 11 22 10 30 66 18 2 1 11 21 11 25 71 55 7 1 65 0 16 3 2 2 2 28 43 28 4 28 36 7 2 27 28 53 11 21 11 18 14 17 111 72 56 50 14 50 14 35 349 41 7 1 79 28 11 0 9 21 107 20 28 22 13 52 76 44 33 24 27 35 30 0 3 0 9 34 4 0 13 47 15 3 22 0 2 0 36 17 2 24 85 6 2 0 2 3 2 14 2 9 8 46 39 7 3 1 3 21 2 6 2 1 2 4 4 0 19 0 13 4 159 52 19 3 21 2 31 47 21 1 2 0 185 46 42 3 37 47 21 0 60 42 14 0 72 26 230 43 117 63 32 7 3 0 3 7 2 1 2 23 16 0 2 0 95 7 3 38 17 0 2 0 29 0 11 39 8 0 22 0 12 45 20 0 35 56 264 8 2 36 18 0 50 29 113 6 2 1 2 37 22 0 26 5 2 1 2 31 15 0 328 18 190 0 80 921 103 110 18 195 2749 1070 4050 582 8634 568 8 30 114 29 19 47 17 3 32 20 6 18 689 63 129 74 6 0 67 12 65 1 2 0 29 6135 9 1237 43 8 8952 286 50 2 18 3 9 395 2309 106 6 12 4 8 8 9 5991 84 2 70 2 1 3 0 3 1 3 3 2 11 2 0 2 6 2 64 2 3 3 7 2 6 2 27 2 3 2 4 2 0 4 6 2 339 3 24 2 24 2 30 2 24 2 30 2 24 2 30 2 24 2 30 2 24 2 7 2357 44 11 6 17 0 370 43 1301 196 60 67 8 0 1205 3 2 26 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 16 6 2 2 4 2 16 4421 42717 35 4148 12 221 3 5761 15 7472 3104 541 1507 4938");
+}
+function initLargeIdContinueRanges() {
+ return restoreRanges("183 0 585 111 24 0 252 4 266 44 2 0 2 1 2 1 2 0 73 10 49 30 7 0 102 6 3 5 3 1 2 3 3 9 24 0 31 26 92 10 16 9 34 8 10 0 25 3 2 8 2 2 2 4 44 2 120 14 2 32 55 2 2 17 2 6 11 1 3 9 18 2 57 0 2 6 3 1 3 2 10 0 11 1 3 9 15 0 3 2 57 0 2 4 5 1 3 2 4 0 21 11 4 0 12 2 57 0 2 7 2 2 2 2 21 1 3 9 11 5 2 2 57 0 2 6 3 1 3 2 8 2 11 1 3 9 19 0 60 4 4 2 2 3 10 0 15 9 17 4 58 6 2 2 2 3 8 1 12 1 3 9 18 2 57 0 2 6 2 2 2 3 8 1 12 1 3 9 17 3 56 1 2 6 2 2 2 3 10 0 11 1 3 9 18 2 71 0 5 5 2 0 2 7 7 9 3 1 62 0 3 6 13 7 2 9 88 0 3 8 12 5 3 9 63 1 7 9 12 0 2 0 2 0 5 1 50 19 2 1 6 10 2 35 10 0 101 19 2 9 13 3 5 2 2 2 3 6 4 3 14 11 2 14 704 2 10 8 929 2 30 2 30 1 31 1 65 31 10 0 3 9 34 2 3 9 144 0 119 11 5 11 11 9 129 10 61 4 58 9 2 28 3 10 7 9 23 13 2 1 64 4 48 16 12 9 18 8 13 2 31 12 3 9 45 13 49 19 9 9 7 9 119 2 2 20 5 0 7 0 3 2 199 57 2 4 576 1 20 0 124 12 5 0 4 11 3071 2 142 0 97 31 555 5 106 1 30086 9 70 0 5 9 33 1 81 1 273 0 4 0 5 0 24 4 5 0 84 1 51 17 11 9 7 17 14 10 29 7 26 12 45 3 48 13 16 9 12 0 11 9 48 13 13 0 9 1 3 9 34 2 51 0 2 2 3 1 6 1 2 0 42 4 6 1 237 7 2 1 3 9 20261 0 738 15 17 15 4 1 25 2 193 9 38 0 702 0 227 0 150 4 294 9 1368 2 2 1 6 3 41 2 5 0 166 1 574 3 9 9 370 1 154 10 176 2 54 14 32 9 16 3 46 10 54 9 7 2 37 13 2 9 6 1 45 0 13 2 49 13 9 3 2 11 83 11 7 0 161 11 6 9 7 3 56 1 2 6 3 1 3 2 10 0 11 1 3 6 4 4 193 17 10 9 5 0 82 19 13 9 214 6 3 8 28 1 83 16 16 9 82 12 9 9 84 14 5 9 243 14 166 9 71 5 2 1 3 3 2 0 2 1 13 9 120 6 3 6 4 0 29 9 41 6 2 3 9 0 10 10 47 15 406 7 2 7 17 9 57 21 2 13 123 5 4 0 2 1 2 6 2 0 9 9 49 4 2 1 2 4 9 9 330 3 19306 9 135 4 60 6 26 9 1014 0 2 54 8 3 82 0 12 1 19628 1 5319 4 4 5 9 7 3 6 31 3 149 2 1418 49 513 54 5 49 9 0 15 0 23 4 2 14 1361 6 2 16 3 6 2 1 2 4 262 6 10 9 419 13 1495 6 110 6 6 9 4759 9 787719 239");
+}
+function isInRange(cp, ranges) {
+ let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0;
+ while (l < r) {
+ i = ((l + r) / 2) | 0;
+ min = ranges[2 * i];
+ max = ranges[2 * i + 1];
+ if (cp < min) {
+ r = i;
+ }
+ else if (cp > max) {
+ l = i + 1;
}
- if (version >= 2020) {
- if (!scValuePatterns.es2020) {
- scValuePatterns.es2020 = new RegExp("^(?:Hmnp|Nand|Nandinagari|Nyiakeng_Puachue_Hmong|" +
- "Wancho|Wcho)$", "u");
- }
- if (scValuePatterns.es2020.test(value)) {
- return true;
- }
+ else {
+ return true;
}
}
return false;
}
-function isValidLoneUnicodeProperty(version, value) {
- if (version >= 2018) {
- if (!binPropertyPatterns.es2018) {
- binPropertyPatterns.es2018 = new RegExp("^(?:AHex|ASCII|ASCII_Hex_Digit|Alpha|Alphabetic|Any|" +
- "Assigned|Bidi_C|Bidi_Control|Bidi_M|Bidi_Mirrored|CI|" +
- "CWCF|CWCM|CWKCF|CWL|CWT|CWU|Case_Ignorable|Cased|" +
- "Changes_When_Casefolded|Changes_When_Casemapped|" +
- "Changes_When_Lowercased|Changes_When_NFKC_Casefolded|" +
- "Changes_When_Titlecased|Changes_When_Uppercased|DI|Dash|" +
- "Default_Ignorable_Code_Point|Dep|Deprecated|Dia|" +
- "Diacritic|Emoji|Emoji_Component|Emoji_Modifier|" +
- "Emoji_Modifier_Base|Emoji_Presentation|Ext|Extender|" +
- "Gr_Base|Gr_Ext|Grapheme_Base|Grapheme_Extend|Hex|" +
- "Hex_Digit|IDC|IDS|IDSB|IDST|IDS_Binary_Operator|" +
- "IDS_Trinary_Operator|ID_Continue|ID_Start|Ideo|" +
- "Ideographic|Join_C|Join_Control|LOE|" +
- "Logical_Order_Exception|Lower|Lowercase|Math|NChar|" +
- "Noncharacter_Code_Point|Pat_Syn|Pat_WS|Pattern_Syntax|" +
- "Pattern_White_Space|QMark|Quotation_Mark|RI|Radical|" +
- "Regional_Indicator|SD|STerm|Sentence_Terminal|" +
- "Soft_Dotted|Term|Terminal_Punctuation|UIdeo|" +
- "Unified_Ideograph|Upper|Uppercase|VS|Variation_Selector|" +
- "White_Space|XIDC|XIDS|XID_Continue|XID_Start|space)$", "u");
- }
- if (binPropertyPatterns.es2018.test(value)) {
- return true;
- }
+function restoreRanges(data) {
+ let last = 0;
+ return data.split(" ").map(s => (last += parseInt(s, 10) | 0));
+}
+
+class DataSet {
+ constructor(raw2018, raw2019, raw2020) {
+ this._raw2018 = raw2018;
+ this._raw2019 = raw2019;
+ this._raw2020 = raw2020;
}
- if (version >= 2019) {
- if (!binPropertyPatterns.es2019) {
- binPropertyPatterns.es2019 = new RegExp("^(?:Extended_Pictographic)$", "u");
- }
- if (binPropertyPatterns.es2019.test(value)) {
- return true;
- }
+ get es2018() {
+ return (this._set2018 || (this._set2018 = new Set(this._raw2018.split(" "))));
+ }
+ get es2019() {
+ return (this._set2019 || (this._set2019 = new Set(this._raw2019.split(" "))));
+ }
+ get es2020() {
+ return (this._set2020 || (this._set2020 = new Set(this._raw2020.split(" "))));
+ }
+}
+const gcNameSet = new Set(["General_Category", "gc"]);
+const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]);
+const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "");
+const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho");
+const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "");
+function isValidUnicodeProperty(version, name, value) {
+ if (gcNameSet.has(name)) {
+ return version >= 2018 && gcValueSets.es2018.has(value);
+ }
+ if (scNameSet.has(name)) {
+ return ((version >= 2018 && scValueSets.es2018.has(value)) ||
+ (version >= 2019 && scValueSets.es2019.has(value)) ||
+ (version >= 2020 && scValueSets.es2020.has(value)));
}
return false;
}
+function isValidLoneUnicodeProperty(version, value) {
+ return ((version >= 2018 && binPropertySets.es2018.has(value)) ||
+ (version >= 2019 && binPropertySets.es2019.has(value)));
+}
const Backspace = 0x08;
const CharacterTabulation = 0x09;
@@ -537,6 +208,15 @@ function digitToInt(code) {
}
return code - DigitZero;
}
+function isLeadSurrogate(code) {
+ return code >= 0xd800 && code <= 0xdbff;
+}
+function isTrailSurrogate(code) {
+ return code >= 0xdc00 && code <= 0xdfff;
+}
+function combineSurrogatePair(lead, trail) {
+ return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000;
+}
const legacyImpl = {
at(s, end, i) {
@@ -765,13 +445,13 @@ class RegExpValidator {
this._uFlag = uFlag && this.ecmaVersion >= 2015;
this._nFlag = uFlag && this.ecmaVersion >= 2018;
this.reset(source, start, end);
- this.pattern();
+ this.consumePattern();
if (!this._nFlag &&
this.ecmaVersion >= 2018 &&
this._groupNames.size > 0) {
this._nFlag = true;
this.rewind(start);
- this.pattern();
+ this.consumePattern();
}
}
get strict() {
@@ -979,13 +659,13 @@ class RegExpValidator {
}
return this.index !== start;
}
- pattern() {
+ consumePattern() {
const start = this.index;
this._numCapturingParens = this.countCapturingParens();
this._groupNames.clear();
this._backreferenceNames.clear();
this.onPatternEnter(start);
- this.disjunction();
+ this.consumeDisjunction();
const cp = this.currentCodePoint;
if (this.currentCodePoint !== -1) {
if (cp === RightParenthesis) {
@@ -1039,15 +719,14 @@ class RegExpValidator {
this.rewind(start);
return count;
}
- disjunction() {
+ consumeDisjunction() {
const start = this.index;
let i = 0;
this.onDisjunctionEnter(start);
- this.alternative(i++);
- while (this.eat(VerticalLine)) {
- this.alternative(i++);
- }
- if (this.eatQuantifier(true)) {
+ do {
+ this.consumeAlternative(i++);
+ } while (this.eat(VerticalLine));
+ if (this.consumeQuantifier(true)) {
this.raise("Nothing to repeat");
}
if (this.eat(LeftCurlyBracket)) {
@@ -1055,27 +734,28 @@ class RegExpValidator {
}
this.onDisjunctionLeave(start, this.index);
}
- alternative(i) {
+ consumeAlternative(i) {
const start = this.index;
this.onAlternativeEnter(start, i);
- while (this.currentCodePoint !== -1 && this.eatTerm()) {
+ while (this.currentCodePoint !== -1 && this.consumeTerm()) {
}
this.onAlternativeLeave(start, this.index, i);
}
- eatTerm() {
- if (this.eatAssertion()) {
- if (this._lastAssertionIsQuantifiable) {
- this.eatQuantifier();
- }
- return true;
+ consumeTerm() {
+ if (this._uFlag || this.strict) {
+ return (this.consumeAssertion() ||
+ (this.consumeAtom() && this.consumeOptionalQuantifier()));
}
- if (this.strict ? this.eatAtom() : this.eatExtendedAtom()) {
- this.eatQuantifier();
- return true;
- }
- return false;
+ return ((this.consumeAssertion() &&
+ (!this._lastAssertionIsQuantifiable ||
+ this.consumeOptionalQuantifier())) ||
+ (this.consumeExtendedAtom() && this.consumeOptionalQuantifier()));
}
- eatAssertion() {
+ consumeOptionalQuantifier() {
+ this.consumeQuantifier();
+ return true;
+ }
+ consumeAssertion() {
const start = this.index;
this._lastAssertionIsQuantifiable = false;
if (this.eat(CircumflexAccent)) {
@@ -1100,7 +780,7 @@ class RegExpValidator {
if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) {
const kind = lookbehind ? "lookbehind" : "lookahead";
this.onLookaroundAssertionEnter(start, kind, negate);
- this.disjunction();
+ this.consumeDisjunction();
if (!this.eat(RightParenthesis)) {
this.raise("Unterminated group");
}
@@ -1112,7 +792,7 @@ class RegExpValidator {
}
return false;
}
- eatQuantifier(noError = false) {
+ consumeQuantifier(noConsume = false) {
const start = this.index;
let min = 0;
let max = 0;
@@ -1129,7 +809,7 @@ class RegExpValidator {
min = 0;
max = 1;
}
- else if (this.eatBracedQuantifier(noError)) {
+ else if (this.eatBracedQuantifier(noConsume)) {
min = this._lastMinValue;
max = this._lastMaxValue;
}
@@ -1137,7 +817,7 @@ class RegExpValidator {
return false;
}
greedy = !this.eat(QuestionMark);
- if (!noError) {
+ if (!noConsume) {
this.onQuantifier(start, this.index, min, max, greedy);
}
return true;
@@ -1161,43 +841,43 @@ class RegExpValidator {
return true;
}
}
- if (!noError && this.strict) {
+ if (!noError && (this._uFlag || this.strict)) {
this.raise("Incomplete quantifier");
}
this.rewind(start);
}
return false;
}
- eatAtom() {
- return (this.eatPatternCharacter() ||
- this.eatDot() ||
- this.eatReverseSolidusAtomEscape() ||
- this.eatCharacterClass() ||
- this.eatUncapturingGroup() ||
- this.eatCapturingGroup());
+ consumeAtom() {
+ return (this.consumePatternCharacter() ||
+ this.consumeDot() ||
+ this.consumeReverseSolidusAtomEscape() ||
+ this.consumeCharacterClass() ||
+ this.consumeUncapturingGroup() ||
+ this.consumeCapturingGroup());
}
- eatDot() {
+ consumeDot() {
if (this.eat(FullStop)) {
this.onAnyCharacterSet(this.index - 1, this.index, "any");
return true;
}
return false;
}
- eatReverseSolidusAtomEscape() {
+ consumeReverseSolidusAtomEscape() {
const start = this.index;
if (this.eat(ReverseSolidus)) {
- if (this.eatAtomEscape()) {
+ if (this.consumeAtomEscape()) {
return true;
}
this.rewind(start);
}
return false;
}
- eatUncapturingGroup() {
+ consumeUncapturingGroup() {
const start = this.index;
if (this.eat3(LeftParenthesis, QuestionMark, Colon)) {
this.onGroupEnter(start);
- this.disjunction();
+ this.consumeDisjunction();
if (!this.eat(RightParenthesis)) {
this.raise("Unterminated group");
}
@@ -1206,19 +886,20 @@ class RegExpValidator {
}
return false;
}
- eatCapturingGroup() {
+ consumeCapturingGroup() {
const start = this.index;
if (this.eat(LeftParenthesis)) {
- this._lastStrValue = "";
+ let name = null;
if (this.ecmaVersion >= 2018) {
- this.groupSpecifier();
+ if (this.consumeGroupSpecifier()) {
+ name = this._lastStrValue;
+ }
}
else if (this.currentCodePoint === QuestionMark) {
this.raise("Invalid group");
}
- const name = this._lastStrValue || null;
this.onCapturingGroupEnter(start, name);
- this.disjunction();
+ this.consumeDisjunction();
if (!this.eat(RightParenthesis)) {
this.raise("Unterminated group");
}
@@ -1227,41 +908,34 @@ class RegExpValidator {
}
return false;
}
- eatExtendedAtom() {
- return (this.eatDot() ||
- this.eatReverseSolidusAtomEscape() ||
- this.eatReverseSolidusFollowedByC() ||
- this.eatCharacterClass() ||
- this.eatUncapturingGroup() ||
- this.eatCapturingGroup() ||
- this.eatInvalidBracedQuantifier() ||
- this.eatExtendedPatternCharacter());
- }
- eatReverseSolidusFollowedByC() {
+ consumeExtendedAtom() {
+ return (this.consumeDot() ||
+ this.consumeReverseSolidusAtomEscape() ||
+ this.consumeReverseSolidusFollowedByC() ||
+ this.consumeCharacterClass() ||
+ this.consumeUncapturingGroup() ||
+ this.consumeCapturingGroup() ||
+ this.consumeInvalidBracedQuantifier() ||
+ this.consumeExtendedPatternCharacter());
+ }
+ consumeReverseSolidusFollowedByC() {
+ const start = this.index;
if (this.currentCodePoint === ReverseSolidus &&
this.nextCodePoint === LatinSmallLetterC) {
this._lastIntValue = this.currentCodePoint;
this.advance();
- this.onCharacter(this.index - 1, this.index, ReverseSolidus);
+ this.onCharacter(start, this.index, ReverseSolidus);
return true;
}
return false;
}
- eatInvalidBracedQuantifier() {
+ consumeInvalidBracedQuantifier() {
if (this.eatBracedQuantifier(true)) {
this.raise("Nothing to repeat");
}
return false;
}
- eatSyntaxCharacter() {
- if (isSyntaxCharacter(this.currentCodePoint)) {
- this._lastIntValue = this.currentCodePoint;
- this.advance();
- return true;
- }
- return false;
- }
- eatPatternCharacter() {
+ consumePatternCharacter() {
const start = this.index;
const cp = this.currentCodePoint;
if (cp !== -1 && !isSyntaxCharacter(cp)) {
@@ -1271,7 +945,7 @@ class RegExpValidator {
}
return false;
}
- eatExtendedPatternCharacter() {
+ consumeExtendedPatternCharacter() {
const start = this.index;
const cp = this.currentCodePoint;
if (cp !== -1 &&
@@ -1292,21 +966,216 @@ class RegExpValidator {
}
return false;
}
- groupSpecifier() {
- this._lastStrValue = "";
+ consumeGroupSpecifier() {
if (this.eat(QuestionMark)) {
if (this.eatGroupName()) {
if (!this._groupNames.has(this._lastStrValue)) {
this._groupNames.add(this._lastStrValue);
- return;
+ return true;
}
this.raise("Duplicate capture group name");
}
this.raise("Invalid group");
}
+ return false;
+ }
+ consumeAtomEscape() {
+ if (this.consumeBackreference() ||
+ this.consumeCharacterClassEscape() ||
+ this.consumeCharacterEscape() ||
+ (this._nFlag && this.consumeKGroupName())) {
+ return true;
+ }
+ if (this.strict || this._uFlag) {
+ this.raise("Invalid escape");
+ }
+ return false;
+ }
+ consumeBackreference() {
+ const start = this.index;
+ if (this.eatDecimalEscape()) {
+ const n = this._lastIntValue;
+ if (n <= this._numCapturingParens) {
+ this.onBackreference(start - 1, this.index, n);
+ return true;
+ }
+ if (this.strict || this._uFlag) {
+ this.raise("Invalid escape");
+ }
+ this.rewind(start);
+ }
+ return false;
+ }
+ consumeCharacterClassEscape() {
+ const start = this.index;
+ if (this.eat(LatinSmallLetterD)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "digit", false);
+ return true;
+ }
+ if (this.eat(LatinCapitalLetterD)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "digit", true);
+ return true;
+ }
+ if (this.eat(LatinSmallLetterS)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "space", false);
+ return true;
+ }
+ if (this.eat(LatinCapitalLetterS)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "space", true);
+ return true;
+ }
+ if (this.eat(LatinSmallLetterW)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "word", false);
+ return true;
+ }
+ if (this.eat(LatinCapitalLetterW)) {
+ this._lastIntValue = -1;
+ this.onEscapeCharacterSet(start - 1, this.index, "word", true);
+ return true;
+ }
+ let negate = false;
+ if (this._uFlag &&
+ this.ecmaVersion >= 2018 &&
+ (this.eat(LatinSmallLetterP) ||
+ (negate = this.eat(LatinCapitalLetterP)))) {
+ this._lastIntValue = -1;
+ if (this.eat(LeftCurlyBracket) &&
+ this.eatUnicodePropertyValueExpression() &&
+ this.eat(RightCurlyBracket)) {
+ this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate);
+ return true;
+ }
+ this.raise("Invalid property name");
+ }
+ return false;
+ }
+ consumeCharacterEscape() {
+ const start = this.index;
+ if (this.eatControlEscape() ||
+ this.eatCControlLetter() ||
+ this.eatZero() ||
+ this.eatHexEscapeSequence() ||
+ this.eatRegExpUnicodeEscapeSequence() ||
+ (!this.strict &&
+ !this._uFlag &&
+ this.eatLegacyOctalEscapeSequence()) ||
+ this.eatIdentityEscape()) {
+ this.onCharacter(start - 1, this.index, this._lastIntValue);
+ return true;
+ }
+ return false;
+ }
+ consumeKGroupName() {
+ const start = this.index;
+ if (this.eat(LatinSmallLetterK)) {
+ if (this.eatGroupName()) {
+ const groupName = this._lastStrValue;
+ this._backreferenceNames.add(groupName);
+ this.onBackreference(start - 1, this.index, groupName);
+ return true;
+ }
+ this.raise("Invalid named reference");
+ }
+ return false;
+ }
+ consumeCharacterClass() {
+ const start = this.index;
+ if (this.eat(LeftSquareBracket)) {
+ const negate = this.eat(CircumflexAccent);
+ this.onCharacterClassEnter(start, negate);
+ this.consumeClassRanges();
+ if (!this.eat(RightSquareBracket)) {
+ this.raise("Unterminated character class");
+ }
+ this.onCharacterClassLeave(start, this.index, negate);
+ return true;
+ }
+ return false;
+ }
+ consumeClassRanges() {
+ const strict = this.strict || this._uFlag;
+ for (;;) {
+ const rangeStart = this.index;
+ if (!this.consumeClassAtom()) {
+ break;
+ }
+ const min = this._lastIntValue;
+ if (!this.eat(HyphenMinus)) {
+ continue;
+ }
+ this.onCharacter(this.index - 1, this.index, HyphenMinus);
+ if (!this.consumeClassAtom()) {
+ break;
+ }
+ const max = this._lastIntValue;
+ if (min === -1 || max === -1) {
+ if (strict) {
+ this.raise("Invalid character class");
+ }
+ continue;
+ }
+ if (min > max) {
+ this.raise("Range out of order in character class");
+ }
+ this.onCharacterClassRange(rangeStart, this.index, min, max);
+ }
+ }
+ consumeClassAtom() {
+ const start = this.index;
+ const cp = this.currentCodePoint;
+ if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) {
+ this.advance();
+ this._lastIntValue = cp;
+ this.onCharacter(start, this.index, this._lastIntValue);
+ return true;
+ }
+ if (this.eat(ReverseSolidus)) {
+ if (this.consumeClassEscape()) {
+ return true;
+ }
+ if (!this.strict && this.currentCodePoint === LatinSmallLetterC) {
+ this._lastIntValue = ReverseSolidus;
+ this.onCharacter(start, this.index, this._lastIntValue);
+ return true;
+ }
+ if (this.strict || this._uFlag) {
+ this.raise("Invalid escape");
+ }
+ this.rewind(start);
+ }
+ return false;
+ }
+ consumeClassEscape() {
+ const start = this.index;
+ if (this.eat(LatinSmallLetterB)) {
+ this._lastIntValue = Backspace;
+ this.onCharacter(start - 1, this.index, this._lastIntValue);
+ return true;
+ }
+ if (this._uFlag && this.eat(HyphenMinus)) {
+ this._lastIntValue = HyphenMinus;
+ this.onCharacter(start - 1, this.index, this._lastIntValue);
+ return true;
+ }
+ let cp = 0;
+ if (!this.strict &&
+ !this._uFlag &&
+ this.currentCodePoint === LatinSmallLetterC &&
+ (isDecimalDigit((cp = this.nextCodePoint)) || cp === LowLine)) {
+ this.advance();
+ this.advance();
+ this._lastIntValue = cp % 0x20;
+ this.onCharacter(start - 1, this.index, this._lastIntValue);
+ return true;
+ }
+ return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape());
}
eatGroupName() {
- this._lastStrValue = "";
if (this.eat(LessThanSign)) {
if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) {
return true;
@@ -1316,9 +1185,8 @@ class RegExpValidator {
return false;
}
eatRegExpIdentifierName() {
- this._lastStrValue = "";
if (this.eatRegExpIdentifierStart()) {
- this._lastStrValue += String.fromCodePoint(this._lastIntValue);
+ this._lastStrValue = String.fromCodePoint(this._lastIntValue);
while (this.eatRegExpIdentifierPart()) {
this._lastStrValue += String.fromCodePoint(this._lastIntValue);
}
@@ -1328,11 +1196,19 @@ class RegExpValidator {
}
eatRegExpIdentifierStart() {
const start = this.index;
+ const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020;
let cp = this.currentCodePoint;
this.advance();
- if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence()) {
+ if (cp === ReverseSolidus &&
+ this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
cp = this._lastIntValue;
}
+ else if (forceUFlag &&
+ isLeadSurrogate(cp) &&
+ isTrailSurrogate(this.currentCodePoint)) {
+ cp = combineSurrogatePair(cp, this.currentCodePoint);
+ this.advance();
+ }
if (isRegExpIdentifierStart(cp)) {
this._lastIntValue = cp;
return true;
@@ -1344,11 +1220,19 @@ class RegExpValidator {
}
eatRegExpIdentifierPart() {
const start = this.index;
+ const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020;
let cp = this.currentCodePoint;
this.advance();
- if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence()) {
+ if (cp === ReverseSolidus &&
+ this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
cp = this._lastIntValue;
}
+ else if (forceUFlag &&
+ isLeadSurrogate(cp) &&
+ isTrailSurrogate(this.currentCodePoint)) {
+ cp = combineSurrogatePair(cp, this.currentCodePoint);
+ this.advance();
+ }
if (isRegExpIdentifierPart(cp)) {
this._lastIntValue = cp;
return true;
@@ -1358,60 +1242,6 @@ class RegExpValidator {
}
return false;
}
- eatAtomEscape() {
- if (this.eatBackreference() ||
- this.eatCharacterClassEscape() ||
- this.eatCharacterEscape() ||
- (this._nFlag && this.eatKGroupName())) {
- return true;
- }
- if (this.strict || this._uFlag) {
- this.raise("Invalid escape");
- }
- return false;
- }
- eatBackreference() {
- const start = this.index;
- if (this.eatDecimalEscape()) {
- const n = this._lastIntValue;
- if (n <= this._numCapturingParens) {
- this.onBackreference(start - 1, this.index, n);
- return true;
- }
- if (this.strict) {
- this.raise("Invalid escape");
- }
- this.rewind(start);
- }
- return false;
- }
- eatKGroupName() {
- const start = this.index;
- if (this.eat(LatinSmallLetterK)) {
- if (this.eatGroupName()) {
- const groupName = this._lastStrValue;
- this._backreferenceNames.add(groupName);
- this.onBackreference(start - 1, this.index, groupName);
- return true;
- }
- this.raise("Invalid named reference");
- }
- return false;
- }
- eatCharacterEscape() {
- const start = this.index;
- if (this.eatControlEscape() ||
- this.eatCControlLetter() ||
- this.eatZero() ||
- this.eatHexEscapeSequence() ||
- this.eatRegExpUnicodeEscapeSequence() ||
- (!this.strict && this.eatLegacyOctalEscapeSequence()) ||
- this.eatIdentityEscape()) {
- this.onCharacter(start - 1, this.index, this._lastIntValue);
- return true;
- }
- return false;
- }
eatCControlLetter() {
const start = this.index;
if (this.eat(LatinSmallLetterC)) {
@@ -1432,24 +1262,24 @@ class RegExpValidator {
return false;
}
eatControlEscape() {
- if (this.eat(LatinSmallLetterT)) {
- this._lastIntValue = CharacterTabulation;
+ if (this.eat(LatinSmallLetterF)) {
+ this._lastIntValue = FormFeed;
return true;
}
if (this.eat(LatinSmallLetterN)) {
this._lastIntValue = LineFeed;
return true;
}
- if (this.eat(LatinSmallLetterV)) {
- this._lastIntValue = LineTabulation;
+ if (this.eat(LatinSmallLetterR)) {
+ this._lastIntValue = CarriageReturn;
return true;
}
- if (this.eat(LatinSmallLetterF)) {
- this._lastIntValue = FormFeed;
+ if (this.eat(LatinSmallLetterT)) {
+ this._lastIntValue = CharacterTabulation;
return true;
}
- if (this.eat(LatinSmallLetterR)) {
- this._lastIntValue = CarriageReturn;
+ if (this.eat(LatinSmallLetterV)) {
+ this._lastIntValue = LineTabulation;
return true;
}
return false;
@@ -1463,57 +1293,55 @@ class RegExpValidator {
}
return false;
}
- eatRegExpUnicodeEscapeSequence() {
+ eatRegExpUnicodeEscapeSequence(forceUFlag = false) {
const start = this.index;
+ const uFlag = forceUFlag || this._uFlag;
if (this.eat(LatinSmallLetterU)) {
- if (this.eatFixedHexDigits(4)) {
- const lead = this._lastIntValue;
- if (this._uFlag && lead >= 0xd800 && lead <= 0xdbff) {
- const leadSurrogateEnd = this.index;
- if (this.eat(ReverseSolidus) &&
- this.eat(LatinSmallLetterU) &&
- this.eatFixedHexDigits(4)) {
- const trail = this._lastIntValue;
- if (trail >= 0xdc00 && trail <= 0xdfff) {
- this._lastIntValue =
- (lead - 0xd800) * 0x400 +
- (trail - 0xdc00) +
- 0x10000;
- return true;
- }
- }
- this.rewind(leadSurrogateEnd);
- this._lastIntValue = lead;
- }
+ if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) ||
+ this.eatFixedHexDigits(4) ||
+ (uFlag && this.eatRegExpUnicodeCodePointEscape())) {
return true;
}
- if (this._uFlag &&
- this.eat(LeftCurlyBracket) &&
- this.eatHexDigits() &&
- this.eat(RightCurlyBracket) &&
- isValidUnicode(this._lastIntValue)) {
- return true;
- }
- if (this.strict || this._uFlag) {
+ if (this.strict || uFlag) {
this.raise("Invalid unicode escape");
}
this.rewind(start);
}
return false;
}
- eatIdentityEscape() {
- if (this._uFlag) {
- if (this.eatSyntaxCharacter()) {
- return true;
- }
- if (this.eat(Solidus)) {
- this._lastIntValue = Solidus;
- return true;
+ eatRegExpUnicodeSurrogatePairEscape() {
+ const start = this.index;
+ if (this.eatFixedHexDigits(4)) {
+ const lead = this._lastIntValue;
+ if (isLeadSurrogate(lead) &&
+ this.eat(ReverseSolidus) &&
+ this.eat(LatinSmallLetterU) &&
+ this.eatFixedHexDigits(4)) {
+ const trail = this._lastIntValue;
+ if (isTrailSurrogate(trail)) {
+ this._lastIntValue = combineSurrogatePair(lead, trail);
+ return true;
+ }
}
- return false;
+ this.rewind(start);
}
- if (this.isValidIdentityEscape(this.currentCodePoint)) {
- this._lastIntValue = this.currentCodePoint;
+ return false;
+ }
+ eatRegExpUnicodeCodePointEscape() {
+ const start = this.index;
+ if (this.eat(LeftCurlyBracket) &&
+ this.eatHexDigits() &&
+ this.eat(RightCurlyBracket) &&
+ isValidUnicode(this._lastIntValue)) {
+ return true;
+ }
+ this.rewind(start);
+ return false;
+ }
+ eatIdentityEscape() {
+ const cp = this.currentCodePoint;
+ if (this.isValidIdentityEscape(cp)) {
+ this._lastIntValue = cp;
this.advance();
return true;
}
@@ -1523,11 +1351,16 @@ class RegExpValidator {
if (cp === -1) {
return false;
}
+ if (this._uFlag) {
+ return isSyntaxCharacter(cp) || cp === Solidus;
+ }
if (this.strict) {
return !isIdContinue(cp);
}
- return (cp !== LatinSmallLetterC &&
- (!this._nFlag || cp !== LatinSmallLetterK));
+ if (this._nFlag) {
+ return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK);
+ }
+ return cp !== LatinSmallLetterC;
}
eatDecimalEscape() {
this._lastIntValue = 0;
@@ -1542,54 +1375,6 @@ class RegExpValidator {
}
return false;
}
- eatCharacterClassEscape() {
- const start = this.index;
- if (this.eat(LatinSmallLetterD)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "digit", false);
- return true;
- }
- if (this.eat(LatinCapitalLetterD)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "digit", true);
- return true;
- }
- if (this.eat(LatinSmallLetterS)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "space", false);
- return true;
- }
- if (this.eat(LatinCapitalLetterS)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "space", true);
- return true;
- }
- if (this.eat(LatinSmallLetterW)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "word", false);
- return true;
- }
- if (this.eat(LatinCapitalLetterW)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "word", true);
- return true;
- }
- let negate = false;
- if (this._uFlag &&
- this.ecmaVersion >= 2018 &&
- (this.eat(LatinSmallLetterP) ||
- (negate = this.eat(LatinCapitalLetterP)))) {
- this._lastIntValue = -1;
- if (this.eat(LeftCurlyBracket) &&
- this.eatUnicodePropertyValueExpression() &&
- this.eat(RightCurlyBracket)) {
- this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate);
- return true;
- }
- this.raise("Invalid property name");
- }
- return false;
- }
eatUnicodePropertyValueExpression() {
const start = this.index;
if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) {
@@ -1638,102 +1423,13 @@ class RegExpValidator {
eatLoneUnicodePropertyNameOrValue() {
return this.eatUnicodePropertyValue();
}
- eatCharacterClass() {
- const start = this.index;
- if (this.eat(LeftSquareBracket)) {
- const negate = this.eat(CircumflexAccent);
- this.onCharacterClassEnter(start, negate);
- this.classRanges();
- if (!this.eat(RightSquareBracket)) {
- this.raise("Unterminated character class");
- }
- this.onCharacterClassLeave(start, this.index, negate);
- return true;
- }
- return false;
- }
- classRanges() {
- let start = this.index;
- while (this.eatClassAtom()) {
- const left = this._lastIntValue;
- const hyphenStart = this.index;
- if (this.eat(HyphenMinus)) {
- this.onCharacter(hyphenStart, this.index, HyphenMinus);
- if (this.eatClassAtom()) {
- const right = this._lastIntValue;
- if (left === -1 || right === -1) {
- if (this.strict) {
- this.raise("Invalid character class");
- }
- }
- else if (left > right) {
- this.raise("Range out of order in character class");
- }
- else {
- this.onCharacterClassRange(start, this.index, left, right);
- }
- }
- }
- start = this.index;
- }
- }
- eatClassAtom() {
- const start = this.index;
- if (this.eat(ReverseSolidus)) {
- if (this.eatClassEscape()) {
- return true;
- }
- if (this._uFlag) {
- this.raise("Invalid escape");
- }
- this.rewind(start);
- }
- const cp = this.currentCodePoint;
- if (cp !== -1 && cp !== RightSquareBracket) {
- this.advance();
- this._lastIntValue = cp;
- this.onCharacter(start, this.index, cp);
- return true;
- }
- return false;
- }
- eatClassEscape() {
- const start = this.index;
- if (this.eat(LatinSmallLetterB)) {
- this._lastIntValue = Backspace;
- this.onCharacter(start - 1, this.index, Backspace);
- return true;
- }
- if (this._uFlag && this.eat(HyphenMinus)) {
- this._lastIntValue = HyphenMinus;
- this.onCharacter(start - 1, this.index, HyphenMinus);
- return true;
- }
- if (!this._uFlag && this.eat(LatinSmallLetterC)) {
- if (this.eatClassControlLetter()) {
- this.onCharacter(start - 1, this.index, this._lastIntValue);
- return true;
- }
- this.rewind(start);
- }
- return this.eatCharacterClassEscape() || this.eatCharacterEscape();
- }
- eatClassControlLetter() {
- const cp = this.currentCodePoint;
- if (isDecimalDigit(cp) || cp === LowLine) {
- this.advance();
- this._lastIntValue = cp % 0x20;
- return true;
- }
- return false;
- }
eatHexEscapeSequence() {
const start = this.index;
if (this.eat(LatinSmallLetterX)) {
if (this.eatFixedHexDigits(2)) {
return true;
}
- if (this._uFlag) {
+ if (this._uFlag || this.strict) {
this.raise("Invalid escape");
}
this.rewind(start);
diff --git a/tools/node_modules/eslint/node_modules/regexpp/package.json b/tools/node_modules/eslint/node_modules/regexpp/package.json
index b7d417582d..1c2b0eb82b 100644
--- a/tools/node_modules/eslint/node_modules/regexpp/package.json
+++ b/tools/node_modules/eslint/node_modules/regexpp/package.json
@@ -36,6 +36,7 @@
"files": [
"index.*"
],
+ "funding": "https://github.com/sponsors/mysticatea",
"homepage": "https://github.com/mysticatea/regexpp#readme",
"keywords": [
"regexp",
@@ -82,7 +83,7 @@
"update:unicode:ids": "ts-node scripts/update-unicode-ids.ts",
"update:unicode:props": "ts-node scripts/update-unicode-properties.ts",
"version": "npm run -s build",
- "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions .ts --watch --growl"
+ "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl"
},
- "version": "3.0.0"
+ "version": "3.1.0"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/rxjs/README.md b/tools/node_modules/eslint/node_modules/rxjs/README.md
index e9204f0ac9..f92dafde47 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/README.md
+++ b/tools/node_modules/eslint/node_modules/rxjs/README.md
@@ -1,6 +1,4 @@
-<img src="doc/asset/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
-======================================
-
+# <img src="docs_app/assets/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
[![CircleCI](https://circleci.com/gh/ReactiveX/rxjs/tree/6.x.svg?style=svg)](https://circleci.com/gh/ReactiveX/rxjs/tree/6.x)
[![npm version](https://badge.fury.io/js/%40reactivex%2Frxjs.svg)](http://badge.fury.io/js/%40reactivex%2Frxjs)
@@ -22,9 +20,8 @@ Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Exten
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Contribution Guidelines](CONTRIBUTING.md)
-- [Maintainer Guidelines](doc/maintainer-guidelines.md)
-- [Creating Operators](doc/operator-creation.md)
-- [API Documentation (WIP)](https://rxjs.dev/)
+- [Maintainer Guidelines](doc_app/content/maintainer-guidelines.md)
+- [API Documentation](https://rxjs.dev/)
## Versions In This Repository
@@ -45,14 +42,16 @@ npm install rxjs
It's recommended to pull in the Observable creation methods you need directly from `'rxjs'` as shown below with `range`. And you can pull in any operator you need from one spot, under `'rxjs/operators'`.
-```js
-import { range } from 'rxjs';
-import { map, filter } from 'rxjs/operators';
+```ts
+import { range } from "rxjs";
+import { map, filter } from "rxjs/operators";
-range(1, 200).pipe(
- filter(x => x % 2 === 1),
- map(x => x + x)
-).subscribe(x => console.log(x));
+range(1, 200)
+ .pipe(
+ filter(x => x % 2 === 1),
+ map(x => x + x)
+ )
+ .subscribe(x => console.log(x));
```
Here, we're using the built-in `pipe` method on Observables to combine operators. See [pipeable operators](https://github.com/ReactiveX/rxjs/blob/master/doc/pipeable-operators.md) for more information.
@@ -89,10 +88,12 @@ The global namespace for rxjs is `rxjs`:
const { range } = rxjs;
const { map, filter } = rxjs.operators;
-range(1, 200).pipe(
- filter(x => x % 2 === 1),
- map(x => x + x)
-).subscribe(x => console.log(x));
+range(1, 200)
+ .pipe(
+ filter(x => x % 2 === 1),
+ map(x => x + x)
+ )
+ .subscribe(x => console.log(x));
```
## Goals
@@ -116,6 +117,7 @@ Run `npm run build_perf` or `npm run perf` to run the performance tests with `pr
Run `npm run perf_micro [operator]` to run micro performance test benchmarking operator.
## Adding documentation
+
We appreciate all contributions to the documentation of any type. All of the information needed to get the docs app up and running locally as well as how to contribute can be found in the [documentation directory](./docs_app).
## Generating PNG marble diagrams
diff --git a/tools/node_modules/eslint/node_modules/rxjs/_esm2015/README.md b/tools/node_modules/eslint/node_modules/rxjs/_esm2015/README.md
index e9204f0ac9..f92dafde47 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/_esm2015/README.md
+++ b/tools/node_modules/eslint/node_modules/rxjs/_esm2015/README.md
@@ -1,6 +1,4 @@
-<img src="doc/asset/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
-======================================
-
+# <img src="docs_app/assets/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
[![CircleCI](https://circleci.com/gh/ReactiveX/rxjs/tree/6.x.svg?style=svg)](https://circleci.com/gh/ReactiveX/rxjs/tree/6.x)
[![npm version](https://badge.fury.io/js/%40reactivex%2Frxjs.svg)](http://badge.fury.io/js/%40reactivex%2Frxjs)
@@ -22,9 +20,8 @@ Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Exten
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Contribution Guidelines](CONTRIBUTING.md)
-- [Maintainer Guidelines](doc/maintainer-guidelines.md)
-- [Creating Operators](doc/operator-creation.md)
-- [API Documentation (WIP)](https://rxjs.dev/)
+- [Maintainer Guidelines](doc_app/content/maintainer-guidelines.md)
+- [API Documentation](https://rxjs.dev/)
## Versions In This Repository
@@ -45,14 +42,16 @@ npm install rxjs
It's recommended to pull in the Observable creation methods you need directly from `'rxjs'` as shown below with `range`. And you can pull in any operator you need from one spot, under `'rxjs/operators'`.
-```js
-import { range } from 'rxjs';
-import { map, filter } from 'rxjs/operators';
+```ts
+import { range } from "rxjs";
+import { map, filter } from "rxjs/operators";
-range(1, 200).pipe(
- filter(x => x % 2 === 1),
- map(x => x + x)
-).subscribe(x => console.log(x));
+range(1, 200)
+ .pipe(
+ filter(x => x % 2 === 1),
+ map(x => x + x)
+ )
+ .subscribe(x => console.log(x));
```
Here, we're using the built-in `pipe` method on Observables to combine operators. See [pipeable operators](https://github.com/ReactiveX/rxjs/blob/master/doc/pipeable-operators.md) for more information.
@@ -89,10 +88,12 @@ The global namespace for rxjs is `rxjs`:
const { range } = rxjs;
const { map, filter } = rxjs.operators;
-range(1, 200).pipe(
- filter(x => x % 2 === 1),
- map(x => x + x)
-).subscribe(x => console.log(x));
+range(1, 200)
+ .pipe(
+ filter(x => x % 2 === 1),
+ map(x => x + x)
+ )
+ .subscribe(x => console.log(x));
```
## Goals
@@ -116,6 +117,7 @@ Run `npm run build_perf` or `npm run perf` to run the performance tests with `pr
Run `npm run perf_micro [operator]` to run micro performance test benchmarking operator.
## Adding documentation
+
We appreciate all contributions to the documentation of any type. All of the information needed to get the docs app up and running locally as well as how to contribute can be found in the [documentation directory](./docs_app).
## Generating PNG marble diagrams
diff --git a/tools/node_modules/eslint/node_modules/rxjs/_esm2015/internal/observable/dom/fetch.js b/tools/node_modules/eslint/node_modules/rxjs/_esm2015/internal/observable/dom/fetch.js
index a999d8bd3f..a490002fdc 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/_esm2015/internal/observable/dom/fetch.js
+++ b/tools/node_modules/eslint/node_modules/rxjs/_esm2015/internal/observable/dom/fetch.js
@@ -1,31 +1,41 @@
import { Observable } from '../../Observable';
+import { Subscription } from '../../Subscription';
export function fromFetch(input, init) {
return new Observable(subscriber => {
const controller = new AbortController();
const signal = controller.signal;
- let outerSignalHandler;
let abortable = true;
let unsubscribed = false;
+ const subscription = new Subscription();
+ subscription.add(() => {
+ unsubscribed = true;
+ if (abortable) {
+ controller.abort();
+ }
+ });
+ let perSubscriberInit;
if (init) {
if (init.signal) {
if (init.signal.aborted) {
controller.abort();
}
else {
- outerSignalHandler = () => {
+ const outerSignal = init.signal;
+ const outerSignalHandler = () => {
if (!signal.aborted) {
controller.abort();
}
};
- init.signal.addEventListener('abort', outerSignalHandler);
+ outerSignal.addEventListener('abort', outerSignalHandler);
+ subscription.add(() => outerSignal.removeEventListener('abort', outerSignalHandler));
}
}
- init = Object.assign({}, init, { signal });
+ perSubscriberInit = Object.assign({}, init, { signal });
}
else {
- init = { signal };
+ perSubscriberInit = { signal };
}
- fetch(input, init).then(response => {
+ fetch(input, perSubscriberInit).then(response => {
abortable = false;
subscriber.next(response);
subscriber.complete();
@@ -35,12 +45,7 @@ export function fromFetch(input, init) {
subscriber.error(err);
}
});
- return () => {
- unsubscribed = true;
- if (abortable) {
- controller.abort();
- }
- };
+ return subscription;
});
}
//# sourceMappingURL=fetch.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/rxjs/_esm2015/internal/util/pipe.js b/tools/node_modules/eslint/node_modules/rxjs/_esm2015/internal/util/pipe.js
index 3bda15e10d..fb1cccf1f9 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/_esm2015/internal/util/pipe.js
+++ b/tools/node_modules/eslint/node_modules/rxjs/_esm2015/internal/util/pipe.js
@@ -1,10 +1,10 @@
-import { noop } from './noop';
+import { identity } from './identity';
export function pipe(...fns) {
return pipeFromArray(fns);
}
export function pipeFromArray(fns) {
- if (!fns) {
- return noop;
+ if (fns.length === 0) {
+ return identity;
}
if (fns.length === 1) {
return fns[0];
diff --git a/tools/node_modules/eslint/node_modules/rxjs/_esm5/README.md b/tools/node_modules/eslint/node_modules/rxjs/_esm5/README.md
index e9204f0ac9..f92dafde47 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/_esm5/README.md
+++ b/tools/node_modules/eslint/node_modules/rxjs/_esm5/README.md
@@ -1,6 +1,4 @@
-<img src="doc/asset/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
-======================================
-
+# <img src="docs_app/assets/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
[![CircleCI](https://circleci.com/gh/ReactiveX/rxjs/tree/6.x.svg?style=svg)](https://circleci.com/gh/ReactiveX/rxjs/tree/6.x)
[![npm version](https://badge.fury.io/js/%40reactivex%2Frxjs.svg)](http://badge.fury.io/js/%40reactivex%2Frxjs)
@@ -22,9 +20,8 @@ Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Exten
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Contribution Guidelines](CONTRIBUTING.md)
-- [Maintainer Guidelines](doc/maintainer-guidelines.md)
-- [Creating Operators](doc/operator-creation.md)
-- [API Documentation (WIP)](https://rxjs.dev/)
+- [Maintainer Guidelines](doc_app/content/maintainer-guidelines.md)
+- [API Documentation](https://rxjs.dev/)
## Versions In This Repository
@@ -45,14 +42,16 @@ npm install rxjs
It's recommended to pull in the Observable creation methods you need directly from `'rxjs'` as shown below with `range`. And you can pull in any operator you need from one spot, under `'rxjs/operators'`.
-```js
-import { range } from 'rxjs';
-import { map, filter } from 'rxjs/operators';
+```ts
+import { range } from "rxjs";
+import { map, filter } from "rxjs/operators";
-range(1, 200).pipe(
- filter(x => x % 2 === 1),
- map(x => x + x)
-).subscribe(x => console.log(x));
+range(1, 200)
+ .pipe(
+ filter(x => x % 2 === 1),
+ map(x => x + x)
+ )
+ .subscribe(x => console.log(x));
```
Here, we're using the built-in `pipe` method on Observables to combine operators. See [pipeable operators](https://github.com/ReactiveX/rxjs/blob/master/doc/pipeable-operators.md) for more information.
@@ -89,10 +88,12 @@ The global namespace for rxjs is `rxjs`:
const { range } = rxjs;
const { map, filter } = rxjs.operators;
-range(1, 200).pipe(
- filter(x => x % 2 === 1),
- map(x => x + x)
-).subscribe(x => console.log(x));
+range(1, 200)
+ .pipe(
+ filter(x => x % 2 === 1),
+ map(x => x + x)
+ )
+ .subscribe(x => console.log(x));
```
## Goals
@@ -116,6 +117,7 @@ Run `npm run build_perf` or `npm run perf` to run the performance tests with `pr
Run `npm run perf_micro [operator]` to run micro performance test benchmarking operator.
## Adding documentation
+
We appreciate all contributions to the documentation of any type. All of the information needed to get the docs app up and running locally as well as how to contribute can be found in the [documentation directory](./docs_app).
## Generating PNG marble diagrams
diff --git a/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/observable/dom/fetch.js b/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/observable/dom/fetch.js
index 6decb81d89..b531337d81 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/observable/dom/fetch.js
+++ b/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/observable/dom/fetch.js
@@ -1,33 +1,43 @@
-/** PURE_IMPORTS_START tslib,_.._Observable PURE_IMPORTS_END */
+/** PURE_IMPORTS_START tslib,_.._Observable,_.._Subscription PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
import { Observable } from '../../Observable';
+import { Subscription } from '../../Subscription';
export function fromFetch(input, init) {
return new Observable(function (subscriber) {
var controller = new AbortController();
var signal = controller.signal;
- var outerSignalHandler;
var abortable = true;
var unsubscribed = false;
+ var subscription = new Subscription();
+ subscription.add(function () {
+ unsubscribed = true;
+ if (abortable) {
+ controller.abort();
+ }
+ });
+ var perSubscriberInit;
if (init) {
if (init.signal) {
if (init.signal.aborted) {
controller.abort();
}
else {
- outerSignalHandler = function () {
+ var outerSignal_1 = init.signal;
+ var outerSignalHandler_1 = function () {
if (!signal.aborted) {
controller.abort();
}
};
- init.signal.addEventListener('abort', outerSignalHandler);
+ outerSignal_1.addEventListener('abort', outerSignalHandler_1);
+ subscription.add(function () { return outerSignal_1.removeEventListener('abort', outerSignalHandler_1); });
}
}
- init = tslib_1.__assign({}, init, { signal: signal });
+ perSubscriberInit = tslib_1.__assign({}, init, { signal: signal });
}
else {
- init = { signal: signal };
+ perSubscriberInit = { signal: signal };
}
- fetch(input, init).then(function (response) {
+ fetch(input, perSubscriberInit).then(function (response) {
abortable = false;
subscriber.next(response);
subscriber.complete();
@@ -37,12 +47,7 @@ export function fromFetch(input, init) {
subscriber.error(err);
}
});
- return function () {
- unsubscribed = true;
- if (abortable) {
- controller.abort();
- }
- };
+ return subscription;
});
}
//# sourceMappingURL=fetch.js.map
diff --git a/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/util/pipe.js b/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/util/pipe.js
index f02d3984d5..1829846c2c 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/util/pipe.js
+++ b/tools/node_modules/eslint/node_modules/rxjs/_esm5/internal/util/pipe.js
@@ -1,5 +1,5 @@
-/** PURE_IMPORTS_START _noop PURE_IMPORTS_END */
-import { noop } from './noop';
+/** PURE_IMPORTS_START _identity PURE_IMPORTS_END */
+import { identity } from './identity';
export function pipe() {
var fns = [];
for (var _i = 0; _i < arguments.length; _i++) {
@@ -8,8 +8,8 @@ export function pipe() {
return pipeFromArray(fns);
}
export function pipeFromArray(fns) {
- if (!fns) {
- return noop;
+ if (fns.length === 0) {
+ return identity;
}
if (fns.length === 1) {
return fns[0];
diff --git a/tools/node_modules/eslint/node_modules/rxjs/bundles/rxjs.umd.js b/tools/node_modules/eslint/node_modules/rxjs/bundles/rxjs.umd.js
index ada2f4954f..ffbe827a1a 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/bundles/rxjs.umd.js
+++ b/tools/node_modules/eslint/node_modules/rxjs/bundles/rxjs.umd.js
@@ -902,7 +902,9 @@
var observable = (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();
- function noop() { }
+ function identity(x) {
+ return x;
+ }
function pipe() {
var fns = [];
@@ -912,8 +914,8 @@
return pipeFromArray(fns);
}
function pipeFromArray(fns) {
- if (!fns) {
- return noop;
+ if (fns.length === 0) {
+ return identity;
}
if (fns.length === 1) {
return fns[0];
@@ -2393,9 +2395,7 @@
return VirtualAction;
}(AsyncAction));
- function identity(x) {
- return x;
- }
+ function noop() { }
function isObservable(obj) {
return !!obj && (obj instanceof Observable || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));
@@ -9170,29 +9170,38 @@
return new Observable(function (subscriber) {
var controller = new AbortController();
var signal = controller.signal;
- var outerSignalHandler;
var abortable = true;
var unsubscribed = false;
+ var subscription = new Subscription();
+ subscription.add(function () {
+ unsubscribed = true;
+ if (abortable) {
+ controller.abort();
+ }
+ });
+ var perSubscriberInit;
if (init) {
if (init.signal) {
if (init.signal.aborted) {
controller.abort();
}
else {
- outerSignalHandler = function () {
+ var outerSignal_1 = init.signal;
+ var outerSignalHandler_1 = function () {
if (!signal.aborted) {
controller.abort();
}
};
- init.signal.addEventListener('abort', outerSignalHandler);
+ outerSignal_1.addEventListener('abort', outerSignalHandler_1);
+ subscription.add(function () { return outerSignal_1.removeEventListener('abort', outerSignalHandler_1); });
}
}
- init = __assign({}, init, { signal: signal });
+ perSubscriberInit = __assign({}, init, { signal: signal });
}
else {
- init = { signal: signal };
+ perSubscriberInit = { signal: signal };
}
- fetch(input, init).then(function (response) {
+ fetch(input, perSubscriberInit).then(function (response) {
abortable = false;
subscriber.next(response);
subscriber.complete();
@@ -9202,12 +9211,7 @@
subscriber.error(err);
}
});
- return function () {
- unsubscribed = true;
- if (abortable) {
- controller.abort();
- }
- };
+ return subscription;
});
}
diff --git a/tools/node_modules/eslint/node_modules/rxjs/bundles/rxjs.umd.min.js b/tools/node_modules/eslint/node_modules/rxjs/bundles/rxjs.umd.min.js
index 9fbb69e08a..edf46e49e1 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/bundles/rxjs.umd.min.js
+++ b/tools/node_modules/eslint/node_modules/rxjs/bundles/rxjs.umd.min.js
@@ -22,76 +22,76 @@
and limitations under the License.
*****************************************************************************/
(function(k,h){"object"===typeof exports&&"undefined"!==typeof module?h(exports):"function"===typeof define&&define.amd?define("rxjs",["exports"],h):h(k.rxjs={})})(this,function(k){function h(c,a){function b(){this.constructor=c}Kb(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function P(c){return"function"===typeof c}function Q(c){setTimeout(function(){throw c;},0)}function ra(c){return null!==c&&"object"===typeof c}function Ka(c){return c.reduce(function(a,b){return a.concat(b instanceof
-Y?b.errors:b)},[])}function sa(c){for(;c;){var a=c.destination,b=c.isStopped;if(c.closed||b)return!1;c=a&&a instanceof m?a:null}return!0}function D(){}function ta(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return La(c)}function La(c){return c?1===c.length?c[0]:function(a){return c.reduce(function(b,a){return a(b)},a)}:D}function Ma(c){c||(c=C.Promise||Promise);if(!c)throw Error("no Promise impl found");return c}function ua(){return function(c){return c.lift(new Lb(c))}}function R(c){return c?
-Mb(c):S}function Mb(c){return new n(function(a){return c.schedule(function(){return a.complete()})})}function A(c){return c&&"function"===typeof c.schedule}function va(c,a){return new n(function(b){var d=new t,e=0;d.add(a.schedule(function(){e===c.length?b.complete():(b.next(c[e++]),b.closed||d.add(this.schedule()))}));return d})}function Z(c,a){return a?va(c,a):new n(Na(c))}function ga(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];return A(a)?(c.pop(),va(c,a)):Z(c)}
-function wa(c,a){return a?new n(function(b){return a.schedule(Nb,0,{error:c,subscriber:b})}):new n(function(b){return b.error(c)})}function Nb(c){c.subscriber.error(c.error)}function Oa(c){return c in xa?(delete xa[c],!0):!1}function J(c){return c}function B(c,a){return function(b){if("function"!==typeof c)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return b.lift(new Ob(c,a))}}function Pa(c,a,b){if(a)if(A(a))b=a;else return function(){for(var d=[],e=0;e<arguments.length;e++)d[e]=
-arguments[e];return Pa(c,b).apply(void 0,d).pipe(B(function(b){return x(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var f=this,g,l={context:f,subject:g,callbackFunc:c,scheduler:b};return new n(function(d){if(b)return b.schedule(Pb,0,{args:a,subscriber:d,params:l});if(!g){g=new T;try{c.apply(f,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];g.next(1>=b.length?b[0]:b);g.complete()}]))}catch(K){sa(g)?g.error(K):
-console.warn(K)}}return g.subscribe(d)})}}function Pb(c){var a=this,b=c.args,d=c.subscriber;c=c.params;var e=c.callbackFunc,f=c.context,g=c.scheduler,l=c.subject;if(!l){l=c.subject=new T;try{e.apply(f,b.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];a.add(g.schedule(Qb,0,{value:1>=b.length?b[0]:b,subject:l}))}]))}catch(u){l.error(u)}}this.add(l.subscribe(d))}function Qb(c){var a=c.subject;a.next(c.value);a.complete()}function Qa(c,a,b){if(a)if(A(a))b=a;else return function(){for(var d=
+Y?b.errors:b)},[])}function sa(c){for(;c;){var a=c.destination,b=c.isStopped;if(c.closed||b)return!1;c=a&&a instanceof l?a:null}return!0}function G(c){return c}function ta(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return La(c)}function La(c){return 0===c.length?G:1===c.length?c[0]:function(a){return c.reduce(function(b,a){return a(b)},a)}}function Ma(c){c||(c=C.Promise||Promise);if(!c)throw Error("no Promise impl found");return c}function ua(){return function(c){return c.lift(new Lb(c))}}
+function R(c){return c?Mb(c):S}function Mb(c){return new n(function(a){return c.schedule(function(){return a.complete()})})}function A(c){return c&&"function"===typeof c.schedule}function va(c,a){return new n(function(b){var d=new p,e=0;d.add(a.schedule(function(){e===c.length?b.complete():(b.next(c[e++]),b.closed||d.add(this.schedule()))}));return d})}function Z(c,a){return a?va(c,a):new n(Na(c))}function ga(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];return A(a)?
+(c.pop(),va(c,a)):Z(c)}function wa(c,a){return a?new n(function(b){return a.schedule(Nb,0,{error:c,subscriber:b})}):new n(function(b){return b.error(c)})}function Nb(c){c.subscriber.error(c.error)}function Oa(c){return c in xa?(delete xa[c],!0):!1}function D(){}function B(c,a){return function(b){if("function"!==typeof c)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return b.lift(new Ob(c,a))}}function Pa(c,a,b){if(a)if(A(a))b=a;else return function(){for(var d=
+[],e=0;e<arguments.length;e++)d[e]=arguments[e];return Pa(c,b).apply(void 0,d).pipe(B(function(b){return x(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var f=this,g,m={context:f,subject:g,callbackFunc:c,scheduler:b};return new n(function(d){if(b)return b.schedule(Pb,0,{args:a,subscriber:d,params:m});if(!g){g=new T;try{c.apply(f,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];g.next(1>=b.length?b[0]:b);g.complete()}]))}catch(K){sa(g)?
+g.error(K):console.warn(K)}}return g.subscribe(d)})}}function Pb(c){var a=this,b=c.args,d=c.subscriber;c=c.params;var e=c.callbackFunc,f=c.context,g=c.scheduler,m=c.subject;if(!m){m=c.subject=new T;try{e.apply(f,b.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];a.add(g.schedule(Qb,0,{value:1>=b.length?b[0]:b,subject:m}))}]))}catch(u){m.error(u)}}this.add(m.subscribe(d))}function Qb(c){var a=c.subject;a.next(c.value);a.complete()}function Qa(c,a,b){if(a)if(A(a))b=a;else return function(){for(var d=
[],e=0;e<arguments.length;e++)d[e]=arguments[e];return Qa(c,b).apply(void 0,d).pipe(B(function(b){return x(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var f={subject:void 0,args:a,callbackFunc:c,scheduler:b,context:this};return new n(function(d){var e=f.context,g=f.subject;if(b)return b.schedule(Rb,0,{params:f,subscriber:d,context:e});if(!g){g=f.subject=new T;try{c.apply(e,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=
-arguments[a];(a=b.shift())?g.error(a):(g.next(1>=b.length?b[0]:b),g.complete())}]))}catch(K){sa(g)?g.error(K):console.warn(K)}}return g.subscribe(d)})}}function Rb(c){var a=this,b=c.params,d=c.subscriber;c=c.context;var e=b.callbackFunc,f=b.args,g=b.scheduler,l=b.subject;if(!l){l=b.subject=new T;try{e.apply(c,f.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];(c=b.shift())?a.add(g.schedule(Ra,0,{err:c,subject:l})):a.add(g.schedule(Sb,0,{value:1>=b.length?b[0]:b,subject:l}))}]))}catch(u){this.add(g.schedule(Ra,
-0,{err:u,subject:l}))}}this.add(l.subscribe(d))}function Sb(c){var a=c.subject;a.next(c.value);a.complete()}function Ra(c){c.subject.error(c.err)}function Sa(c){return!!c&&"function"!==typeof c.subscribe&&"function"===typeof c.then}function p(c,a,b,d,e){void 0===e&&(e=new G(c,b,d));if(!e.closed)return a instanceof n?a.subscribe(e):ha(a)(e)}function Tb(c,a){return new n(function(b){var d=new t;d.add(a.schedule(function(){var e=c[U]();d.add(e.subscribe({next:function(c){d.add(a.schedule(function(){return b.next(c)}))},
-error:function(c){d.add(a.schedule(function(){return b.error(c)}))},complete:function(){d.add(a.schedule(function(){return b.complete()}))}}))}));return d})}function Ub(c,a){return new n(function(b){var d=new t;d.add(a.schedule(function(){return c.then(function(c){d.add(a.schedule(function(){b.next(c);d.add(a.schedule(function(){return b.complete()}))}))},function(c){d.add(a.schedule(function(){return b.error(c)}))})}));return d})}function Vb(c,a){if(!c)throw Error("Iterable cannot be null");return new n(function(b){var d=
-new t,e;d.add(function(){e&&"function"===typeof e.return&&e.return()});d.add(a.schedule(function(){e=c[E]();d.add(a.schedule(function(){if(!b.closed){var a,c;try{var d=e.next();a=d.value;c=d.done}catch(u){b.error(u);return}c?b.complete():(b.next(a),this.schedule())}}))}));return d})}function Ta(c,a){if(null!=c){if(c&&"function"===typeof c[U])return Tb(c,a);if(Sa(c))return Ub(c,a);if(Ua(c))return va(c,a);if(c&&"function"===typeof c[E]||"string"===typeof c)return Vb(c,a)}throw new TypeError((null!==
-c&&typeof c||c)+" is not observable");}function F(c,a){return a?Ta(c,a):c instanceof n?c:new n(ha(c))}function L(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(d){return d.pipe(L(function(b,d){return F(c(b,d)).pipe(B(function(c,e){return a(b,c,d,e)}))},b))};"number"===typeof a&&(b=a);return function(a){return a.lift(new Wb(c,b))}}function ya(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return L(J,c)}function Va(){return ya(1)}function aa(){for(var c=[],a=0;a<
-arguments.length;a++)c[a]=arguments[a];return Va()(ga.apply(void 0,c))}function za(c){return new n(function(a){var b;try{b=c()}catch(d){a.error(d);return}return(b?F(b):R()).subscribe(a)})}function ia(c,a){return new n(function(b){var d=c.length;if(0===d)b.complete();else for(var e=Array(d),f=0,g=0,l=function(l){var h=F(c[l]),u=!1;b.add(h.subscribe({next:function(b){u||(u=!0,g++);e[l]=b},error:function(a){return b.error(a)},complete:function(){f++;f!==d&&u||(g===d&&b.next(a?a.reduce(function(b,a,c){return b[a]=
-e[c],b},{}):e),b.complete())}}))},h=0;h<d;h++)l(h)})}function Wa(c,a,b,d){P(b)&&(d=b,b=void 0);return d?Wa(c,a,b).pipe(B(function(b){return x(b)?d.apply(void 0,b):d(b)})):new n(function(d){Xa(c,a,function(b){1<arguments.length?d.next(Array.prototype.slice.call(arguments)):d.next(b)},d,b)})}function Xa(c,a,b,d,e){var f;if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(a,b,e),f=function(){return c.removeEventListener(a,b,e)};else if(c&&"function"===
-typeof c.on&&"function"===typeof c.off)c.on(a,b),f=function(){return c.off(a,b)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(a,b),f=function(){return c.removeListener(a,b)};else if(c&&c.length)for(var g=0,l=c.length;g<l;g++)Xa(c[g],a,b,d,e);else throw new TypeError("Invalid event target");d.add(f)}function Ya(c,a,b){return b?Ya(c,a).pipe(B(function(a){return x(a)?b.apply(void 0,a):b(a)})):new n(function(b){var d=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=
+arguments[a];(a=b.shift())?g.error(a):(g.next(1>=b.length?b[0]:b),g.complete())}]))}catch(K){sa(g)?g.error(K):console.warn(K)}}return g.subscribe(d)})}}function Rb(c){var a=this,b=c.params,d=c.subscriber;c=c.context;var e=b.callbackFunc,f=b.args,g=b.scheduler,m=b.subject;if(!m){m=b.subject=new T;try{e.apply(c,f.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];(c=b.shift())?a.add(g.schedule(Ra,0,{err:c,subject:m})):a.add(g.schedule(Sb,0,{value:1>=b.length?b[0]:b,subject:m}))}]))}catch(u){this.add(g.schedule(Ra,
+0,{err:u,subject:m}))}}this.add(m.subscribe(d))}function Sb(c){var a=c.subject;a.next(c.value);a.complete()}function Ra(c){c.subject.error(c.err)}function Sa(c){return!!c&&"function"!==typeof c.subscribe&&"function"===typeof c.then}function q(c,a,b,d,e){void 0===e&&(e=new H(c,b,d));if(!e.closed)return a instanceof n?a.subscribe(e):ha(a)(e)}function Tb(c,a){return new n(function(b){var d=new p;d.add(a.schedule(function(){var e=c[U]();d.add(e.subscribe({next:function(c){d.add(a.schedule(function(){return b.next(c)}))},
+error:function(c){d.add(a.schedule(function(){return b.error(c)}))},complete:function(){d.add(a.schedule(function(){return b.complete()}))}}))}));return d})}function Ub(c,a){return new n(function(b){var d=new p;d.add(a.schedule(function(){return c.then(function(c){d.add(a.schedule(function(){b.next(c);d.add(a.schedule(function(){return b.complete()}))}))},function(c){d.add(a.schedule(function(){return b.error(c)}))})}));return d})}function Vb(c,a){if(!c)throw Error("Iterable cannot be null");return new n(function(b){var d=
+new p,e;d.add(function(){e&&"function"===typeof e.return&&e.return()});d.add(a.schedule(function(){e=c[E]();d.add(a.schedule(function(){if(!b.closed){var a,c;try{var d=e.next();a=d.value;c=d.done}catch(u){b.error(u);return}c?b.complete():(b.next(a),this.schedule())}}))}));return d})}function Ta(c,a){if(null!=c){if(c&&"function"===typeof c[U])return Tb(c,a);if(Sa(c))return Ub(c,a);if(Ua(c))return va(c,a);if(c&&"function"===typeof c[E]||"string"===typeof c)return Vb(c,a)}throw new TypeError((null!==
+c&&typeof c||c)+" is not observable");}function F(c,a){return a?Ta(c,a):c instanceof n?c:new n(ha(c))}function L(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(d){return d.pipe(L(function(b,d){return F(c(b,d)).pipe(B(function(c,e){return a(b,c,d,e)}))},b))};"number"===typeof a&&(b=a);return function(a){return a.lift(new Wb(c,b))}}function ya(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return L(G,c)}function Va(){return ya(1)}function aa(){for(var c=[],a=0;a<
+arguments.length;a++)c[a]=arguments[a];return Va()(ga.apply(void 0,c))}function za(c){return new n(function(a){var b;try{b=c()}catch(d){a.error(d);return}return(b?F(b):R()).subscribe(a)})}function ia(c,a){return new n(function(b){var d=c.length;if(0===d)b.complete();else for(var e=Array(d),f=0,g=0,m=function(m){var h=F(c[m]),u=!1;b.add(h.subscribe({next:function(b){u||(u=!0,g++);e[m]=b},error:function(a){return b.error(a)},complete:function(){f++;f!==d&&u||(g===d&&b.next(a?a.reduce(function(b,a,c){return b[a]=
+e[c],b},{}):e),b.complete())}}))},h=0;h<d;h++)m(h)})}function Wa(c,a,b,d){P(b)&&(d=b,b=void 0);return d?Wa(c,a,b).pipe(B(function(b){return x(b)?d.apply(void 0,b):d(b)})):new n(function(d){Xa(c,a,function(b){1<arguments.length?d.next(Array.prototype.slice.call(arguments)):d.next(b)},d,b)})}function Xa(c,a,b,d,e){var f;if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(a,b,e),f=function(){return c.removeEventListener(a,b,e)};else if(c&&"function"===
+typeof c.on&&"function"===typeof c.off)c.on(a,b),f=function(){return c.off(a,b)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(a,b),f=function(){return c.removeListener(a,b)};else if(c&&c.length)for(var g=0,m=c.length;g<m;g++)Xa(c[g],a,b,d,e);else throw new TypeError("Invalid event target");d.add(f)}function Ya(c,a,b){return b?Ya(c,a).pipe(B(function(a){return x(a)?b.apply(void 0,a):b(a)})):new n(function(b){var d=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=
arguments[c];return b.next(1===a.length?a[0]:a)},f;try{f=c(d)}catch(g){b.error(g);return}if(P(a))return function(){return a(d,f)}})}function $b(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=c.iterate(c.state)}catch(f){a.error(f);return}else c.needIterate=!0;if(b){var d=void 0;try{d=b(c.state)}catch(f){a.error(f);return}if(!d){a.complete();return}if(a.closed)return}var e;try{e=c.resultSelector(c.state)}catch(f){a.error(f);return}if(!a.closed&&(a.next(e),!a.closed))return this.schedule(c)}}
function V(c){return!x(c)&&0<=c-parseFloat(c)+1}function ac(c){var a=c.subscriber,b=c.counter;c=c.period;a.next(b);this.schedule({subscriber:a,counter:b+1,period:c},c)}function Za(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var a=Number.POSITIVE_INFINITY,b=null,d=c[c.length-1];A(d)?(b=c.pop(),1<c.length&&"number"===typeof c[c.length-1]&&(a=c.pop())):"number"===typeof d&&(a=c.pop());return null===b&&1===c.length&&c[0]instanceof n?c[0]:ya(a)(Z(c,b))}function Aa(){for(var c=[],a=0;a<
arguments.length;a++)c[a]=arguments[a];if(0===c.length)return S;var b=c[0],d=c.slice(1);return 1===c.length&&x(b)?Aa.apply(void 0,b):new n(function(a){var c=function(){return a.add(Aa.apply(void 0,d).subscribe(a))};return F(b).subscribe({next:function(b){a.next(b)},error:c,complete:c})})}function bc(c){var a=c.keys,b=c.index,d=c.subscriber,e=c.subscription;c=c.obj;if(!d.closed)if(b<a.length){var f=a[b];d.next([f,c[f]]);e.add(this.schedule({keys:a,index:b+1,subscriber:d,subscription:e,obj:c}))}else d.complete()}
-function $a(c,a){function b(){return!b.pred.apply(b.thisArg,arguments)}b.pred=c;b.thisArg=a;return b}function H(c,a){return function(b){return b.lift(new cc(c,a))}}function ab(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length)if(x(c[0]))c=c[0];else return c[0];return Z(c,void 0).lift(new dc)}function ec(c){var a=c.start,b=c.index,d=c.subscriber;b>=c.count?d.complete():(d.next(a),d.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))}function bb(c,a,b){void 0===c&&(c=0);var d=
+function $a(c,a){function b(){return!b.pred.apply(b.thisArg,arguments)}b.pred=c;b.thisArg=a;return b}function I(c,a){return function(b){return b.lift(new cc(c,a))}}function ab(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length)if(x(c[0]))c=c[0];else return c[0];return Z(c,void 0).lift(new dc)}function ec(c){var a=c.start,b=c.index,d=c.subscriber;b>=c.count?d.complete():(d.next(a),d.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))}function bb(c,a,b){void 0===c&&(c=0);var d=
-1;V(a)?d=1>Number(a)&&1||Number(a):A(a)&&(b=a);A(b)||(b=y);return new n(function(a){var e=V(c)?c:+c-b.now();return b.schedule(fc,e,{index:0,period:d,subscriber:a})})}function fc(c){var a=c.index,b=c.period,d=c.subscriber;d.next(a);if(!d.closed){if(-1===b)return d.complete();c.index=a+1;this.schedule(c,b)}}function cb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];"function"===typeof a&&c.pop();return Z(c,void 0).lift(new db(a))}function eb(c){return function(a){return a.lift(new gc(c))}}
function fb(c){var a=c.subscriber,b=c.context;b&&a.closeContext(b);a.closed||(c.context=a.openContext(),c.context.closeAction=this.schedule(c,c.bufferTimeSpan))}function hc(c){var a=c.bufferCreationInterval,b=c.bufferTimeSpan,d=c.subscriber,e=c.scheduler,f=d.openContext();d.closed||(d.add(f.closeAction=e.schedule(gb,b,{subscriber:d,context:f})),this.schedule(c,a))}function gb(c){c.subscriber.closeContext(c.context)}function hb(c,a){return L(c,a,1)}function ic(c){c.debouncedNext()}function ba(c){void 0===
c&&(c=null);return function(a){return a.lift(new jc(c))}}function ib(c,a){return function(b){return b.lift(new kc(c,a))}}function ja(c){void 0===c&&(c=lc);return function(a){return a.lift(new mc(c))}}function lc(){return new ca}function Ba(c){return function(a){return 0===c?R():a.lift(new nc(c))}}function jb(c,a){return a?function(b){return b.pipe(jb(function(b,e){return F(c(b,e)).pipe(B(function(c,d){return a(b,c,e,d)}))}))}:function(b){return b.lift(new oc(c))}}function ka(c){return function(a){return 0===
c?R():a.lift(new pc(c))}}function la(c,a){var b=!1;2<=arguments.length&&(b=!0);return function(d){return d.lift(new qc(c,a,b))}}function ma(c,a){return 2<=arguments.length?function(b){return ta(la(c,a),ka(1),ba(a))(b)}:function(b){return ta(la(function(b,a,f){return c(b,a,f+1)}),ka(1))(b)}}function M(c,a){return function(b){var d;d="function"===typeof c?c:function(){return c};if("function"===typeof a)return b.lift(new rc(d,a));var e=Object.create(b,sc);e.source=b;e.subjectFactory=d;return e}}function tc(c,
-a){return function(b){var d=b;for(b=0;b<a;b++)if(d=d[c[b]],"undefined"===typeof d)return;return d}}function uc(c){var a=c.period;c.subscriber.notifyNext();this.schedule(c,a)}function vc(){return new v}function wc(c){var a=c.bufferSize,b=void 0===a?Number.POSITIVE_INFINITY:a,a=c.windowTime,d=void 0===a?Number.POSITIVE_INFINITY:a,e=c.refCount,f=c.scheduler,g,l=0,h,k=!1,r=!1;return function(a){l++;if(!g||k)k=!1,g=new W(b,d,f),h=a.subscribe({next:function(b){g.next(b)},error:function(b){k=!0;g.error(b)},
-complete:function(){r=!0;h=void 0;g.complete()}});var c=g.subscribe(this);this.add(function(){l--;c.unsubscribe();h&&!r&&e&&0===l&&(h.unsubscribe(),g=h=void 0)})}}function da(c,a){return"function"===typeof a?function(b){return b.pipe(da(function(b,e){return F(c(b,e)).pipe(B(function(c,d){return a(b,c,e,d)}))}))}:function(b){return b.lift(new xc(c))}}function yc(c){c.subscriber.clearThrottle()}function kb(c,a,b){void 0===b&&(b=y);return function(d){var e=c instanceof Date&&!isNaN(+c),f=e?+c-b.now():
+a){return function(b){var d=b;for(b=0;b<a;b++)if(d=d[c[b]],"undefined"===typeof d)return;return d}}function uc(c){var a=c.period;c.subscriber.notifyNext();this.schedule(c,a)}function vc(){return new v}function wc(c){var a=c.bufferSize,b=void 0===a?Number.POSITIVE_INFINITY:a,a=c.windowTime,d=void 0===a?Number.POSITIVE_INFINITY:a,e=c.refCount,f=c.scheduler,g,m=0,h,k=!1,r=!1;return function(a){m++;if(!g||k)k=!1,g=new W(b,d,f),h=a.subscribe({next:function(b){g.next(b)},error:function(b){k=!0;g.error(b)},
+complete:function(){r=!0;h=void 0;g.complete()}});var c=g.subscribe(this);this.add(function(){m--;c.unsubscribe();h&&!r&&e&&0===m&&(h.unsubscribe(),g=h=void 0)})}}function da(c,a){return"function"===typeof a?function(b){return b.pipe(da(function(b,e){return F(c(b,e)).pipe(B(function(c,d){return a(b,c,e,d)}))}))}:function(b){return b.lift(new xc(c))}}function yc(c){c.subscriber.clearThrottle()}function kb(c,a,b){void 0===b&&(b=y);return function(d){var e=c instanceof Date&&!isNaN(+c),f=e?+c-b.now():
Math.abs(c);return d.lift(new zc(f,e,a,b))}}function Ac(c,a,b){if(0===b)return[a];c.push(a);return c}function Bc(c){var a=c.subscriber,b=c.windowTimeSpan,d=c.window;d&&a.closeWindow(d);c.window=a.openWindow();this.schedule(c,b)}function Cc(c){var a=c.windowTimeSpan,b=c.subscriber,d=c.scheduler,e=c.windowCreationInterval,f=b.openWindow(),g={action:this,subscription:null};g.subscription=d.schedule(lb,a,{subscriber:b,window:f,context:g});this.add(g.subscription);this.schedule(c,e)}function lb(c){var a=
-c.subscriber,b=c.window;(c=c.context)&&c.action&&c.subscription&&c.action.remove(c.subscription);a.closeWindow(b)}function mb(c,a){for(var b=0,d=a.length;b<d;b++)for(var e=a[b],f=Object.getOwnPropertyNames(e.prototype),g=0,l=f.length;g<l;g++){var h=f[g];c.prototype[h]=e.prototype[h]}}function Dc(c,a){void 0===a&&(a=null);return new N({method:"GET",url:c,headers:a})}function Ec(c,a,b){return new N({method:"POST",url:c,body:a,headers:b})}function Fc(c,a){return new N({method:"DELETE",url:c,headers:a})}
+c.subscriber,b=c.window;(c=c.context)&&c.action&&c.subscription&&c.action.remove(c.subscription);a.closeWindow(b)}function mb(c,a){for(var b=0,d=a.length;b<d;b++)for(var e=a[b],f=Object.getOwnPropertyNames(e.prototype),g=0,m=f.length;g<m;g++){var h=f[g];c.prototype[h]=e.prototype[h]}}function Dc(c,a){void 0===a&&(a=null);return new N({method:"GET",url:c,headers:a})}function Ec(c,a,b){return new N({method:"POST",url:c,body:a,headers:b})}function Fc(c,a){return new N({method:"DELETE",url:c,headers:a})}
function Gc(c,a,b){return new N({method:"PUT",url:c,body:a,headers:b})}function Hc(c,a,b){return new N({method:"PATCH",url:c,body:a,headers:b})}function Ic(c,a){return Jc(new N({method:"GET",url:c,responseType:"json",headers:a}))}function nb(c,a){switch(c){case "json":return c="response"in a?a.responseType?a.response:JSON.parse(a.response||a.responseText||"null"):JSON.parse(a.responseText||"null"),c;case "xml":return a.responseXML;default:return"response"in a?a.response:a.responseText}}var Kb=Object.setPrototypeOf||
{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},ob=Object.assign||function(c){for(var a,b=1,d=arguments.length;b<d;b++){a=arguments[b];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(c[e]=a[e])}return c},Ca=!1,C={Promise:void 0,set useDeprecatedSynchronousErrorHandling(c){c?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):Ca&&console.log("RxJS: Back to a better error behavior. Thank you. \x3c3");
Ca=c},get useDeprecatedSynchronousErrorHandling(){return Ca}},na={closed:!0,next:function(c){},error:function(c){if(C.useDeprecatedSynchronousErrorHandling)throw c;Q(c)},complete:function(){}},x=function(){return Array.isArray||function(c){return c&&"number"===typeof c.length}}(),Y=function(){function c(a){Error.call(this);this.message=a?a.length+" errors occurred during unsubscription:\n"+a.map(function(b,a){return a+1+") "+b.toString()}).join("\n "):"";this.name="UnsubscriptionError";this.errors=
-a;return this}c.prototype=Object.create(Error.prototype);return c}(),t=function(){function c(a){this.closed=!1;this._subscriptions=this._parentOrParents=null;a&&(this._unsubscribe=a)}c.prototype.unsubscribe=function(){var a;if(!this.closed){var b=this._parentOrParents,d=this._unsubscribe,e=this._subscriptions;this.closed=!0;this._subscriptions=this._parentOrParents=null;if(b instanceof c)b.remove(this);else if(null!==b)for(var f=0;f<b.length;++f)b[f].remove(this);if(P(d))try{d.call(this)}catch(g){a=
+a;return this}c.prototype=Object.create(Error.prototype);return c}(),p=function(){function c(a){this.closed=!1;this._subscriptions=this._parentOrParents=null;a&&(this._unsubscribe=a)}c.prototype.unsubscribe=function(){var a;if(!this.closed){var b=this._parentOrParents,d=this._unsubscribe,e=this._subscriptions;this.closed=!0;this._subscriptions=this._parentOrParents=null;if(b instanceof c)b.remove(this);else if(null!==b)for(var f=0;f<b.length;++f)b[f].remove(this);if(P(d))try{d.call(this)}catch(g){a=
g instanceof Y?Ka(g.errors):[g]}if(x(e))for(f=-1,b=e.length;++f<b;)if(d=e[f],ra(d))try{d.unsubscribe()}catch(g){a=a||[],g instanceof Y?a=a.concat(Ka(g.errors)):a.push(g)}if(a)throw new Y(a);}};c.prototype.add=function(a){var b=a;if(!a)return c.EMPTY;switch(typeof a){case "function":b=new c(a);case "object":if(b===this||b.closed||"function"!==typeof b.unsubscribe)return b;if(this.closed)return b.unsubscribe(),b;b instanceof c||(a=b,b=new c,b._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+
a+" added to Subscription.");}a=b._parentOrParents;if(null===a)b._parentOrParents=this;else if(a instanceof c){if(a===this)return b;b._parentOrParents=[a,this]}else if(-1===a.indexOf(this))a.push(this);else return b;a=this._subscriptions;null===a?this._subscriptions=[b]:a.push(b);return b};c.prototype.remove=function(a){var b=this._subscriptions;b&&(a=b.indexOf(a),-1!==a&&b.splice(a,1))};c.EMPTY=function(a){a.closed=!0;return a}(new c);return c}(),oa="function"===typeof Symbol?Symbol("rxSubscriber"):
-"@@rxSubscriber_"+Math.random(),m=function(c){function a(b,d,e){var f=c.call(this)||this;f.syncErrorValue=null;f.syncErrorThrown=!1;f.syncErrorThrowable=!1;f.isStopped=!1;switch(arguments.length){case 0:f.destination=na;break;case 1:if(!b){f.destination=na;break}if("object"===typeof b){b instanceof a?(f.syncErrorThrowable=b.syncErrorThrowable,f.destination=b,b.add(f)):(f.syncErrorThrowable=!0,f.destination=new pb(f,b));break}default:f.syncErrorThrowable=!0,f.destination=new pb(f,b,d,e)}return f}h(a,
+"@@rxSubscriber_"+Math.random(),l=function(c){function a(b,d,e){var f=c.call(this)||this;f.syncErrorValue=null;f.syncErrorThrown=!1;f.syncErrorThrowable=!1;f.isStopped=!1;switch(arguments.length){case 0:f.destination=na;break;case 1:if(!b){f.destination=na;break}if("object"===typeof b){b instanceof a?(f.syncErrorThrowable=b.syncErrorThrowable,f.destination=b,b.add(f)):(f.syncErrorThrowable=!0,f.destination=new pb(f,b));break}default:f.syncErrorThrowable=!0,f.destination=new pb(f,b,d,e)}return f}h(a,
c);a.prototype[oa]=function(){return this};a.create=function(b,c,e){b=new a(b,c,e);b.syncErrorThrowable=!1;return b};a.prototype.next=function(b){this.isStopped||this._next(b)};a.prototype.error=function(b){this.isStopped||(this.isStopped=!0,this._error(b))};a.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,c.prototype.unsubscribe.call(this))};a.prototype._next=function(b){this.destination.next(b)};
-a.prototype._error=function(b){this.destination.error(b);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete();this.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var b=this._parentOrParents;this._parentOrParents=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parentOrParents=b;return this};return a}(t),pb=function(c){function a(b,a,e,f){var d=c.call(this)||this;d._parentSubscriber=b;var l;b=d;P(a)?l=a:a&&(l=a.next,e=a.error,f=a.complete,a!==na&&
-(b=Object.create(a),P(b.unsubscribe)&&d.add(b.unsubscribe.bind(b)),b.unsubscribe=d.unsubscribe.bind(d)));d._context=b;d._next=l;d._error=e;d._complete=f;return d}h(a,c);a.prototype.next=function(b){if(!this.isStopped&&this._next){var a=this._parentSubscriber;C.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,this._next,b)&&this.unsubscribe():this.__tryOrUnsub(this._next,b)}};a.prototype.error=function(b){if(!this.isStopped){var a=this._parentSubscriber,c=C.useDeprecatedSynchronousErrorHandling;
+a.prototype._error=function(b){this.destination.error(b);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete();this.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var b=this._parentOrParents;this._parentOrParents=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parentOrParents=b;return this};return a}(p),pb=function(c){function a(b,a,e,f){var d=c.call(this)||this;d._parentSubscriber=b;var m;b=d;P(a)?m=a:a&&(m=a.next,e=a.error,f=a.complete,a!==na&&
+(b=Object.create(a),P(b.unsubscribe)&&d.add(b.unsubscribe.bind(b)),b.unsubscribe=d.unsubscribe.bind(d)));d._context=b;d._next=m;d._error=e;d._complete=f;return d}h(a,c);a.prototype.next=function(b){if(!this.isStopped&&this._next){var a=this._parentSubscriber;C.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,this._next,b)&&this.unsubscribe():this.__tryOrUnsub(this._next,b)}};a.prototype.error=function(b){if(!this.isStopped){var a=this._parentSubscriber,c=C.useDeprecatedSynchronousErrorHandling;
if(this._error)c&&a.syncErrorThrowable?this.__tryOrSetError(a,this._error,b):this.__tryOrUnsub(this._error,b),this.unsubscribe();else if(a.syncErrorThrowable)c?(a.syncErrorValue=b,a.syncErrorThrown=!0):Q(b),this.unsubscribe();else{this.unsubscribe();if(c)throw b;Q(b)}}};a.prototype.complete=function(){var b=this;if(!this.isStopped){var a=this._parentSubscriber;if(this._complete){var c=function(){return b._complete.call(b._context)};C.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,
c):this.__tryOrUnsub(c)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(b,a){try{b.call(this._context,a)}catch(e){this.unsubscribe();if(C.useDeprecatedSynchronousErrorHandling)throw e;Q(e)}};a.prototype.__tryOrSetError=function(b,a,c){if(!C.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{a.call(this._context,c)}catch(f){return C.useDeprecatedSynchronousErrorHandling?(b.syncErrorValue=f,b.syncErrorThrown=!0):Q(f),!0}return!1};a.prototype._unsubscribe=function(){var b=this._parentSubscriber;
-this._parentSubscriber=this._context=null;b.unsubscribe()};return a}(m),U="function"===typeof Symbol&&Symbol.observable||"@@observable",n=function(){function c(a){this._isScalar=!1;a&&(this._subscribe=a)}c.prototype.lift=function(a){var b=new c;b.source=this;b.operator=a;return b};c.prototype.subscribe=function(a,b,c){var d=this.operator;a:{if(a){if(a instanceof m)break a;if(a[oa]){a=a[oa]();break a}}a=a||b||c?new m(a,b,c):new m(na)}d?a.add(d.call(a,this.source)):a.add(this.source||C.useDeprecatedSynchronousErrorHandling&&
+this._parentSubscriber=this._context=null;b.unsubscribe()};return a}(l),U="function"===typeof Symbol&&Symbol.observable||"@@observable",n=function(){function c(a){this._isScalar=!1;a&&(this._subscribe=a)}c.prototype.lift=function(a){var b=new c;b.source=this;b.operator=a;return b};c.prototype.subscribe=function(a,b,c){var d=this.operator;a:{if(a){if(a instanceof l)break a;if(a[oa]){a=a[oa]();break a}}a=a||b||c?new l(a,b,c):new l(na)}d?a.add(d.call(a,this.source)):a.add(this.source||C.useDeprecatedSynchronousErrorHandling&&
!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a));if(C.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};c.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(b){C.useDeprecatedSynchronousErrorHandling&&(a.syncErrorThrown=!0,a.syncErrorValue=b),sa(a)?a.error(b):console.warn(b)}};c.prototype.forEach=function(a,b){var c=this;b=Ma(b);return new b(function(b,d){var e;e=c.subscribe(function(b){try{a(b)}catch(u){d(u),
-e&&e.unsubscribe()}},d,b)})};c.prototype._subscribe=function(a){var b=this.source;return b&&b.subscribe(a)};c.prototype[U]=function(){return this};c.prototype.pipe=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return 0===a.length?this:La(a)(this)};c.prototype.toPromise=function(a){var b=this;a=Ma(a);return new a(function(a,c){var d;b.subscribe(function(b){return d=b},function(b){return c(b)},function(){return a(d)})})};c.create=function(a){return new c(a)};return c}(),I=function(){function c(){Error.call(this);
-this.message="object unsubscribed";this.name="ObjectUnsubscribedError";return this}c.prototype=Object.create(Error.prototype);return c}(),qb=function(c){function a(b,a){var d=c.call(this)||this;d.subject=b;d.subscriber=a;d.closed=!1;return d}h(a,c);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var b=this.subject,a=b.observers;this.subject=null;!a||0===a.length||b.isStopped||b.closed||(b=a.indexOf(this.subscriber),-1!==b&&a.splice(b,1))}};return a}(t),rb=function(c){function a(b){var a=
-c.call(this,b)||this;a.destination=b;return a}h(a,c);return a}(m),v=function(c){function a(){var b=c.call(this)||this;b.observers=[];b.closed=!1;b.isStopped=!1;b.hasError=!1;b.thrownError=null;return b}h(a,c);a.prototype[oa]=function(){return new rb(this)};a.prototype.lift=function(b){var a=new Da(this,this);a.operator=b;return a};a.prototype.next=function(b){if(this.closed)throw new I;if(!this.isStopped)for(var a=this.observers,c=a.length,a=a.slice(),f=0;f<c;f++)a[f].next(b)};a.prototype.error=function(b){if(this.closed)throw new I;
-this.hasError=!0;this.thrownError=b;this.isStopped=!0;for(var a=this.observers,c=a.length,a=a.slice(),f=0;f<c;f++)a[f].error(b);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new I;this.isStopped=!0;for(var b=this.observers,a=b.length,b=b.slice(),c=0;c<a;c++)b[c].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe=function(b){if(this.closed)throw new I;return c.prototype._trySubscribe.call(this,
-b)};a.prototype._subscribe=function(b){if(this.closed)throw new I;if(this.hasError)return b.error(this.thrownError),t.EMPTY;if(this.isStopped)return b.complete(),t.EMPTY;this.observers.push(b);return new qb(this,b)};a.prototype.asObservable=function(){var b=new n;b.source=this;return b};a.create=function(b,a){return new Da(b,a)};return a}(n),Da=function(c){function a(b,a){var d=c.call(this)||this;d.destination=b;d.source=a;return d}h(a,c);a.prototype.next=function(b){var a=this.destination;a&&a.next&&
-a.next(b)};a.prototype.error=function(b){var a=this.destination;a&&a.error&&this.destination.error(b)};a.prototype.complete=function(){var b=this.destination;b&&b.complete&&this.destination.complete()};a.prototype._subscribe=function(b){return this.source?this.source.subscribe(b):t.EMPTY};return a}(v),Lb=function(){function c(a){this.connectable=a}c.prototype.call=function(a,b){var c=this.connectable;c._refCount++;a=new Kc(a,c);b=b.subscribe(a);a.closed||(a.connection=c.connect());return b};return c}(),
-Kc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}h(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=a?this.connection=null:(b._refCount=a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null,!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a}(m),sb=function(c){function a(b,a){var d=c.call(this)||this;d.source=b;d.subjectFactory=a;d._refCount=0;d._isComplete=
-!1;return d}h(a,c);a.prototype._subscribe=function(b){return this.getSubject().subscribe(b)};a.prototype.getSubject=function(){var b=this._subject;if(!b||b.isStopped)this._subject=this.subjectFactory();return this._subject};a.prototype.connect=function(){var b=this._connection;b||(this._isComplete=!1,b=this._connection=new t,b.add(this.source.subscribe(new Lc(this.getSubject(),this))),b.closed&&(this._connection=null,b=t.EMPTY));return b};a.prototype.refCount=function(){return ua()(this)};return a}(n),
+e&&e.unsubscribe()}},d,b)})};c.prototype._subscribe=function(a){var b=this.source;return b&&b.subscribe(a)};c.prototype[U]=function(){return this};c.prototype.pipe=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return 0===a.length?this:La(a)(this)};c.prototype.toPromise=function(a){var b=this;a=Ma(a);return new a(function(a,c){var d;b.subscribe(function(b){return d=b},function(b){return c(b)},function(){return a(d)})})};c.create=function(a){return new c(a)};return c}(),J=function(){function c(){Error.call(this);
+this.message="object unsubscribed";this.name="ObjectUnsubscribedError";return this}c.prototype=Object.create(Error.prototype);return c}(),qb=function(c){function a(b,a){var d=c.call(this)||this;d.subject=b;d.subscriber=a;d.closed=!1;return d}h(a,c);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var b=this.subject,a=b.observers;this.subject=null;!a||0===a.length||b.isStopped||b.closed||(b=a.indexOf(this.subscriber),-1!==b&&a.splice(b,1))}};return a}(p),rb=function(c){function a(b){var a=
+c.call(this,b)||this;a.destination=b;return a}h(a,c);return a}(l),v=function(c){function a(){var b=c.call(this)||this;b.observers=[];b.closed=!1;b.isStopped=!1;b.hasError=!1;b.thrownError=null;return b}h(a,c);a.prototype[oa]=function(){return new rb(this)};a.prototype.lift=function(b){var a=new Da(this,this);a.operator=b;return a};a.prototype.next=function(b){if(this.closed)throw new J;if(!this.isStopped)for(var a=this.observers,c=a.length,a=a.slice(),f=0;f<c;f++)a[f].next(b)};a.prototype.error=function(b){if(this.closed)throw new J;
+this.hasError=!0;this.thrownError=b;this.isStopped=!0;for(var a=this.observers,c=a.length,a=a.slice(),f=0;f<c;f++)a[f].error(b);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new J;this.isStopped=!0;for(var b=this.observers,a=b.length,b=b.slice(),c=0;c<a;c++)b[c].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe=function(b){if(this.closed)throw new J;return c.prototype._trySubscribe.call(this,
+b)};a.prototype._subscribe=function(b){if(this.closed)throw new J;if(this.hasError)return b.error(this.thrownError),p.EMPTY;if(this.isStopped)return b.complete(),p.EMPTY;this.observers.push(b);return new qb(this,b)};a.prototype.asObservable=function(){var b=new n;b.source=this;return b};a.create=function(b,a){return new Da(b,a)};return a}(n),Da=function(c){function a(b,a){var d=c.call(this)||this;d.destination=b;d.source=a;return d}h(a,c);a.prototype.next=function(b){var a=this.destination;a&&a.next&&
+a.next(b)};a.prototype.error=function(b){var a=this.destination;a&&a.error&&this.destination.error(b)};a.prototype.complete=function(){var b=this.destination;b&&b.complete&&this.destination.complete()};a.prototype._subscribe=function(b){return this.source?this.source.subscribe(b):p.EMPTY};return a}(v),Lb=function(){function c(a){this.connectable=a}c.prototype.call=function(a,b){var c=this.connectable;c._refCount++;a=new Kc(a,c);b=b.subscribe(a);a.closed||(a.connection=c.connect());return b};return c}(),
+Kc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}h(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=a?this.connection=null:(b._refCount=a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null,!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a}(l),sb=function(c){function a(b,a){var d=c.call(this)||this;d.source=b;d.subjectFactory=a;d._refCount=0;d._isComplete=
+!1;return d}h(a,c);a.prototype._subscribe=function(b){return this.getSubject().subscribe(b)};a.prototype.getSubject=function(){var b=this._subject;if(!b||b.isStopped)this._subject=this.subjectFactory();return this._subject};a.prototype.connect=function(){var b=this._connection;b||(this._isComplete=!1,b=this._connection=new p,b.add(this.source.subscribe(new Lc(this.getSubject(),this))),b.closed&&(this._connection=null,b=p.EMPTY));return b};a.prototype.refCount=function(){return ua()(this)};return a}(n),
sc=function(){var c=sb.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:c._subscribe},_isComplete:{value:c._isComplete,writable:!0},getSubject:{value:c.getSubject},connect:{value:c.connect},refCount:{value:c.refCount}}}(),Lc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}h(a,c);a.prototype._error=function(b){this._unsubscribe();c.prototype._error.call(this,b)};
a.prototype._complete=function(){this.connectable._isComplete=!0;this._unsubscribe();c.prototype._complete.call(this)};a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._connection;b._refCount=0;b._subject=null;b._connection=null;a&&a.unsubscribe()}};return a}(rb);(function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}h(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=
-a?this.connection=null:(b._refCount=a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null,!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a})(m);var Nc=function(){function c(a,b,c,e){this.keySelector=a;this.elementSelector=b;this.durationSelector=c;this.subjectSelector=e}c.prototype.call=function(a,b){return b.subscribe(new Mc(a,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return c}(),Mc=function(c){function a(b,
-a,e,f,g){b=c.call(this,b)||this;b.keySelector=a;b.elementSelector=e;b.durationSelector=f;b.subjectSelector=g;b.groups=null;b.attemptedToUnsubscribe=!1;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.keySelector(b)}catch(e){this.error(e);return}this._group(b,a)};a.prototype._group=function(b,a){var c=this.groups;c||(c=this.groups=new Map);var d=c.get(a),g;if(this.elementSelector)try{g=this.elementSelector(b)}catch(l){this.error(l)}else g=b;if(!d&&(d=this.subjectSelector?this.subjectSelector():
-new v,c.set(a,d),b=new Ea(a,d,this),this.destination.next(b),this.durationSelector)){b=void 0;try{b=this.durationSelector(new Ea(a,d))}catch(l){this.error(l);return}this.add(b.subscribe(new Oc(a,d,this)))}d.closed||d.next(g)};a.prototype._error=function(b){var a=this.groups;a&&(a.forEach(function(a,c){a.error(b)}),a.clear());this.destination.error(b)};a.prototype._complete=function(){var b=this.groups;b&&(b.forEach(function(b,a){b.complete()}),b.clear());this.destination.complete()};a.prototype.removeGroup=
-function(b){this.groups.delete(b)};a.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&c.prototype.unsubscribe.call(this))};return a}(m),Oc=function(c){function a(b,a,e){var d=c.call(this,a)||this;d.key=b;d.group=a;d.parent=e;return d}h(a,c);a.prototype._next=function(b){this.complete()};a.prototype._unsubscribe=function(){var b=this.parent,a=this.key;this.key=this.parent=null;b&&b.removeGroup(a)};return a}(m),Ea=function(c){function a(b,a,e){var d=c.call(this)||
-this;d.key=b;d.groupSubject=a;d.refCountSubscription=e;return d}h(a,c);a.prototype._subscribe=function(b){var a=new t,c=this.refCountSubscription,f=this.groupSubject;c&&!c.closed&&a.add(new Pc(c));a.add(f.subscribe(b));return a};return a}(n),Pc=function(c){function a(b){var a=c.call(this)||this;a.parent=b;b.count++;return a}h(a,c);a.prototype.unsubscribe=function(){var b=this.parent;b.closed||this.closed||(c.prototype.unsubscribe.call(this),--b.count,0===b.count&&b.attemptedToUnsubscribe&&b.unsubscribe())};
-return a}(t),tb=function(c){function a(b){var a=c.call(this)||this;a._value=b;return a}h(a,c);Object.defineProperty(a.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0});a.prototype._subscribe=function(b){var a=c.prototype._subscribe.call(this,b);a&&!a.closed&&b.next(this._value);return a};a.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new I;return this._value};a.prototype.next=function(b){c.prototype.next.call(this,
+a?this.connection=null:(b._refCount=a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null,!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a})(l);var Nc=function(){function c(a,b,c,e){this.keySelector=a;this.elementSelector=b;this.durationSelector=c;this.subjectSelector=e}c.prototype.call=function(a,b){return b.subscribe(new Mc(a,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return c}(),Mc=function(c){function a(b,
+a,e,f,g){b=c.call(this,b)||this;b.keySelector=a;b.elementSelector=e;b.durationSelector=f;b.subjectSelector=g;b.groups=null;b.attemptedToUnsubscribe=!1;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.keySelector(b)}catch(e){this.error(e);return}this._group(b,a)};a.prototype._group=function(b,a){var c=this.groups;c||(c=this.groups=new Map);var d=c.get(a),g;if(this.elementSelector)try{g=this.elementSelector(b)}catch(m){this.error(m)}else g=b;if(!d&&(d=this.subjectSelector?this.subjectSelector():
+new v,c.set(a,d),b=new Ea(a,d,this),this.destination.next(b),this.durationSelector)){b=void 0;try{b=this.durationSelector(new Ea(a,d))}catch(m){this.error(m);return}this.add(b.subscribe(new Oc(a,d,this)))}d.closed||d.next(g)};a.prototype._error=function(b){var a=this.groups;a&&(a.forEach(function(a,c){a.error(b)}),a.clear());this.destination.error(b)};a.prototype._complete=function(){var b=this.groups;b&&(b.forEach(function(b,a){b.complete()}),b.clear());this.destination.complete()};a.prototype.removeGroup=
+function(b){this.groups.delete(b)};a.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&c.prototype.unsubscribe.call(this))};return a}(l),Oc=function(c){function a(b,a,e){var d=c.call(this,a)||this;d.key=b;d.group=a;d.parent=e;return d}h(a,c);a.prototype._next=function(b){this.complete()};a.prototype._unsubscribe=function(){var b=this.parent,a=this.key;this.key=this.parent=null;b&&b.removeGroup(a)};return a}(l),Ea=function(c){function a(b,a,e){var d=c.call(this)||
+this;d.key=b;d.groupSubject=a;d.refCountSubscription=e;return d}h(a,c);a.prototype._subscribe=function(b){var a=new p,c=this.refCountSubscription,f=this.groupSubject;c&&!c.closed&&a.add(new Pc(c));a.add(f.subscribe(b));return a};return a}(n),Pc=function(c){function a(b){var a=c.call(this)||this;a.parent=b;b.count++;return a}h(a,c);a.prototype.unsubscribe=function(){var b=this.parent;b.closed||this.closed||(c.prototype.unsubscribe.call(this),--b.count,0===b.count&&b.attemptedToUnsubscribe&&b.unsubscribe())};
+return a}(p),tb=function(c){function a(b){var a=c.call(this)||this;a._value=b;return a}h(a,c);Object.defineProperty(a.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0});a.prototype._subscribe=function(b){var a=c.prototype._subscribe.call(this,b);a&&!a.closed&&b.next(this._value);return a};a.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new J;return this._value};a.prototype.next=function(b){c.prototype.next.call(this,
this._value=b)};return a}(v),ea=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;d.pending=!1;return d}h(a,c);a.prototype.schedule=function(b,a){void 0===a&&(a=0);if(this.closed)return this;this.state=b;b=this.id;var c=this.scheduler;null!=b&&(this.id=this.recycleAsyncId(c,b,a));this.pending=!0;this.delay=a;this.id=this.id||this.requestAsyncId(c,this.id,a);return this};a.prototype.requestAsyncId=function(b,a,c){void 0===c&&(c=0);return setInterval(b.flush.bind(b,this),
c)};a.prototype.recycleAsyncId=function(b,a,c){void 0===c&&(c=0);if(null!==c&&this.delay===c&&!1===this.pending)return a;clearInterval(a)};a.prototype.execute=function(b,a){if(this.closed)return Error("executing a cancelled action");this.pending=!1;if(b=this._execute(b,a))return b;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(b,a){a=!1;var c=void 0;try{this.work(b)}catch(f){a=!0,c=!!f&&f||Error(f)}if(a)return this.unsubscribe(),
-c};a.prototype._unsubscribe=function(){var b=this.id,a=this.scheduler,c=a.actions,f=c.indexOf(this);this.state=this.work=null;this.pending=!1;this.scheduler=null;-1!==f&&c.splice(f,1);null!=b&&(this.id=this.recycleAsyncId(a,b,null));this.delay=null};return a}(function(c){function a(b,a){return c.call(this)||this}h(a,c);a.prototype.schedule=function(b,a){return this};return a}(t)),Qc=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d}h(a,c);a.prototype.schedule=
+c};a.prototype._unsubscribe=function(){var b=this.id,a=this.scheduler,c=a.actions,f=c.indexOf(this);this.state=this.work=null;this.pending=!1;this.scheduler=null;-1!==f&&c.splice(f,1);null!=b&&(this.id=this.recycleAsyncId(a,b,null));this.delay=null};return a}(function(c){function a(b,a){return c.call(this)||this}h(a,c);a.prototype.schedule=function(b,a){return this};return a}(p)),Qc=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d}h(a,c);a.prototype.schedule=
function(b,a){void 0===a&&(a=0);if(0<a)return c.prototype.schedule.call(this,b,a);this.delay=a;this.state=b;this.scheduler.flush(this);return this};a.prototype.execute=function(b,a){return 0<a||this.closed?c.prototype.execute.call(this,b,a):this._execute(b,a)};a.prototype.requestAsyncId=function(b,a,e){void 0===e&&(e=0);return null!==e&&0<e||null===e&&0<this.delay?c.prototype.requestAsyncId.call(this,b,a,e):b.flush(this)};return a}(ea),Fa=function(){function c(a,b){void 0===b&&(b=c.now);this.SchedulerAction=
a;this.now=b}c.prototype.schedule=function(a,b,c){void 0===b&&(b=0);return(new this.SchedulerAction(this,a)).schedule(c,b)};c.now=function(){return Date.now()};return c}(),O=function(c){function a(b,d){void 0===d&&(d=Fa.now);var e=c.call(this,b,function(){return a.delegate&&a.delegate!==e?a.delegate.now():d()})||this;e.actions=[];e.active=!1;e.scheduled=void 0;return e}h(a,c);a.prototype.schedule=function(b,d,e){void 0===d&&(d=0);return a.delegate&&a.delegate!==this?a.delegate.schedule(b,d,e):c.prototype.schedule.call(this,
b,d,e)};a.prototype.flush=function(b){var a=this.actions;if(this.active)a.push(b);else{var c;this.active=!0;do if(c=b.execute(b.state,b.delay))break;while(b=a.shift());this.active=!1;if(c){for(;b=a.shift();)b.unsubscribe();throw c;}}};return a}(Fa),ub=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);return a}(O))(Qc),S=new n(function(c){return c.complete()}),Na=function(c){return function(a){for(var b=0,d=c.length;b<d&&!a.closed;b++)a.next(c[b]);a.complete()}};(function(c){c.NEXT=
"N";c.ERROR="E";c.COMPLETE="C"})(k.NotificationKind||(k.NotificationKind={}));var w=function(){function c(a,b,c){this.kind=a;this.value=b;this.error=c;this.hasValue="N"===a}c.prototype.observe=function(a){switch(this.kind){case "N":return a.next&&a.next(this.value);case "E":return a.error&&a.error(this.error);case "C":return a.complete&&a.complete()}};c.prototype.do=function(a,b,c){switch(this.kind){case "N":return a&&a(this.value);case "E":return b&&b(this.error);case "C":return c&&c()}};c.prototype.accept=
function(a,b,c){return a&&"function"===typeof a.next?this.observe(a):this.do(a,b,c)};c.prototype.toObservable=function(){switch(this.kind){case "N":return ga(this.value);case "E":return wa(this.error);case "C":return R()}throw Error("unexpected notification kind value");};c.createNext=function(a){return"undefined"!==typeof a?new c("N",a):c.undefinedValueNotification};c.createError=function(a){return new c("E",void 0,a)};c.createComplete=function(){return c.completeNotification};c.completeNotification=
new c("C");c.undefinedValueNotification=new c("N",void 0);return c}(),Rc=function(){function c(a,b){void 0===b&&(b=0);this.scheduler=a;this.delay=b}c.prototype.call=function(a,b){return b.subscribe(new vb(a,this.scheduler,this.delay))};return c}(),vb=function(c){function a(b,a,e){void 0===e&&(e=0);b=c.call(this,b)||this;b.scheduler=a;b.delay=e;return b}h(a,c);a.dispatch=function(b){b.notification.observe(b.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(b){this.destination.add(this.scheduler.schedule(a.dispatch,
-this.delay,new Sc(b,this.destination)))};a.prototype._next=function(b){this.scheduleMessage(w.createNext(b))};a.prototype._error=function(b){this.scheduleMessage(w.createError(b));this.unsubscribe()};a.prototype._complete=function(){this.scheduleMessage(w.createComplete());this.unsubscribe()};return a}(m),Sc=function(){return function(c,a){this.notification=c;this.destination=a}}(),W=function(c){function a(b,a,e){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);var d=
+this.delay,new Sc(b,this.destination)))};a.prototype._next=function(b){this.scheduleMessage(w.createNext(b))};a.prototype._error=function(b){this.scheduleMessage(w.createError(b));this.unsubscribe()};a.prototype._complete=function(){this.scheduleMessage(w.createComplete());this.unsubscribe()};return a}(l),Sc=function(){return function(c,a){this.notification=c;this.destination=a}}(),W=function(c){function a(b,a,e){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);var d=
c.call(this)||this;d.scheduler=e;d._events=[];d._infiniteTimeWindow=!1;d._bufferSize=1>b?1:b;d._windowTime=1>a?1:a;a===Number.POSITIVE_INFINITY?(d._infiniteTimeWindow=!0,d.next=d.nextInfiniteTimeWindow):d.next=d.nextTimeWindow;return d}h(a,c);a.prototype.nextInfiniteTimeWindow=function(b){var a=this._events;a.push(b);a.length>this._bufferSize&&a.shift();c.prototype.next.call(this,b)};a.prototype.nextTimeWindow=function(b){this._events.push(new Tc(this._getNow(),b));this._trimBufferThenGetEvents();
-c.prototype.next.call(this,b)};a.prototype._subscribe=function(b){var a=this._infiniteTimeWindow,c=a?this._events:this._trimBufferThenGetEvents(),f=this.scheduler,g=c.length,l;if(this.closed)throw new I;this.isStopped||this.hasError?l=t.EMPTY:(this.observers.push(b),l=new qb(this,b));f&&b.add(b=new vb(b,f));if(a)for(a=0;a<g&&!b.closed;a++)b.next(c[a]);else for(a=0;a<g&&!b.closed;a++)b.next(c[a].value);this.hasError?b.error(this.thrownError):this.isStopped&&b.complete();return l};a.prototype._getNow=
-function(){return(this.scheduler||ub).now()};a.prototype._trimBufferThenGetEvents=function(){for(var b=this._getNow(),a=this._bufferSize,c=this._windowTime,f=this._events,g=f.length,l=0;l<g&&!(b-f[l].time<c);)l++;g>a&&(l=Math.max(l,g-a));0<l&&f.splice(0,l);return f};return a}(v),Tc=function(){return function(c,a){this.time=c;this.value=a}}(),T=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||this;b.value=null;b.hasNext=!1;b.hasCompleted=!1;return b}h(a,c);a.prototype._subscribe=function(b){return this.hasError?
-(b.error(this.thrownError),t.EMPTY):this.hasCompleted&&this.hasNext?(b.next(this.value),b.complete(),t.EMPTY):c.prototype._subscribe.call(this,b)};a.prototype.next=function(b){this.hasCompleted||(this.value=b,this.hasNext=!0)};a.prototype.error=function(b){this.hasCompleted||c.prototype.error.call(this,b)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&c.prototype.next.call(this,this.value);c.prototype.complete.call(this)};return a}(v),Uc=1,Vc=Promise.resolve(),xa={},wb={setImmediate:function(c){var a=
+c.prototype.next.call(this,b)};a.prototype._subscribe=function(b){var a=this._infiniteTimeWindow,c=a?this._events:this._trimBufferThenGetEvents(),f=this.scheduler,g=c.length,m;if(this.closed)throw new J;this.isStopped||this.hasError?m=p.EMPTY:(this.observers.push(b),m=new qb(this,b));f&&b.add(b=new vb(b,f));if(a)for(a=0;a<g&&!b.closed;a++)b.next(c[a]);else for(a=0;a<g&&!b.closed;a++)b.next(c[a].value);this.hasError?b.error(this.thrownError):this.isStopped&&b.complete();return m};a.prototype._getNow=
+function(){return(this.scheduler||ub).now()};a.prototype._trimBufferThenGetEvents=function(){for(var b=this._getNow(),a=this._bufferSize,c=this._windowTime,f=this._events,g=f.length,m=0;m<g&&!(b-f[m].time<c);)m++;g>a&&(m=Math.max(m,g-a));0<m&&f.splice(0,m);return f};return a}(v),Tc=function(){return function(c,a){this.time=c;this.value=a}}(),T=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||this;b.value=null;b.hasNext=!1;b.hasCompleted=!1;return b}h(a,c);a.prototype._subscribe=function(b){return this.hasError?
+(b.error(this.thrownError),p.EMPTY):this.hasCompleted&&this.hasNext?(b.next(this.value),b.complete(),p.EMPTY):c.prototype._subscribe.call(this,b)};a.prototype.next=function(b){this.hasCompleted||(this.value=b,this.hasNext=!0)};a.prototype.error=function(b){this.hasCompleted||c.prototype.error.call(this,b)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&c.prototype.next.call(this,this.value);c.prototype.complete.call(this)};return a}(v),Uc=1,Vc=Promise.resolve(),xa={},wb={setImmediate:function(c){var a=
Uc++;xa[a]=!0;Vc.then(function(){return Oa(a)&&c()});return a},clearImmediate:function(c){Oa(c)}},Wc=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d}h(a,c);a.prototype.requestAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e)return c.prototype.requestAsyncId.call(this,b,a,e);b.actions.push(this);return b.scheduled||(b.scheduled=wb.setImmediate(b.flush.bind(b,null)))};a.prototype.recycleAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e||null===
e&&0<this.delay)return c.prototype.recycleAsyncId.call(this,b,a,e);0===b.actions.length&&(wb.clearImmediate(a),b.scheduled=void 0)};return a}(ea),pa=new (function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.flush=function(b){this.active=!0;this.scheduled=void 0;var a=this.actions,c,f=-1,g=a.length;b=b||a.shift();do if(c=b.execute(b.state,b.delay))break;while(++f<g&&(b=a.shift()));this.active=!1;if(c){for(;++f<g&&(b=a.shift());)b.unsubscribe();throw c;}};return a}(O))(Wc),
y=new O(ea),Xc=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d}h(a,c);a.prototype.requestAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e)return c.prototype.requestAsyncId.call(this,b,a,e);b.actions.push(this);return b.scheduled||(b.scheduled=requestAnimationFrame(function(){return b.flush(null)}))};a.prototype.recycleAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0<e||null===e&&0<this.delay)return c.prototype.recycleAsyncId.call(this,b,a,
@@ -100,169 +100,169 @@ void 0===a&&(a=Number.POSITIVE_INFINITY);var d=c.call(this,b,function(){return d
d.index=e;d.active=!0;d.index=b.index=e;return d}h(a,c);a.prototype.schedule=function(b,d){void 0===d&&(d=0);if(!this.id)return c.prototype.schedule.call(this,b,d);this.active=!1;var e=new a(this.scheduler,this.work);this.add(e);return e.schedule(b,d)};a.prototype.requestAsyncId=function(b,c,e){void 0===e&&(e=0);this.delay=b.frame+e;b=b.actions;b.push(this);b.sort(a.sortActions);return!0};a.prototype.recycleAsyncId=function(b,a,c){};a.prototype._execute=function(b,a){if(!0===this.active)return c.prototype._execute.call(this,
b,a)};a.sortActions=function(b,a){return b.delay===a.delay?b.index===a.index?0:b.index>a.index?1:-1:b.delay>a.delay?1:-1};return a}(ea),X=function(){function c(){Error.call(this);this.message="argument out of range";this.name="ArgumentOutOfRangeError";return this}c.prototype=Object.create(Error.prototype);return c}(),ca=function(){function c(){Error.call(this);this.message="no elements in sequence";this.name="EmptyError";return this}c.prototype=Object.create(Error.prototype);return c}(),yb=function(){function c(){Error.call(this);
this.message="Timeout has occurred";this.name="TimeoutError";return this}c.prototype=Object.create(Error.prototype);return c}(),Ob=function(){function c(a,b){this.project=a;this.thisArg=b}c.prototype.call=function(a,b){return b.subscribe(new Zc(a,this.project,this.thisArg))};return c}(),Zc=function(c){function a(b,a,e){b=c.call(this,b)||this;b.project=a;b.count=0;b.thisArg=e||b;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.project.call(this.thisArg,b,this.count++)}catch(e){this.destination.error(e);
-return}this.destination.next(a)};return a}(m),q=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyError=function(b,a){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.complete()};return a}(m),G=function(c){function a(b,a,e){var d=c.call(this)||this;d.parent=b;d.outerValue=a;d.outerIndex=e;d.index=0;return d}h(a,c);a.prototype._next=function(b){this.parent.notifyNext(this.outerValue,
-b,this.outerIndex,this.index++,this)};a.prototype._error=function(b){this.parent.notifyError(b,this);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete(this);this.unsubscribe()};return a}(m),$c=function(c){return function(a){c.then(function(b){a.closed||(a.next(b),a.complete())},function(b){return a.error(b)}).then(null,Q);return a}},E;E="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";var ad=function(c){return function(a){var b=c[E]();do{var d=
+return}this.destination.next(a)};return a}(l),t=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyError=function(b,a){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.complete()};return a}(l),H=function(c){function a(b,a,e){var d=c.call(this)||this;d.parent=b;d.outerValue=a;d.outerIndex=e;d.index=0;return d}h(a,c);a.prototype._next=function(b){this.parent.notifyNext(this.outerValue,
+b,this.outerIndex,this.index++,this)};a.prototype._error=function(b){this.parent.notifyError(b,this);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete(this);this.unsubscribe()};return a}(l),$c=function(c){return function(a){c.then(function(b){a.closed||(a.next(b),a.complete())},function(b){return a.error(b)}).then(null,Q);return a}},E;E="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";var ad=function(c){return function(a){var b=c[E]();do{var d=
b.next();if(d.done){a.complete();break}a.next(d.value);if(a.closed)break}while(1);"function"===typeof b.return&&a.add(function(){b.return&&b.return()});return a}},bd=function(c){return function(a){var b=c[U]();if("function"!==typeof b.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return b.subscribe(a)}},Ua=function(c){return c&&"number"===typeof c.length&&"function"!==typeof c},ha=function(c){if(c&&"function"===typeof c[U])return bd(c);if(Ua(c))return Na(c);
if(Sa(c))return $c(c);if(c&&"function"===typeof c[E])return ad(c);c=ra(c)?"an invalid object":"'"+c+"'";throw new TypeError("You provided "+c+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.");},zb={},Ha=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new cd(a,this.resultSelector))};return c}(),cd=function(c){function a(b,a){b=c.call(this,b)||this;b.resultSelector=a;b.active=0;b.values=[];b.observables=[];return b}
-h(a,c);a.prototype._next=function(b){this.values.push(zb);this.observables.push(b)};a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;for(var c=0;c<a;c++){var f=b[c];this.add(p(this,f,f,c))}}};a.prototype.notifyComplete=function(b){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(b,a,c,f,g){b=this.values;f=b[c];f=this.toRespond?f===zb?--this.toRespond:this.toRespond:0;b[c]=a;0===
-f&&(this.resultSelector?this._tryResultSelector(b):this.destination.next(b.slice()))};a.prototype._tryResultSelector=function(b){var a;try{a=this.resultSelector.apply(this,b)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(q),Wb=function(){function c(a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.project=a;this.concurrent=b}c.prototype.call=function(a,b){return b.subscribe(new dd(a,this.project,this.concurrent))};return c}(),dd=function(c){function a(b,a,e){void 0===
-e&&(e=Number.POSITIVE_INFINITY);b=c.call(this,b)||this;b.project=a;b.concurrent=e;b.hasCompleted=!1;b.buffer=[];b.active=0;b.index=0;return b}h(a,c);a.prototype._next=function(b){this.active<this.concurrent?this._tryNext(b):this.buffer.push(b)};a.prototype._tryNext=function(b){var a,c=this.index++;try{a=this.project(b,c)}catch(f){this.destination.error(f);return}this.active++;this._innerSub(a,b,c)};a.prototype._innerSub=function(b,a,c){a=new G(this,a,c);c=this.destination;c.add(a);b=p(this,b,void 0,
-void 0,a);b!==a&&c.add(b)};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyComplete=function(b){var a=this.buffer;this.remove(b);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(q),Ab=new n(D),cc=function(){function c(a,b){this.predicate=a;this.thisArg=
-b}c.prototype.call=function(a,b){return b.subscribe(new ed(a,this.predicate,this.thisArg))};return c}(),ed=function(c){function a(b,a,e){b=c.call(this,b)||this;b.predicate=a;b.thisArg=e;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.predicate.call(this.thisArg,b,this.count++)}catch(e){this.destination.error(e);return}a&&this.destination.next(b)};return a}(m),dc=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new fd(a))};return c}(),fd=function(c){function a(b){b=
-c.call(this,b)||this;b.hasFirst=!1;b.observables=[];b.subscriptions=[];return b}h(a,c);a.prototype._next=function(b){this.observables.push(b)};a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{for(var c=0;c<a&&!this.hasFirst;c++){var f=b[c],f=p(this,f,f,c);this.subscriptions&&this.subscriptions.push(f);this.add(f)}this.observables=null}};a.prototype.notifyNext=function(b,a,c,f,g){if(!this.hasFirst){this.hasFirst=!0;for(b=0;b<this.subscriptions.length;b++)b!==
-c&&(f=this.subscriptions[b],f.unsubscribe(),this.remove(f));this.subscriptions=null}this.destination.next(a)};return a}(q),db=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new gd(a,this.resultSelector))};return c}(),gd=function(c){function a(b,a,e){void 0===e&&(e=Object.create(null));b=c.call(this,b)||this;b.iterators=[];b.active=0;b.resultSelector="function"===typeof a?a:null;b.values=e;return b}h(a,c);a.prototype._next=function(b){var a=this.iterators;
+h(a,c);a.prototype._next=function(b){this.values.push(zb);this.observables.push(b)};a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;for(var c=0;c<a;c++){var f=b[c];this.add(q(this,f,f,c))}}};a.prototype.notifyComplete=function(b){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(b,a,c,f,g){b=this.values;f=b[c];f=this.toRespond?f===zb?--this.toRespond:this.toRespond:0;b[c]=a;0===
+f&&(this.resultSelector?this._tryResultSelector(b):this.destination.next(b.slice()))};a.prototype._tryResultSelector=function(b){var a;try{a=this.resultSelector.apply(this,b)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(t),Wb=function(){function c(a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.project=a;this.concurrent=b}c.prototype.call=function(a,b){return b.subscribe(new dd(a,this.project,this.concurrent))};return c}(),dd=function(c){function a(b,a,e){void 0===
+e&&(e=Number.POSITIVE_INFINITY);b=c.call(this,b)||this;b.project=a;b.concurrent=e;b.hasCompleted=!1;b.buffer=[];b.active=0;b.index=0;return b}h(a,c);a.prototype._next=function(b){this.active<this.concurrent?this._tryNext(b):this.buffer.push(b)};a.prototype._tryNext=function(b){var a,c=this.index++;try{a=this.project(b,c)}catch(f){this.destination.error(f);return}this.active++;this._innerSub(a,b,c)};a.prototype._innerSub=function(b,a,c){a=new H(this,a,c);c=this.destination;c.add(a);b=q(this,b,void 0,
+void 0,a);b!==a&&c.add(b)};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyComplete=function(b){var a=this.buffer;this.remove(b);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(t),Ab=new n(D),cc=function(){function c(a,b){this.predicate=a;this.thisArg=
+b}c.prototype.call=function(a,b){return b.subscribe(new ed(a,this.predicate,this.thisArg))};return c}(),ed=function(c){function a(b,a,e){b=c.call(this,b)||this;b.predicate=a;b.thisArg=e;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.predicate.call(this.thisArg,b,this.count++)}catch(e){this.destination.error(e);return}a&&this.destination.next(b)};return a}(l),dc=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new fd(a))};return c}(),fd=function(c){function a(b){b=
+c.call(this,b)||this;b.hasFirst=!1;b.observables=[];b.subscriptions=[];return b}h(a,c);a.prototype._next=function(b){this.observables.push(b)};a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{for(var c=0;c<a&&!this.hasFirst;c++){var f=b[c],f=q(this,f,f,c);this.subscriptions&&this.subscriptions.push(f);this.add(f)}this.observables=null}};a.prototype.notifyNext=function(b,a,c,f,g){if(!this.hasFirst){this.hasFirst=!0;for(b=0;b<this.subscriptions.length;b++)b!==
+c&&(f=this.subscriptions[b],f.unsubscribe(),this.remove(f));this.subscriptions=null}this.destination.next(a)};return a}(t),db=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new gd(a,this.resultSelector))};return c}(),gd=function(c){function a(b,a,e){void 0===e&&(e=Object.create(null));b=c.call(this,b)||this;b.iterators=[];b.active=0;b.resultSelector="function"===typeof a?a:null;b.values=e;return b}h(a,c);a.prototype._next=function(b){var a=this.iterators;
x(b)?a.push(new hd(b)):"function"===typeof b[E]?a.push(new id(b[E]())):a.push(new jd(this.destination,this,b))};a.prototype._complete=function(){var b=this.iterators,a=b.length;this.unsubscribe();if(0===a)this.destination.complete();else{this.active=a;for(var c=0;c<a;c++){var f=b[c];f.stillUnsubscribed?this.destination.add(f.subscribe(f,c)):this.active--}}};a.prototype.notifyInactive=function(){this.active--;0===this.active&&this.destination.complete()};a.prototype.checkIterators=function(){for(var b=
-this.iterators,a=b.length,c=this.destination,f=0;f<a;f++){var g=b[f];if("function"===typeof g.hasValue&&!g.hasValue())return}for(var l=!1,h=[],f=0;f<a;f++){var g=b[f],k=g.next();g.hasCompleted()&&(l=!0);if(k.done){c.complete();return}h.push(k.value)}this.resultSelector?this._tryresultSelector(h):c.next(h);l&&c.complete()};a.prototype._tryresultSelector=function(b){var a;try{a=this.resultSelector.apply(this,b)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(m),id=function(){function c(a){this.iterator=
+this.iterators,a=b.length,c=this.destination,f=0;f<a;f++){var g=b[f];if("function"===typeof g.hasValue&&!g.hasValue())return}for(var m=!1,h=[],f=0;f<a;f++){var g=b[f],k=g.next();g.hasCompleted()&&(m=!0);if(k.done){c.complete();return}h.push(k.value)}this.resultSelector?this._tryresultSelector(h):c.next(h);m&&c.complete()};a.prototype._tryresultSelector=function(b){var a;try{a=this.resultSelector.apply(this,b)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(l),id=function(){function c(a){this.iterator=
a;this.nextResult=a.next()}c.prototype.hasValue=function(){return!0};c.prototype.next=function(){var a=this.nextResult;this.nextResult=this.iterator.next();return a};c.prototype.hasCompleted=function(){var a=this.nextResult;return a&&a.done};return c}(),hd=function(){function c(a){this.array=a;this.length=this.index=0;this.length=a.length}c.prototype[E]=function(){return this};c.prototype.next=function(a){a=this.index++;var b=this.array;return a<this.length?{value:b[a],done:!1}:{value:null,done:!0}};
c.prototype.hasValue=function(){return this.array.length>this.index};c.prototype.hasCompleted=function(){return this.array.length===this.index};return c}(),jd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.parent=a;b.observable=e;b.stillUnsubscribed=!0;b.buffer=[];b.isComplete=!1;return b}h(a,c);a.prototype[E]=function(){return this};a.prototype.next=function(){var b=this.buffer;return 0===b.length&&this.isComplete?{value:null,done:!0}:{value:b.shift(),done:!1}};a.prototype.hasValue=function(){return 0<
-this.buffer.length};a.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete};a.prototype.notifyComplete=function(){0<this.buffer.length?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()};a.prototype.notifyNext=function(b,a,c,f,g){this.buffer.push(a);this.parent.checkIterators()};a.prototype.subscribe=function(b,a){return p(this,this.observable,this,a)};return a}(q),gc=function(){function c(a){this.durationSelector=a}c.prototype.call=function(a,
-b){return b.subscribe(new kd(a,this.durationSelector))};return c}(),kd=function(c){function a(b,a){b=c.call(this,b)||this;b.durationSelector=a;b.hasValue=!1;return b}h(a,c);a.prototype._next=function(b){this.value=b;this.hasValue=!0;if(!this.throttled){var a=void 0;try{var c=this.durationSelector,a=c(b)}catch(f){return this.destination.error(f)}b=p(this,a);!b||b.closed?this.clearThrottle():this.add(this.throttled=b)}};a.prototype.clearThrottle=function(){var b=this.value,a=this.hasValue,c=this.throttled;
-c&&(this.remove(c),this.throttled=null,c.unsubscribe());a&&(this.value=null,this.hasValue=!1,this.destination.next(b))};a.prototype.notifyNext=function(b,a,c,f){this.clearThrottle()};a.prototype.notifyComplete=function(){this.clearThrottle()};return a}(q),md=function(){function c(a){this.closingNotifier=a}c.prototype.call=function(a,b){return b.subscribe(new ld(a,this.closingNotifier))};return c}(),ld=function(c){function a(b,a){b=c.call(this,b)||this;b.buffer=[];b.add(p(b,a));return b}h(a,c);a.prototype._next=
-function(b){this.buffer.push(b)};a.prototype.notifyNext=function(b,a,c,f,g){b=this.buffer;this.buffer=[];this.destination.next(b)};return a}(q),pd=function(){function c(a,b){this.bufferSize=a;this.subscriberClass=(this.startBufferEvery=b)&&a!==b?nd:od}c.prototype.call=function(a,b){return b.subscribe(new this.subscriberClass(a,this.bufferSize,this.startBufferEvery))};return c}(),od=function(c){function a(b,a){b=c.call(this,b)||this;b.bufferSize=a;b.buffer=[];return b}h(a,c);a.prototype._next=function(b){var a=
-this.buffer;a.push(b);a.length==this.bufferSize&&(this.destination.next(a),this.buffer=[])};a.prototype._complete=function(){var b=this.buffer;0<b.length&&this.destination.next(b);c.prototype._complete.call(this)};return a}(m),nd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.bufferSize=a;b.startBufferEvery=e;b.buffers=[];b.count=0;return b}h(a,c);a.prototype._next=function(b){var a=this.bufferSize,c=this.startBufferEvery,f=this.buffers,g=this.count;this.count++;0===g%c&&f.push([]);for(c=
-f.length;c--;)g=f[c],g.push(b),g.length===a&&(f.splice(c,1),this.destination.next(g))};a.prototype._complete=function(){for(var b=this.buffers,a=this.destination;0<b.length;){var e=b.shift();0<e.length&&a.next(e)}c.prototype._complete.call(this)};return a}(m),rd=function(){function c(a,b,c,e){this.bufferTimeSpan=a;this.bufferCreationInterval=b;this.maxBufferSize=c;this.scheduler=e}c.prototype.call=function(a,b){return b.subscribe(new qd(a,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,
+this.buffer.length};a.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete};a.prototype.notifyComplete=function(){0<this.buffer.length?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()};a.prototype.notifyNext=function(b,a,c,f,g){this.buffer.push(a);this.parent.checkIterators()};a.prototype.subscribe=function(b,a){return q(this,this.observable,this,a)};return a}(t),gc=function(){function c(a){this.durationSelector=a}c.prototype.call=function(a,
+b){return b.subscribe(new kd(a,this.durationSelector))};return c}(),kd=function(c){function a(b,a){b=c.call(this,b)||this;b.durationSelector=a;b.hasValue=!1;return b}h(a,c);a.prototype._next=function(b){this.value=b;this.hasValue=!0;if(!this.throttled){var a=void 0;try{var c=this.durationSelector,a=c(b)}catch(f){return this.destination.error(f)}b=q(this,a);!b||b.closed?this.clearThrottle():this.add(this.throttled=b)}};a.prototype.clearThrottle=function(){var b=this.value,a=this.hasValue,c=this.throttled;
+c&&(this.remove(c),this.throttled=null,c.unsubscribe());a&&(this.value=null,this.hasValue=!1,this.destination.next(b))};a.prototype.notifyNext=function(b,a,c,f){this.clearThrottle()};a.prototype.notifyComplete=function(){this.clearThrottle()};return a}(t),md=function(){function c(a){this.closingNotifier=a}c.prototype.call=function(a,b){return b.subscribe(new ld(a,this.closingNotifier))};return c}(),ld=function(c){function a(b,a){b=c.call(this,b)||this;b.buffer=[];b.add(q(b,a));return b}h(a,c);a.prototype._next=
+function(b){this.buffer.push(b)};a.prototype.notifyNext=function(b,a,c,f,g){b=this.buffer;this.buffer=[];this.destination.next(b)};return a}(t),pd=function(){function c(a,b){this.bufferSize=a;this.subscriberClass=(this.startBufferEvery=b)&&a!==b?nd:od}c.prototype.call=function(a,b){return b.subscribe(new this.subscriberClass(a,this.bufferSize,this.startBufferEvery))};return c}(),od=function(c){function a(b,a){b=c.call(this,b)||this;b.bufferSize=a;b.buffer=[];return b}h(a,c);a.prototype._next=function(b){var a=
+this.buffer;a.push(b);a.length==this.bufferSize&&(this.destination.next(a),this.buffer=[])};a.prototype._complete=function(){var b=this.buffer;0<b.length&&this.destination.next(b);c.prototype._complete.call(this)};return a}(l),nd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.bufferSize=a;b.startBufferEvery=e;b.buffers=[];b.count=0;return b}h(a,c);a.prototype._next=function(b){var a=this.bufferSize,c=this.startBufferEvery,f=this.buffers,g=this.count;this.count++;0===g%c&&f.push([]);for(c=
+f.length;c--;)g=f[c],g.push(b),g.length===a&&(f.splice(c,1),this.destination.next(g))};a.prototype._complete=function(){for(var b=this.buffers,a=this.destination;0<b.length;){var e=b.shift();0<e.length&&a.next(e)}c.prototype._complete.call(this)};return a}(l),rd=function(){function c(a,b,c,e){this.bufferTimeSpan=a;this.bufferCreationInterval=b;this.maxBufferSize=c;this.scheduler=e}c.prototype.call=function(a,b){return b.subscribe(new qd(a,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,
this.scheduler))};return c}(),sd=function(){return function(){this.buffer=[]}}(),qd=function(c){function a(b,a,e,f,g){b=c.call(this,b)||this;b.bufferTimeSpan=a;b.bufferCreationInterval=e;b.maxBufferSize=f;b.scheduler=g;b.contexts=[];f=b.openContext();b.timespanOnly=null==e||0>e;if(b.timespanOnly)b.add(f.closeAction=g.schedule(fb,a,{subscriber:b,context:f,bufferTimeSpan:a}));else{var d={bufferTimeSpan:a,bufferCreationInterval:e,subscriber:b,scheduler:g};b.add(f.closeAction=g.schedule(gb,a,{subscriber:b,
-context:f}));b.add(g.schedule(hc,e,d))}return b}h(a,c);a.prototype._next=function(b){for(var a=this.contexts,c=a.length,f,g=0;g<c;g++){var l=a[g],h=l.buffer;h.push(b);h.length==this.maxBufferSize&&(f=l)}if(f)this.onBufferFull(f)};a.prototype._error=function(b){this.contexts.length=0;c.prototype._error.call(this,b)};a.prototype._complete=function(){for(var b=this.contexts,a=this.destination;0<b.length;){var e=b.shift();a.next(e.buffer)}c.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.contexts=
+context:f}));b.add(g.schedule(hc,e,d))}return b}h(a,c);a.prototype._next=function(b){for(var a=this.contexts,c=a.length,f,g=0;g<c;g++){var m=a[g],h=m.buffer;h.push(b);h.length==this.maxBufferSize&&(f=m)}if(f)this.onBufferFull(f)};a.prototype._error=function(b){this.contexts.length=0;c.prototype._error.call(this,b)};a.prototype._complete=function(){for(var b=this.contexts,a=this.destination;0<b.length;){var e=b.shift();a.next(e.buffer)}c.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.contexts=
null};a.prototype.onBufferFull=function(b){this.closeContext(b);b=b.closeAction;b.unsubscribe();this.remove(b);if(!this.closed&&this.timespanOnly){b=this.openContext();var a=this.bufferTimeSpan;this.add(b.closeAction=this.scheduler.schedule(fb,a,{subscriber:this,context:b,bufferTimeSpan:a}))}};a.prototype.openContext=function(){var b=new sd;this.contexts.push(b);return b};a.prototype.closeContext=function(b){this.destination.next(b.buffer);var a=this.contexts;0<=(a?a.indexOf(b):-1)&&a.splice(a.indexOf(b),
-1)};return a}(m),ud=function(){function c(a,b){this.openings=a;this.closingSelector=b}c.prototype.call=function(a,b){return b.subscribe(new td(a,this.openings,this.closingSelector))};return c}(),td=function(c){function a(b,a,e){b=c.call(this,b)||this;b.openings=a;b.closingSelector=e;b.contexts=[];b.add(p(b,a));return b}h(a,c);a.prototype._next=function(b){for(var a=this.contexts,c=a.length,f=0;f<c;f++)a[f].buffer.push(b)};a.prototype._error=function(b){for(var a=this.contexts;0<a.length;){var e=a.shift();
+1)};return a}(l),ud=function(){function c(a,b){this.openings=a;this.closingSelector=b}c.prototype.call=function(a,b){return b.subscribe(new td(a,this.openings,this.closingSelector))};return c}(),td=function(c){function a(b,a,e){b=c.call(this,b)||this;b.openings=a;b.closingSelector=e;b.contexts=[];b.add(q(b,a));return b}h(a,c);a.prototype._next=function(b){for(var a=this.contexts,c=a.length,f=0;f<c;f++)a[f].buffer.push(b)};a.prototype._error=function(b){for(var a=this.contexts;0<a.length;){var e=a.shift();
e.subscription.unsubscribe();e.buffer=null;e.subscription=null}this.contexts=null;c.prototype._error.call(this,b)};a.prototype._complete=function(){for(var b=this.contexts;0<b.length;){var a=b.shift();this.destination.next(a.buffer);a.subscription.unsubscribe();a.buffer=null;a.subscription=null}this.contexts=null;c.prototype._complete.call(this)};a.prototype.notifyNext=function(b,a,c,f,g){b?this.closeBuffer(b):this.openBuffer(a)};a.prototype.notifyComplete=function(b){this.closeBuffer(b.context)};
-a.prototype.openBuffer=function(b){try{var a=this.closingSelector.call(this,b);a&&this.trySubscribe(a)}catch(e){this._error(e)}};a.prototype.closeBuffer=function(b){var a=this.contexts;if(a&&b){var c=b.subscription;this.destination.next(b.buffer);a.splice(a.indexOf(b),1);this.remove(c);c.unsubscribe()}};a.prototype.trySubscribe=function(b){var a=this.contexts,c=new t,f={buffer:[],subscription:c};a.push(f);b=p(this,b,f);!b||b.closed?this.closeBuffer(f):(b.context=f,this.add(b),c.add(b))};return a}(q),
+a.prototype.openBuffer=function(b){try{var a=this.closingSelector.call(this,b);a&&this.trySubscribe(a)}catch(e){this._error(e)}};a.prototype.closeBuffer=function(b){var a=this.contexts;if(a&&b){var c=b.subscription;this.destination.next(b.buffer);a.splice(a.indexOf(b),1);this.remove(c);c.unsubscribe()}};a.prototype.trySubscribe=function(b){var a=this.contexts,c=new p,f={buffer:[],subscription:c};a.push(f);b=q(this,b,f);!b||b.closed?this.closeBuffer(f):(b.context=f,this.add(b),c.add(b))};return a}(t),
wd=function(){function c(a){this.closingSelector=a}c.prototype.call=function(a,b){return b.subscribe(new vd(a,this.closingSelector))};return c}(),vd=function(c){function a(b,a){b=c.call(this,b)||this;b.closingSelector=a;b.subscribing=!1;b.openBuffer();return b}h(a,c);a.prototype._next=function(b){this.buffer.push(b)};a.prototype._complete=function(){var b=this.buffer;b&&this.destination.next(b);c.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.buffer=null;this.subscribing=
-!1};a.prototype.notifyNext=function(b,a,c,f,g){this.openBuffer()};a.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()};a.prototype.openBuffer=function(){var b=this.closingSubscription;b&&(this.remove(b),b.unsubscribe());(b=this.buffer)&&this.destination.next(b);this.buffer=[];var a;try{var c=this.closingSelector;a=c()}catch(f){return this.error(f)}this.closingSubscription=b=new t;this.add(b);this.subscribing=!0;b.add(p(this,a));this.subscribing=!1};return a}(q),
-yd=function(){function c(a){this.selector=a}c.prototype.call=function(a,b){return b.subscribe(new xd(a,this.selector,this.caught))};return c}(),xd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.selector=a;b.caught=e;return b}h(a,c);a.prototype.error=function(b){if(!this.isStopped){var a=void 0;try{a=this.selector(b,this.caught)}catch(e){c.prototype.error.call(this,e);return}this._unsubscribeAndRecycle();b=new G(this,void 0,void 0);this.add(b);a=p(this,a,void 0,void 0,b);a!==b&&this.add(a)}};
-return a}(q),Ad=function(){function c(a,b){this.predicate=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new zd(a,this.predicate,this.source))};return c}(),zd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.predicate=a;b.source=e;b.count=0;b.index=0;return b}h(a,c);a.prototype._next=function(b){this.predicate?this._tryPredicate(b):this.count++};a.prototype._tryPredicate=function(b){var a;try{a=this.predicate(b,this.index++,this.source)}catch(e){this.destination.error(e);
-return}a&&this.count++};a.prototype._complete=function(){this.destination.next(this.count);this.destination.complete()};return a}(m),Cd=function(){function c(a){this.durationSelector=a}c.prototype.call=function(a,b){return b.subscribe(new Bd(a,this.durationSelector))};return c}(),Bd=function(c){function a(b,a){b=c.call(this,b)||this;b.durationSelector=a;b.hasValue=!1;b.durationSubscription=null;return b}h(a,c);a.prototype._next=function(b){try{var a=this.durationSelector.call(this,b);a&&this._tryNext(b,
-a)}catch(e){this.destination.error(e)}};a.prototype._complete=function(){this.emitValue();this.destination.complete()};a.prototype._tryNext=function(b,a){var c=this.durationSubscription;this.value=b;this.hasValue=!0;c&&(c.unsubscribe(),this.remove(c));(c=p(this,a))&&!c.closed&&this.add(this.durationSubscription=c)};a.prototype.notifyNext=function(b,a,c,f,g){this.emitValue()};a.prototype.notifyComplete=function(){this.emitValue()};a.prototype.emitValue=function(){if(this.hasValue){var b=this.value,
-a=this.durationSubscription;a&&(this.durationSubscription=null,a.unsubscribe(),this.remove(a));this.value=null;this.hasValue=!1;c.prototype._next.call(this,b)}};return a}(q),Ed=function(){function c(a,b){this.dueTime=a;this.scheduler=b}c.prototype.call=function(a,b){return b.subscribe(new Dd(a,this.dueTime,this.scheduler))};return c}(),Dd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.dueTime=a;b.scheduler=e;b.debouncedSubscription=null;b.lastValue=null;b.hasValue=!1;return b}h(a,c);a.prototype._next=
+!1};a.prototype.notifyNext=function(b,a,c,f,g){this.openBuffer()};a.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()};a.prototype.openBuffer=function(){var b=this.closingSubscription;b&&(this.remove(b),b.unsubscribe());(b=this.buffer)&&this.destination.next(b);this.buffer=[];var a;try{var c=this.closingSelector;a=c()}catch(f){return this.error(f)}this.closingSubscription=b=new p;this.add(b);this.subscribing=!0;b.add(q(this,a));this.subscribing=!1};return a}(t),
+yd=function(){function c(a){this.selector=a}c.prototype.call=function(a,b){return b.subscribe(new xd(a,this.selector,this.caught))};return c}(),xd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.selector=a;b.caught=e;return b}h(a,c);a.prototype.error=function(b){if(!this.isStopped){var a=void 0;try{a=this.selector(b,this.caught)}catch(e){c.prototype.error.call(this,e);return}this._unsubscribeAndRecycle();b=new H(this,void 0,void 0);this.add(b);a=q(this,a,void 0,void 0,b);a!==b&&this.add(a)}};
+return a}(t),Ad=function(){function c(a,b){this.predicate=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new zd(a,this.predicate,this.source))};return c}(),zd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.predicate=a;b.source=e;b.count=0;b.index=0;return b}h(a,c);a.prototype._next=function(b){this.predicate?this._tryPredicate(b):this.count++};a.prototype._tryPredicate=function(b){var a;try{a=this.predicate(b,this.index++,this.source)}catch(e){this.destination.error(e);
+return}a&&this.count++};a.prototype._complete=function(){this.destination.next(this.count);this.destination.complete()};return a}(l),Cd=function(){function c(a){this.durationSelector=a}c.prototype.call=function(a,b){return b.subscribe(new Bd(a,this.durationSelector))};return c}(),Bd=function(c){function a(b,a){b=c.call(this,b)||this;b.durationSelector=a;b.hasValue=!1;b.durationSubscription=null;return b}h(a,c);a.prototype._next=function(b){try{var a=this.durationSelector.call(this,b);a&&this._tryNext(b,
+a)}catch(e){this.destination.error(e)}};a.prototype._complete=function(){this.emitValue();this.destination.complete()};a.prototype._tryNext=function(b,a){var c=this.durationSubscription;this.value=b;this.hasValue=!0;c&&(c.unsubscribe(),this.remove(c));(c=q(this,a))&&!c.closed&&this.add(this.durationSubscription=c)};a.prototype.notifyNext=function(b,a,c,f,g){this.emitValue()};a.prototype.notifyComplete=function(){this.emitValue()};a.prototype.emitValue=function(){if(this.hasValue){var b=this.value,
+a=this.durationSubscription;a&&(this.durationSubscription=null,a.unsubscribe(),this.remove(a));this.value=null;this.hasValue=!1;c.prototype._next.call(this,b)}};return a}(t),Ed=function(){function c(a,b){this.dueTime=a;this.scheduler=b}c.prototype.call=function(a,b){return b.subscribe(new Dd(a,this.dueTime,this.scheduler))};return c}(),Dd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.dueTime=a;b.scheduler=e;b.debouncedSubscription=null;b.lastValue=null;b.hasValue=!1;return b}h(a,c);a.prototype._next=
function(b){this.clearDebounce();this.lastValue=b;this.hasValue=!0;this.add(this.debouncedSubscription=this.scheduler.schedule(ic,this.dueTime,this))};a.prototype._complete=function(){this.debouncedNext();this.destination.complete()};a.prototype.debouncedNext=function(){this.clearDebounce();if(this.hasValue){var b=this.lastValue;this.lastValue=null;this.hasValue=!1;this.destination.next(b)}};a.prototype.clearDebounce=function(){var b=this.debouncedSubscription;null!==b&&(this.remove(b),b.unsubscribe(),
-this.debouncedSubscription=null)};return a}(m),jc=function(){function c(a){this.defaultValue=a}c.prototype.call=function(a,b){return b.subscribe(new Fd(a,this.defaultValue))};return c}(),Fd=function(c){function a(b,a){b=c.call(this,b)||this;b.defaultValue=a;b.isEmpty=!0;return b}h(a,c);a.prototype._next=function(b){this.isEmpty=!1;this.destination.next(b)};a.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue);this.destination.complete()};return a}(m),Hd=function(){function c(a,
+this.debouncedSubscription=null)};return a}(l),jc=function(){function c(a){this.defaultValue=a}c.prototype.call=function(a,b){return b.subscribe(new Fd(a,this.defaultValue))};return c}(),Fd=function(c){function a(b,a){b=c.call(this,b)||this;b.defaultValue=a;b.isEmpty=!0;return b}h(a,c);a.prototype._next=function(b){this.isEmpty=!1;this.destination.next(b)};a.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue);this.destination.complete()};return a}(l),Hd=function(){function c(a,
b){this.delay=a;this.scheduler=b}c.prototype.call=function(a,b){return b.subscribe(new Gd(a,this.delay,this.scheduler))};return c}(),Gd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.delay=a;b.scheduler=e;b.queue=[];b.active=!1;b.errored=!1;return b}h(a,c);a.dispatch=function(b){for(var a=b.source,c=a.queue,f=b.scheduler,g=b.destination;0<c.length&&0>=c[0].time-f.now();)c.shift().notification.observe(g);0<c.length?(a=Math.max(0,c[0].time-f.now()),this.schedule(b,a)):(this.unsubscribe(),a.active=
!1)};a.prototype._schedule=function(b){this.active=!0;this.destination.add(b.schedule(a.dispatch,this.delay,{source:this,destination:this.destination,scheduler:b}))};a.prototype.scheduleNotification=function(b){if(!0!==this.errored){var a=this.scheduler;b=new Id(a.now()+this.delay,b);this.queue.push(b);!1===this.active&&this._schedule(a)}};a.prototype._next=function(b){this.scheduleNotification(w.createNext(b))};a.prototype._error=function(b){this.errored=!0;this.queue=[];this.destination.error(b);
-this.unsubscribe()};a.prototype._complete=function(){this.scheduleNotification(w.createComplete());this.unsubscribe()};return a}(m),Id=function(){return function(c,a){this.time=c;this.notification=a}}(),Bb=function(){function c(a){this.delayDurationSelector=a}c.prototype.call=function(a,b){return b.subscribe(new Jd(a,this.delayDurationSelector))};return c}(),Jd=function(c){function a(b,a){b=c.call(this,b)||this;b.delayDurationSelector=a;b.completed=!1;b.delayNotifierSubscriptions=[];b.index=0;return b}
+this.unsubscribe()};a.prototype._complete=function(){this.scheduleNotification(w.createComplete());this.unsubscribe()};return a}(l),Id=function(){return function(c,a){this.time=c;this.notification=a}}(),Bb=function(){function c(a){this.delayDurationSelector=a}c.prototype.call=function(a,b){return b.subscribe(new Jd(a,this.delayDurationSelector))};return c}(),Jd=function(c){function a(b,a){b=c.call(this,b)||this;b.delayDurationSelector=a;b.completed=!1;b.delayNotifierSubscriptions=[];b.index=0;return b}
h(a,c);a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(b);this.removeSubscription(g);this.tryComplete()};a.prototype.notifyError=function(b,a){this._error(b)};a.prototype.notifyComplete=function(b){(b=this.removeSubscription(b))&&this.destination.next(b);this.tryComplete()};a.prototype._next=function(b){var a=this.index++;try{var c=this.delayDurationSelector(b,a);c&&this.tryDelay(c,b)}catch(f){this.destination.error(f)}};a.prototype._complete=function(){this.completed=!0;this.tryComplete();
-this.unsubscribe()};a.prototype.removeSubscription=function(b){b.unsubscribe();var a=this.delayNotifierSubscriptions.indexOf(b);-1!==a&&this.delayNotifierSubscriptions.splice(a,1);return b.outerValue};a.prototype.tryDelay=function(b,a){(b=p(this,b,a))&&!b.closed&&(this.destination.add(b),this.delayNotifierSubscriptions.push(b))};a.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()};return a}(q),Ld=function(c){function a(b,a){var d=
+this.unsubscribe()};a.prototype.removeSubscription=function(b){b.unsubscribe();var a=this.delayNotifierSubscriptions.indexOf(b);-1!==a&&this.delayNotifierSubscriptions.splice(a,1);return b.outerValue};a.prototype.tryDelay=function(b,a){(b=q(this,b,a))&&!b.closed&&(this.destination.add(b),this.delayNotifierSubscriptions.push(b))};a.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()};return a}(t),Ld=function(c){function a(b,a){var d=
c.call(this)||this;d.source=b;d.subscriptionDelay=a;return d}h(a,c);a.prototype._subscribe=function(b){this.subscriptionDelay.subscribe(new Kd(b,this.source))};return a}(n),Kd=function(c){function a(b,a){var d=c.call(this)||this;d.parent=b;d.source=a;d.sourceSubscribed=!1;return d}h(a,c);a.prototype._next=function(b){this.subscribeToSource()};a.prototype._error=function(b){this.unsubscribe();this.parent.error(b)};a.prototype._complete=function(){this.unsubscribe();this.subscribeToSource()};a.prototype.subscribeToSource=
-function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))};return a}(m),Nd=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new Md(a))};return c}(),Md=function(c){function a(b){return c.call(this,b)||this}h(a,c);a.prototype._next=function(b){b.observe(this.destination)};return a}(m),Pd=function(){function c(a,b){this.keySelector=a;this.flushes=b}c.prototype.call=function(a,b){return b.subscribe(new Od(a,this.keySelector,
-this.flushes))};return c}(),Od=function(c){function a(b,a,e){b=c.call(this,b)||this;b.keySelector=a;b.values=new Set;e&&b.add(p(b,e));return b}h(a,c);a.prototype.notifyNext=function(b,a,c,f,g){this.values.clear()};a.prototype.notifyError=function(b,a){this._error(b)};a.prototype._next=function(b){this.keySelector?this._useKeySelector(b):this._finalizeNext(b,b)};a.prototype._useKeySelector=function(b){var a,c=this.destination;try{a=this.keySelector(b)}catch(f){c.error(f);return}this._finalizeNext(a,
-b)};a.prototype._finalizeNext=function(b,a){var c=this.values;c.has(b)||(c.add(b),this.destination.next(a))};return a}(q),kc=function(){function c(a,b){this.compare=a;this.keySelector=b}c.prototype.call=function(a,b){return b.subscribe(new Qd(a,this.compare,this.keySelector))};return c}(),Qd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.keySelector=e;b.hasKey=!1;"function"===typeof a&&(b.compare=a);return b}h(a,c);a.prototype.compare=function(b,a){return b===a};a.prototype._next=function(b){var a;
-try{var c=this.keySelector;a=c?c(b):b}catch(g){return this.destination.error(g)}c=!1;if(this.hasKey)try{var f=this.compare,c=f(this.key,a)}catch(g){return this.destination.error(g)}else this.hasKey=!0;c||(this.key=a,this.destination.next(b))};return a}(m),mc=function(){function c(a){this.errorFactory=a}c.prototype.call=function(a,b){return b.subscribe(new Rd(a,this.errorFactory))};return c}(),Rd=function(c){function a(b,a){b=c.call(this,b)||this;b.errorFactory=a;b.hasValue=!1;return b}h(a,c);a.prototype._next=
-function(b){this.hasValue=!0;this.destination.next(b)};a.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var b=void 0;try{b=this.errorFactory()}catch(d){b=d}this.destination.error(b)};return a}(m),nc=function(){function c(a){this.total=a;if(0>this.total)throw new X;}c.prototype.call=function(a,b){return b.subscribe(new Sd(a,this.total))};return c}(),Sd=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a=
-this.total,c=++this.count;c<=a&&(this.destination.next(b),c===a&&(this.destination.complete(),this.unsubscribe()))};return a}(m),Ud=function(){function c(a,b,c){this.predicate=a;this.thisArg=b;this.source=c}c.prototype.call=function(a,b){return b.subscribe(new Td(a,this.predicate,this.thisArg,this.source))};return c}(),Td=function(c){function a(b,a,e,f){b=c.call(this,b)||this;b.predicate=a;b.thisArg=e;b.source=f;b.index=0;b.thisArg=e||b;return b}h(a,c);a.prototype.notifyComplete=function(b){this.destination.next(b);
-this.destination.complete()};a.prototype._next=function(b){var a=!1;try{a=this.predicate.call(this.thisArg,b,this.index++,this.source)}catch(e){this.destination.error(e);return}a||this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(m),Wd=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new Vd(a))};return c}(),Vd=function(c){function a(b){b=c.call(this,b)||this;b.hasCompleted=!1;b.hasSubscription=!1;return b}h(a,c);a.prototype._next=
-function(b){this.hasSubscription||(this.hasSubscription=!0,this.add(p(this,b)))};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete()};a.prototype.notifyComplete=function(b){this.remove(b);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(q),oc=function(){function c(a){this.project=a}c.prototype.call=function(a,b){return b.subscribe(new Xd(a,this.project))};return c}(),Xd=function(c){function a(b,a){b=c.call(this,b)||
-this;b.project=a;b.hasSubscription=!1;b.hasCompleted=!1;b.index=0;return b}h(a,c);a.prototype._next=function(b){this.hasSubscription||this.tryNext(b)};a.prototype.tryNext=function(b){var a,c=this.index++;try{a=this.project(b,c)}catch(f){this.destination.error(f);return}this.hasSubscription=!0;this._innerSub(a,b,c)};a.prototype._innerSub=function(b,a,c){a=new G(this,a,c);c=this.destination;c.add(a);b=p(this,b,void 0,void 0,a);b!==a&&c.add(b)};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||
-this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyError=function(b){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.remove(b);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(q),Zd=function(){function c(a,b,c){this.project=a;this.concurrent=b;this.scheduler=c}c.prototype.call=function(a,b){return b.subscribe(new Yd(a,this.project,this.concurrent,
+function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))};return a}(l),Nd=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new Md(a))};return c}(),Md=function(c){function a(b){return c.call(this,b)||this}h(a,c);a.prototype._next=function(b){b.observe(this.destination)};return a}(l),Pd=function(){function c(a,b){this.keySelector=a;this.flushes=b}c.prototype.call=function(a,b){return b.subscribe(new Od(a,this.keySelector,
+this.flushes))};return c}(),Od=function(c){function a(b,a,e){b=c.call(this,b)||this;b.keySelector=a;b.values=new Set;e&&b.add(q(b,e));return b}h(a,c);a.prototype.notifyNext=function(b,a,c,f,g){this.values.clear()};a.prototype.notifyError=function(b,a){this._error(b)};a.prototype._next=function(b){this.keySelector?this._useKeySelector(b):this._finalizeNext(b,b)};a.prototype._useKeySelector=function(b){var a,c=this.destination;try{a=this.keySelector(b)}catch(f){c.error(f);return}this._finalizeNext(a,
+b)};a.prototype._finalizeNext=function(b,a){var c=this.values;c.has(b)||(c.add(b),this.destination.next(a))};return a}(t),kc=function(){function c(a,b){this.compare=a;this.keySelector=b}c.prototype.call=function(a,b){return b.subscribe(new Qd(a,this.compare,this.keySelector))};return c}(),Qd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.keySelector=e;b.hasKey=!1;"function"===typeof a&&(b.compare=a);return b}h(a,c);a.prototype.compare=function(b,a){return b===a};a.prototype._next=function(b){var a;
+try{var c=this.keySelector;a=c?c(b):b}catch(g){return this.destination.error(g)}c=!1;if(this.hasKey)try{var f=this.compare,c=f(this.key,a)}catch(g){return this.destination.error(g)}else this.hasKey=!0;c||(this.key=a,this.destination.next(b))};return a}(l),mc=function(){function c(a){this.errorFactory=a}c.prototype.call=function(a,b){return b.subscribe(new Rd(a,this.errorFactory))};return c}(),Rd=function(c){function a(b,a){b=c.call(this,b)||this;b.errorFactory=a;b.hasValue=!1;return b}h(a,c);a.prototype._next=
+function(b){this.hasValue=!0;this.destination.next(b)};a.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var b=void 0;try{b=this.errorFactory()}catch(d){b=d}this.destination.error(b)};return a}(l),nc=function(){function c(a){this.total=a;if(0>this.total)throw new X;}c.prototype.call=function(a,b){return b.subscribe(new Sd(a,this.total))};return c}(),Sd=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a=
+this.total,c=++this.count;c<=a&&(this.destination.next(b),c===a&&(this.destination.complete(),this.unsubscribe()))};return a}(l),Ud=function(){function c(a,b,c){this.predicate=a;this.thisArg=b;this.source=c}c.prototype.call=function(a,b){return b.subscribe(new Td(a,this.predicate,this.thisArg,this.source))};return c}(),Td=function(c){function a(b,a,e,f){b=c.call(this,b)||this;b.predicate=a;b.thisArg=e;b.source=f;b.index=0;b.thisArg=e||b;return b}h(a,c);a.prototype.notifyComplete=function(b){this.destination.next(b);
+this.destination.complete()};a.prototype._next=function(b){var a=!1;try{a=this.predicate.call(this.thisArg,b,this.index++,this.source)}catch(e){this.destination.error(e);return}a||this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(l),Wd=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new Vd(a))};return c}(),Vd=function(c){function a(b){b=c.call(this,b)||this;b.hasCompleted=!1;b.hasSubscription=!1;return b}h(a,c);a.prototype._next=
+function(b){this.hasSubscription||(this.hasSubscription=!0,this.add(q(this,b)))};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete()};a.prototype.notifyComplete=function(b){this.remove(b);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(t),oc=function(){function c(a){this.project=a}c.prototype.call=function(a,b){return b.subscribe(new Xd(a,this.project))};return c}(),Xd=function(c){function a(b,a){b=c.call(this,b)||
+this;b.project=a;b.hasSubscription=!1;b.hasCompleted=!1;b.index=0;return b}h(a,c);a.prototype._next=function(b){this.hasSubscription||this.tryNext(b)};a.prototype.tryNext=function(b){var a,c=this.index++;try{a=this.project(b,c)}catch(f){this.destination.error(f);return}this.hasSubscription=!0;this._innerSub(a,b,c)};a.prototype._innerSub=function(b,a,c){a=new H(this,a,c);c=this.destination;c.add(a);b=q(this,b,void 0,void 0,a);b!==a&&c.add(b)};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||
+this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyError=function(b){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.remove(b);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(t),Zd=function(){function c(a,b,c){this.project=a;this.concurrent=b;this.scheduler=c}c.prototype.call=function(a,b){return b.subscribe(new Yd(a,this.project,this.concurrent,
this.scheduler))};return c}(),Yd=function(c){function a(b,a,e,f){b=c.call(this,b)||this;b.project=a;b.concurrent=e;b.scheduler=f;b.index=0;b.active=0;b.hasCompleted=!1;e<Number.POSITIVE_INFINITY&&(b.buffer=[]);return b}h(a,c);a.dispatch=function(b){b.subscriber.subscribeToProjection(b.result,b.value,b.index)};a.prototype._next=function(b){var c=this.destination;if(c.closed)this._complete();else{var e=this.index++;if(this.active<this.concurrent){c.next(b);try{var f=this.project,g=f(b,e);this.scheduler?
-this.destination.add(this.scheduler.schedule(a.dispatch,0,{subscriber:this,result:g,value:b,index:e})):this.subscribeToProjection(g,b,e)}catch(l){c.error(l)}}else this.buffer.push(b)}};a.prototype.subscribeToProjection=function(b,a,c){this.active++;this.destination.add(p(this,b,a,c))};a.prototype._complete=function(){(this.hasCompleted=!0,0===this.active)&&this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(b,a,c,f,g){this._next(a)};a.prototype.notifyComplete=function(b){var a=
-this.buffer;this.destination.remove(b);this.active--;a&&0<a.length&&this._next(a.shift());this.hasCompleted&&0===this.active&&this.destination.complete()};return a}(q),ae=function(){function c(a){this.callback=a}c.prototype.call=function(a,b){return b.subscribe(new $d(a,this.callback))};return c}(),$d=function(c){function a(b,a){b=c.call(this,b)||this;b.add(new t(a));return b}h(a,c);return a}(m),Cb=function(){function c(a,b,c,e){this.predicate=a;this.source=b;this.yieldIndex=c;this.thisArg=e}c.prototype.call=
+this.destination.add(this.scheduler.schedule(a.dispatch,0,{subscriber:this,result:g,value:b,index:e})):this.subscribeToProjection(g,b,e)}catch(m){c.error(m)}}else this.buffer.push(b)}};a.prototype.subscribeToProjection=function(b,a,c){this.active++;this.destination.add(q(this,b,a,c))};a.prototype._complete=function(){(this.hasCompleted=!0,0===this.active)&&this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(b,a,c,f,g){this._next(a)};a.prototype.notifyComplete=function(b){var a=
+this.buffer;this.destination.remove(b);this.active--;a&&0<a.length&&this._next(a.shift());this.hasCompleted&&0===this.active&&this.destination.complete()};return a}(t),ae=function(){function c(a){this.callback=a}c.prototype.call=function(a,b){return b.subscribe(new $d(a,this.callback))};return c}(),$d=function(c){function a(b,a){b=c.call(this,b)||this;b.add(new p(a));return b}h(a,c);return a}(l),Cb=function(){function c(a,b,c,e){this.predicate=a;this.source=b;this.yieldIndex=c;this.thisArg=e}c.prototype.call=
function(a,b){return b.subscribe(new be(a,this.predicate,this.source,this.yieldIndex,this.thisArg))};return c}(),be=function(c){function a(b,a,e,f,g){b=c.call(this,b)||this;b.predicate=a;b.source=e;b.yieldIndex=f;b.thisArg=g;b.index=0;return b}h(a,c);a.prototype.notifyComplete=function(b){var a=this.destination;a.next(b);a.complete();this.unsubscribe()};a.prototype._next=function(b){var a=this.predicate,c=this.thisArg,f=this.index++;try{a.call(c||this,b,f,this.source)&&this.notifyComplete(this.yieldIndex?
-f:b)}catch(g){this.destination.error(g)}};a.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)};return a}(m),de=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new ce(a))};return c}(),ce=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype._next=function(b){};return a}(m),fe=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new ee(a))};return c}(),ee=function(c){function a(b){return c.call(this,
-b)||this}h(a,c);a.prototype.notifyComplete=function(b){var a=this.destination;a.next(b);a.complete()};a.prototype._next=function(b){this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(m),pc=function(){function c(a){this.total=a;if(0>this.total)throw new X;}c.prototype.call=function(a,b){return b.subscribe(new ge(a,this.total))};return c}(),ge=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.ring=[];b.count=0;return b}h(a,c);a.prototype._next=
-function(b){var a=this.ring,c=this.total,f=this.count++;a.length<c?a.push(b):a[f%c]=b};a.prototype._complete=function(){var b=this.destination,a=this.count;if(0<a)for(var c=this.count>=this.total?this.total:this.count,f=this.ring,g=0;g<c;g++){var l=a++%c;b.next(f[l])}b.complete()};return a}(m),ie=function(){function c(a){this.value=a}c.prototype.call=function(a,b){return b.subscribe(new he(a,this.value))};return c}(),he=function(c){function a(b,a){b=c.call(this,b)||this;b.value=a;return b}h(a,c);
-a.prototype._next=function(b){this.destination.next(this.value)};return a}(m),ke=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new je(a))};return c}(),je=function(c){function a(b){return c.call(this,b)||this}h(a,c);a.prototype._next=function(b){this.destination.next(w.createNext(b))};a.prototype._error=function(b){var a=this.destination;a.next(w.createError(b));a.complete()};a.prototype._complete=function(){var b=this.destination;b.next(w.createComplete());b.complete()};
-return a}(m),qc=function(){function c(a,b,c){void 0===c&&(c=!1);this.accumulator=a;this.seed=b;this.hasSeed=c}c.prototype.call=function(a,b){return b.subscribe(new le(a,this.accumulator,this.seed,this.hasSeed))};return c}(),le=function(c){function a(b,a,e,f){b=c.call(this,b)||this;b.accumulator=a;b._seed=e;b.hasSeed=f;b.index=0;return b}h(a,c);Object.defineProperty(a.prototype,"seed",{get:function(){return this._seed},set:function(b){this.hasSeed=!0;this._seed=b},enumerable:!0,configurable:!0});a.prototype._next=
-function(b){if(this.hasSeed)return this._tryNext(b);this.seed=b;this.destination.next(b)};a.prototype._tryNext=function(b){var a=this.index++,c;try{c=this.accumulator(this.seed,b,a)}catch(f){this.destination.error(f)}this.seed=c;this.destination.next(c)};return a}(m),ne=function(){function c(a,b,c){this.accumulator=a;this.seed=b;this.concurrent=c}c.prototype.call=function(a,b){return b.subscribe(new me(a,this.accumulator,this.seed,this.concurrent))};return c}(),me=function(c){function a(b,a,e,f){b=
-c.call(this,b)||this;b.accumulator=a;b.acc=e;b.concurrent=f;b.hasValue=!1;b.hasCompleted=!1;b.buffer=[];b.active=0;b.index=0;return b}h(a,c);a.prototype._next=function(b){if(this.active<this.concurrent){var a=this.index++,c=this.destination,f=void 0;try{var g=this.accumulator,f=g(this.acc,b,a)}catch(l){return c.error(l)}this.active++;this._innerSub(f,b,a)}else this.buffer.push(b)};a.prototype._innerSub=function(b,a,c){a=new G(this,a,c);c=this.destination;c.add(a);b=p(this,b,void 0,void 0,a);b!==a&&
+f:b)}catch(g){this.destination.error(g)}};a.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)};return a}(l),de=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new ce(a))};return c}(),ce=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype._next=function(b){};return a}(l),fe=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new ee(a))};return c}(),ee=function(c){function a(b){return c.call(this,
+b)||this}h(a,c);a.prototype.notifyComplete=function(b){var a=this.destination;a.next(b);a.complete()};a.prototype._next=function(b){this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(l),pc=function(){function c(a){this.total=a;if(0>this.total)throw new X;}c.prototype.call=function(a,b){return b.subscribe(new ge(a,this.total))};return c}(),ge=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.ring=[];b.count=0;return b}h(a,c);a.prototype._next=
+function(b){var a=this.ring,c=this.total,f=this.count++;a.length<c?a.push(b):a[f%c]=b};a.prototype._complete=function(){var b=this.destination,a=this.count;if(0<a)for(var c=this.count>=this.total?this.total:this.count,f=this.ring,g=0;g<c;g++){var m=a++%c;b.next(f[m])}b.complete()};return a}(l),ie=function(){function c(a){this.value=a}c.prototype.call=function(a,b){return b.subscribe(new he(a,this.value))};return c}(),he=function(c){function a(b,a){b=c.call(this,b)||this;b.value=a;return b}h(a,c);
+a.prototype._next=function(b){this.destination.next(this.value)};return a}(l),ke=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new je(a))};return c}(),je=function(c){function a(b){return c.call(this,b)||this}h(a,c);a.prototype._next=function(b){this.destination.next(w.createNext(b))};a.prototype._error=function(b){var a=this.destination;a.next(w.createError(b));a.complete()};a.prototype._complete=function(){var b=this.destination;b.next(w.createComplete());b.complete()};
+return a}(l),qc=function(){function c(a,b,c){void 0===c&&(c=!1);this.accumulator=a;this.seed=b;this.hasSeed=c}c.prototype.call=function(a,b){return b.subscribe(new le(a,this.accumulator,this.seed,this.hasSeed))};return c}(),le=function(c){function a(b,a,e,f){b=c.call(this,b)||this;b.accumulator=a;b._seed=e;b.hasSeed=f;b.index=0;return b}h(a,c);Object.defineProperty(a.prototype,"seed",{get:function(){return this._seed},set:function(b){this.hasSeed=!0;this._seed=b},enumerable:!0,configurable:!0});a.prototype._next=
+function(b){if(this.hasSeed)return this._tryNext(b);this.seed=b;this.destination.next(b)};a.prototype._tryNext=function(b){var a=this.index++,c;try{c=this.accumulator(this.seed,b,a)}catch(f){this.destination.error(f)}this.seed=c;this.destination.next(c)};return a}(l),ne=function(){function c(a,b,c){this.accumulator=a;this.seed=b;this.concurrent=c}c.prototype.call=function(a,b){return b.subscribe(new me(a,this.accumulator,this.seed,this.concurrent))};return c}(),me=function(c){function a(b,a,e,f){b=
+c.call(this,b)||this;b.accumulator=a;b.acc=e;b.concurrent=f;b.hasValue=!1;b.hasCompleted=!1;b.buffer=[];b.active=0;b.index=0;return b}h(a,c);a.prototype._next=function(b){if(this.active<this.concurrent){var a=this.index++,c=this.destination,f=void 0;try{var g=this.accumulator,f=g(this.acc,b,a)}catch(m){return c.error(m)}this.active++;this._innerSub(f,b,a)}else this.buffer.push(b)};a.prototype._innerSub=function(b,a,c){a=new H(this,a,c);c=this.destination;c.add(a);b=q(this,b,void 0,void 0,a);b!==a&&
c.add(b)};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete());this.unsubscribe()};a.prototype.notifyNext=function(b,a,c,f,g){b=this.destination;this.acc=a;this.hasValue=!0;b.next(a)};a.prototype.notifyComplete=function(b){var a=this.buffer;this.destination.remove(b);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),
-this.destination.complete())};return a}(q),rc=function(){function c(a,b){this.subjectFactory=a;this.selector=b}c.prototype.call=function(a,b){var c=this.selector,e=this.subjectFactory();a=c(e).subscribe(a);a.add(b.subscribe(e));return a};return c}(),pe=function(){function c(a){this.nextSources=a}c.prototype.call=function(a,b){return b.subscribe(new oe(a,this.nextSources))};return c}(),oe=function(c){function a(b,a){var d=c.call(this,b)||this;d.destination=b;d.nextSources=a;return d}h(a,c);a.prototype.notifyError=
-function(b,a){this.subscribeToNextSource()};a.prototype.notifyComplete=function(b){this.subscribeToNextSource()};a.prototype._error=function(b){this.subscribeToNextSource();this.unsubscribe()};a.prototype._complete=function(){this.subscribeToNextSource();this.unsubscribe()};a.prototype.subscribeToNextSource=function(){var b=this.nextSources.shift();if(b){var a=new G(this,void 0,void 0),c=this.destination;c.add(a);b=p(this,b,void 0,void 0,a);b!==a&&c.add(b)}else this.destination.complete()};return a}(q),
-re=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new qe(a))};return c}(),qe=function(c){function a(b){b=c.call(this,b)||this;b.hasPrev=!1;return b}h(a,c);a.prototype._next=function(b){var a;this.hasPrev?a=[this.prev,b]:this.hasPrev=!0;this.prev=b;a&&this.destination.next(a)};return a}(m),Db=function(){function c(a,b){this.count=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new se(a,this.count,this.source))};return c}(),se=function(c){function a(b,a,
-e){b=c.call(this,b)||this;b.count=a;b.source=e;return b}h(a,c);a.prototype.complete=function(){if(!this.isStopped){var b=this.source,a=this.count;if(0===a)return c.prototype.complete.call(this);-1<a&&(this.count=a-1);b.subscribe(this._unsubscribeAndRecycle())}};return a}(m),ue=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){return b.subscribe(new te(a,this.notifier,b))};return c}(),te=function(c){function a(b,a,e){b=c.call(this,b)||this;b.notifier=a;b.source=e;b.sourceIsBeingSubscribedTo=
+this.destination.complete())};return a}(t),rc=function(){function c(a,b){this.subjectFactory=a;this.selector=b}c.prototype.call=function(a,b){var c=this.selector,e=this.subjectFactory();a=c(e).subscribe(a);a.add(b.subscribe(e));return a};return c}(),pe=function(){function c(a){this.nextSources=a}c.prototype.call=function(a,b){return b.subscribe(new oe(a,this.nextSources))};return c}(),oe=function(c){function a(b,a){var d=c.call(this,b)||this;d.destination=b;d.nextSources=a;return d}h(a,c);a.prototype.notifyError=
+function(b,a){this.subscribeToNextSource()};a.prototype.notifyComplete=function(b){this.subscribeToNextSource()};a.prototype._error=function(b){this.subscribeToNextSource();this.unsubscribe()};a.prototype._complete=function(){this.subscribeToNextSource();this.unsubscribe()};a.prototype.subscribeToNextSource=function(){var b=this.nextSources.shift();if(b){var a=new H(this,void 0,void 0),c=this.destination;c.add(a);b=q(this,b,void 0,void 0,a);b!==a&&c.add(b)}else this.destination.complete()};return a}(t),
+re=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new qe(a))};return c}(),qe=function(c){function a(b){b=c.call(this,b)||this;b.hasPrev=!1;return b}h(a,c);a.prototype._next=function(b){var a;this.hasPrev?a=[this.prev,b]:this.hasPrev=!0;this.prev=b;a&&this.destination.next(a)};return a}(l),Db=function(){function c(a,b){this.count=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new se(a,this.count,this.source))};return c}(),se=function(c){function a(b,a,
+e){b=c.call(this,b)||this;b.count=a;b.source=e;return b}h(a,c);a.prototype.complete=function(){if(!this.isStopped){var b=this.source,a=this.count;if(0===a)return c.prototype.complete.call(this);-1<a&&(this.count=a-1);b.subscribe(this._unsubscribeAndRecycle())}};return a}(l),ue=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){return b.subscribe(new te(a,this.notifier,b))};return c}(),te=function(c){function a(b,a,e){b=c.call(this,b)||this;b.notifier=a;b.source=e;b.sourceIsBeingSubscribedTo=
!0;return b}h(a,c);a.prototype.notifyNext=function(b,a,c,f,g){this.sourceIsBeingSubscribedTo=!0;this.source.subscribe(this)};a.prototype.notifyComplete=function(b){if(!1===this.sourceIsBeingSubscribedTo)return c.prototype.complete.call(this)};a.prototype.complete=function(){this.sourceIsBeingSubscribedTo=!1;if(!this.isStopped){this.retries||this.subscribeToRetries();if(!this.retriesSubscription||this.retriesSubscription.closed)return c.prototype.complete.call(this);this._unsubscribeAndRecycle();this.notifications.next()}};
a.prototype._unsubscribe=function(){var b=this.notifications,a=this.retriesSubscription;b&&(b.unsubscribe(),this.notifications=null);a&&(a.unsubscribe(),this.retriesSubscription=null);this.retries=null};a.prototype._unsubscribeAndRecycle=function(){var b=this._unsubscribe;this._unsubscribe=null;c.prototype._unsubscribeAndRecycle.call(this);this._unsubscribe=b;return this};a.prototype.subscribeToRetries=function(){this.notifications=new v;var b;try{var a=this.notifier;b=a(this.notifications)}catch(e){return c.prototype.complete.call(this)}this.retries=
-b;this.retriesSubscription=p(this,b)};return a}(q),we=function(){function c(a,b){this.count=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new ve(a,this.count,this.source))};return c}(),ve=function(c){function a(b,a,e){b=c.call(this,b)||this;b.count=a;b.source=e;return b}h(a,c);a.prototype.error=function(b){if(!this.isStopped){var a=this.source,e=this.count;if(0===e)return c.prototype.error.call(this,b);-1<e&&(this.count=e-1);a.subscribe(this._unsubscribeAndRecycle())}};return a}(m),
-ye=function(){function c(a,b){this.notifier=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new xe(a,this.notifier,this.source))};return c}(),xe=function(c){function a(b,a,e){b=c.call(this,b)||this;b.notifier=a;b.source=e;return b}h(a,c);a.prototype.error=function(b){if(!this.isStopped){var a=this.errors,e=this.retries,f=this.retriesSubscription;if(e)this.retriesSubscription=this.errors=null;else{a=new v;try{var g=this.notifier,e=g(a)}catch(l){return c.prototype.error.call(this,
-l)}f=p(this,e)}this._unsubscribeAndRecycle();this.errors=a;this.retries=e;this.retriesSubscription=f;a.next(b)}};a.prototype._unsubscribe=function(){var b=this.errors,a=this.retriesSubscription;b&&(b.unsubscribe(),this.errors=null);a&&(a.unsubscribe(),this.retriesSubscription=null);this.retries=null};a.prototype.notifyNext=function(b,a,c,f,g){b=this._unsubscribe;this._unsubscribe=null;this._unsubscribeAndRecycle();this._unsubscribe=b;this.source.subscribe(this)};return a}(q),Ae=function(){function c(a){this.notifier=
-a}c.prototype.call=function(a,b){a=new ze(a);b=b.subscribe(a);b.add(p(a,this.notifier));return b};return c}(),ze=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||this;b.hasValue=!1;return b}h(a,c);a.prototype._next=function(b){this.value=b;this.hasValue=!0};a.prototype.notifyNext=function(b,a,c,f,g){this.emitValue()};a.prototype.notifyComplete=function(){this.emitValue()};a.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))};return a}(q),
-Ce=function(){function c(a,b){this.period=a;this.scheduler=b}c.prototype.call=function(a,b){return b.subscribe(new Be(a,this.period,this.scheduler))};return c}(),Be=function(c){function a(b,a,e){b=c.call(this,b)||this;b.period=a;b.scheduler=e;b.hasValue=!1;b.add(e.schedule(uc,a,{subscriber:b,period:a}));return b}h(a,c);a.prototype._next=function(b){this.lastValue=b;this.hasValue=!0};a.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))};return a}(m),
+b;this.retriesSubscription=q(this,b)};return a}(t),we=function(){function c(a,b){this.count=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new ve(a,this.count,this.source))};return c}(),ve=function(c){function a(b,a,e){b=c.call(this,b)||this;b.count=a;b.source=e;return b}h(a,c);a.prototype.error=function(b){if(!this.isStopped){var a=this.source,e=this.count;if(0===e)return c.prototype.error.call(this,b);-1<e&&(this.count=e-1);a.subscribe(this._unsubscribeAndRecycle())}};return a}(l),
+ye=function(){function c(a,b){this.notifier=a;this.source=b}c.prototype.call=function(a,b){return b.subscribe(new xe(a,this.notifier,this.source))};return c}(),xe=function(c){function a(b,a,e){b=c.call(this,b)||this;b.notifier=a;b.source=e;return b}h(a,c);a.prototype.error=function(b){if(!this.isStopped){var a=this.errors,e=this.retries,f=this.retriesSubscription;if(e)this.retriesSubscription=this.errors=null;else{a=new v;try{var g=this.notifier,e=g(a)}catch(m){return c.prototype.error.call(this,
+m)}f=q(this,e)}this._unsubscribeAndRecycle();this.errors=a;this.retries=e;this.retriesSubscription=f;a.next(b)}};a.prototype._unsubscribe=function(){var b=this.errors,a=this.retriesSubscription;b&&(b.unsubscribe(),this.errors=null);a&&(a.unsubscribe(),this.retriesSubscription=null);this.retries=null};a.prototype.notifyNext=function(b,a,c,f,g){b=this._unsubscribe;this._unsubscribe=null;this._unsubscribeAndRecycle();this._unsubscribe=b;this.source.subscribe(this)};return a}(t),Ae=function(){function c(a){this.notifier=
+a}c.prototype.call=function(a,b){a=new ze(a);b=b.subscribe(a);b.add(q(a,this.notifier));return b};return c}(),ze=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||this;b.hasValue=!1;return b}h(a,c);a.prototype._next=function(b){this.value=b;this.hasValue=!0};a.prototype.notifyNext=function(b,a,c,f,g){this.emitValue()};a.prototype.notifyComplete=function(){this.emitValue()};a.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))};return a}(t),
+Ce=function(){function c(a,b){this.period=a;this.scheduler=b}c.prototype.call=function(a,b){return b.subscribe(new Be(a,this.period,this.scheduler))};return c}(),Be=function(c){function a(b,a,e){b=c.call(this,b)||this;b.period=a;b.scheduler=e;b.hasValue=!1;b.add(e.schedule(uc,a,{subscriber:b,period:a}));return b}h(a,c);a.prototype._next=function(b){this.lastValue=b;this.hasValue=!0};a.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))};return a}(l),
Ee=function(){function c(a,b){this.compareTo=a;this.comparator=b}c.prototype.call=function(a,b){return b.subscribe(new De(a,this.compareTo,this.comparator))};return c}(),De=function(c){function a(b,a,e){var d=c.call(this,b)||this;d.compareTo=a;d.comparator=e;d._a=[];d._b=[];d._oneComplete=!1;d.destination.add(a.subscribe(new Fe(b,d)));return d}h(a,c);a.prototype._next=function(b){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(b),this.checkValues())};a.prototype._complete=function(){this._oneComplete?
-this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0;this.unsubscribe()};a.prototype.checkValues=function(){for(var b=this._a,a=this._b,c=this.comparator;0<b.length&&0<a.length;){var f=b.shift(),g=a.shift(),l=!1;try{l=c?c(f,g):f===g}catch(u){this.destination.error(u)}l||this.emit(!1)}};a.prototype.emit=function(b){var a=this.destination;a.next(b);a.complete()};a.prototype.nextB=function(b){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(b),this.checkValues())};
-a.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0};return a}(m),Fe=function(c){function a(b,a){b=c.call(this,b)||this;b.parent=a;return b}h(a,c);a.prototype._next=function(b){this.parent.nextB(b)};a.prototype._error=function(b){this.parent.error(b);this.unsubscribe()};a.prototype._complete=function(){this.parent.completeB();this.unsubscribe()};return a}(m),He=function(){function c(a,b){this.predicate=a;this.source=b}c.prototype.call=
+this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0;this.unsubscribe()};a.prototype.checkValues=function(){for(var b=this._a,a=this._b,c=this.comparator;0<b.length&&0<a.length;){var f=b.shift(),g=a.shift(),m=!1;try{m=c?c(f,g):f===g}catch(u){this.destination.error(u)}m||this.emit(!1)}};a.prototype.emit=function(b){var a=this.destination;a.next(b);a.complete()};a.prototype.nextB=function(b){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(b),this.checkValues())};
+a.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0};return a}(l),Fe=function(c){function a(b,a){b=c.call(this,b)||this;b.parent=a;return b}h(a,c);a.prototype._next=function(b){this.parent.nextB(b)};a.prototype._error=function(b){this.parent.error(b);this.unsubscribe()};a.prototype._complete=function(){this.parent.completeB();this.unsubscribe()};return a}(l),He=function(){function c(a,b){this.predicate=a;this.source=b}c.prototype.call=
function(a,b){return b.subscribe(new Ge(a,this.predicate,this.source))};return c}(),Ge=function(c){function a(b,a,e){b=c.call(this,b)||this;b.predicate=a;b.source=e;b.seenValue=!1;b.index=0;return b}h(a,c);a.prototype.applySingleValue=function(b){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=b)};a.prototype._next=function(b){var a=this.index++;this.predicate?this.tryNext(b,a):this.applySingleValue(b)};a.prototype.tryNext=function(b,
-a){try{this.predicate(b,a,this.source)&&this.applySingleValue(b)}catch(e){this.destination.error(e)}};a.prototype._complete=function(){var b=this.destination;0<this.index?(b.next(this.seenValue?this.singleValue:void 0),b.complete()):b.error(new ca)};return a}(m),Je=function(){function c(a){this.total=a}c.prototype.call=function(a,b){return b.subscribe(new Ie(a,this.total))};return c}(),Ie=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.count=0;return b}h(a,c);a.prototype._next=function(b){++this.count>
-this.total&&this.destination.next(b)};return a}(m),Le=function(){function c(a){this._skipCount=a;if(0>this._skipCount)throw new X;}c.prototype.call=function(a,b){return 0===this._skipCount?b.subscribe(new m(a)):b.subscribe(new Ke(a,this._skipCount))};return c}(),Ke=function(c){function a(b,a){b=c.call(this,b)||this;b._skipCount=a;b._count=0;b._ring=Array(a);return b}h(a,c);a.prototype._next=function(b){var a=this._skipCount,c=this._count++;if(c<a)this._ring[c]=b;else{var a=c%a,c=this._ring,f=c[a];
-c[a]=b;this.destination.next(f)}};return a}(m),Ne=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){return b.subscribe(new Me(a,this.notifier))};return c}(),Me=function(c){function a(a,d){a=c.call(this,a)||this;a.hasValue=!1;var b=new G(a,void 0,void 0);a.add(b);a.innerSubscription=b;d=p(a,d,void 0,void 0,b);d!==b&&(a.add(d),a.innerSubscription=d);return a}h(a,c);a.prototype._next=function(a){this.hasValue&&c.prototype._next.call(this,a)};a.prototype.notifyNext=function(a,c,
-e,f,g){this.hasValue=!0;this.innerSubscription&&this.innerSubscription.unsubscribe()};a.prototype.notifyComplete=function(){};return a}(q),Pe=function(){function c(a){this.predicate=a}c.prototype.call=function(a,b){return b.subscribe(new Oe(a,this.predicate))};return c}(),Oe=function(c){function a(a,d){a=c.call(this,a)||this;a.predicate=d;a.skipping=!0;a.index=0;return a}h(a,c);a.prototype._next=function(a){var b=this.destination;this.skipping&&this.tryCallPredicate(a);this.skipping||b.next(a)};a.prototype.tryCallPredicate=
-function(a){try{this.skipping=!!this.predicate(a,this.index++)}catch(d){this.destination.error(d)}};return a}(m),Qe=function(c){function a(a,d,e){void 0===d&&(d=0);void 0===e&&(e=pa);var b=c.call(this)||this;b.source=a;b.delayTime=d;b.scheduler=e;if(!V(d)||0>d)b.delayTime=0;e&&"function"===typeof e.schedule||(b.scheduler=pa);return b}h(a,c);a.create=function(b,c,e){void 0===c&&(c=0);void 0===e&&(e=pa);return new a(b,c,e)};a.dispatch=function(a){return this.add(a.source.subscribe(a.subscriber))};a.prototype._subscribe=
+a){try{this.predicate(b,a,this.source)&&this.applySingleValue(b)}catch(e){this.destination.error(e)}};a.prototype._complete=function(){var b=this.destination;0<this.index?(b.next(this.seenValue?this.singleValue:void 0),b.complete()):b.error(new ca)};return a}(l),Je=function(){function c(a){this.total=a}c.prototype.call=function(a,b){return b.subscribe(new Ie(a,this.total))};return c}(),Ie=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.count=0;return b}h(a,c);a.prototype._next=function(b){++this.count>
+this.total&&this.destination.next(b)};return a}(l),Le=function(){function c(a){this._skipCount=a;if(0>this._skipCount)throw new X;}c.prototype.call=function(a,b){return 0===this._skipCount?b.subscribe(new l(a)):b.subscribe(new Ke(a,this._skipCount))};return c}(),Ke=function(c){function a(b,a){b=c.call(this,b)||this;b._skipCount=a;b._count=0;b._ring=Array(a);return b}h(a,c);a.prototype._next=function(b){var a=this._skipCount,c=this._count++;if(c<a)this._ring[c]=b;else{var a=c%a,c=this._ring,f=c[a];
+c[a]=b;this.destination.next(f)}};return a}(l),Ne=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){return b.subscribe(new Me(a,this.notifier))};return c}(),Me=function(c){function a(a,d){a=c.call(this,a)||this;a.hasValue=!1;var b=new H(a,void 0,void 0);a.add(b);a.innerSubscription=b;d=q(a,d,void 0,void 0,b);d!==b&&(a.add(d),a.innerSubscription=d);return a}h(a,c);a.prototype._next=function(a){this.hasValue&&c.prototype._next.call(this,a)};a.prototype.notifyNext=function(a,c,
+e,f,g){this.hasValue=!0;this.innerSubscription&&this.innerSubscription.unsubscribe()};a.prototype.notifyComplete=function(){};return a}(t),Pe=function(){function c(a){this.predicate=a}c.prototype.call=function(a,b){return b.subscribe(new Oe(a,this.predicate))};return c}(),Oe=function(c){function a(a,d){a=c.call(this,a)||this;a.predicate=d;a.skipping=!0;a.index=0;return a}h(a,c);a.prototype._next=function(a){var b=this.destination;this.skipping&&this.tryCallPredicate(a);this.skipping||b.next(a)};a.prototype.tryCallPredicate=
+function(a){try{this.skipping=!!this.predicate(a,this.index++)}catch(d){this.destination.error(d)}};return a}(l),Qe=function(c){function a(a,d,e){void 0===d&&(d=0);void 0===e&&(e=pa);var b=c.call(this)||this;b.source=a;b.delayTime=d;b.scheduler=e;if(!V(d)||0>d)b.delayTime=0;e&&"function"===typeof e.schedule||(b.scheduler=pa);return b}h(a,c);a.create=function(b,c,e){void 0===c&&(c=0);void 0===e&&(e=pa);return new a(b,c,e)};a.dispatch=function(a){return this.add(a.source.subscribe(a.subscriber))};a.prototype._subscribe=
function(b){return this.scheduler.schedule(a.dispatch,this.delayTime,{source:this.source,subscriber:b})};return a}(n),Re=function(){function c(a,b){this.scheduler=a;this.delay=b}c.prototype.call=function(a,b){return(new Qe(b,this.delay,this.scheduler)).subscribe(a)};return c}(),xc=function(){function c(a){this.project=a}c.prototype.call=function(a,b){return b.subscribe(new Se(a,this.project))};return c}(),Se=function(c){function a(a,d){a=c.call(this,a)||this;a.project=d;a.index=0;return a}h(a,c);
-a.prototype._next=function(a){var b,c=this.index++;try{b=this.project(a,c)}catch(f){this.destination.error(f);return}this._innerSub(b,a,c)};a.prototype._innerSub=function(a,c,e){var b=this.innerSubscription;b&&b.unsubscribe();c=new G(this,c,e);e=this.destination;e.add(c);this.innerSubscription=p(this,a,void 0,void 0,c);this.innerSubscription!==c&&e.add(this.innerSubscription)};a.prototype._complete=function(){var a=this.innerSubscription;a&&!a.closed||c.prototype._complete.call(this);this.unsubscribe()};
-a.prototype._unsubscribe=function(){this.innerSubscription=null};a.prototype.notifyComplete=function(a){this.destination.remove(a);this.innerSubscription=null;this.isStopped&&c.prototype._complete.call(this)};a.prototype.notifyNext=function(a,c,e,f,g){this.destination.next(c)};return a}(q),Ue=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){a=new Te(a);var c=p(a,this.notifier);return c&&!a.seenValue?(a.add(c),b.subscribe(a)):a};return c}(),Te=function(c){function a(a){a=c.call(this,
-a)||this;a.seenValue=!1;return a}h(a,c);a.prototype.notifyNext=function(a,c,e,f,g){this.seenValue=!0;this.complete()};a.prototype.notifyComplete=function(){};return a}(q),We=function(){function c(a,b){this.predicate=a;this.inclusive=b}c.prototype.call=function(a,b){return b.subscribe(new Ve(a,this.predicate,this.inclusive))};return c}(),Ve=function(c){function a(a,d,e){a=c.call(this,a)||this;a.predicate=d;a.inclusive=e;a.index=0;return a}h(a,c);a.prototype._next=function(a){var b=this.destination,
-c;try{c=this.predicate(a,this.index++)}catch(f){b.error(f);return}this.nextOrComplete(a,c)};a.prototype.nextOrComplete=function(a,c){var b=this.destination;c?b.next(a):(this.inclusive&&b.next(a),b.complete())};return a}(m),Ye=function(){function c(a,b,c){this.nextOrObserver=a;this.error=b;this.complete=c}c.prototype.call=function(a,b){return b.subscribe(new Xe(a,this.nextOrObserver,this.error,this.complete))};return c}(),Xe=function(c){function a(a,d,e,f){a=c.call(this,a)||this;a._tapNext=D;a._tapError=
+a.prototype._next=function(a){var b,c=this.index++;try{b=this.project(a,c)}catch(f){this.destination.error(f);return}this._innerSub(b,a,c)};a.prototype._innerSub=function(a,c,e){var b=this.innerSubscription;b&&b.unsubscribe();c=new H(this,c,e);e=this.destination;e.add(c);this.innerSubscription=q(this,a,void 0,void 0,c);this.innerSubscription!==c&&e.add(this.innerSubscription)};a.prototype._complete=function(){var a=this.innerSubscription;a&&!a.closed||c.prototype._complete.call(this);this.unsubscribe()};
+a.prototype._unsubscribe=function(){this.innerSubscription=null};a.prototype.notifyComplete=function(a){this.destination.remove(a);this.innerSubscription=null;this.isStopped&&c.prototype._complete.call(this)};a.prototype.notifyNext=function(a,c,e,f,g){this.destination.next(c)};return a}(t),Ue=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){a=new Te(a);var c=q(a,this.notifier);return c&&!a.seenValue?(a.add(c),b.subscribe(a)):a};return c}(),Te=function(c){function a(a){a=c.call(this,
+a)||this;a.seenValue=!1;return a}h(a,c);a.prototype.notifyNext=function(a,c,e,f,g){this.seenValue=!0;this.complete()};a.prototype.notifyComplete=function(){};return a}(t),We=function(){function c(a,b){this.predicate=a;this.inclusive=b}c.prototype.call=function(a,b){return b.subscribe(new Ve(a,this.predicate,this.inclusive))};return c}(),Ve=function(c){function a(a,d,e){a=c.call(this,a)||this;a.predicate=d;a.inclusive=e;a.index=0;return a}h(a,c);a.prototype._next=function(a){var b=this.destination,
+c;try{c=this.predicate(a,this.index++)}catch(f){b.error(f);return}this.nextOrComplete(a,c)};a.prototype.nextOrComplete=function(a,c){var b=this.destination;c?b.next(a):(this.inclusive&&b.next(a),b.complete())};return a}(l),Ye=function(){function c(a,b,c){this.nextOrObserver=a;this.error=b;this.complete=c}c.prototype.call=function(a,b){return b.subscribe(new Xe(a,this.nextOrObserver,this.error,this.complete))};return c}(),Xe=function(c){function a(a,d,e,f){a=c.call(this,a)||this;a._tapNext=D;a._tapError=
D;a._tapComplete=D;a._tapError=e||D;a._tapComplete=f||D;P(d)?(a._context=a,a._tapNext=d):d&&(a._context=d,a._tapNext=d.next||D,a._tapError=d.error||D,a._tapComplete=d.complete||D);return a}h(a,c);a.prototype._next=function(a){try{this._tapNext.call(this._context,a)}catch(d){this.destination.error(d);return}this.destination.next(a)};a.prototype._error=function(a){try{this._tapError.call(this._context,a)}catch(d){this.destination.error(d);return}this.destination.error(a)};a.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(b){this.destination.error(b);
-return}return this.destination.complete()};return a}(m),Eb={leading:!0,trailing:!1},$e=function(){function c(a,b,c){this.durationSelector=a;this.leading=b;this.trailing=c}c.prototype.call=function(a,b){return b.subscribe(new Ze(a,this.durationSelector,this.leading,this.trailing))};return c}(),Ze=function(c){function a(a,d,e,f){var b=c.call(this,a)||this;b.destination=a;b.durationSelector=d;b._leading=e;b._trailing=f;b._hasValue=!1;return b}h(a,c);a.prototype._next=function(a){this._hasValue=!0;this._sendValue=
-a;this._throttled||(this._leading?this.send():this.throttle(a))};a.prototype.send=function(){var a=this._sendValue;this._hasValue&&(this.destination.next(a),this.throttle(a));this._hasValue=!1;this._sendValue=null};a.prototype.throttle=function(a){(a=this.tryDurationSelector(a))&&this.add(this._throttled=p(this,a))};a.prototype.tryDurationSelector=function(a){try{return this.durationSelector(a)}catch(d){return this.destination.error(d),null}};a.prototype.throttlingDone=function(){var a=this._throttled,
-c=this._trailing;a&&a.unsubscribe();this._throttled=null;c&&this.send()};a.prototype.notifyNext=function(a,c,e,f,g){this.throttlingDone()};a.prototype.notifyComplete=function(){this.throttlingDone()};return a}(q),bf=function(){function c(a,b,c,e){this.duration=a;this.scheduler=b;this.leading=c;this.trailing=e}c.prototype.call=function(a,b){return b.subscribe(new af(a,this.duration,this.scheduler,this.leading,this.trailing))};return c}(),af=function(c){function a(a,d,e,f,g){a=c.call(this,a)||this;
+return}return this.destination.complete()};return a}(l),Eb={leading:!0,trailing:!1},$e=function(){function c(a,b,c){this.durationSelector=a;this.leading=b;this.trailing=c}c.prototype.call=function(a,b){return b.subscribe(new Ze(a,this.durationSelector,this.leading,this.trailing))};return c}(),Ze=function(c){function a(a,d,e,f){var b=c.call(this,a)||this;b.destination=a;b.durationSelector=d;b._leading=e;b._trailing=f;b._hasValue=!1;return b}h(a,c);a.prototype._next=function(a){this._hasValue=!0;this._sendValue=
+a;this._throttled||(this._leading?this.send():this.throttle(a))};a.prototype.send=function(){var a=this._sendValue;this._hasValue&&(this.destination.next(a),this.throttle(a));this._hasValue=!1;this._sendValue=null};a.prototype.throttle=function(a){(a=this.tryDurationSelector(a))&&this.add(this._throttled=q(this,a))};a.prototype.tryDurationSelector=function(a){try{return this.durationSelector(a)}catch(d){return this.destination.error(d),null}};a.prototype.throttlingDone=function(){var a=this._throttled,
+c=this._trailing;a&&a.unsubscribe();this._throttled=null;c&&this.send()};a.prototype.notifyNext=function(a,c,e,f,g){this.throttlingDone()};a.prototype.notifyComplete=function(){this.throttlingDone()};return a}(t),bf=function(){function c(a,b,c,e){this.duration=a;this.scheduler=b;this.leading=c;this.trailing=e}c.prototype.call=function(a,b){return b.subscribe(new af(a,this.duration,this.scheduler,this.leading,this.trailing))};return c}(),af=function(c){function a(a,d,e,f,g){a=c.call(this,a)||this;
a.duration=d;a.scheduler=e;a.leading=f;a.trailing=g;a._hasTrailingValue=!1;a._trailingValue=null;return a}h(a,c);a.prototype._next=function(a){this.throttled?this.trailing&&(this._trailingValue=a,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(yc,this.duration,{subscriber:this})),this.leading?this.destination.next(a):this.trailing&&(this._trailingValue=a,this._hasTrailingValue=!0))};a.prototype._complete=function(){this._hasTrailingValue&&this.destination.next(this._trailingValue);
-this.destination.complete()};a.prototype.clearThrottle=function(){var a=this.throttled;a&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),a.unsubscribe(),this.remove(a),this.throttled=null)};return a}(m),cf=function(){return function(c,a){this.value=c;this.interval=a}}(),zc=function(){function c(a,b,c,e){this.waitFor=a;this.absoluteTimeout=b;this.withObservable=c;this.scheduler=e}c.prototype.call=function(a,b){return b.subscribe(new df(a,
-this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))};return c}(),df=function(c){function a(a,d,e,f,g){a=c.call(this,a)||this;a.absoluteTimeout=d;a.waitFor=e;a.withObservable=f;a.scheduler=g;a.action=null;a.scheduleTimeout();return a}h(a,c);a.dispatchTimeout=function(a){var b=a.withObservable;a._unsubscribeAndRecycle();a.add(p(a,b))};a.prototype.scheduleTimeout=function(){var b=this.action;b?this.action=b.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(a.dispatchTimeout,
-this.waitFor,this))};a.prototype._next=function(a){this.absoluteTimeout||this.scheduleTimeout();c.prototype._next.call(this,a)};a.prototype._unsubscribe=function(){this.withObservable=this.scheduler=this.action=null};return a}(q),ef=function(){return function(c,a){this.value=c;this.timestamp=a}}(),gf=function(){function c(a){this.windowBoundaries=a}c.prototype.call=function(a,b){a=new ff(a);b=b.subscribe(a);b.closed||a.add(p(a,this.windowBoundaries));return b};return c}(),ff=function(c){function a(a){var b=
+this.destination.complete()};a.prototype.clearThrottle=function(){var a=this.throttled;a&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),a.unsubscribe(),this.remove(a),this.throttled=null)};return a}(l),cf=function(){return function(c,a){this.value=c;this.interval=a}}(),zc=function(){function c(a,b,c,e){this.waitFor=a;this.absoluteTimeout=b;this.withObservable=c;this.scheduler=e}c.prototype.call=function(a,b){return b.subscribe(new df(a,
+this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))};return c}(),df=function(c){function a(a,d,e,f,g){a=c.call(this,a)||this;a.absoluteTimeout=d;a.waitFor=e;a.withObservable=f;a.scheduler=g;a.action=null;a.scheduleTimeout();return a}h(a,c);a.dispatchTimeout=function(a){var b=a.withObservable;a._unsubscribeAndRecycle();a.add(q(a,b))};a.prototype.scheduleTimeout=function(){var b=this.action;b?this.action=b.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(a.dispatchTimeout,
+this.waitFor,this))};a.prototype._next=function(a){this.absoluteTimeout||this.scheduleTimeout();c.prototype._next.call(this,a)};a.prototype._unsubscribe=function(){this.withObservable=this.scheduler=this.action=null};return a}(t),ef=function(){return function(c,a){this.value=c;this.timestamp=a}}(),gf=function(){function c(a){this.windowBoundaries=a}c.prototype.call=function(a,b){a=new ff(a);b=b.subscribe(a);b.closed||a.add(q(a,this.windowBoundaries));return b};return c}(),ff=function(c){function a(a){var b=
c.call(this,a)||this;b.window=new v;a.next(b.window);return b}h(a,c);a.prototype.notifyNext=function(a,c,e,f,g){this.openWindow()};a.prototype.notifyError=function(a,c){this._error(a)};a.prototype.notifyComplete=function(a){this._complete()};a.prototype._next=function(a){this.window.next(a)};a.prototype._error=function(a){this.window.error(a);this.destination.error(a)};a.prototype._complete=function(){this.window.complete();this.destination.complete()};a.prototype._unsubscribe=function(){this.window=
-null};a.prototype.openWindow=function(){var a=this.window;a&&a.complete();var a=this.destination,c=this.window=new v;a.next(c)};return a}(q),jf=function(){function c(a,b){this.windowSize=a;this.startWindowEvery=b}c.prototype.call=function(a,b){return b.subscribe(new hf(a,this.windowSize,this.startWindowEvery))};return c}(),hf=function(c){function a(a,d,e){var b=c.call(this,a)||this;b.destination=a;b.windowSize=d;b.startWindowEvery=e;b.windows=[new v];b.count=0;a.next(b.windows[0]);return b}h(a,c);
-a.prototype._next=function(a){for(var b=0<this.startWindowEvery?this.startWindowEvery:this.windowSize,c=this.destination,f=this.windowSize,g=this.windows,l=g.length,h=0;h<l&&!this.closed;h++)g[h].next(a);a=this.count-f+1;0<=a&&0===a%b&&!this.closed&&g.shift().complete();0!==++this.count%b||this.closed||(b=new v,g.push(b),c.next(b))};a.prototype._error=function(a){var b=this.windows;if(b)for(;0<b.length&&!this.closed;)b.shift().error(a);this.destination.error(a)};a.prototype._complete=function(){var a=
-this.windows;if(a)for(;0<a.length&&!this.closed;)a.shift().complete();this.destination.complete()};a.prototype._unsubscribe=function(){this.count=0;this.windows=null};return a}(m),lf=function(){function c(a,b,c,e){this.windowTimeSpan=a;this.windowCreationInterval=b;this.maxWindowSize=c;this.scheduler=e}c.prototype.call=function(a,b){return b.subscribe(new kf(a,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))};return c}(),mf=function(c){function a(){var a=null!==
+null};a.prototype.openWindow=function(){var a=this.window;a&&a.complete();var a=this.destination,c=this.window=new v;a.next(c)};return a}(t),jf=function(){function c(a,b){this.windowSize=a;this.startWindowEvery=b}c.prototype.call=function(a,b){return b.subscribe(new hf(a,this.windowSize,this.startWindowEvery))};return c}(),hf=function(c){function a(a,d,e){var b=c.call(this,a)||this;b.destination=a;b.windowSize=d;b.startWindowEvery=e;b.windows=[new v];b.count=0;a.next(b.windows[0]);return b}h(a,c);
+a.prototype._next=function(a){for(var b=0<this.startWindowEvery?this.startWindowEvery:this.windowSize,c=this.destination,f=this.windowSize,g=this.windows,m=g.length,h=0;h<m&&!this.closed;h++)g[h].next(a);a=this.count-f+1;0<=a&&0===a%b&&!this.closed&&g.shift().complete();0!==++this.count%b||this.closed||(b=new v,g.push(b),c.next(b))};a.prototype._error=function(a){var b=this.windows;if(b)for(;0<b.length&&!this.closed;)b.shift().error(a);this.destination.error(a)};a.prototype._complete=function(){var a=
+this.windows;if(a)for(;0<a.length&&!this.closed;)a.shift().complete();this.destination.complete()};a.prototype._unsubscribe=function(){this.count=0;this.windows=null};return a}(l),lf=function(){function c(a,b,c,e){this.windowTimeSpan=a;this.windowCreationInterval=b;this.maxWindowSize=c;this.scheduler=e}c.prototype.call=function(a,b){return b.subscribe(new kf(a,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))};return c}(),mf=function(c){function a(){var a=null!==
c&&c.apply(this,arguments)||this;a._numberOfNextedValues=0;return a}h(a,c);a.prototype.next=function(a){this._numberOfNextedValues++;c.prototype.next.call(this,a)};Object.defineProperty(a.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0});return a}(v),kf=function(c){function a(a,d,e,f,g){var b=c.call(this,a)||this;b.destination=a;b.windowTimeSpan=d;b.windowCreationInterval=e;b.maxWindowSize=f;b.scheduler=g;b.windows=[];a=b.openWindow();
null!==e&&0<=e?(f={windowTimeSpan:d,windowCreationInterval:e,subscriber:b,scheduler:g},b.add(g.schedule(lb,d,{subscriber:b,window:a,context:null})),b.add(g.schedule(Cc,e,f))):b.add(g.schedule(Bc,d,{subscriber:b,window:a,windowTimeSpan:d}));return b}h(a,c);a.prototype._next=function(a){for(var b=this.windows,c=b.length,f=0;f<c;f++){var g=b[f];g.closed||(g.next(a),g.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(g))}};a.prototype._error=function(a){for(var b=this.windows;0<b.length;)b.shift().error(a);
-this.destination.error(a)};a.prototype._complete=function(){for(var a=this.windows;0<a.length;){var c=a.shift();c.closed||c.complete()}this.destination.complete()};a.prototype.openWindow=function(){var a=new mf;this.windows.push(a);this.destination.next(a);return a};a.prototype.closeWindow=function(a){a.complete();var b=this.windows;b.splice(b.indexOf(a),1)};return a}(m),of=function(){function c(a,b){this.openings=a;this.closingSelector=b}c.prototype.call=function(a,b){return b.subscribe(new nf(a,
-this.openings,this.closingSelector))};return c}(),nf=function(c){function a(a,d,e){a=c.call(this,a)||this;a.openings=d;a.closingSelector=e;a.contexts=[];a.add(a.openSubscription=p(a,d,d));return a}h(a,c);a.prototype._next=function(a){var b=this.contexts;if(b)for(var c=b.length,f=0;f<c;f++)b[f].window.next(a)};a.prototype._error=function(a){var b=this.contexts;this.contexts=null;if(b)for(var e=b.length,f=-1;++f<e;){var g=b[f];g.window.error(a);g.subscription.unsubscribe()}c.prototype._error.call(this,
+this.destination.error(a)};a.prototype._complete=function(){for(var a=this.windows;0<a.length;){var c=a.shift();c.closed||c.complete()}this.destination.complete()};a.prototype.openWindow=function(){var a=new mf;this.windows.push(a);this.destination.next(a);return a};a.prototype.closeWindow=function(a){a.complete();var b=this.windows;b.splice(b.indexOf(a),1)};return a}(l),of=function(){function c(a,b){this.openings=a;this.closingSelector=b}c.prototype.call=function(a,b){return b.subscribe(new nf(a,
+this.openings,this.closingSelector))};return c}(),nf=function(c){function a(a,d,e){a=c.call(this,a)||this;a.openings=d;a.closingSelector=e;a.contexts=[];a.add(a.openSubscription=q(a,d,d));return a}h(a,c);a.prototype._next=function(a){var b=this.contexts;if(b)for(var c=b.length,f=0;f<c;f++)b[f].window.next(a)};a.prototype._error=function(a){var b=this.contexts;this.contexts=null;if(b)for(var e=b.length,f=-1;++f<e;){var g=b[f];g.window.error(a);g.subscription.unsubscribe()}c.prototype._error.call(this,
a)};a.prototype._complete=function(){var a=this.contexts;this.contexts=null;if(a)for(var d=a.length,e=-1;++e<d;){var f=a[e];f.window.complete();f.subscription.unsubscribe()}c.prototype._complete.call(this)};a.prototype._unsubscribe=function(){var a=this.contexts;this.contexts=null;if(a)for(var c=a.length,e=-1;++e<c;){var f=a[e];f.window.unsubscribe();f.subscription.unsubscribe()}};a.prototype.notifyNext=function(a,c,e,f,g){if(a===this.openings){a=void 0;try{var b=this.closingSelector;a=b(c)}catch(u){return this.error(u)}c=
-new v;b=new t;e={window:c,subscription:b};this.contexts.push(e);a=p(this,a,e);a.closed?this.closeWindow(this.contexts.length-1):(a.context=e,b.add(a));this.destination.next(c)}else this.closeWindow(this.contexts.indexOf(a))};a.prototype.notifyError=function(a){this.error(a)};a.prototype.notifyComplete=function(a){a!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(a.context))};a.prototype.closeWindow=function(a){if(-1!==a){var b=this.contexts,c=b[a],f=c.window,c=c.subscription;b.splice(a,
-1);f.complete();c.unsubscribe()}};return a}(q),qf=function(){function c(a){this.closingSelector=a}c.prototype.call=function(a,b){return b.subscribe(new pf(a,this.closingSelector))};return c}(),pf=function(c){function a(a,d){var b=c.call(this,a)||this;b.destination=a;b.closingSelector=d;b.openWindow();return b}h(a,c);a.prototype.notifyNext=function(a,c,e,f,g){this.openWindow(g)};a.prototype.notifyError=function(a,c){this._error(a)};a.prototype.notifyComplete=function(a){this.openWindow(a)};a.prototype._next=
+new v;b=new p;e={window:c,subscription:b};this.contexts.push(e);a=q(this,a,e);a.closed?this.closeWindow(this.contexts.length-1):(a.context=e,b.add(a));this.destination.next(c)}else this.closeWindow(this.contexts.indexOf(a))};a.prototype.notifyError=function(a){this.error(a)};a.prototype.notifyComplete=function(a){a!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(a.context))};a.prototype.closeWindow=function(a){if(-1!==a){var b=this.contexts,c=b[a],f=c.window,c=c.subscription;b.splice(a,
+1);f.complete();c.unsubscribe()}};return a}(t),qf=function(){function c(a){this.closingSelector=a}c.prototype.call=function(a,b){return b.subscribe(new pf(a,this.closingSelector))};return c}(),pf=function(c){function a(a,d){var b=c.call(this,a)||this;b.destination=a;b.closingSelector=d;b.openWindow();return b}h(a,c);a.prototype.notifyNext=function(a,c,e,f,g){this.openWindow(g)};a.prototype.notifyError=function(a,c){this._error(a)};a.prototype.notifyComplete=function(a){this.openWindow(a)};a.prototype._next=
function(a){this.window.next(a)};a.prototype._error=function(a){this.window.error(a);this.destination.error(a);this.unsubscribeClosingNotification()};a.prototype._complete=function(){this.window.complete();this.destination.complete();this.unsubscribeClosingNotification()};a.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()};a.prototype.openWindow=function(a){void 0===a&&(a=null);a&&(this.remove(a),a.unsubscribe());(a=this.window)&&
-a.complete();a=this.window=new v;this.destination.next(a);var b;try{var c=this.closingSelector;b=c()}catch(f){this.destination.error(f);this.window.error(f);return}this.add(this.closingNotification=p(this,b))};return a}(q),sf=function(){function c(a,b){this.observables=a;this.project=b}c.prototype.call=function(a,b){return b.subscribe(new rf(a,this.observables,this.project))};return c}(),rf=function(c){function a(a,d,e){a=c.call(this,a)||this;a.observables=d;a.project=e;a.toRespond=[];e=d.length;
-a.values=Array(e);for(var b=0;b<e;b++)a.toRespond.push(b);for(b=0;b<e;b++){var g=d[b];a.add(p(a,g,g,b))}return a}h(a,c);a.prototype.notifyNext=function(a,c,e,f,g){this.values[e]=c;a=this.toRespond;0<a.length&&(e=a.indexOf(e),-1!==e&&a.splice(e,1))};a.prototype.notifyComplete=function(){};a.prototype._next=function(a){0===this.toRespond.length&&(a=[a].concat(this.values),this.project?this._tryProject(a):this.destination.next(a))};a.prototype._tryProject=function(a){var b;try{b=this.project.apply(this,
-a)}catch(e){this.destination.error(e);return}this.destination.next(b)};return a}(q),tf=Object.freeze({audit:eb,auditTime:function(c,a){void 0===a&&(a=y);return eb(function(){return bb(c,a)})},buffer:function(c){return function(a){return a.lift(new md(c))}},bufferCount:function(c,a){void 0===a&&(a=null);return function(b){return b.lift(new pd(c,a))}},bufferTime:function(c){var a=arguments.length,b=y;A(arguments[arguments.length-1])&&(b=arguments[arguments.length-1],a--);var d=null;2<=a&&(d=arguments[1]);
+a.complete();a=this.window=new v;this.destination.next(a);var b;try{var c=this.closingSelector;b=c()}catch(f){this.destination.error(f);this.window.error(f);return}this.add(this.closingNotification=q(this,b))};return a}(t),sf=function(){function c(a,b){this.observables=a;this.project=b}c.prototype.call=function(a,b){return b.subscribe(new rf(a,this.observables,this.project))};return c}(),rf=function(c){function a(a,d,e){a=c.call(this,a)||this;a.observables=d;a.project=e;a.toRespond=[];e=d.length;
+a.values=Array(e);for(var b=0;b<e;b++)a.toRespond.push(b);for(b=0;b<e;b++){var g=d[b];a.add(q(a,g,g,b))}return a}h(a,c);a.prototype.notifyNext=function(a,c,e,f,g){this.values[e]=c;a=this.toRespond;0<a.length&&(e=a.indexOf(e),-1!==e&&a.splice(e,1))};a.prototype.notifyComplete=function(){};a.prototype._next=function(a){0===this.toRespond.length&&(a=[a].concat(this.values),this.project?this._tryProject(a):this.destination.next(a))};a.prototype._tryProject=function(a){var b;try{b=this.project.apply(this,
+a)}catch(e){this.destination.error(e);return}this.destination.next(b)};return a}(t),tf=Object.freeze({audit:eb,auditTime:function(c,a){void 0===a&&(a=y);return eb(function(){return bb(c,a)})},buffer:function(c){return function(a){return a.lift(new md(c))}},bufferCount:function(c,a){void 0===a&&(a=null);return function(b){return b.lift(new pd(c,a))}},bufferTime:function(c){var a=arguments.length,b=y;A(arguments[arguments.length-1])&&(b=arguments[arguments.length-1],a--);var d=null;2<=a&&(d=arguments[1]);
var e=Number.POSITIVE_INFINITY;3<=a&&(e=arguments[2]);return function(a){return a.lift(new rd(c,d,e,b))}},bufferToggle:function(c,a){return function(b){return b.lift(new ud(c,a))}},bufferWhen:function(c){return function(a){return a.lift(new wd(c))}},catchError:function(c){return function(a){var b=new yd(c);a=a.lift(b);return b.caught=a}},combineAll:function(c){return function(a){return a.lift(new Ha(c))}},combineLatest:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=null;
"function"===typeof c[c.length-1]&&(b=c.pop());1===c.length&&x(c[0])&&(c=c[0].slice());return function(a){return a.lift.call(F([a].concat(c)),new Ha(b))}},concat:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){return a.lift.call(aa.apply(void 0,[a].concat(c)))}},concatAll:Va,concatMap:hb,concatMapTo:function(c,a){return hb(function(){return c},a)},count:function(c){return function(a){return a.lift(new Ad(c,a))}},debounce:function(c){return function(a){return a.lift(new Cd(c))}},
debounceTime:function(c,a){void 0===a&&(a=y);return function(b){return b.lift(new Ed(c,a))}},defaultIfEmpty:ba,delay:function(c,a){void 0===a&&(a=y);var b=c instanceof Date&&!isNaN(+c)?+c-a.now():Math.abs(c);return function(c){return c.lift(new Hd(b,a))}},delayWhen:function(c,a){return a?function(b){return(new Ld(b,a)).lift(new Bb(c))}:function(a){return a.lift(new Bb(c))}},dematerialize:function(){return function(c){return c.lift(new Nd)}},distinct:function(c,a){return function(b){return b.lift(new Pd(c,
-a))}},distinctUntilChanged:ib,distinctUntilKeyChanged:function(c,a){return ib(function(b,d){return a?a(b[c],d[c]):b[c]===d[c]})},elementAt:function(c,a){if(0>c)throw new X;var b=2<=arguments.length;return function(d){return d.pipe(H(function(a,b){return b===c}),Ba(1),b?ba(a):ja(function(){return new X}))}},endWith:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){return aa(a,ga.apply(void 0,c))}},every:function(c,a){return function(b){return b.lift(new Ud(c,a,
-b))}},exhaust:function(){return function(c){return c.lift(new Wd)}},exhaustMap:jb,expand:function(c,a,b){void 0===a&&(a=Number.POSITIVE_INFINITY);void 0===b&&(b=void 0);a=1>(a||0)?Number.POSITIVE_INFINITY:a;return function(d){return d.lift(new Zd(c,a,b))}},filter:H,finalize:function(c){return function(a){return a.lift(new ae(c))}},find:function(c,a){if("function"!==typeof c)throw new TypeError("predicate is not a function");return function(b){return b.lift(new Cb(c,b,!1,a))}},findIndex:function(c,
-a){return function(b){return b.lift(new Cb(c,b,!0,a))}},first:function(c,a){var b=2<=arguments.length;return function(d){return d.pipe(c?H(function(a,b){return c(a,b,d)}):J,Ba(1),b?ba(a):ja(function(){return new ca}))}},groupBy:function(c,a,b,d){return function(e){return e.lift(new Nc(c,a,b,d))}},ignoreElements:function(){return function(c){return c.lift(new de)}},isEmpty:function(){return function(c){return c.lift(new fe)}},last:function(c,a){var b=2<=arguments.length;return function(d){return d.pipe(c?
-H(function(a,b){return c(a,b,d)}):J,ka(1),b?ba(a):ja(function(){return new ca}))}},map:B,mapTo:function(c){return function(a){return a.lift(new ie(c))}},materialize:function(){return function(c){return c.lift(new ke)}},max:function(c){return ma("function"===typeof c?function(a,b){return 0<c(a,b)?a:b}:function(a,b){return a>b?a:b})},merge:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){return a.lift.call(Za.apply(void 0,[a].concat(c)))}},mergeAll:ya,mergeMap:L,
+a))}},distinctUntilChanged:ib,distinctUntilKeyChanged:function(c,a){return ib(function(b,d){return a?a(b[c],d[c]):b[c]===d[c]})},elementAt:function(c,a){if(0>c)throw new X;var b=2<=arguments.length;return function(d){return d.pipe(I(function(a,b){return b===c}),Ba(1),b?ba(a):ja(function(){return new X}))}},endWith:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){return aa(a,ga.apply(void 0,c))}},every:function(c,a){return function(b){return b.lift(new Ud(c,a,
+b))}},exhaust:function(){return function(c){return c.lift(new Wd)}},exhaustMap:jb,expand:function(c,a,b){void 0===a&&(a=Number.POSITIVE_INFINITY);void 0===b&&(b=void 0);a=1>(a||0)?Number.POSITIVE_INFINITY:a;return function(d){return d.lift(new Zd(c,a,b))}},filter:I,finalize:function(c){return function(a){return a.lift(new ae(c))}},find:function(c,a){if("function"!==typeof c)throw new TypeError("predicate is not a function");return function(b){return b.lift(new Cb(c,b,!1,a))}},findIndex:function(c,
+a){return function(b){return b.lift(new Cb(c,b,!0,a))}},first:function(c,a){var b=2<=arguments.length;return function(d){return d.pipe(c?I(function(a,b){return c(a,b,d)}):G,Ba(1),b?ba(a):ja(function(){return new ca}))}},groupBy:function(c,a,b,d){return function(e){return e.lift(new Nc(c,a,b,d))}},ignoreElements:function(){return function(c){return c.lift(new de)}},isEmpty:function(){return function(c){return c.lift(new fe)}},last:function(c,a){var b=2<=arguments.length;return function(d){return d.pipe(c?
+I(function(a,b){return c(a,b,d)}):G,ka(1),b?ba(a):ja(function(){return new ca}))}},map:B,mapTo:function(c){return function(a){return a.lift(new ie(c))}},materialize:function(){return function(c){return c.lift(new ke)}},max:function(c){return ma("function"===typeof c?function(a,b){return 0<c(a,b)?a:b}:function(a,b){return a>b?a:b})},merge:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){return a.lift.call(Za.apply(void 0,[a].concat(c)))}},mergeAll:ya,mergeMap:L,
flatMap:L,mergeMapTo:function(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if("function"===typeof a)return L(function(){return c},a,b);"number"===typeof a&&(b=a);return L(function(){return c},b)},mergeScan:function(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);return function(d){return d.lift(new ne(c,a,b))}},min:function(c){return ma("function"===typeof c?function(a,b){return 0>c(a,b)?a:b}:function(a,b){return a<b?a:b})},multicast:M,observeOn:function(c,a){void 0===a&&(a=0);return function(b){return b.lift(new Rc(c,
-a))}},onErrorResumeNext:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];1===c.length&&x(c[0])&&(c=c[0]);return function(a){return a.lift(new pe(c))}},pairwise:function(){return function(c){return c.lift(new re)}},partition:function(c,a){return function(b){return[H(c,a)(b),H($a(c,a))(b)]}},pluck:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=c.length;if(0===b)throw Error("list of properties cannot be empty.");return function(a){return B(tc(c,b))(a)}},
+a))}},onErrorResumeNext:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];1===c.length&&x(c[0])&&(c=c[0]);return function(a){return a.lift(new pe(c))}},pairwise:function(){return function(c){return c.lift(new re)}},partition:function(c,a){return function(b){return[I(c,a)(b),I($a(c,a))(b)]}},pluck:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=c.length;if(0===b)throw Error("list of properties cannot be empty.");return function(a){return B(tc(c,b))(a)}},
publish:function(c){return c?M(function(){return new v},c):M(new v)},publishBehavior:function(c){return function(a){return M(new tb(c))(a)}},publishLast:function(){return function(c){return M(new T)(c)}},publishReplay:function(c,a,b,d){b&&"function"!==typeof b&&(d=b);var e="function"===typeof b?b:void 0,f=new W(c,a,d);return function(a){return M(function(){return f},e)(a)}},race:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){1===c.length&&x(c[0])&&(c=c[0]);
return a.lift.call(ab.apply(void 0,[a].concat(c)))}},reduce:ma,repeat:function(c){void 0===c&&(c=-1);return function(a){return 0===c?R():0>c?a.lift(new Db(-1,a)):a.lift(new Db(c-1,a))}},repeatWhen:function(c){return function(a){return a.lift(new ue(c))}},retry:function(c){void 0===c&&(c=-1);return function(a){return a.lift(new we(c,a))}},retryWhen:function(c){return function(a){return a.lift(new ye(c,a))}},refCount:ua,sample:function(c){return function(a){return a.lift(new Ae(c))}},sampleTime:function(c,
a){void 0===a&&(a=y);return function(b){return b.lift(new Ce(c,a))}},scan:la,sequenceEqual:function(c,a){return function(b){return b.lift(new Ee(c,a))}},share:function(){return function(c){return ua()(M(vc)(c))}},shareReplay:function(c,a,b){var d;d=c&&"object"===typeof c?c:{bufferSize:c,windowTime:a,refCount:!1,scheduler:b};return function(a){return a.lift(wc(d))}},single:function(c){return function(a){return a.lift(new He(c,a))}},skip:function(c){return function(a){return a.lift(new Je(c))}},skipLast:function(c){return function(a){return a.lift(new Le(c))}},
-skipUntil:function(c){return function(a){return a.lift(new Ne(c))}},skipWhile:function(c){return function(a){return a.lift(new Pe(c))}},startWith:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=c[c.length-1];return A(b)?(c.pop(),function(a){return aa(c,a,b)}):function(a){return aa(c,a)}},subscribeOn:function(c,a){void 0===a&&(a=0);return function(b){return b.lift(new Re(c,a))}},switchAll:function(){return da(J)},switchMap:da,switchMapTo:function(c,a){return a?da(function(){return c},
+skipUntil:function(c){return function(a){return a.lift(new Ne(c))}},skipWhile:function(c){return function(a){return a.lift(new Pe(c))}},startWith:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=c[c.length-1];return A(b)?(c.pop(),function(a){return aa(c,a,b)}):function(a){return aa(c,a)}},subscribeOn:function(c,a){void 0===a&&(a=0);return function(b){return b.lift(new Re(c,a))}},switchAll:function(){return da(G)},switchMap:da,switchMapTo:function(c,a){return a?da(function(){return c},
a):da(function(){return c})},take:Ba,takeLast:ka,takeUntil:function(c){return function(a){return a.lift(new Ue(c))}},takeWhile:function(c,a){void 0===a&&(a=!1);return function(b){return b.lift(new We(c,a))}},tap:function(c,a,b){return function(d){return d.lift(new Ye(c,a,b))}},throttle:function(c,a){void 0===a&&(a=Eb);return function(b){return b.lift(new $e(c,a.leading,a.trailing))}},throttleTime:function(c,a,b){void 0===a&&(a=y);void 0===b&&(b=Eb);return function(d){return d.lift(new bf(c,a,b.leading,
b.trailing))}},throwIfEmpty:ja,timeInterval:function(c){void 0===c&&(c=y);return function(a){return za(function(){return a.pipe(la(function(a,d){a=a.current;return{value:d,current:c.now(),last:a}},{current:c.now(),value:void 0,last:void 0}),B(function(a){return new cf(a.value,a.current-a.last)}))})}},timeout:function(c,a){void 0===a&&(a=y);return kb(c,wa(new yb),a)},timeoutWith:kb,timestamp:function(c){void 0===c&&(c=y);return B(function(a){return new ef(a,c.now())})},toArray:function(){return ma(Ac,
[])},window:function(c){return function(a){return a.lift(new gf(c))}},windowCount:function(c,a){void 0===a&&(a=0);return function(b){return b.lift(new jf(c,a))}},windowTime:function(c,a,b,d){var e=y,f=null,g=Number.POSITIVE_INFINITY;A(d)&&(e=d);A(b)?e=b:V(b)&&(g=b);A(a)?e=a:V(a)&&(f=a);return function(a){return a.lift(new lf(c,f,g,e))}},windowToggle:function(c,a){return function(b){return b.lift(new of(c,a))}},windowWhen:function(c){return function(a){return a.lift(new qf(c))}},withLatestFrom:function(){for(var c=
[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){var b;"function"===typeof c[c.length-1]&&(b=c.pop());return a.lift(new sf(c,b))}},zip:function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(a){return a.lift.call(cb.apply(void 0,[a].concat(c)))}},zipAll:function(c){return function(a){return a.lift(new db(c))}}}),fa=function(){return function(c,a){void 0===a&&(a=Number.POSITIVE_INFINITY);this.subscribedFrame=c;this.unsubscribedFrame=a}}(),Fb=function(){function c(){this.subscriptions=
-[]}c.prototype.logSubscribedFrame=function(){this.subscriptions.push(new fa(this.scheduler.now()));return this.subscriptions.length-1};c.prototype.logUnsubscribedFrame=function(a){var b=this.subscriptions;b[a]=new fa(b[a].subscribedFrame,this.scheduler.now())};return c}(),Ia=function(c){function a(a,d){var b=c.call(this,function(a){var b=this,c=b.logSubscribedFrame(),d=new t;d.add(new t(function(){b.logUnsubscribedFrame(c)}));b.scheduleMessages(a);return d})||this;b.messages=a;b.subscriptions=[];
-b.scheduler=d;return b}h(a,c);a.prototype.scheduleMessages=function(a){for(var b=this.messages.length,c=0;c<b;c++){var f=this.messages[c];a.add(this.scheduler.schedule(function(a){a.message.notification.observe(a.subscriber)},f.frame,{message:f,subscriber:a}))}};return a}(n);mb(Ia,[Fb]);var Gb=function(c){function a(a,d){var b=c.call(this)||this;b.messages=a;b.subscriptions=[];b.scheduler=d;return b}h(a,c);a.prototype._subscribe=function(a){var b=this,e=b.logSubscribedFrame(),f=new t;f.add(new t(function(){b.logUnsubscribedFrame(e)}));
+[]}c.prototype.logSubscribedFrame=function(){this.subscriptions.push(new fa(this.scheduler.now()));return this.subscriptions.length-1};c.prototype.logUnsubscribedFrame=function(a){var b=this.subscriptions;b[a]=new fa(b[a].subscribedFrame,this.scheduler.now())};return c}(),Ia=function(c){function a(a,d){var b=c.call(this,function(a){var b=this,c=b.logSubscribedFrame(),d=new p;d.add(new p(function(){b.logUnsubscribedFrame(c)}));b.scheduleMessages(a);return d})||this;b.messages=a;b.subscriptions=[];
+b.scheduler=d;return b}h(a,c);a.prototype.scheduleMessages=function(a){for(var b=this.messages.length,c=0;c<b;c++){var f=this.messages[c];a.add(this.scheduler.schedule(function(a){a.message.notification.observe(a.subscriber)},f.frame,{message:f,subscriber:a}))}};return a}(n);mb(Ia,[Fb]);var Gb=function(c){function a(a,d){var b=c.call(this)||this;b.messages=a;b.subscriptions=[];b.scheduler=d;return b}h(a,c);a.prototype._subscribe=function(a){var b=this,e=b.logSubscribedFrame(),f=new p;f.add(new p(function(){b.logUnsubscribedFrame(e)}));
f.add(c.prototype._subscribe.call(this,a));return f};a.prototype.setup=function(){for(var a=this,c=a.messages.length,e=0;e<c;e++)(function(){var b=a.messages[e];a.scheduler.schedule(function(){b.notification.observe(a)},b.frame)})()};return a}(v);mb(Gb,[Fb]);var vf=function(c){function a(a){var b=c.call(this,Ga,750)||this;b.assertDeepEqual=a;b.hotObservables=[];b.coldObservables=[];b.flushTests=[];b.runMode=!1;return b}h(a,c);a.prototype.createTime=function(b){b=b.indexOf("|");if(-1===b)throw Error('marble diagram for time should have a completion marker "|"');
return b*a.frameTimeFactor};a.prototype.createColdObservable=function(b,c,e){if(-1!==b.indexOf("^"))throw Error('cold observable cannot have subscription offset "^"');if(-1!==b.indexOf("!"))throw Error('cold observable cannot have unsubscription marker "!"');b=a.parseMarbles(b,c,e,void 0,this.runMode);b=new Ia(b,this);this.coldObservables.push(b);return b};a.prototype.createHotObservable=function(b,c,e){if(-1!==b.indexOf("!"))throw Error('hot observable cannot have unsubscription marker "!"');b=a.parseMarbles(b,
c,e,void 0,this.runMode);b=new Gb(b,this);this.hotObservables.push(b);return b};a.prototype.materializeInnerObservable=function(a,c){var b=this,d=[];a.subscribe(function(a){d.push({frame:b.frame-c,notification:w.createNext(a)})},function(a){d.push({frame:b.frame-c,notification:w.createError(a)})},function(){d.push({frame:b.frame-c,notification:w.createComplete()})});return d};a.prototype.expectObservable=function(b,c){var d=this;void 0===c&&(c=null);var f=[],g={actual:f,ready:!1};c=a.parseMarblesAsSubscriptions(c,
this.runMode);var h=c.unsubscribedFrame,k;this.schedule(function(){k=b.subscribe(function(a){var b=a;a instanceof n&&(b=d.materializeInnerObservable(b,d.frame));f.push({frame:d.frame,notification:w.createNext(b)})},function(a){f.push({frame:d.frame,notification:w.createError(a)})},function(){f.push({frame:d.frame,notification:w.createComplete()})})},c.subscribedFrame===Number.POSITIVE_INFINITY?0:c.subscribedFrame);h!==Number.POSITIVE_INFINITY&&this.schedule(function(){return k.unsubscribe()},h);this.flushTests.push(g);
-var m=this.runMode;return{toBe:function(b,c,d){g.ready=!0;g.expected=a.parseMarbles(b,c,d,!0,m)}}};a.prototype.expectSubscriptions=function(b){var c={actual:b,ready:!1};this.flushTests.push(c);var e=this.runMode;return{toBe:function(b){b="string"===typeof b?[b]:b;c.ready=!0;c.expected=b.map(function(b){return a.parseMarblesAsSubscriptions(b,e)})}}};a.prototype.flush=function(){for(var a=this,d=this.hotObservables;0<d.length;)d.shift().setup();c.prototype.flush.call(this);this.flushTests=this.flushTests.filter(function(b){return b.ready?
-(a.assertDeepEqual(b.actual,b.expected),!1):!0})};a.parseMarblesAsSubscriptions=function(a,c){var b=this;void 0===c&&(c=!1);if("string"!==typeof a)return new fa(Number.POSITIVE_INFINITY);for(var d=a.length,g=-1,h=Number.POSITIVE_INFINITY,k=Number.POSITIVE_INFINITY,m=0,r=function(d){var e=m,f=function(a){e+=a*b.frameTimeFactor},l=a[d];switch(l){case " ":c||f(1);break;case "-":f(1);break;case "(":g=m;f(1);break;case ")":g=-1;f(1);break;case "^":if(h!==Number.POSITIVE_INFINITY)throw Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");
-h=-1<g?g:m;f(1);break;case "!":if(k!==Number.POSITIVE_INFINITY)throw Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");k=-1<g?g:m;break;default:if(c&&l.match(/^[0-9]$/)&&(0===d||" "===a[d-1])){var r=a.slice(d).match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);if(r){d+=r[0].length-1;var l=parseFloat(r[1]),u=void 0;switch(r[2]){case "ms":u=l;break;case "s":u=1E3*l;break;case "m":u=6E4*l}f(u/n.frameTimeFactor);break}}throw Error("there can only be '^' and '!' markers in a subscription marble diagram. Found instead '"+
-l+"'.");}m=e;p=d},n=this,p,q=0;q<d;q++)r(q),q=p;return 0>k?new fa(h):new fa(h,k)};a.parseMarbles=function(a,c,e,f,g){var b=this;void 0===f&&(f=!1);void 0===g&&(g=!1);if(-1!==a.indexOf("!"))throw Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var d=a.length,h=[],k=g?a.replace(/^[ ]+/,"").indexOf("^"):a.indexOf("^"),m=-1===k?0:k*-this.frameTimeFactor,n="object"!==typeof c?function(a){return a}:function(a){return f&&c[a]instanceof Ia?c[a].messages:c[a]},p=-1,k=function(c){var d=
-m,f=function(a){d+=a*b.frameTimeFactor},l=void 0,k=a[c];switch(k){case " ":g||f(1);break;case "-":f(1);break;case "(":p=m;f(1);break;case ")":p=-1;f(1);break;case "|":l=w.createComplete();f(1);break;case "^":f(1);break;case "#":l=w.createError(e||"error");f(1);break;default:if(g&&k.match(/^[0-9]$/)&&(0===c||" "===a[c-1])){var u=a.slice(c).match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);if(u){c+=u[0].length-1;var k=parseFloat(u[1]),r=void 0;switch(u[2]){case "ms":r=k;break;case "s":r=1E3*k;break;case "m":r=
-6E4*k}f(r/q.frameTimeFactor);break}}l=w.createNext(n(k));f(1)}l&&h.push({frame:-1<p?p:m,notification:l});m=d;t=c},q=this,t,v=0;v<d;v++)k(v),v=t;return h};a.prototype.run=function(b){var c=a.frameTimeFactor,e=this.maxFrames;a.frameTimeFactor=1;this.maxFrames=Number.POSITIVE_INFINITY;this.runMode=!0;O.delegate=this;var f={cold:this.createColdObservable.bind(this),hot:this.createHotObservable.bind(this),flush:this.flush.bind(this),expectObservable:this.expectObservable.bind(this),expectSubscriptions:this.expectSubscriptions.bind(this)};
+var l=this.runMode;return{toBe:function(b,c,d){g.ready=!0;g.expected=a.parseMarbles(b,c,d,!0,l)}}};a.prototype.expectSubscriptions=function(b){var c={actual:b,ready:!1};this.flushTests.push(c);var e=this.runMode;return{toBe:function(b){b="string"===typeof b?[b]:b;c.ready=!0;c.expected=b.map(function(b){return a.parseMarblesAsSubscriptions(b,e)})}}};a.prototype.flush=function(){for(var a=this,d=this.hotObservables;0<d.length;)d.shift().setup();c.prototype.flush.call(this);this.flushTests=this.flushTests.filter(function(b){return b.ready?
+(a.assertDeepEqual(b.actual,b.expected),!1):!0})};a.parseMarblesAsSubscriptions=function(a,c){var b=this;void 0===c&&(c=!1);if("string"!==typeof a)return new fa(Number.POSITIVE_INFINITY);for(var d=a.length,g=-1,h=Number.POSITIVE_INFINITY,k=Number.POSITIVE_INFINITY,l=0,r=function(d){var e=l,f=function(a){e+=a*b.frameTimeFactor},m=a[d];switch(m){case " ":c||f(1);break;case "-":f(1);break;case "(":g=l;f(1);break;case ")":g=-1;f(1);break;case "^":if(h!==Number.POSITIVE_INFINITY)throw Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");
+h=-1<g?g:l;f(1);break;case "!":if(k!==Number.POSITIVE_INFINITY)throw Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");k=-1<g?g:l;break;default:if(c&&m.match(/^[0-9]$/)&&(0===d||" "===a[d-1])){var r=a.slice(d).match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);if(r){d+=r[0].length-1;var m=parseFloat(r[1]),u=void 0;switch(r[2]){case "ms":u=m;break;case "s":u=1E3*m;break;case "m":u=6E4*m}f(u/n.frameTimeFactor);break}}throw Error("there can only be '^' and '!' markers in a subscription marble diagram. Found instead '"+
+m+"'.");}l=e;q=d},n=this,q,p=0;p<d;p++)r(p),p=q;return 0>k?new fa(h):new fa(h,k)};a.parseMarbles=function(a,c,e,f,g){var b=this;void 0===f&&(f=!1);void 0===g&&(g=!1);if(-1!==a.indexOf("!"))throw Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var d=a.length,h=[],k=g?a.replace(/^[ ]+/,"").indexOf("^"):a.indexOf("^"),l=-1===k?0:k*-this.frameTimeFactor,n="object"!==typeof c?function(a){return a}:function(a){return f&&c[a]instanceof Ia?c[a].messages:c[a]},p=-1,k=function(c){var d=
+l,f=function(a){d+=a*b.frameTimeFactor},m=void 0,k=a[c];switch(k){case " ":g||f(1);break;case "-":f(1);break;case "(":p=l;f(1);break;case ")":p=-1;f(1);break;case "|":m=w.createComplete();f(1);break;case "^":f(1);break;case "#":m=w.createError(e||"error");f(1);break;default:if(g&&k.match(/^[0-9]$/)&&(0===c||" "===a[c-1])){var u=a.slice(c).match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);if(u){c+=u[0].length-1;var k=parseFloat(u[1]),r=void 0;switch(u[2]){case "ms":r=k;break;case "s":r=1E3*k;break;case "m":r=
+6E4*k}f(r/q.frameTimeFactor);break}}m=w.createNext(n(k));f(1)}m&&h.push({frame:-1<p?p:l,notification:m});l=d;t=c},q=this,t,v=0;v<d;v++)k(v),v=t;return h};a.prototype.run=function(b){var c=a.frameTimeFactor,e=this.maxFrames;a.frameTimeFactor=1;this.maxFrames=Number.POSITIVE_INFINITY;this.runMode=!0;O.delegate=this;var f={cold:this.createColdObservable.bind(this),hot:this.createHotObservable.bind(this),flush:this.flush.bind(this),expectObservable:this.expectObservable.bind(this),expectSubscriptions:this.expectSubscriptions.bind(this)};
try{var g=b(f);this.flush();return g}finally{a.frameTimeFactor=c,this.maxFrames=e,this.runMode=!1,O.delegate=void 0}};return a}(xb),wf=Object.freeze({TestScheduler:vf}),xf="undefined"!==typeof self&&"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,yf="undefined"!==typeof global&&global,z="undefined"!==typeof window&&window||yf||xf;if(!z)throw Error("RxJS could not find any global context (window, self, global)");var Jc=B(function(c,a){return c.response}),N=function(c){function a(a){var b=
c.call(this)||this,e={async:!0,createXHR:function(){var a;if(this.crossDomain)if(z.XMLHttpRequest)a=new z.XMLHttpRequest;else if(z.XDomainRequest)a=new z.XDomainRequest;else throw Error("CORS is not supported by your browser");else if(z.XMLHttpRequest)a=new z.XMLHttpRequest;else{var b=void 0;try{for(var c=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=0;3>d;d++)try{b=c[d];new z.ActiveXObject(b);break}catch(r){}a=new z.ActiveXObject(b)}catch(r){throw Error("XMLHttpRequest is not supported by your browser");
}}return a},crossDomain:!0,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"===typeof a)e.url=a;else for(var f in a)a.hasOwnProperty(f)&&(e[f]=a[f]);b.request=e;return b}h(a,c);a.prototype._subscribe=function(a){return new zf(a,this.request)};a.create=function(){var b=function(b){return new a(b)};b.get=Dc;b.post=Ec;b.delete=Fc;b.put=Gc;b.patch=Hc;b.getJSON=Ic;return b}();return a}(n),zf=function(c){function a(a,d){a=c.call(this,a)||this;a.request=d;a.done=!1;var b=
-d.headers=d.headers||{};d.crossDomain||a.getHeader(b,"X-Requested-With")||(b["X-Requested-With"]="XMLHttpRequest");a.getHeader(b,"Content-Type")||z.FormData&&d.body instanceof z.FormData||"undefined"===typeof d.body||(b["Content-Type"]="application/x-www-form-urlencoded; charset\x3dUTF-8");d.body=a.serializeBody(d.body,a.getHeader(d.headers,"Content-Type"));a.send();return a}h(a,c);a.prototype.next=function(a){this.done=!0;var b=this.xhr,c=this.request,f=this.destination,g;try{g=new Hb(a,b,c)}catch(l){return f.error(l)}f.next(g)};
-a.prototype.send=function(){var a=this.request,c=this.request,e=c.user,f=c.method,g=c.url,h=c.async,k=c.password,m=c.headers,c=c.body;try{var r=this.xhr=a.createXHR();this.setupEvents(r,a);e?r.open(f,g,h,e,k):r.open(f,g,h);h&&(r.timeout=a.timeout,r.responseType=a.responseType);"withCredentials"in r&&(r.withCredentials=!!a.withCredentials);this.setHeaders(r,m);c?r.send(c):r.send()}catch(Xb){this.error(Xb)}};a.prototype.serializeBody=function(a,c){if(!a||"string"===typeof a||z.FormData&&a instanceof
+d.headers=d.headers||{};d.crossDomain||a.getHeader(b,"X-Requested-With")||(b["X-Requested-With"]="XMLHttpRequest");a.getHeader(b,"Content-Type")||z.FormData&&d.body instanceof z.FormData||"undefined"===typeof d.body||(b["Content-Type"]="application/x-www-form-urlencoded; charset\x3dUTF-8");d.body=a.serializeBody(d.body,a.getHeader(d.headers,"Content-Type"));a.send();return a}h(a,c);a.prototype.next=function(a){this.done=!0;var b=this.xhr,c=this.request,f=this.destination,g;try{g=new Hb(a,b,c)}catch(m){return f.error(m)}f.next(g)};
+a.prototype.send=function(){var a=this.request,c=this.request,e=c.user,f=c.method,g=c.url,h=c.async,k=c.password,l=c.headers,c=c.body;try{var r=this.xhr=a.createXHR();this.setupEvents(r,a);e?r.open(f,g,h,e,k):r.open(f,g,h);h&&(r.timeout=a.timeout,r.responseType=a.responseType);"withCredentials"in r&&(r.withCredentials=!!a.withCredentials);this.setHeaders(r,l);c?r.send(c):r.send()}catch(Xb){this.error(Xb)}};a.prototype.serializeBody=function(a,c){if(!a||"string"===typeof a||z.FormData&&a instanceof
z.FormData)return a;if(c){var b=c.indexOf(";");-1!==b&&(c=c.substring(0,b))}switch(c){case "application/x-www-form-urlencoded":return Object.keys(a).map(function(b){return encodeURIComponent(b)+"\x3d"+encodeURIComponent(a[b])}).join("\x26");case "application/json":return JSON.stringify(a);default:return a}};a.prototype.setHeaders=function(a,c){for(var b in c)c.hasOwnProperty(b)&&a.setRequestHeader(b,c[b])};a.prototype.getHeader=function(a,c){for(var b in a)if(b.toLowerCase()===c.toLowerCase())return a[b]};
a.prototype.setupEvents=function(a,c){function b(a){var c=b.subscriber,d=b.progressSubscriber,e=b.request;d&&d.error(a);var f;try{f=new Ib(this,e)}catch(Ja){f=Ja}c.error(f)}function d(a){}function g(a){var b=g.subscriber,c=g.progressSubscriber,d=g.request;if(4===this.readyState){var e=1223===this.status?204:this.status,f="text"===this.responseType?this.response||this.responseText:this.response;0===e&&(e=f?200:0);if(400>e)c&&c.complete(),b.next(a),b.complete();else{c&&c.error(a);a=void 0;try{a=new qa("ajax error "+
-e,this,d)}catch(uf){a=uf}b.error(a)}}}var h=c.progressSubscriber;a.ontimeout=b;b.request=c;b.subscriber=this;b.progressSubscriber=h;if(a.upload&&"withCredentials"in a){if(h){var k;k=function(a){k.progressSubscriber.next(a)};z.XDomainRequest?a.onprogress=k:a.upload.onprogress=k;k.progressSubscriber=h}var m;m=function(a){var b=m.progressSubscriber,c=m.subscriber,d=m.request;b&&b.error(a);var e;try{e=new qa("ajax error",this,d)}catch(Ja){e=Ja}c.error(e)};a.onerror=m;m.request=c;m.subscriber=this;m.progressSubscriber=
-h}a.onreadystatechange=d;d.subscriber=this;d.progressSubscriber=h;d.request=c;a.onload=g;g.subscriber=this;g.progressSubscriber=h;g.request=c};a.prototype.unsubscribe=function(){var a=this.xhr;!this.done&&a&&4!==a.readyState&&"function"===typeof a.abort&&a.abort();c.prototype.unsubscribe.call(this)};return a}(m),Hb=function(){return function(c,a,b){this.originalEvent=c;this.xhr=a;this.request=b;this.status=a.status;this.responseType=a.responseType||b.responseType;this.response=nb(this.responseType,
+e,this,d)}catch(uf){a=uf}b.error(a)}}}var h=c.progressSubscriber;a.ontimeout=b;b.request=c;b.subscriber=this;b.progressSubscriber=h;if(a.upload&&"withCredentials"in a){if(h){var k;k=function(a){k.progressSubscriber.next(a)};z.XDomainRequest?a.onprogress=k:a.upload.onprogress=k;k.progressSubscriber=h}var l;l=function(a){var b=l.progressSubscriber,c=l.subscriber,d=l.request;b&&b.error(a);var e;try{e=new qa("ajax error",this,d)}catch(Ja){e=Ja}c.error(e)};a.onerror=l;l.request=c;l.subscriber=this;l.progressSubscriber=
+h}a.onreadystatechange=d;d.subscriber=this;d.progressSubscriber=h;d.request=c;a.onload=g;g.subscriber=this;g.progressSubscriber=h;g.request=c};a.prototype.unsubscribe=function(){var a=this.xhr;!this.done&&a&&4!==a.readyState&&"function"===typeof a.abort&&a.abort();c.prototype.unsubscribe.call(this)};return a}(l),Hb=function(){return function(c,a,b){this.originalEvent=c;this.xhr=a;this.request=b;this.status=a.status;this.responseType=a.responseType||b.responseType;this.response=nb(this.responseType,
a)}}(),qa=function(){function c(a,b,c){Error.call(this);this.message=a;this.name="AjaxError";this.xhr=b;this.request=c;this.status=b.status;this.responseType=b.responseType||c.responseType;this.response=nb(this.responseType,b);return this}c.prototype=Object.create(Error.prototype);return c}(),Ib=function(c,a){qa.call(this,"ajax timeout",c,a);this.name="AjaxTimeoutError";return this},Af=Object.freeze({ajax:N.create,AjaxResponse:Hb,AjaxError:qa,AjaxTimeoutError:Ib}),Bf={url:"",deserializer:function(c){return JSON.parse(c.data)},
serializer:function(c){return JSON.stringify(c)}},Jb=function(c){function a(a,d){var b=c.call(this)||this;if(a instanceof n)b.destination=d,b.source=a;else{d=b._config=ob({},Bf);b._output=new v;if("string"===typeof a)d.url=a;else for(var f in a)a.hasOwnProperty(f)&&(d[f]=a[f]);if(!d.WebSocketCtor&&WebSocket)d.WebSocketCtor=WebSocket;else if(!d.WebSocketCtor)throw Error("no WebSocket constructor can be found");b.destination=new W}return b}h(a,c);a.prototype.lift=function(b){var c=new a(this._config,
this.destination);c.operator=b;c.source=this;return c};a.prototype._resetState=function(){this._socket=null;this.source||(this.destination=new W);this._output=new v};a.prototype.multiplex=function(a,c,e){var b=this;return new n(function(d){try{b.next(a())}catch(u){d.error(u)}var f=b.subscribe(function(a){try{e(a)&&d.next(a)}catch(K){d.error(K)}},function(a){return d.error(a)},function(){return d.complete()});return function(){try{b.next(c())}catch(u){d.error(u)}f.unsubscribe()}})};a.prototype._connectSocket=
-function(){var a=this,c=this._config,e=c.WebSocketCtor,f=c.protocol,g=c.url,c=c.binaryType,h=this._output,k=null;try{this._socket=k=f?new e(g,f):new e(g),c&&(this._socket.binaryType=c)}catch(r){h.error(r);return}var n=new t(function(){a._socket=null;k&&1===k.readyState&&k.close()});k.onopen=function(b){if(a._socket){var c=a._config.openObserver;c&&c.next(b);b=a.destination;a.destination=m.create(function(b){if(1===k.readyState)try{var c=a._config.serializer;k.send(c(b))}catch(Zb){a.destination.error(Zb)}},
+function(){var a=this,c=this._config,e=c.WebSocketCtor,f=c.protocol,g=c.url,c=c.binaryType,h=this._output,k=null;try{this._socket=k=f?new e(g,f):new e(g),c&&(this._socket.binaryType=c)}catch(r){h.error(r);return}var n=new p(function(){a._socket=null;k&&1===k.readyState&&k.close()});k.onopen=function(b){if(a._socket){var c=a._config.openObserver;c&&c.next(b);b=a.destination;a.destination=l.create(function(b){if(1===k.readyState)try{var c=a._config.serializer;k.send(c(b))}catch(Zb){a.destination.error(Zb)}},
function(b){var c=a._config.closingObserver;c&&c.next(void 0);b&&b.code?k.close(b.code,b.reason):h.error(new TypeError("WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }"));a._resetState()},function(){var b=a._config.closingObserver;b&&b.next(void 0);k.close();a._resetState()});b&&b instanceof W&&n.add(b.subscribe(a.destination))}else k.close(),a._resetState()};k.onerror=function(b){a._resetState();h.error(b)};k.onclose=
function(b){a._resetState();var c=a._config.closeObserver;c&&c.next(b);b.wasClean?h.complete():h.error(b)};k.onmessage=function(b){try{var c=a._config.deserializer;h.next(c(b))}catch(Yb){h.error(Yb)}}};a.prototype._subscribe=function(a){var b=this,c=this.source;if(c)return c.subscribe(a);this._socket||this._connectSocket();this._output.subscribe(a);a.add(function(){var a=b._socket;0===b._output.observers.length&&(a&&1===a.readyState&&a.close(),b._resetState())});return a};a.prototype.unsubscribe=
-function(){var a=this._socket;a&&1===a.readyState&&a.close();this._resetState();c.prototype.unsubscribe.call(this)};return a}(Da),Cf=Object.freeze({webSocket:function(c){return new Jb(c)},WebSocketSubject:Jb}),Df=Object.freeze({fromFetch:function(c,a){return new n(function(b){var d=new AbortController,e=d.signal,f=!0,g=!1;a?(a.signal&&(a.signal.aborted?d.abort():a.signal.addEventListener("abort",function(){e.aborted||d.abort()})),a=ob({},a,{signal:e})):a={signal:e};fetch(c,a).then(function(a){f=!1;
-b.next(a);b.complete()}).catch(function(a){f=!1;g||b.error(a)});return function(){g=!0;f&&d.abort()}})}});k.operators=tf;k.testing=wf;k.ajax=Af;k.webSocket=Cf;k.fetch=Df;k.Observable=n;k.ConnectableObservable=sb;k.GroupedObservable=Ea;k.observable=U;k.Subject=v;k.BehaviorSubject=tb;k.ReplaySubject=W;k.AsyncSubject=T;k.asapScheduler=pa;k.asyncScheduler=y;k.queueScheduler=ub;k.animationFrameScheduler=Yc;k.VirtualTimeScheduler=xb;k.VirtualAction=Ga;k.Scheduler=Fa;k.Subscription=t;k.Subscriber=m;k.Notification=
-w;k.pipe=ta;k.noop=D;k.identity=J;k.isObservable=function(c){return!!c&&(c instanceof n||"function"===typeof c.lift&&"function"===typeof c.subscribe)};k.ArgumentOutOfRangeError=X;k.EmptyError=ca;k.ObjectUnsubscribedError=I;k.UnsubscriptionError=Y;k.TimeoutError=yb;k.bindCallback=Pa;k.bindNodeCallback=Qa;k.combineLatest=function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=a=null;A(c[c.length-1])&&(b=c.pop());"function"===typeof c[c.length-1]&&(a=c.pop());1===c.length&&x(c[0])&&
-(c=c[0]);return Z(c,b).lift(new Ha(a))};k.concat=aa;k.defer=za;k.empty=R;k.forkJoin=function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length){var b=c[0];if(x(b))return ia(b,null);if(ra(b)&&Object.getPrototypeOf(b)===Object.prototype)return c=Object.keys(b),ia(c.map(function(a){return b[a]}),c)}if("function"===typeof c[c.length-1]){var d=c.pop(),c=1===c.length&&x(c[0])?c[0]:c;return ia(c,null).pipe(B(function(a){return d.apply(void 0,a)}))}return ia(c,null)};k.from=F;k.fromEvent=
-Wa;k.fromEventPattern=Ya;k.generate=function(c,a,b,d,e){var f,g;1==arguments.length?(g=c.initialState,a=c.condition,b=c.iterate,f=c.resultSelector||J,e=c.scheduler):void 0===d||A(d)?(g=c,f=J,e=d):(g=c,f=d);return new n(function(c){var d=g;if(e)return e.schedule($b,0,{subscriber:c,iterate:b,condition:a,resultSelector:f,state:d});do{if(a){var h=void 0;try{h=a(d)}catch(r){c.error(r);break}if(!h){c.complete();break}}h=void 0;try{h=f(d)}catch(r){c.error(r);break}c.next(h);if(c.closed)break;try{d=b(d)}catch(r){c.error(r);
-break}}while(1)})};k.iif=function(c,a,b){void 0===a&&(a=S);void 0===b&&(b=S);return za(function(){return c()?a:b})};k.interval=function(c,a){void 0===c&&(c=0);void 0===a&&(a=y);if(!V(c)||0>c)c=0;a&&"function"===typeof a.schedule||(a=y);return new n(function(b){b.add(a.schedule(ac,c,{subscriber:b,counter:0,period:c}));return b})};k.merge=Za;k.never=function(){return Ab};k.of=ga;k.onErrorResumeNext=Aa;k.pairs=function(c,a){return a?new n(function(b){var d=Object.keys(c),e=new t;e.add(a.schedule(bc,
-0,{keys:d,index:0,subscriber:b,subscription:e,obj:c}));return e}):new n(function(a){for(var b=Object.keys(c),e=0;e<b.length&&!a.closed;e++){var f=b[e];c.hasOwnProperty(f)&&a.next([f,c[f]])}a.complete()})};k.partition=function(c,a,b){return[H(a,b)(new n(ha(c))),H($a(a,b))(new n(ha(c)))]};k.race=ab;k.range=function(c,a,b){void 0===c&&(c=0);return new n(function(d){void 0===a&&(a=c,c=0);var e=0,f=c;if(b)return b.schedule(ec,0,{index:e,count:a,start:c,subscriber:d});do{if(e++>=a){d.complete();break}d.next(f++);
-if(d.closed)break}while(1)})};k.throwError=wa;k.timer=bb;k.using=function(c,a){return new n(function(b){var d;try{d=c()}catch(g){b.error(g);return}var e;try{e=a(d)}catch(g){b.error(g);return}var f=(e?F(e):S).subscribe(b);return function(){f.unsubscribe();d&&d.unsubscribe()}})};k.zip=cb;k.scheduled=Ta;k.EMPTY=S;k.NEVER=Ab;k.config=C;Object.defineProperty(k,"__esModule",{value:!0})});
+function(){var a=this._socket;a&&1===a.readyState&&a.close();this._resetState();c.prototype.unsubscribe.call(this)};return a}(Da),Cf=Object.freeze({webSocket:function(c){return new Jb(c)},WebSocketSubject:Jb}),Df=Object.freeze({fromFetch:function(c,a){return new n(function(b){var d=new AbortController,e=d.signal,f=!0,g=!1,h=new p;h.add(function(){g=!0;f&&d.abort()});var k;if(a){if(a.signal)if(a.signal.aborted)d.abort();else{var l=a.signal,n=function(){e.aborted||d.abort()};l.addEventListener("abort",
+n);h.add(function(){return l.removeEventListener("abort",n)})}k=ob({},a,{signal:e})}else k={signal:e};fetch(c,k).then(function(a){f=!1;b.next(a);b.complete()}).catch(function(a){f=!1;g||b.error(a)});return h})}});k.operators=tf;k.testing=wf;k.ajax=Af;k.webSocket=Cf;k.fetch=Df;k.Observable=n;k.ConnectableObservable=sb;k.GroupedObservable=Ea;k.observable=U;k.Subject=v;k.BehaviorSubject=tb;k.ReplaySubject=W;k.AsyncSubject=T;k.asapScheduler=pa;k.asyncScheduler=y;k.queueScheduler=ub;k.animationFrameScheduler=
+Yc;k.VirtualTimeScheduler=xb;k.VirtualAction=Ga;k.Scheduler=Fa;k.Subscription=p;k.Subscriber=l;k.Notification=w;k.pipe=ta;k.noop=D;k.identity=G;k.isObservable=function(c){return!!c&&(c instanceof n||"function"===typeof c.lift&&"function"===typeof c.subscribe)};k.ArgumentOutOfRangeError=X;k.EmptyError=ca;k.ObjectUnsubscribedError=J;k.UnsubscriptionError=Y;k.TimeoutError=yb;k.bindCallback=Pa;k.bindNodeCallback=Qa;k.combineLatest=function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=
+a=null;A(c[c.length-1])&&(b=c.pop());"function"===typeof c[c.length-1]&&(a=c.pop());1===c.length&&x(c[0])&&(c=c[0]);return Z(c,b).lift(new Ha(a))};k.concat=aa;k.defer=za;k.empty=R;k.forkJoin=function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length){var b=c[0];if(x(b))return ia(b,null);if(ra(b)&&Object.getPrototypeOf(b)===Object.prototype)return c=Object.keys(b),ia(c.map(function(a){return b[a]}),c)}if("function"===typeof c[c.length-1]){var d=c.pop(),c=1===c.length&&x(c[0])?
+c[0]:c;return ia(c,null).pipe(B(function(a){return d.apply(void 0,a)}))}return ia(c,null)};k.from=F;k.fromEvent=Wa;k.fromEventPattern=Ya;k.generate=function(c,a,b,d,e){var f,g;1==arguments.length?(g=c.initialState,a=c.condition,b=c.iterate,f=c.resultSelector||G,e=c.scheduler):void 0===d||A(d)?(g=c,f=G,e=d):(g=c,f=d);return new n(function(c){var d=g;if(e)return e.schedule($b,0,{subscriber:c,iterate:b,condition:a,resultSelector:f,state:d});do{if(a){var h=void 0;try{h=a(d)}catch(r){c.error(r);break}if(!h){c.complete();
+break}}h=void 0;try{h=f(d)}catch(r){c.error(r);break}c.next(h);if(c.closed)break;try{d=b(d)}catch(r){c.error(r);break}}while(1)})};k.iif=function(c,a,b){void 0===a&&(a=S);void 0===b&&(b=S);return za(function(){return c()?a:b})};k.interval=function(c,a){void 0===c&&(c=0);void 0===a&&(a=y);if(!V(c)||0>c)c=0;a&&"function"===typeof a.schedule||(a=y);return new n(function(b){b.add(a.schedule(ac,c,{subscriber:b,counter:0,period:c}));return b})};k.merge=Za;k.never=function(){return Ab};k.of=ga;k.onErrorResumeNext=
+Aa;k.pairs=function(c,a){return a?new n(function(b){var d=Object.keys(c),e=new p;e.add(a.schedule(bc,0,{keys:d,index:0,subscriber:b,subscription:e,obj:c}));return e}):new n(function(a){for(var b=Object.keys(c),e=0;e<b.length&&!a.closed;e++){var f=b[e];c.hasOwnProperty(f)&&a.next([f,c[f]])}a.complete()})};k.partition=function(c,a,b){return[I(a,b)(new n(ha(c))),I($a(a,b))(new n(ha(c)))]};k.race=ab;k.range=function(c,a,b){void 0===c&&(c=0);return new n(function(d){void 0===a&&(a=c,c=0);var e=0,f=c;if(b)return b.schedule(ec,
+0,{index:e,count:a,start:c,subscriber:d});do{if(e++>=a){d.complete();break}d.next(f++);if(d.closed)break}while(1)})};k.throwError=wa;k.timer=bb;k.using=function(c,a){return new n(function(b){var d;try{d=c()}catch(g){b.error(g);return}var e;try{e=a(d)}catch(g){b.error(g);return}var f=(e?F(e):S).subscribe(b);return function(){f.unsubscribe();d&&d.unsubscribe()}})};k.zip=cb;k.scheduled=Ta;k.EMPTY=S;k.NEVER=Ab;k.config=C;Object.defineProperty(k,"__esModule",{value:!0})});
//# sourceMappingURL=rxjs.umd.min.js.map
diff --git a/tools/node_modules/eslint/node_modules/rxjs/internal/observable/dom/fetch.js b/tools/node_modules/eslint/node_modules/rxjs/internal/observable/dom/fetch.js
index 4a5b258b66..dbbc437c5b 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/internal/observable/dom/fetch.js
+++ b/tools/node_modules/eslint/node_modules/rxjs/internal/observable/dom/fetch.js
@@ -12,33 +12,43 @@ var __assign = (this && this.__assign) || function () {
};
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require("../../Observable");
+var Subscription_1 = require("../../Subscription");
function fromFetch(input, init) {
return new Observable_1.Observable(function (subscriber) {
var controller = new AbortController();
var signal = controller.signal;
- var outerSignalHandler;
var abortable = true;
var unsubscribed = false;
+ var subscription = new Subscription_1.Subscription();
+ subscription.add(function () {
+ unsubscribed = true;
+ if (abortable) {
+ controller.abort();
+ }
+ });
+ var perSubscriberInit;
if (init) {
if (init.signal) {
if (init.signal.aborted) {
controller.abort();
}
else {
- outerSignalHandler = function () {
+ var outerSignal_1 = init.signal;
+ var outerSignalHandler_1 = function () {
if (!signal.aborted) {
controller.abort();
}
};
- init.signal.addEventListener('abort', outerSignalHandler);
+ outerSignal_1.addEventListener('abort', outerSignalHandler_1);
+ subscription.add(function () { return outerSignal_1.removeEventListener('abort', outerSignalHandler_1); });
}
}
- init = __assign({}, init, { signal: signal });
+ perSubscriberInit = __assign({}, init, { signal: signal });
}
else {
- init = { signal: signal };
+ perSubscriberInit = { signal: signal };
}
- fetch(input, init).then(function (response) {
+ fetch(input, perSubscriberInit).then(function (response) {
abortable = false;
subscriber.next(response);
subscriber.complete();
@@ -48,12 +58,7 @@ function fromFetch(input, init) {
subscriber.error(err);
}
});
- return function () {
- unsubscribed = true;
- if (abortable) {
- controller.abort();
- }
- };
+ return subscription;
});
}
exports.fromFetch = fromFetch;
diff --git a/tools/node_modules/eslint/node_modules/rxjs/internal/util/pipe.js b/tools/node_modules/eslint/node_modules/rxjs/internal/util/pipe.js
index 5305efd9a9..586ba4fb31 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/internal/util/pipe.js
+++ b/tools/node_modules/eslint/node_modules/rxjs/internal/util/pipe.js
@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-var noop_1 = require("./noop");
+var identity_1 = require("./identity");
function pipe() {
var fns = [];
for (var _i = 0; _i < arguments.length; _i++) {
@@ -10,8 +10,8 @@ function pipe() {
}
exports.pipe = pipe;
function pipeFromArray(fns) {
- if (!fns) {
- return noop_1.noop;
+ if (fns.length === 0) {
+ return identity_1.identity;
}
if (fns.length === 1) {
return fns[0];
diff --git a/tools/node_modules/eslint/node_modules/rxjs/package.json b/tools/node_modules/eslint/node_modules/rxjs/package.json
index b76f2e9630..8665c82861 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/package.json
+++ b/tools/node_modules/eslint/node_modules/rxjs/package.json
@@ -181,5 +181,5 @@
},
"sideEffects": false,
"typings": "./index.d.ts",
- "version": "6.5.4"
+ "version": "6.5.5"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/rxjs/src/README.md b/tools/node_modules/eslint/node_modules/rxjs/src/README.md
index e9204f0ac9..f92dafde47 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/src/README.md
+++ b/tools/node_modules/eslint/node_modules/rxjs/src/README.md
@@ -1,6 +1,4 @@
-<img src="doc/asset/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
-======================================
-
+# <img src="docs_app/assets/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
[![CircleCI](https://circleci.com/gh/ReactiveX/rxjs/tree/6.x.svg?style=svg)](https://circleci.com/gh/ReactiveX/rxjs/tree/6.x)
[![npm version](https://badge.fury.io/js/%40reactivex%2Frxjs.svg)](http://badge.fury.io/js/%40reactivex%2Frxjs)
@@ -22,9 +20,8 @@ Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Exten
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Contribution Guidelines](CONTRIBUTING.md)
-- [Maintainer Guidelines](doc/maintainer-guidelines.md)
-- [Creating Operators](doc/operator-creation.md)
-- [API Documentation (WIP)](https://rxjs.dev/)
+- [Maintainer Guidelines](doc_app/content/maintainer-guidelines.md)
+- [API Documentation](https://rxjs.dev/)
## Versions In This Repository
@@ -45,14 +42,16 @@ npm install rxjs
It's recommended to pull in the Observable creation methods you need directly from `'rxjs'` as shown below with `range`. And you can pull in any operator you need from one spot, under `'rxjs/operators'`.
-```js
-import { range } from 'rxjs';
-import { map, filter } from 'rxjs/operators';
+```ts
+import { range } from "rxjs";
+import { map, filter } from "rxjs/operators";
-range(1, 200).pipe(
- filter(x => x % 2 === 1),
- map(x => x + x)
-).subscribe(x => console.log(x));
+range(1, 200)
+ .pipe(
+ filter(x => x % 2 === 1),
+ map(x => x + x)
+ )
+ .subscribe(x => console.log(x));
```
Here, we're using the built-in `pipe` method on Observables to combine operators. See [pipeable operators](https://github.com/ReactiveX/rxjs/blob/master/doc/pipeable-operators.md) for more information.
@@ -89,10 +88,12 @@ The global namespace for rxjs is `rxjs`:
const { range } = rxjs;
const { map, filter } = rxjs.operators;
-range(1, 200).pipe(
- filter(x => x % 2 === 1),
- map(x => x + x)
-).subscribe(x => console.log(x));
+range(1, 200)
+ .pipe(
+ filter(x => x % 2 === 1),
+ map(x => x + x)
+ )
+ .subscribe(x => console.log(x));
```
## Goals
@@ -116,6 +117,7 @@ Run `npm run build_perf` or `npm run perf` to run the performance tests with `pr
Run `npm run perf_micro [operator]` to run micro performance test benchmarking operator.
## Adding documentation
+
We appreciate all contributions to the documentation of any type. All of the information needed to get the docs app up and running locally as well as how to contribute can be found in the [documentation directory](./docs_app).
## Generating PNG marble diagrams
diff --git a/tools/node_modules/eslint/node_modules/semver/README.md b/tools/node_modules/eslint/node_modules/semver/README.md
index 9ba40454c2..9bef045af2 100644
--- a/tools/node_modules/eslint/node_modules/semver/README.md
+++ b/tools/node_modules/eslint/node_modules/semver/README.md
@@ -78,6 +78,8 @@ const semverOutside = require('semver/ranges/outside')
const semverGtr = require('semver/ranges/gtr')
const semverLtr = require('semver/ranges/ltr')
const semverIntersects = require('semver/ranges/intersects')
+const simplifyRange = require('semver/ranges/simplify')
+const rangeSubset = require('semver/ranges/subset')
```
As a command-line utility:
@@ -254,8 +256,8 @@ inclusive range, then all versions that start with the supplied parts
of the tuple are accepted, but nothing that would be greater than the
provided tuple parts.
-* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
-* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
+* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
+* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
@@ -263,28 +265,28 @@ Any of `X`, `x`, or `*` may be used to "stand in" for one of the
numeric values in the `[major, minor, patch]` tuple.
* `*` := `>=0.0.0` (Any version satisfies)
-* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
-* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
+* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
+* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
A partial version range is treated as an X-Range, so the special
character is in fact optional.
* `""` (empty string) := `*` := `>=0.0.0`
-* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
-* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
+* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
+* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
Allows patch-level changes if a minor version is specified on the
comparator. Allows minor-level changes if not.
-* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
-* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
-* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
-* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
-* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
-* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
-* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
+* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
+* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
+* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
+* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
+* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
+* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
+* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
@@ -306,15 +308,15 @@ However, it presumes that there will *not* be breaking changes between
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
additive (but non-breaking), according to commonly observed practices.
-* `^1.2.3` := `>=1.2.3 <2.0.0`
-* `^0.2.3` := `>=0.2.3 <0.3.0`
-* `^0.0.3` := `>=0.0.3 <0.0.4`
-* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
+* `^1.2.3` := `>=1.2.3 <2.0.0-0`
+* `^0.2.3` := `>=0.2.3 <0.3.0-0`
+* `^0.0.3` := `>=0.0.3 <0.0.4-0`
+* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
-* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
+* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
`0.0.3` version *only* will be allowed, if they are greater than or
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
@@ -322,16 +324,16 @@ When parsing caret ranges, a missing `patch` value desugars to the
number `0`, but will allow flexibility within that value, even if the
major and minor versions are both `0`.
-* `^1.2.x` := `>=1.2.0 <2.0.0`
-* `^0.0.x` := `>=0.0.0 <0.1.0`
-* `^0.0` := `>=0.0.0 <0.1.0`
+* `^1.2.x` := `>=1.2.0 <2.0.0-0`
+* `^0.0.x` := `>=0.0.0 <0.1.0-0`
+* `^0.0` := `>=0.0.0 <0.1.0-0`
A missing `minor` and `patch` values will desugar to zero, but also
allow flexibility within those values, even if the major version is
zero.
-* `^1.x` := `>=1.0.0 <2.0.0`
-* `^0.x` := `>=0.0.0 <1.0.0`
+* `^1.x` := `>=1.0.0 <2.0.0-0`
+* `^0.x` := `>=0.0.0 <1.0.0-0`
### Range Grammar
@@ -446,6 +448,16 @@ strings that they parse.
`hilo` argument must be either the string `'>'` or `'<'`. (This is
the function called by `gtr` and `ltr`.)
* `intersects(range)`: Return true if any of the ranges comparators intersect
+* `simplifyRange(versions, range)`: Return a "simplified" range that
+ matches the same items in `versions` list as the range specified. Note
+ that it does *not* guarantee that it would match the same versions in all
+ cases, only for the set of versions provided. This is useful when
+ generating ranges by joining together multiple versions with `||`
+ programmatically, to provide the user with something a bit more
+ ergonomic. If the provided range is shorter in string-length than the
+ generated range, then that is returned.
+* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
+ entirely contained by the `superRange` range.
Note that, since ranges may be non-contiguous, a version might not be
greater than a range, less than a range, *or* satisfy a range! For
diff --git a/tools/node_modules/eslint/node_modules/semver/classes/range.js b/tools/node_modules/eslint/node_modules/semver/classes/range.js
index 90876c389f..83f8967717 100644
--- a/tools/node_modules/eslint/node_modules/semver/classes/range.js
+++ b/tools/node_modules/eslint/node_modules/semver/classes/range.js
@@ -68,7 +68,7 @@ class Range {
range = range.trim()
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
- range = range.replace(hr, hyphenReplace)
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
debug('hyphen replace', range)
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
@@ -92,6 +92,7 @@ class Range {
.map(comp => parseComparator(comp, this.options))
.join(' ')
.split(/\s+/)
+ .map(comp => replaceGTE0(comp, this.options))
// in loose mode, throw out any that are not valid comparators
.filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)
.map(comp => new Comparator(comp, this.options))
@@ -191,11 +192,11 @@ const parseComparator = (comp, options) => {
const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
// ~, ~> --> * (any, kinda silly)
-// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
-// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
-// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
-// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
-// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
const replaceTildes = (comp, options) =>
comp.trim().split(/\s+/).map((comp) => {
return replaceTilde(comp, options)
@@ -210,18 +211,18 @@ const replaceTilde = (comp, options) => {
if (isX(M)) {
ret = ''
} else if (isX(m)) {
- ret = `>=${M}.0.0 <${+M + 1}.0.0`
+ ret = `>=${M}.0.0 <${+M + 1}.0.0-0`
} else if (isX(p)) {
- // ~1.2 == >=1.2.0 <1.3.0
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0`
+ // ~1.2 == >=1.2.0 <1.3.0-0
+ ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`
} else if (pr) {
debug('replaceTilde pr', pr)
ret = `>=${M}.${m}.${p}-${pr
- } <${M}.${+m + 1}.0`
+ } <${M}.${+m + 1}.0-0`
} else {
- // ~1.2.3 == >=1.2.3 <1.3.0
+ // ~1.2.3 == >=1.2.3 <1.3.0-0
ret = `>=${M}.${m}.${p
- } <${M}.${+m + 1}.0`
+ } <${M}.${+m + 1}.0-0`
}
debug('tilde return', ret)
@@ -230,11 +231,11 @@ const replaceTilde = (comp, options) => {
}
// ^ --> * (any, kinda silly)
-// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
-// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
-// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
-// ^1.2.3 --> >=1.2.3 <2.0.0
-// ^1.2.0 --> >=1.2.0 <2.0.0
+// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
+// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
+// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
+// ^1.2.3 --> >=1.2.3 <2.0.0-0
+// ^1.2.0 --> >=1.2.0 <2.0.0-0
const replaceCarets = (comp, options) =>
comp.trim().split(/\s+/).map((comp) => {
return replaceCaret(comp, options)
@@ -243,6 +244,7 @@ const replaceCarets = (comp, options) =>
const replaceCaret = (comp, options) => {
debug('caret', comp, options)
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
+ const z = options.includePrerelease ? '-0' : ''
return comp.replace(r, (_, M, m, p, pr) => {
debug('caret', comp, _, M, m, p, pr)
let ret
@@ -250,40 +252,40 @@ const replaceCaret = (comp, options) => {
if (isX(M)) {
ret = ''
} else if (isX(m)) {
- ret = `>=${M}.0.0 <${+M + 1}.0.0`
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
} else if (isX(p)) {
if (M === '0') {
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0`
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
} else {
- ret = `>=${M}.${m}.0 <${+M + 1}.0.0`
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
}
} else if (pr) {
debug('replaceCaret pr', pr)
if (M === '0') {
if (m === '0') {
ret = `>=${M}.${m}.${p}-${pr
- } <${M}.${m}.${+p + 1}`
+ } <${M}.${m}.${+p + 1}-0`
} else {
ret = `>=${M}.${m}.${p}-${pr
- } <${M}.${+m + 1}.0`
+ } <${M}.${+m + 1}.0-0`
}
} else {
ret = `>=${M}.${m}.${p}-${pr
- } <${+M + 1}.0.0`
+ } <${+M + 1}.0.0-0`
}
} else {
debug('no pr')
if (M === '0') {
if (m === '0') {
ret = `>=${M}.${m}.${p
- } <${M}.${m}.${+p + 1}`
+ }${z} <${M}.${m}.${+p + 1}-0`
} else {
ret = `>=${M}.${m}.${p
- } <${M}.${+m + 1}.0`
+ }${z} <${M}.${+m + 1}.0-0`
}
} else {
ret = `>=${M}.${m}.${p
- } <${+M + 1}.0.0`
+ } <${+M + 1}.0.0-0`
}
}
@@ -356,12 +358,15 @@ const replaceXRange = (comp, options) => {
}
}
+ if (gtlt === '<')
+ pr = '-0'
+
ret = `${gtlt + M}.${m}.${p}${pr}`
} else if (xm) {
- ret = `>=${M}.0.0${pr} <${+M + 1}.0.0${pr}`
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
} else if (xp) {
ret = `>=${M}.${m}.0${pr
- } <${M}.${+m + 1}.0${pr}`
+ } <${M}.${+m + 1}.0-0`
}
debug('xRange return', ret)
@@ -378,32 +383,42 @@ const replaceStars = (comp, options) => {
return comp.trim().replace(re[t.STAR], '')
}
+const replaceGTE0 = (comp, options) => {
+ debug('replaceGTE0', comp, options)
+ return comp.trim()
+ .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
+}
+
// This function is passed to string.replace(re[t.HYPHENRANGE])
// M, m, patch, prerelease, build
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
-// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
-// 1.2 - 3.4 => >=1.2.0 <3.5.0
-const hyphenReplace = ($0,
+// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
+// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
+const hyphenReplace = incPr => ($0,
from, fM, fm, fp, fpr, fb,
to, tM, tm, tp, tpr, tb) => {
if (isX(fM)) {
from = ''
} else if (isX(fm)) {
- from = `>=${fM}.0.0`
+ from = `>=${fM}.0.0${incPr ? '-0' : ''}`
} else if (isX(fp)) {
- from = `>=${fM}.${fm}.0`
- } else {
+ from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
+ } else if (fpr) {
from = `>=${from}`
+ } else {
+ from = `>=${from}${incPr ? '-0' : ''}`
}
if (isX(tM)) {
to = ''
} else if (isX(tm)) {
- to = `<${+tM + 1}.0.0`
+ to = `<${+tM + 1}.0.0-0`
} else if (isX(tp)) {
- to = `<${tM}.${+tm + 1}.0`
+ to = `<${tM}.${+tm + 1}.0-0`
} else if (tpr) {
to = `<=${tM}.${tm}.${tp}-${tpr}`
+ } else if (incPr) {
+ to = `<${tM}.${tm}.${+tp + 1}-0`
} else {
to = `<=${to}`
}
diff --git a/tools/node_modules/eslint/node_modules/semver/index.js b/tools/node_modules/eslint/node_modules/semver/index.js
index 3a0b4e52c1..57e2ae6494 100644
--- a/tools/node_modules/eslint/node_modules/semver/index.js
+++ b/tools/node_modules/eslint/node_modules/semver/index.js
@@ -43,4 +43,6 @@ module.exports = {
gtr: require('./ranges/gtr'),
ltr: require('./ranges/ltr'),
intersects: require('./ranges/intersects'),
+ simplifyRange: require('./ranges/simplify'),
+ subset: require('./ranges/subset'),
}
diff --git a/tools/node_modules/eslint/node_modules/semver/internal/re.js b/tools/node_modules/eslint/node_modules/semver/internal/re.js
index 0e8fb52897..54d4176dea 100644
--- a/tools/node_modules/eslint/node_modules/semver/internal/re.js
+++ b/tools/node_modules/eslint/node_modules/semver/internal/re.js
@@ -177,3 +177,6 @@ createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
// Star ranges basically just allow anything at all.
createToken('STAR', '(<|>)?=?\\s*\\*')
+// >=0.0.0 is like a star
+createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$')
+createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$')
diff --git a/tools/node_modules/eslint/node_modules/semver/package.json b/tools/node_modules/eslint/node_modules/semver/package.json
index 6230e4ff34..a45cbad6a9 100644
--- a/tools/node_modules/eslint/node_modules/semver/package.json
+++ b/tools/node_modules/eslint/node_modules/semver/package.json
@@ -9,18 +9,18 @@
"deprecated": false,
"description": "The semantic version parser used by npm.",
"devDependencies": {
- "tap": "^14.10.2"
+ "tap": "^14.10.7"
},
"engines": {
"node": ">=10"
},
"files": [
- "bin",
+ "bin/**/*.js",
"range.bnf",
- "classes",
- "functions",
- "internal",
- "ranges",
+ "classes/**/*.js",
+ "functions/**/*.js",
+ "internal/**/*.js",
+ "ranges/**/*.js",
"index.js",
"preload.js"
],
@@ -43,5 +43,5 @@
"check-coverage": true,
"coverage-map": "map.js"
},
- "version": "7.1.3"
+ "version": "7.3.2"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/strip-json-comments/index.js b/tools/node_modules/eslint/node_modules/strip-json-comments/index.js
index c37da3de24..bb00b38baf 100644
--- a/tools/node_modules/eslint/node_modules/strip-json-comments/index.js
+++ b/tools/node_modules/eslint/node_modules/strip-json-comments/index.js
@@ -17,6 +17,10 @@ const isEscaped = (jsonString, quotePosition) => {
};
module.exports = (jsonString, options = {}) => {
+ if (typeof jsonString !== 'string') {
+ throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``);
+ }
+
const strip = options.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
let insideString = false;
diff --git a/tools/node_modules/eslint/node_modules/strip-json-comments/package.json b/tools/node_modules/eslint/node_modules/strip-json-comments/package.json
index e10695c282..286d4fd3a0 100644
--- a/tools/node_modules/eslint/node_modules/strip-json-comments/package.json
+++ b/tools/node_modules/eslint/node_modules/strip-json-comments/package.json
@@ -50,5 +50,5 @@
"bench": "matcha benchmark.js",
"test": "xo && ava && tsd"
},
- "version": "3.0.1"
+ "version": "3.1.0"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/strip-json-comments/readme.md b/tools/node_modules/eslint/node_modules/strip-json-comments/readme.md
index 9ebfc206c4..741c7ffddd 100644
--- a/tools/node_modules/eslint/node_modules/strip-json-comments/readme.md
+++ b/tools/node_modules/eslint/node_modules/strip-json-comments/readme.md
@@ -38,7 +38,7 @@ JSON.parse(stripJsonComments(json));
## API
-### stripJsonComments(jsonString, [options])
+### stripJsonComments(jsonString, options?)
#### jsonString
@@ -71,6 +71,14 @@ $ npm run bench
- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS
-## License
+---
-MIT © [Sindre Sorhus](https://sindresorhus.com)
+<div align="center">
+ <b>
+ <a href="https://tidelift.com/subscription/pkg/npm-strip-json-comments?utm_source=npm-strip-json-comments&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
+ </b>
+ <br>
+ <sub>
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
+ </sub>
+</div>
diff --git a/tools/node_modules/eslint/node_modules/tslib/README.md b/tools/node_modules/eslint/node_modules/tslib/README.md
index ad5150934b..83c8074ec7 100644
--- a/tools/node_modules/eslint/node_modules/tslib/README.md
+++ b/tools/node_modules/eslint/node_modules/tslib/README.md
@@ -35,9 +35,9 @@ For optimized bundles with TypeScript, you should absolutely consider using `tsl
For the latest stable version, run:
## npm
-
-```sh
-# TypeScript 2.3.3 or later
+
+```sh
+# TypeScript 2.3.3 or later
npm install --save tslib
# TypeScript 2.3.2 or earlier
@@ -60,9 +60,9 @@ yarn add tslib@1.6.1
# TypeScript 2.3.3 or later
bower install tslib
-# TypeScript 2.3.2 or earlier
-bower install tslib@1.6.1
-```
+# TypeScript 2.3.2 or earlier
+bower install tslib@1.6.1
+```
## JSPM
@@ -109,9 +109,9 @@ You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:
}
```
-For JSPM users:
-
-```json
+For JSPM users:
+
+```json
{
"compilerOptions": {
"module": "system",
@@ -125,9 +125,9 @@ For JSPM users:
```
-# Contribute
-
-There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
+# Contribute
+
+There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
diff --git a/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js b/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js
index d4d104400d..ba93162616 100644
--- a/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js
+++ b/tools/node_modules/eslint/node_modules/tslib/tslib.es6.js
@@ -57,9 +57,9 @@ export function __decorate(decorators, target, key, desc) {
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
-export function __param(paramIndex, decorator) {
- return function (target, key) { decorator(target, key, paramIndex); }
-}
+export function __param(paramIndex, decorator) {
+ return function (target, key) { decorator(target, key, paramIndex); }
+}
export function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
@@ -77,9 +77,9 @@ export function __awaiter(thisArg, _arguments, P, generator) {
export function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
@@ -99,9 +99,9 @@ export function __generator(thisArg, body) {
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
-}
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+}
export function __exportStar(m, exports) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
@@ -123,9 +123,9 @@ export function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
- try {
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
- }
+ try {
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
+ }
catch (error) { e = { error: error }; }
finally {
try {
@@ -187,9 +187,9 @@ export function __makeTemplateObject(cooked, raw) {
export function __importStar(mod) {
if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
- result.default = mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
+ result.default = mod;
return result;
}
diff --git a/tools/node_modules/eslint/node_modules/tslib/tslib.js b/tools/node_modules/eslint/node_modules/tslib/tslib.js
index 8d4404ac11..e0c30b95d3 100644
--- a/tools/node_modules/eslint/node_modules/tslib/tslib.js
+++ b/tools/node_modules/eslint/node_modules/tslib/tslib.js
@@ -24,9 +24,9 @@ var __generator;
var __exportStar;
var __values;
var __read;
-var __spread;
-var __spreadArrays;
-var __await;
+var __spread;
+var __spreadArrays;
+var __await;
var __asyncGenerator;
var __asyncDelegator;
var __asyncValues;
@@ -41,9 +41,9 @@ var __classPrivateFieldSet;
define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
}
else if (typeof module === "object" && typeof module.exports === "object") {
- factory(createExporter(root, createExporter(module.exports)));
- }
- else {
+ factory(createExporter(root, createExporter(module.exports)));
+ }
+ else {
factory(createExporter(root));
}
function createExporter(exports, previous) {
@@ -96,9 +96,9 @@ var __classPrivateFieldSet;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
- __param = function (paramIndex, decorator) {
- return function (target, key) { decorator(target, key, paramIndex); }
- };
+ __param = function (paramIndex, decorator) {
+ return function (target, key) { decorator(target, key, paramIndex); }
+ };
__metadata = function (metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
@@ -116,9 +116,9 @@ var __classPrivateFieldSet;
__generator = function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
@@ -138,9 +138,9 @@ var __classPrivateFieldSet;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
- };
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+ };
__exportStar = function (m, exports) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
@@ -162,9 +162,9 @@ var __classPrivateFieldSet;
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
- try {
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
- }
+ try {
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
+ }
catch (error) { e = { error: error }; }
finally {
try {
@@ -227,9 +227,9 @@ var __classPrivateFieldSet;
__importStar = function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
- result["default"] = mod;
- return result;
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
+ result["default"] = mod;
+ return result;
};
__importDefault = function (mod) {
@@ -257,14 +257,14 @@ var __classPrivateFieldSet;
exporter("__decorate", __decorate);
exporter("__param", __param);
exporter("__metadata", __metadata);
- exporter("__awaiter", __awaiter);
- exporter("__generator", __generator);
- exporter("__exportStar", __exportStar);
+ exporter("__awaiter", __awaiter);
+ exporter("__generator", __generator);
+ exporter("__exportStar", __exportStar);
exporter("__values", __values);
exporter("__read", __read);
- exporter("__spread", __spread);
- exporter("__spreadArrays", __spreadArrays);
- exporter("__await", __await);
+ exporter("__spread", __spread);
+ exporter("__spreadArrays", __spreadArrays);
+ exporter("__await", __await);
exporter("__asyncGenerator", __asyncGenerator);
exporter("__asyncDelegator", __asyncDelegator);
exporter("__asyncValues", __asyncValues);
diff --git a/tools/node_modules/eslint/node_modules/type-check/README.md b/tools/node_modules/eslint/node_modules/type-check/README.md
index ec92d5930b..b170d67c25 100644
--- a/tools/node_modules/eslint/node_modules/type-check/README.md
+++ b/tools/node_modules/eslint/node_modules/type-check/README.md
@@ -2,7 +2,7 @@
<a name="type-check" />
-`type-check` is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of [levn](https://github.com/gkz/levn). MIT license. Version 0.3.2. Check out the [demo](http://gkz.github.io/type-check/).
+`type-check` is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of [levn](https://github.com/gkz/levn). MIT license. Version 0.4.0. Check out the [demo](http://gkz.github.io/type-check/).
For updates on `type-check`, [follow me on twitter](https://twitter.com/gkzahariev).
@@ -134,7 +134,7 @@ White space is ignored. The root node is a __Types__.
* __Identifier__ = `[\$\w]+` - a group of any lower or upper case letters, numbers, underscores, or dollar signs - eg. `String`
* __Type__ = an `Identifier`, an `Identifier` followed by a `Structure`, just a `Structure`, or a wildcard `*` - eg. `String`, `Object{x: Number}`, `{x: Number}`, `Array{0: String, 1: Boolean, length: Number}`, `*`
-* __Types__ = optionally a comment (an `Indentifier` followed by a `::`), optionally the identifier `Maybe`, one or more `Type`, separated by `|` - eg. `Number`, `String | Date`, `Maybe Number`, `Maybe Boolean | String`
+* __Types__ = optionally a comment (an `Identifier` followed by a `::`), optionally the identifier `Maybe`, one or more `Type`, separated by `|` - eg. `Number`, `String | Date`, `Maybe Number`, `Maybe Boolean | String`
* __Structure__ = `Fields`, or a `Tuple`, or an `Array` - eg. `{x: Number}`, `(String, Number)`, `[Date]`
* __Fields__ = a `{`, followed one or more `Field` separated by a comma `,` (trailing comma `,` is permitted), optionally an `...` (always preceded by a comma `,`), followed by a `}` - eg. `{x: Number, y: String}`, `{k: Function, ...}`
* __Field__ = an `Identifier`, followed by a colon `:`, followed by `Types` - eg. `x: Date | String`, `y: Boolean`
@@ -203,7 +203,7 @@ typeCheck('Even', 3, options); // false
`customTypes` allows you to set up custom types for validation. The value of this is an object. The keys of the object are the types you will be matching. Each value of the object will be an object having a `typeOf` property - a string, and `validate` property - a function.
-The `typeOf` property is the type the value should be, and `validate` is a function which should return true if the value is of that type. `validate` receives one parameter, which is the value that we are checking.
+The `typeOf` property is the type the value should be (optional - if not set only `validate` will be used), and `validate` is a function which should return true if the value is of that type. `validate` receives one parameter, which is the value that we are checking.
## Technical About
diff --git a/tools/node_modules/eslint/node_modules/type-check/lib/check.js b/tools/node_modules/eslint/node_modules/type-check/lib/check.js
index 0504c8d2f4..f78687ee03 100644
--- a/tools/node_modules/eslint/node_modules/type-check/lib/check.js
+++ b/tools/node_modules/eslint/node_modules/type-check/lib/check.js
@@ -1,6 +1,6 @@
-// Generated by LiveScript 1.4.0
+// Generated by LiveScript 1.6.0
(function(){
- var ref$, any, all, isItNaN, types, defaultType, customTypes, toString$ = {}.toString;
+ var ref$, any, all, isItNaN, types, defaultType, toString$ = {}.toString;
ref$ = require('prelude-ls'), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN;
types = {
Number: {
@@ -36,24 +36,24 @@
array: 'Array',
tuple: 'Array'
};
- function checkArray(input, type){
+ function checkArray(input, type, options){
return all(function(it){
- return checkMultiple(it, type.of);
+ return checkMultiple(it, type.of, options);
}, input);
}
- function checkTuple(input, type){
+ function checkTuple(input, type, options){
var i, i$, ref$, len$, types;
i = 0;
for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) {
types = ref$[i$];
- if (!checkMultiple(input[i], types)) {
+ if (!checkMultiple(input[i], types, options)) {
return false;
}
i++;
}
return input.length <= i;
}
- function checkFields(input, type){
+ function checkFields(input, type, options){
var inputKeys, numInputKeys, k, numOfKeys, key, ref$, types;
inputKeys = {};
numInputKeys = 0;
@@ -64,7 +64,7 @@
numOfKeys = 0;
for (key in ref$ = type.of) {
types = ref$[key];
- if (!checkMultiple(input[key], types)) {
+ if (!checkMultiple(input[key], types, options)) {
return false;
}
if (inputKeys[key]) {
@@ -73,31 +73,31 @@
}
return type.subset || numInputKeys === numOfKeys;
}
- function checkStructure(input, type){
+ function checkStructure(input, type, options){
if (!(input instanceof Object)) {
return false;
}
switch (type.structure) {
case 'fields':
- return checkFields(input, type);
+ return checkFields(input, type, options);
case 'array':
- return checkArray(input, type);
+ return checkArray(input, type, options);
case 'tuple':
- return checkTuple(input, type);
+ return checkTuple(input, type, options);
}
}
- function check(input, typeObj){
+ function check(input, typeObj, options){
var type, structure, setting, that;
type = typeObj.type, structure = typeObj.structure;
if (type) {
if (type === '*') {
return true;
}
- setting = customTypes[type] || types[type];
+ setting = options.customTypes[type] || types[type];
if (setting) {
- return setting.typeOf === toString$.call(input).slice(8, -1) && setting.validate(input);
+ return (setting.typeOf === void 8 || setting.typeOf === toString$.call(input).slice(8, -1)) && setting.validate(input);
} else {
- return type === toString$.call(input).slice(8, -1) && (!structure || checkStructure(input, typeObj));
+ return type === toString$.call(input).slice(8, -1) && (!structure || checkStructure(input, typeObj, options));
}
} else if (structure) {
if (that = defaultType[structure]) {
@@ -105,22 +105,24 @@
return false;
}
}
- return checkStructure(input, typeObj);
+ return checkStructure(input, typeObj, options);
} else {
throw new Error("No type defined. Input: " + input + ".");
}
}
- function checkMultiple(input, types){
+ function checkMultiple(input, types, options){
if (toString$.call(types).slice(8, -1) !== 'Array') {
throw new Error("Types must be in an array. Input: " + input + ".");
}
return any(function(it){
- return check(input, it);
+ return check(input, it, options);
}, types);
}
module.exports = function(parsedType, input, options){
options == null && (options = {});
- customTypes = options.customTypes || {};
- return checkMultiple(input, parsedType);
+ if (options.customTypes == null) {
+ options.customTypes = {};
+ }
+ return checkMultiple(input, parsedType, options);
};
}).call(this);
diff --git a/tools/node_modules/eslint/node_modules/type-check/lib/index.js b/tools/node_modules/eslint/node_modules/type-check/lib/index.js
index f3316bab49..09db4cb61a 100644
--- a/tools/node_modules/eslint/node_modules/type-check/lib/index.js
+++ b/tools/node_modules/eslint/node_modules/type-check/lib/index.js
@@ -1,7 +1,7 @@
-// Generated by LiveScript 1.4.0
+// Generated by LiveScript 1.6.0
(function(){
var VERSION, parseType, parsedTypeCheck, typeCheck;
- VERSION = '0.3.2';
+ VERSION = '0.4.0';
parseType = require('./parse-type');
parsedTypeCheck = require('./check');
typeCheck = function(type, input, options){
diff --git a/tools/node_modules/eslint/node_modules/type-check/lib/parse-type.js b/tools/node_modules/eslint/node_modules/type-check/lib/parse-type.js
index 5baf661fae..c360c97339 100644
--- a/tools/node_modules/eslint/node_modules/type-check/lib/parse-type.js
+++ b/tools/node_modules/eslint/node_modules/type-check/lib/parse-type.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.4.0
+// Generated by LiveScript 1.6.0
(function(){
var identifierRegex, tokenRegex;
identifierRegex = /[\$\w]+/;
@@ -134,7 +134,7 @@
}
}
function consumeTypes(tokens){
- var lookahead, types, typesSoFar, typeObj, type;
+ var lookahead, types, typesSoFar, typeObj, type, structure;
if ('::' === peek(tokens)) {
throw new Error("No comment before comment separator '::' found.");
}
@@ -160,11 +160,13 @@
};
}
for (;;) {
- typeObj = consumeType(tokens), type = typeObj.type;
+ typeObj = consumeType(tokens), type = typeObj.type, structure = typeObj.structure;
if (!typesSoFar[type]) {
types.push(typeObj);
}
- typesSoFar[type] = true;
+ if (structure == null) {
+ typesSoFar[type] = true;
+ }
if (!maybeConsumeOp(tokens, '|')) {
break;
}
diff --git a/tools/node_modules/eslint/node_modules/type-check/package.json b/tools/node_modules/eslint/node_modules/type-check/package.json
index 8197d0b3d9..a056438a76 100644
--- a/tools/node_modules/eslint/node_modules/type-check/package.json
+++ b/tools/node_modules/eslint/node_modules/type-check/package.json
@@ -8,15 +8,14 @@
},
"bundleDependencies": false,
"dependencies": {
- "prelude-ls": "~1.1.2"
+ "prelude-ls": "^1.2.1"
},
"deprecated": false,
"description": "type-check allows you to check the types of JavaScript values at runtime with a Haskell like type syntax.",
"devDependencies": {
- "browserify": "~12.0.1",
- "istanbul": "~0.4.1",
- "livescript": "~1.4.0",
- "mocha": "~2.3.4"
+ "browserify": "^16.5.1",
+ "livescript": "^1.6.0",
+ "mocha": "^7.1.1"
},
"engines": {
"node": ">= 0.8.0"
@@ -43,5 +42,5 @@
"scripts": {
"test": "make test"
},
- "version": "0.3.2"
+ "version": "0.4.0"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json
index edabe8c444..2a74d14f3c 100644
--- a/tools/node_modules/eslint/package.json
+++ b/tools/node_modules/eslint/package.json
@@ -13,8 +13,8 @@
"dependencies": {
"@babel/code-frame": "^7.0.0",
"ajv": "^6.10.0",
- "chalk": "^3.0.0",
- "cross-spawn": "^7.0.1",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.2",
"debug": "^4.0.1",
"doctrine": "^3.0.0",
"eslint-plugin-markdown": "^1.0.2",
@@ -35,16 +35,16 @@
"is-glob": "^4.0.0",
"js-yaml": "^3.13.1",
"json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.3.0",
+ "levn": "^0.4.1",
"lodash": "^4.17.14",
"minimatch": "^3.0.4",
"natural-compare": "^1.4.0",
- "optionator": "^0.8.3",
+ "optionator": "^0.9.1",
"progress": "^2.0.0",
- "regexpp": "^3.0.0",
- "semver": "^7.1.1",
+ "regexpp": "^3.1.0",
+ "semver": "^7.2.1",
"strip-ansi": "^6.0.0",
- "strip-json-comments": "^3.0.1",
+ "strip-json-comments": "^3.1.0",
"table": "^5.2.3",
"text-table": "^0.2.0",
"v8-compile-cache": "^2.0.3"
@@ -61,39 +61,40 @@
"common-tags": "^1.8.0",
"core-js": "^3.1.3",
"dateformat": "^3.0.3",
- "ejs": "^2.6.1",
+ "ejs": "^3.0.2",
+ "escape-string-regexp": "^3.0.0",
"eslint": "file:.",
"eslint-config-eslint": "file:packages/eslint-config-eslint",
"eslint-plugin-eslint-plugin": "^2.2.1",
"eslint-plugin-internal-rules": "file:tools/internal-rules",
- "eslint-plugin-jsdoc": "^15.9.5",
- "eslint-plugin-node": "^9.0.0",
+ "eslint-plugin-jsdoc": "^22.1.0",
+ "eslint-plugin-node": "^11.1.0",
"eslint-release": "^1.2.0",
"eslump": "^2.0.0",
"esprima": "^4.0.1",
- "glob": "^7.1.3",
+ "glob": "^7.1.6",
"jsdoc": "^3.5.5",
"karma": "^4.0.1",
- "karma-chrome-launcher": "^2.2.0",
+ "karma-chrome-launcher": "^3.1.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.3",
"karma-webpack": "^4.0.0-rc.6",
"leche": "^2.2.3",
- "lint-staged": "^8.1.5",
+ "lint-staged": "^10.1.2",
"load-perf": "^0.2.0",
- "markdownlint": "^0.15.0",
- "markdownlint-cli": "^0.17.0",
+ "markdownlint": "^0.19.0",
+ "markdownlint-cli": "^0.22.0",
"memfs": "^3.0.1",
- "mocha": "^6.1.2",
+ "mocha": "^7.1.1",
"mocha-junit-reporter": "^1.23.0",
"npm-license": "^0.3.3",
- "nyc": "^14.1.1",
+ "nyc": "^15.0.1",
"proxyquire": "^2.0.1",
- "puppeteer": "^1.18.0",
- "recast": "^0.18.1",
+ "puppeteer": "^2.1.1",
+ "recast": "^0.19.0",
"regenerator-runtime": "^0.13.2",
"shelljs": "^0.8.2",
- "sinon": "^7.3.2",
+ "sinon": "^9.0.1",
"temp": "^0.9.0",
"webpack": "^4.35.0",
"webpack-cli": "^3.3.5",
@@ -152,5 +153,5 @@
"test:cli": "mocha",
"webpack": "node Makefile.js webpack"
},
- "version": "7.0.0-alpha.3"
+ "version": "7.0.0-rc.0"
} \ No newline at end of file