From a7dcd40d6d2ffd5ea6463272ae76b75ade25ff94 Mon Sep 17 00:00:00 2001 From: Seth Poulsen Date: Mon, 19 Mar 2018 16:59:38 -0600 Subject: [PATCH 001/116] Handle absolute as well as relative paths (issue #969) --- src/arr/compiler/cli-module-loader.arr | 18 ++++++++++++------ src/js/trove/pathlib.js | 7 +++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/arr/compiler/cli-module-loader.arr b/src/arr/compiler/cli-module-loader.arr index d25c0fe34a..ba5cc15e08 100644 --- a/src/arr/compiler/cli-module-loader.arr +++ b/src/arr/compiler/cli-module-loader.arr @@ -232,13 +232,21 @@ type CLIContext = { cache-base-dir :: String } +fun get-real-path(current-load-path :: String, dep :: CS.Dependency): + this-path = dep.arguments.get(0) + if P.is-absolute(this-path): + this-path + else: + P.join(current-load-path, this-path) + end +end + fun module-finder(ctxt :: CLIContext, dep :: CS.Dependency): cases(CS.Dependency) dep: | dependency(protocol, args) => if protocol == "file": clp = ctxt.current-load-path - this-path = dep.arguments.get(0) - real-path = P.join(clp, this-path) + real-path = get-real-path(clp, dep) new-context = ctxt.{current-load-path: P.dirname(real-path)} if F.file-exists(real-path): CL.located(get-file-locator(ctxt.cache-base-dir, real-path), new-context) @@ -255,8 +263,7 @@ fun module-finder(ctxt :: CLIContext, dep :: CS.Dependency): CL.located(force-check-mode, ctxt) else if protocol == "file-no-cache": clp = ctxt.current-load-path - this-path = dep.arguments.get(0) - real-path = P.join(clp, this-path) + real-path = get-real-path(clp, dep) new-context = ctxt.{current-load-path: P.dirname(real-path)} if F.file-exists(real-path): CL.located(FL.file-locator(real-path, CS.standard-globals), new-context) @@ -265,8 +272,7 @@ fun module-finder(ctxt :: CLIContext, dep :: CS.Dependency): end else if protocol == "js-file": clp = ctxt.current-load-path - this-path = dep.arguments.get(0) - real-path = P.join(clp, this-path) + real-path = get-real-path(clp, dep) new-context = ctxt.{current-load-path: P.dirname(real-path)} locator = JSF.make-jsfile-locator(real-path) CL.located(locator, new-context) diff --git a/src/js/trove/pathlib.js b/src/js/trove/pathlib.js index 43bed2d9de..563bc92dac 100644 --- a/src/js/trove/pathlib.js +++ b/src/js/trove/pathlib.js @@ -52,9 +52,12 @@ var sext = RUNTIME.unwrap(ext); return RUNTIME.makeString(path.basename(s, sext)); }), - "path-sep": RUNTIME.makeString(path.sep) + "is-absolute": RUNTIME.makeFunction(function(p) { + return path.isAbsolute(p); + }), + "path-sep": RUNTIME.makeString(path.sep), }; return RUNTIME.makeModuleReturn(values, {}); - } + } }) From 8c2a02576a0337729afeabac563e5e0a02ba83f9 Mon Sep 17 00:00:00 2001 From: Seth Poulsen Date: Mon, 9 Apr 2018 13:04:29 -0600 Subject: [PATCH 002/116] Convert all paths to relative paths internally. --- src/arr/compiler/cli-module-loader.arr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arr/compiler/cli-module-loader.arr b/src/arr/compiler/cli-module-loader.arr index ba5cc15e08..1eda45585e 100644 --- a/src/arr/compiler/cli-module-loader.arr +++ b/src/arr/compiler/cli-module-loader.arr @@ -235,7 +235,7 @@ type CLIContext = { fun get-real-path(current-load-path :: String, dep :: CS.Dependency): this-path = dep.arguments.get(0) if P.is-absolute(this-path): - this-path + P.relative(current-load-path, this-path) else: P.join(current-load-path, this-path) end From d76f2a1983a7ba116f821d230d05a1e30c9ab0e5 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Wed, 29 Aug 2018 08:33:42 -0700 Subject: [PATCH 003/116] simple synthesis for ref fields --- src/arr/compiler/type-check.arr | 52 +++++++++++++++++++--------- tests/type-check/bad/ref-fail.arr | 6 ++++ tests/type-check/bad/ref-not-ref.arr | 6 ++++ tests/type-check/good/ref-set.arr | 6 ++++ 4 files changed, 53 insertions(+), 17 deletions(-) create mode 100644 tests/type-check/bad/ref-fail.arr create mode 100644 tests/type-check/bad/ref-not-ref.arr create mode 100644 tests/type-check/good/ref-set.arr diff --git a/src/arr/compiler/type-check.arr b/src/arr/compiler/type-check.arr index 5ab33e9241..6c2204afed 100644 --- a/src/arr/compiler/type-check.arr +++ b/src/arr/compiler/type-check.arr @@ -1875,32 +1875,50 @@ fun synthesis-extend(update-loc :: Loc, obj :: Expr, obj-type :: Type, fields :: end fun synthesis-update(update-loc :: Loc, obj :: Expr, obj-type :: Type, fields :: List, context :: Context) -> TypingResult: - collect-members(fields, false, context).typing-bind(lam(new-members, shadow context): - instantiate-object-type(obj-type, context).typing-bind(lam(shadow obj-type, shadow context): - cases(Type) obj-type: - | t-record(t-fields, _, inferred) => - foldr-fold-result(lam(key, shadow context, final-fields): - cases(Option) t-fields.get(key): + instantiate-object-type(obj-type, context).typing-bind(lam(shadow obj-type, shadow context): + cases(Type) obj-type: + | t-record(t-fields, _, inferred) => + foldr-fold-result(lam(field, shadow context, new-fields): + cases(Option) t-fields.get(field.name): + | none => + fold-errors([list: C.object-missing-field(field.name, tostring(obj-type), obj-type.l, update-loc)]) + | some(old-type) => + cases(Type) old-type: + | t-ref(onto, l, ref-inferred) => + checking(field.value, onto, false, context).fold-bind(lam(new-value, _, shadow context): + fold-result(link(A.s-data-field(field.l, field.name, new-value), fields), context) + end) + | else => + fold-errors([list: C.incorrect-type(tostring(old-type), old-type.l, tostring(t-ref(old-type, update-loc, false)), update-loc)]) + end + end + end, fields, context, empty).typing-bind(lam(final-fields, shadow context): + typing-result(A.s-update(update-loc, obj, final-fields), obj-type, context) + end) + | t-existential(_, l, _) => + typing-error([list: C.unable-to-infer(l)]) + | else => + instantiate-data-type(obj-type, context).typing-bind(lam(data-type, shadow context): + foldr-fold-result(lam(field, shadow context, new-fields): + cases(Option) data-type.fields.get(field.name): | none => - fold-errors([list: C.object-missing-field(key, tostring(obj-type), obj-type.l, update-loc)]) + fold-errors([list: C.object-missing-field(field.name, tostring(obj-type), obj-type.l, update-loc)]) | some(old-type) => cases(Type) old-type: | t-ref(onto, l, ref-inferred) => - new-type = new-members.get-value(key) - fold-result(final-fields.set(key, t-ref(new-type, new-type.l, ref-inferred)), context) + checking(field.value, onto, false, context).fold-bind(lam(new-value, _, shadow context): + fold-result(link(A.s-data-field(field.l, field.name, new-value), fields), context) + end) | else => fold-errors([list: C.incorrect-type(tostring(old-type), old-type.l, tostring(t-ref(old-type, update-loc, false)), update-loc)]) end end - end, new-members.keys-list(), context, t-fields).typing-bind(lam(final-fields, shadow context): - typing-result(A.s-update(update-loc, obj, fields), t-record(final-fields, update-loc, inferred), context) + end, fields, context, empty).typing-bind(lam(final-fields, shadow context): + typing-result(A.s-update(update-loc, obj, final-fields), obj-type, context) end) - | t-existential(_, l, _) => - typing-error([list: C.unable-to-infer(l)]) - | else => - typing-error([list: C.incorrect-type-expression(tostring(obj-type), obj-type.l, "an object type", update-loc, obj)]) - end - end) + end) + # typing-error([list: C.incorrect-type-expression(tostring(obj-type), obj-type.l, "an object type", update-loc, obj)]) + end end) end diff --git a/tests/type-check/bad/ref-fail.arr b/tests/type-check/bad/ref-fail.arr new file mode 100644 index 0000000000..68f8b0f032 --- /dev/null +++ b/tests/type-check/bad/ref-fail.arr @@ -0,0 +1,6 @@ +data Element: + | elt(val :: T, ref parent :: Option>) +end + +e :: Element = elt(0, none) +e!{parent: 8} diff --git a/tests/type-check/bad/ref-not-ref.arr b/tests/type-check/bad/ref-not-ref.arr new file mode 100644 index 0000000000..b65cf85e18 --- /dev/null +++ b/tests/type-check/bad/ref-not-ref.arr @@ -0,0 +1,6 @@ +data Element: + | elt(val :: T, ref parent :: Option>) +end + +e :: Element = elt(0, none) +e!{val: 8} diff --git a/tests/type-check/good/ref-set.arr b/tests/type-check/good/ref-set.arr new file mode 100644 index 0000000000..d24a15febe --- /dev/null +++ b/tests/type-check/good/ref-set.arr @@ -0,0 +1,6 @@ +data Element: + | elt(val :: T, ref parent :: Option>) +end + +e :: Element = elt(0, none) +e!{parent: none} From 60b184591c06f89b58960842394ce837b9a4f6da Mon Sep 17 00:00:00 2001 From: mkolosick Date: Fri, 21 Sep 2018 12:13:25 -0700 Subject: [PATCH 004/116] Streamlined redundant conditional --- src/arr/compiler/type-check.arr | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/arr/compiler/type-check.arr b/src/arr/compiler/type-check.arr index 6c2204afed..7cc04f33ce 100644 --- a/src/arr/compiler/type-check.arr +++ b/src/arr/compiler/type-check.arr @@ -1730,13 +1730,7 @@ fun collect-bindings(binds :: List, context :: Context) -> FoldResult) maybe-type: | some(typ) => typ.set-loc(binding.l) - | none => - cases(A.Name) binding.id: - | s-atom(base, _) => - new-existential(binding.l, true) - | else => - new-existential(binding.l, true) - end + | none => new-existential(binding.l, true) end shadow context = context.add-variable(new-type) fold-result(dict.set(binding.id.key(), new-type), context) From 3cfaf099e29cef8df95328d2f19fda22d7937e07 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Thu, 4 Oct 2018 16:59:45 -0700 Subject: [PATCH 005/116] Updates to patch security warning with old jasmine This isn't user-facing, but avoids us getting npm CRITICAL SECURITY errors because a tester has an old dependency. It also has the happy consequence of simplifying some of the parse-test configuration. --- Makefile | 2 +- package.json | 4 ++-- tests/parse/parse.js | 14 +++++++++++++- tests/parse/require-test-runner/all-spec.js | 18 ------------------ tests/parse/test.js | 16 ---------------- 5 files changed, 16 insertions(+), 38 deletions(-) delete mode 100644 tests/parse/require-test-runner/all-spec.js delete mode 100644 tests/parse/test.js diff --git a/Makefile b/Makefile index 0e0d58c307..72f37ce581 100644 --- a/Makefile +++ b/Makefile @@ -235,7 +235,7 @@ test: pyret-test type-check-test .PHONY : parse-test parse-test: tests/parse/parse.js build/phaseA/js/pyret-tokenizer.js build/phaseA/js/pyret-parser.js - cd tests/parse/ && $(NODE) test.js require-test-runner/ + cd tests/parse/ && $(NODE) parse.js TEST_FILES := $(wildcard tests/pyret/tests/*.arr) TYPE_TEST_FILES := $(wildcard tests/type-check/bad/*.arr) $(wildcard tests/type-check/good/*.arr) $(wildcard tests/type-check/should/*.arr) $(wildcard tests/type-check/should-not/*.arr) diff --git a/package.json b/package.json index 2ff91fd8ef..a27dd9468e 100644 --- a/package.json +++ b/package.json @@ -13,12 +13,12 @@ }, "dependencies": { "ascii-table": "~0.0.9", - "benchmark": "2.0.0", + "benchmark": "^2.1.4", "browserify": "^14.4.0", "command-line-args": "^3.0.1", "error-stack-parser": "^2.0.1", "http": "0.0.0", - "jasmine-node": "1.14.5", + "jasmine": "^3.2.0", "js-sha256": "^0.5.0", "lockfile": "^1.0.2", "node-uuid": "^1.4.8", diff --git a/tests/parse/parse.js b/tests/parse/parse.js index ef99330c34..1613064b12 100644 --- a/tests/parse/parse.js +++ b/tests/parse/parse.js @@ -1,7 +1,18 @@ +var Jasmine = require('jasmine'); +var jazz = new Jasmine(); const R = require("requirejs"); var build = process.env["PHASE"] || "build/phaseA"; +R.config({ + waitSeconds: 15000, + paths: { + "trove": "../../" + build + "/trove", + "js": "../../" + build + "/js", + "compiler": "../../" + build + "/arr/compiler", + "jglr": "../../lib/jglr", + "pyret-base": "../../" + build + } +}); R(["pyret-base/js/pyret-tokenizer", "pyret-base/js/pyret-parser", "fs"], function(T, G, fs) { - _ = require("jasmine-node"); function parse(str) { const toks = T.Tokenizer; toks.tokenizeFrom(str); @@ -753,5 +764,6 @@ R(["pyret-base/js/pyret-tokenizer", "pyret-base/js/pyret-parser", "fs"], functio }); }); + jazz.execute(); }); diff --git a/tests/parse/require-test-runner/all-spec.js b/tests/parse/require-test-runner/all-spec.js deleted file mode 100644 index efd78b613c..0000000000 --- a/tests/parse/require-test-runner/all-spec.js +++ /dev/null @@ -1,18 +0,0 @@ -var r = require("requirejs"); - -var build = process.env["PHASE"] || "build/phaseA"; - -r.config({ - waitSeconds: 15000, - paths: { - "trove": "../../../" + build + "/trove", - "js": "../../../" + build + "/js", - "compiler": "../../../" + build + "/arr/compiler", - "jglr": "../../../lib/jglr", - "pyret-base": "../../../" + build - } -}); - -r(["../parse"], function () { }, function(err) { - console.log("Require failed! ", err); -}); diff --git a/tests/parse/test.js b/tests/parse/test.js deleted file mode 100644 index bd49891739..0000000000 --- a/tests/parse/test.js +++ /dev/null @@ -1,16 +0,0 @@ -j = require('jasmine-node'); - -j.executeSpecsInFolder({ - specFolders: [process.argv[2]], - onComplete: function() { console.log("done"); }, - onError: function(err) { console.log("Require failed! ", err); }, - isVerbose: true, - showColors: true, - teamcity: false, - useRequireJs: true, - regExpSpec: false, - junitreport: false, - includeStackTrace: true, - growl: false - }); - From a549d43499431164aad4c08fe5643305688ee041 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Fri, 21 Dec 2018 09:20:49 -0500 Subject: [PATCH 006/116] Fix an issue with reassigning parameters in TRO calls [Reported via email] In the implementation of the algorithm for reassigning TRO parameters, j-vars were mixed with j-assigns, which is a type error. There was no test for this case, which has been added. The algorithm is fine as far as I can tell and test, it just needed to return JStmts, not JExprs, and do the wrapping internally for the j-assigns rather than leaving that work until later. --- src/arr/compiler/anf-loop-compiler.arr | 8 ++++---- src/arr/compiler/concat-lists.arr | 16 +++++++++++++--- tests/pyret/regression.arr | 1 + .../regression/get-assignments-var-as-expr.arr | 14 ++++++++++++++ 4 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 tests/pyret/regression/get-assignments-var-as-expr.arr diff --git a/src/arr/compiler/anf-loop-compiler.arr b/src/arr/compiler/anf-loop-compiler.arr index 8e71907a47..e25e2b275a 100644 --- a/src/arr/compiler/anf-loop-compiler.arr +++ b/src/arr/compiler/anf-loop-compiler.arr @@ -997,7 +997,7 @@ fun is-id-occurs(target :: A.Name, e :: J.JExpr) block: found end -fun get-assignments(lst :: List, limit :: Number) -> {List; List}: +fun get-assignments(lst :: List, limit :: Number) -> {List; List}: doc: ``` Find an order of assignment statements in `lst` that avoid new variables where `limit` is the number of round-robin attempts allowed. @@ -1024,7 +1024,7 @@ fun get-assignments(lst :: List, limit :: Number) -> {List; Li if limit == 0: tmp-arg = fresh-id(compiler-name('tmp_asgn')) {pre; post} = get-assignments(rest, rest.length()) - {link(j-var(tmp-arg, actual), pre); link(j-assign(formal, j-id(tmp-arg)), post)} + {link(j-var(tmp-arg, actual), pre); link(j-expr(j-assign(formal, j-id(tmp-arg))), post)} else: occurs-any = for any(next-asgn :: J.JExpr%(is-j-assign) from rest): is-id-occurs(formal, next-asgn.rhs) @@ -1033,7 +1033,7 @@ fun get-assignments(lst :: List, limit :: Number) -> {List; Li get-assignments(rest + [list: asgn], limit - 1) else: {pre; post} = get-assignments(rest, rest.length()) - {link(asgn, pre); post} + {link(j-expr(asgn), pre); post} end end end @@ -1065,7 +1065,7 @@ fun compile-split-app(l, compiler, opt-dest, f, args, opt-body, app-info, is-def j-block([clist: j-expr(j-dot-assign(RUNTIME, "EXN_STACKHEIGHT", j-num(0))), j-expr(j-assign(ans, rt-method("makeCont", cl-empty)))]))] + - CL.map_list(j-expr, pre + post) + + CL.from_list(pre + post) + # CL.map_list2( # lam(compiled-arg, arg): # console-log([clist: j-str(tostring(arg)), j-id(arg)]) diff --git a/src/arr/compiler/concat-lists.arr b/src/arr/compiler/concat-lists.arr index e12d532d61..56141bdfd9 100644 --- a/src/arr/compiler/concat-lists.arr +++ b/src/arr/compiler/concat-lists.arr @@ -238,6 +238,16 @@ fun map_list2(f :: (a, b -> c), l1 :: List, l2 :: List) -> Concat end end -# check: -# [clist: 1, 2, 3] is concat-cons(1, concat-cons(2, concat-singleton(3))) -# end +fun from_list(l :: List): + doc: "Returns a List version of this catenable list" + if is-empty(l): + concat-empty + else: + concat-cons(l.first, from_list(l.rest)) + end +end + +check: + # [clist: 1, 2, 3] is concat-cons(1, concat-cons(2, concat-singleton(3))) + nothing +end diff --git a/tests/pyret/regression.arr b/tests/pyret/regression.arr index f29e5457c6..751da1d55b 100644 --- a/tests/pyret/regression.arr +++ b/tests/pyret/regression.arr @@ -23,3 +23,4 @@ import file("./regression/escaping-module-uris.arr") as _ import file("./regression/tail-recursion-arg-order.arr") as _ import file("./regression/flat-refinement.arr") as _ import file("./regression/parens-after-comments.arr") as _ +import file("./regression/get-assignments-var-as-expr.arr") as _ diff --git a/tests/pyret/regression/get-assignments-var-as-expr.arr b/tests/pyret/regression/get-assignments-var-as-expr.arr new file mode 100644 index 0000000000..ba8c928746 --- /dev/null +++ b/tests/pyret/regression/get-assignments-var-as-expr.arr @@ -0,0 +1,14 @@ +var zs = empty +fun f(x, y, z) block: + zs := link(z, zs) + if z == 12: + x + y + z + else: + f(y, x, y) + end +end + +check: + f(12, 11, 14) is 35 + zs is [list: 12, 11, 14] +end From 5c5720bc4e233dbbee5b0b8db357762297bd32eb Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Fri, 21 Dec 2018 09:42:04 -0500 Subject: [PATCH 007/116] comment out to comply with new WF rule --- src/arr/compiler/concat-lists.arr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/arr/compiler/concat-lists.arr b/src/arr/compiler/concat-lists.arr index 56141bdfd9..6d2ea1b0d6 100644 --- a/src/arr/compiler/concat-lists.arr +++ b/src/arr/compiler/concat-lists.arr @@ -247,7 +247,7 @@ fun from_list(l :: List): end end -check: +#check: # [clist: 1, 2, 3] is concat-cons(1, concat-cons(2, concat-singleton(3))) - nothing -end +# nothing +#end From a0532eaf346107e6fce44efa4a88abc2f508b631 Mon Sep 17 00:00:00 2001 From: Ben Lerner Date: Tue, 5 Mar 2019 17:37:25 -0500 Subject: [PATCH 008/116] Fixing #1441 --- src/arr/compiler/well-formed.arr | 11 +++++++++-- tests/pyret/tests/test-well-formed.arr | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/arr/compiler/well-formed.arr b/src/arr/compiler/well-formed.arr index afeacbb60d..53ea39f24b 100644 --- a/src/arr/compiler/well-formed.arr +++ b/src/arr/compiler/well-formed.arr @@ -596,8 +596,11 @@ well-formed-visitor = A.default-iter-visitor.{ end end, method s-user-block(self, l :: Loc, body :: A.Expr) block: + old-pbl = parent-block-loc parent-block-loc := l - body.visit(self) + ans = body.visit(self) + parent-block-loc := old-pbl + ans end, method s-tuple-bind(self, l, fields, as-name) block: true @@ -852,10 +855,14 @@ well-formed-visitor = A.default-iter-visitor.{ ans end, method s-for(self, l, iterator, bindings, ann, body, blocky) block: + old-pbl = parent-block-loc + parent-block-loc := l when not(blocky): wf-blocky-blocks(l, [list: body]) end - iterator.visit(self) and lists.all(_.visit(self), bindings) and ann.visit(self) and body.visit(self) + ans = iterator.visit(self) and lists.all(_.visit(self), bindings) and ann.visit(self) and body.visit(self) + parent-block-loc := old-pbl + ans end, method s-frac(self, l, num, den) block: when den == 0: diff --git a/tests/pyret/tests/test-well-formed.arr b/tests/pyret/tests/test-well-formed.arr index b23c3d7afd..1e31c9dcc7 100644 --- a/tests/pyret/tests/test-well-formed.arr +++ b/tests/pyret/tests/test-well-formed.arr @@ -119,6 +119,8 @@ check "malformed blocks": "10") satisfies CS.is-block-needed + c("for map(): end") satisfies CS.is-wf-empty-block + run-str("lam(): x = 5 end") is%(output) compile-error(CS.is-block-ending) run-str("lam(): var x = 5 end") is%(output) compile-error(CS.is-block-ending) run-str("lam(): fun f(): nothing end end") is%(output) compile-error(CS.is-block-ending) From d959027670ddf567dd328a52f5a3b2f0581b9958 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Fri, 21 Jun 2019 08:55:37 -0700 Subject: [PATCH 009/116] table-from-column --- src/arr/trove/tables.arr | 8 ++++++++ tests/pyret/tests/test-tables.arr | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/arr/trove/tables.arr b/src/arr/trove/tables.arr index c9ca4e76a1..0ab70252db 100644 --- a/src/arr/trove/tables.arr +++ b/src/arr/trove/tables.arr @@ -93,3 +93,11 @@ table-from-rows = { make4: lam(t1, t2, t3, t4): table-from-raw-array([raw-array: t1, t2, t3, t4]) end, make5: lam(t1, t2, t3, t4, t5): table-from-raw-array([raw-array: t1, t2, t3, t4, t5]) end, } + +table-from-column :: String, List -> Table +fun table-from-column(col-name, values): + rows = for map(v from values): + raw-row.make([raw-array: {col-name; v}]) + end + table-from-rows.make(raw-array-from-list(rows)) +end diff --git a/tests/pyret/tests/test-tables.arr b/tests/pyret/tests/test-tables.arr index da33adaadc..658e0406f3 100644 --- a/tests/pyret/tests/test-tables.arr +++ b/tests/pyret/tests/test-tables.arr @@ -685,3 +685,18 @@ check "table-from-rows": end +check "table-from-column": + col1 = range(0, 100) + col2 = range(500, 600) + col3 = range(1000, 1100) + + t = TS.table-from-column("a", col1).add-column("b", col2).add-column("c", col3) + + t.length() is 100 + t.column-names() is [list: "a", "b", "c"] + cs = t.all-columns() + cs.get(0) is col1 + cs.get(1) is col2 + cs.get(2) is col3 + cs.length() is 3 +end From 2fa257174ae582673abbd0a5bc91732d5b35e1e0 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Fri, 21 Jun 2019 09:06:55 -0700 Subject: [PATCH 010/116] use old contract syntax (need a bootstrap for parameterics in standalones) --- src/arr/trove/tables.arr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arr/trove/tables.arr b/src/arr/trove/tables.arr index 0ab70252db..29593280de 100644 --- a/src/arr/trove/tables.arr +++ b/src/arr/trove/tables.arr @@ -94,10 +94,10 @@ table-from-rows = { make5: lam(t1, t2, t3, t4, t5): table-from-raw-array([raw-array: t1, t2, t3, t4, t5]) end, } -table-from-column :: String, List -> Table -fun table-from-column(col-name, values): +fun table-from-column(col-name :: String, values :: List) -> Table: rows = for map(v from values): raw-row.make([raw-array: {col-name; v}]) end table-from-rows.make(raw-array-from-list(rows)) end + From c1bd42ad862dccfb4f0a51edc96b1de4d00a176b Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Fri, 21 Jun 2019 09:24:42 -0700 Subject: [PATCH 011/116] fix tests, add constructor form for table-from-columns (plural) --- src/arr/trove/tables.arr | 32 ++++++++++++++++ tests/pyret/tests/test-tables.arr | 64 ++++++++++++++++++++++++++++--- 2 files changed, 91 insertions(+), 5 deletions(-) diff --git a/src/arr/trove/tables.arr b/src/arr/trove/tables.arr index 29593280de..842f39a32a 100644 --- a/src/arr/trove/tables.arr +++ b/src/arr/trove/tables.arr @@ -101,3 +101,35 @@ fun table-from-column(col-name :: String, values :: List) -> Table: table-from-rows.make(raw-array-from-list(rows)) end + + +table-from-cols :: RawArray<{String; List}> -> Table +fun table-from-cols(colspecs): + if raw-array-length(colspecs) == 0: + raise("table-from-columns requires at least one column") + else: + {name; vals} = raw-array-get(colspecs, 0) + for raw-array-fold(t from table-from-column(name, vals), c from colspecs, i from 1): + if i == 0: t + else: + {cname; cvals} = c + t.add-column(cname, cvals) + end + end + end +end + + +table-from-columns = { + make: table-from-cols, + make0: lam(): table-from-cols([raw-array:]) end, + make1: lam(t): table-from-cols([raw-array: t]) end, + make2: lam(t1, t2): table-from-cols([raw-array: t1, t2]) end, + make3: lam(t1, t2, t3): table-from-cols([raw-array: t1, t2, t3]) end, + make4: lam(t1, t2, t3, t4): table-from-cols([raw-array: t1, t2, t3, t4]) end, + make5: lam(t1, t2, t3, t4, t5): table-from-cols([raw-array: t1, t2, t3, t4, t5]) end, +} + + + + diff --git a/tests/pyret/tests/test-tables.arr b/tests/pyret/tests/test-tables.arr index 658e0406f3..b3bdd8c794 100644 --- a/tests/pyret/tests/test-tables.arr +++ b/tests/pyret/tests/test-tables.arr @@ -685,12 +685,14 @@ check "table-from-rows": end -check "table-from-column": - col1 = range(0, 100) - col2 = range(500, 600) - col3 = range(1000, 1100) +table-from-column = TS.table-from-column +table-from-columns = TS.table-from-columns +col1 = range(0, 100) +col2 = range(500, 600) +col3 = range(1000, 1100) - t = TS.table-from-column("a", col1).add-column("b", col2).add-column("c", col3) +check "table-from-column": + t = table-from-column("a", col1).add-column("b", col2).add-column("c", col3) t.length() is 100 t.column-names() is [list: "a", "b", "c"] @@ -700,3 +702,55 @@ check "table-from-column": cs.get(2) is col3 cs.length() is 3 end + + +check: + [table-from-columns:] raises "requires at least one" +end +check: + tfc1 = [table-from-columns: {"a"; col1}] + tfc1.column-names() is [list: "a"] + cs = tfc1.all-columns() + cs.get(0) is col1 + cs.length() is 1 +end +check: + tfc2 = [table-from-columns: {"a"; col1}, {"b"; col2}] + tfc2.column-names() is [list: "a", "b"] + cs = tfc2.all-columns() + cs.get(0) is col1 + cs.get(1) is col2 + + cs.length() is 2 +end +check: + tfc3 = [table-from-columns: {"a"; col1}, {"b"; col2}, {"c"; col3}] + tfc3.column-names() is [list: "a", "b", "c"] + cs = tfc3.all-columns() + cs.get(0) is col1 + cs.get(1) is col2 + cs.get(2) is col3 + cs.length() is 3 +end +check: + tfc4 = [table-from-columns: {"a"; col1}, {"b"; col2}, {"c"; col3}, {"d"; col2}] + tfc4.column-names() is [list: "a", "b", "c", "d"] + cs = tfc4.all-columns() + cs.get(0) is col1 + cs.get(1) is col2 + cs.get(2) is col3 + cs.get(3) is col2 + cs.length() is 4 +end +check: + tfc5 = [table-from-columns: {"a"; col1}, {"b"; col2}, {"c"; col3}, {"d"; col2}, {"e"; col1}] + tfc5.column-names() is [list: "a", "b", "c", "d", "e"] + cs = tfc5.all-columns() + cs.get(0) is col1 + cs.get(1) is col2 + cs.get(2) is col3 + cs.get(3) is col2 + cs.get(4) is col1 + cs.length() is 5 +end + From 980eb41952c2e6c360010a48ecf247bd82b76b25 Mon Sep 17 00:00:00 2001 From: Ben Lerner Date: Wed, 17 Jul 2019 13:29:25 -0400 Subject: [PATCH 012/116] Fixing a very strange bug in the tokenizer for certain programs, e.g.: ``` import lists as L #| |# # ``` This code was using the wrong signature for `makeWSToken`, so it wasn't passing in the correct srcloc positions. (Thanks to Yanyan for finding this bug.) --- src/js/base/pyret-tokenizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/base/pyret-tokenizer.js b/src/js/base/pyret-tokenizer.js index 83c2e93bcf..e7bf80b039 100644 --- a/src/js/base/pyret-tokenizer.js +++ b/src/js/base/pyret-tokenizer.js @@ -540,7 +540,7 @@ define("pyret-base/js/pyret-tokenizer", ["jglr/jglr"], function(E) { } } if (nestingDepth === 0) { - return this.makeWSToken("COMMENT", ""/*this.str.slice(pos, this.pos)*/, line, col, pos); + return this.makeWSToken(line, col, pos); } else { var ws_loc = SrcLoc.make(line, col, pos, this.curLine, this.curCol, this.pos); return this.makeToken("UNTERMINATED-BLOCK-COMMENT", this.str.slice(pos, this.pos), ws_loc, tok_spec); From 8da6c42976ac9ca3adbd52ca0f364b6922095df6 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Tue, 30 Jul 2019 14:41:40 -0700 Subject: [PATCH 013/116] Refactor compile-module to avoid calculating provides on bogus programs, which causes exceptions rather than reporting the compile errors [fixes #1332, fixes #1013, fixes #815] Co-authored-by: Ben Lerner --- src/arr/compiler/compile-lib.arr | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/arr/compiler/compile-lib.arr b/src/arr/compiler/compile-lib.arr index 85d2777798..85ea4eb920 100644 --- a/src/arr/compiler/compile-lib.arr +++ b/src/arr/compiler/compile-lib.arr @@ -405,7 +405,7 @@ fun compile-module(locator :: Locator, provide-map :: SD.StringDict, module end } else: add-phase("Resolved names", named-result) - var provides = AU.get-named-provides(named-result, locator.uri(), env) + var provides = dummy-provides(locator.uri()) # Once name resolution has happened, any newly-created s-binds must be added to bindings... var desugared = D.desugar(named-result.ast) named-result.bindings.merge-now(desugared.new-binds) @@ -413,7 +413,9 @@ fun compile-module(locator :: Locator, provide-map :: SD.StringDict, module any-errors := RS.check-unbound-ids-bad-assignments(desugared.ast, named-result, env) add-phase("Fully desugared", desugared.ast) var type-checked = - if options.type-check: + if is-link(any-errors): + CS.err(any-errors) + else if options.type-check: type-checked = T.type-check(desugared.ast, env, modules) if CS.is-ok(type-checked) block: provides := AU.get-typed-provides(type-checked.code, locator.uri(), env) @@ -439,21 +441,14 @@ fun compile-module(locator :: Locator, provide-map :: SD.StringDict, module .visit(AU.set-recursive-visitor) .visit(AU.set-tail-visitor) add-phase("Cleaned AST", cleaned) - {final-provides; cr} = if is-empty(any-errors): - JSP.trace-make-compiled-pyret(add-phase, cleaned, env, named-result.bindings, named-result.type-bindings, provides, options) - else: - if options.collect-all and options.ignore-unbound: - JSP.trace-make-compiled-pyret(add-phase, cleaned, env, options) - else: - {provides; add-phase("Result", CS.err(unique(any-errors)))} - end - end + provides := AU.get-named-provides(named-result, locator.uri(), env) + {final-provides; cr} = JSP.trace-make-compiled-pyret(add-phase, cleaned, env, named-result.bindings, named-result.type-bindings, provides, options) cleaned := nothing canonical-provides = AU.canonicalize-provides(final-provides, env) mod-result = module-as-string(canonical-provides, env, cr) {mod-result; if options.collect-all or options.collect-times: ret.tolist() else: empty end} | err(_) => - { module-as-string(dummy-provides(locator.uri()), env, type-checked); + { module-as-string(provides, env, type-checked); if options.collect-all or options.collect-times: phase("Result", type-checked, time-now(), ret).tolist() else: empty From 392fc9365719e3b71067be0bc9c7dfd08c120770 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Tue, 30 Jul 2019 16:48:56 -0700 Subject: [PATCH 014/116] these tests are now caught but unbound-ids-bad-assignments earlier in the pipeline --- tests/type-check/bad/no-such-module.arr | 2 -- tests/type-check/bad/not-var.arr | 2 -- 2 files changed, 4 deletions(-) delete mode 100644 tests/type-check/bad/no-such-module.arr delete mode 100644 tests/type-check/bad/not-var.arr diff --git a/tests/type-check/bad/no-such-module.arr b/tests/type-check/bad/no-such-module.arr deleted file mode 100644 index e0d7f3c985..0000000000 --- a/tests/type-check/bad/no-such-module.arr +++ /dev/null @@ -1,2 +0,0 @@ - -a :: B.Number = 5 diff --git a/tests/type-check/bad/not-var.arr b/tests/type-check/bad/not-var.arr deleted file mode 100644 index a911648192..0000000000 --- a/tests/type-check/bad/not-var.arr +++ /dev/null @@ -1,2 +0,0 @@ -a = 5 -a := 6 From da91ba21f3e8be0cc5632d3bbcb1723ad37017d5 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Tue, 30 Jul 2019 21:13:43 -0700 Subject: [PATCH 015/116] fix previous refactoring; get-typed-provides needs to be in this context to have all the relevant information --- src/arr/compiler/compile-lib.arr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/arr/compiler/compile-lib.arr b/src/arr/compiler/compile-lib.arr index 85ea4eb920..f0c8f36e06 100644 --- a/src/arr/compiler/compile-lib.arr +++ b/src/arr/compiler/compile-lib.arr @@ -431,7 +431,6 @@ fun compile-module(locator :: Locator, provide-map :: SD.StringDict, module cases(CS.CompileResult) type-checked block: | ok(_) => var tc-ast = type-checked.code - type-checked := nothing var dp-ast = DP.desugar-post-tc(tc-ast, env) tc-ast := nothing var cleaned = dp-ast @@ -441,7 +440,9 @@ fun compile-module(locator :: Locator, provide-map :: SD.StringDict, module .visit(AU.set-recursive-visitor) .visit(AU.set-tail-visitor) add-phase("Cleaned AST", cleaned) - provides := AU.get-named-provides(named-result, locator.uri(), env) + when not(options.type-check) block: + provides := AU.get-named-provides(named-result, locator.uri(), env) + end {final-provides; cr} = JSP.trace-make-compiled-pyret(add-phase, cleaned, env, named-result.bindings, named-result.type-bindings, provides, options) cleaned := nothing canonical-provides = AU.canonicalize-provides(final-provides, env) From 2af42d6c8fd44d329f95b83141f5c777df52f44f Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Wed, 31 Jul 2019 08:57:48 -0700 Subject: [PATCH 016/116] make sure to unique-ify the errors, as in other places --- src/arr/compiler/compile-lib.arr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arr/compiler/compile-lib.arr b/src/arr/compiler/compile-lib.arr index f0c8f36e06..0b407d161b 100644 --- a/src/arr/compiler/compile-lib.arr +++ b/src/arr/compiler/compile-lib.arr @@ -414,7 +414,7 @@ fun compile-module(locator :: Locator, provide-map :: SD.StringDict, module add-phase("Fully desugared", desugared.ast) var type-checked = if is-link(any-errors): - CS.err(any-errors) + CS.err(unique(any-errors)) else if options.type-check: type-checked = T.type-check(desugared.ast, env, modules) if CS.is-ok(type-checked) block: From f356b40de22f51db38435946344911fda226e832 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Mon, 26 Aug 2019 08:57:53 -0700 Subject: [PATCH 017/116] add stdev-sample (#1475) --- src/arr/trove/statistics.arr | 11 +++++++++++ tests/pyret/tests/test-statistics.arr | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/arr/trove/statistics.arr b/src/arr/trove/statistics.arr index 6d387e3903..2b21a3e956 100644 --- a/src/arr/trove/statistics.arr +++ b/src/arr/trove/statistics.arr @@ -9,6 +9,7 @@ provide { mode-largest: mode-largest, mode-any: mode-any, stdev: stdev, + stdev-sample: stdev-sample, linear-regression: linear-regression, r-squared: r-squared } end @@ -150,6 +151,16 @@ fun stdev(l :: List) -> Number: num-sqrt(sq-mean) end +fun stdev-sample(l :: List) -> Number: + doc: ```returns the standard deviation of the list + of numbers, or raises an error if the list is empty``` + len = l.length() + reg-mean = mean(l) + sq-diff = l.map(lam(k): num-expt((k - reg-mean), 2) end) + sq-mean = math.sum(sq-diff) / (len - 1) + num-sqrt(sq-mean) +end + fun linear-regression(x :: List, y :: List) -> (Number -> Number): doc: "returns a linear predictor function calculated with ordinary least squares regression" if x.length() <> y.length(): diff --git a/tests/pyret/tests/test-statistics.arr b/tests/pyret/tests/test-statistics.arr index 5157312fe4..4f028f4d1b 100644 --- a/tests/pyret/tests/test-statistics.arr +++ b/tests/pyret/tests/test-statistics.arr @@ -54,6 +54,11 @@ check "numeric helpers": stdev([list: 3, 4, 5, 6, 7]) is%(within(0.01)) 1.41 stdev([list: 1, 1, 1, 1]) is-roughly ~0 stdev([list:]) raises "empty" + + stdev-sample([list: 3, 4, 5, 6, 7]) is%(within(0.01)) num-sqrt(10 / 4) + stdev-sample([list: 3]) raises "division by zero" + stdev-sample([list: 1, 1, 1, 1]) is-roughly ~0 + stdev-sample([list:]) raises "empty" end From 2316d78dd9c1c2e3bd0b8f428fd46b2d3c909ab3 Mon Sep 17 00:00:00 2001 From: Emmanuel Schanzer Date: Tue, 27 Aug 2019 14:58:42 -0400 Subject: [PATCH 018/116] add runtime function for fast sorting of numbers, and use it to speed up stats library --- src/arr/trove/statistics.arr | 40 +++++++++++++++++++----------------- src/js/base/runtime.js | 9 ++++++++ src/js/trove/global.js | 5 +++++ 3 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/arr/trove/statistics.arr b/src/arr/trove/statistics.arr index 6d387e3903..e5de71ffdb 100644 --- a/src/arr/trove/statistics.arr +++ b/src/arr/trove/statistics.arr @@ -30,40 +30,42 @@ end fun median(l :: List) -> Number: doc: "returns the median element of the list" + block: + when(is-empty(l)): + raise(E.generic-type-mismatch(l, "Non-Empty list")) + end - fun is-odd(n :: Number) -> Boolean: - num-modulo(n, 2) == 1 - end - - sorted = l.sort() - size = length(sorted) - index-of-median = num-floor(size / 2) - cases (List) sorted: - | empty => raise(E.message-exception("The input list is empty")) - | link(first, rest) => - if is-odd(size): - sorted.get(index-of-median) + sorted = builtins.raw-array-sort-nums(raw-array-from-list(l), true) + size = raw-array-length(sorted) + index-of-median = num-floor(size / 2) + if size == 0: raise(E.message-exception("The input list is empty")) + else: + if num-modulo(size, 2) == 1: + raw-array-get(sorted, index-of-median) else: - (sorted.get(index-of-median) + sorted.get(index-of-median - 1)) / 2 + (raw-array-get(sorted, index-of-median) + raw-array-get(sorted, index-of-median - 1)) / 2 end + end end end fun group-and-count(l :: List) -> List<{Number; Number}> block: doc: "Returns a list of all the values in the list, together with their counts, sorted descending by value" - nums-sorted = l.sort() - cases(List) nums-sorted: - | empty => empty - | link(first, rest) => - {front; acc} = for fold({{cur; count}; lst} from {{first; 1}; empty}, n from rest): + sorted = builtins.raw-array-sort-nums(raw-array-from-list(l), true) + size = raw-array-length(sorted) + + if size == 0: empty + else: + first = raw-array-get(sorted, 0) + {front; acc} = for raw-array-fold({{cur; count}; lst} from {{first; 0}; empty}, n from sorted, _ from 0): if within(~0.0)(cur, n): {{cur; count + 1}; lst} else: {{n; 1}; link({cur; count}, lst)} end end - link(front, acc) + link(front, acc) end end diff --git a/src/js/base/runtime.js b/src/js/base/runtime.js index 2c3e17fa70..c0c120ed3f 100644 --- a/src/js/base/runtime.js +++ b/src/js/base/runtime.js @@ -4138,6 +4138,13 @@ function (Namespace, jsnums, codePoint, util, exnStackParser, loader, seedrandom return arr[ix]; }; + var raw_array_sort_nums = function(arr, asc) { + if (arguments.length !== 2) { var $a=new Array(arguments.length); for (var $i=0;$i Date: Tue, 3 Sep 2019 14:06:22 -0400 Subject: [PATCH 019/116] fix bug in array sorting, and make test suite for median more robust --- src/arr/trove/statistics.arr | 2 +- src/js/base/runtime.js | 4 +++- tests/pyret/tests/test-statistics.arr | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/arr/trove/statistics.arr b/src/arr/trove/statistics.arr index 14efceeec9..2532a39401 100644 --- a/src/arr/trove/statistics.arr +++ b/src/arr/trove/statistics.arr @@ -53,7 +53,7 @@ end fun group-and-count(l :: List) -> List<{Number; Number}> block: doc: "Returns a list of all the values in the list, together with their counts, sorted descending by value" - sorted = builtins.raw-array-sort-nums(raw-array-from-list(l), true) + sorted = builtins.raw-array-sort-nums(raw-array-from-list(l), false) size = raw-array-length(sorted) if size == 0: empty diff --git a/src/js/base/runtime.js b/src/js/base/runtime.js index c0c120ed3f..40ba606e8b 100644 --- a/src/js/base/runtime.js +++ b/src/js/base/runtime.js @@ -4141,7 +4141,9 @@ function (Namespace, jsnums, codePoint, util, exnStackParser, loader, seedrandom var raw_array_sort_nums = function(arr, asc) { if (arguments.length !== 2) { var $a=new Array(arguments.length); for (var $i=0;$i jsnums.lessThan(x,y)? 1 : jsnums.roughlyEquals(x, y, 0)? 0 : -1; + const wrappedGT = (x, y) => jsnums.greaterThan(x,y)? 1 : jsnums.roughlyEquals(x, y, 0)? 0 : -1; + arr.sort(asc? wrappedLT : wrappedGT); return arr; }; diff --git a/tests/pyret/tests/test-statistics.arr b/tests/pyret/tests/test-statistics.arr index 4f028f4d1b..46e4502f67 100644 --- a/tests/pyret/tests/test-statistics.arr +++ b/tests/pyret/tests/test-statistics.arr @@ -1,5 +1,6 @@ import equality as E include statistics +import lists as L check "numeric helpers": @@ -17,11 +18,11 @@ check "numeric helpers": median([list: 1, ~1, ~1]) is-roughly ~1 # Even numbered lists - median([list: ]) raises "empty" + median([list: ]) raises "Non-Empty list" median([list: -1, 1]) is 0 - median([list: 1, 2, 3, 4]) is 2.5 - median([list: -1, 0, ~2, 3]) is-roughly ~1 - median([list: ~0, ~1, ~2, ~2, ~6, ~8]) is-roughly ~2 + median(L.shuffle([list: 1, 2, 3, 4])) is 2.5 + median(L.shuffle([list: -1, 0, ~2, 3])) is-roughly ~1 + median(L.shuffle([list: ~0, ~1, ~2, ~2, ~6, ~8])) is-roughly ~2 # Mode has-mode([list: ]) is false From 9ebd42dd88d34bf9c51918b7c79d94ca53f861b7 Mon Sep 17 00:00:00 2001 From: ayazhafiz Date: Mon, 9 Sep 2019 10:21:28 -0500 Subject: [PATCH 020/116] fix: properly parse octal escape sequences MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1480. Currently, octal escape sequences are parsed incorrectly because the sequence is evaluated only partially. The "\" delimiter in an octal sequence like "\101" is already siphoned off during escape sequence matching, so it is enough to simply parse the match of the numeric sequence "101". --- src/js/base/pyret-tokenizer.js | 2 +- tests/parse/parse.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/js/base/pyret-tokenizer.js b/src/js/base/pyret-tokenizer.js index e7bf80b039..711f2c7eb7 100644 --- a/src/js/base/pyret-tokenizer.js +++ b/src/js/base/pyret-tokenizer.js @@ -62,7 +62,7 @@ define("pyret-base/js/pyret-tokenizer", ["jglr/jglr"], function(E) { else if (esc === "\\") { ret += "\\"; } else if (esc[0] === 'u') { ret += String.fromCharCode(parseInt(esc.slice(1), 16)); } else if (esc[0] === 'x') { ret += String.fromCharCode(parseInt(esc.slice(1), 16)); } - else { ret += String.fromCharCode(parseInt(esc.slice(2), 8)); } + else { ret += String.fromCharCode(parseInt(esc, 8)); } match = escapes.exec(s); } ret += s; diff --git a/tests/parse/parse.js b/tests/parse/parse.js index 1613064b12..9838d6d0ca 100644 --- a/tests/parse/parse.js +++ b/tests/parse/parse.js @@ -762,6 +762,14 @@ R(["pyret-base/js/pyret-tokenizer", "pyret-base/js/pyret-parser", "fs"], functio expect(parse("spy \"five\": x end")).not.toBe(false); expect(parse("spy \"five\": x: 5 end")).not.toBe(false); }); + + it("should parse octal escape squences", function() { + expect(parse("\\0")).toBe(""); + expect(parse("\\101")).toBe("A"); + expect(parse("\\101bc")).toBe("Abc"); + expect(parse("\\77")).toBe("?"); + expect(parse("\\88")).toBe("88"); + }); }); jazz.execute(); From 7656aa31430dabd81cb5e630258477ae23076f99 Mon Sep 17 00:00:00 2001 From: ayazhafiz Date: Mon, 9 Sep 2019 13:45:27 -0500 Subject: [PATCH 021/116] fixup! fix: properly parse octal escape sequences --- tests/parse/parse.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/parse/parse.js b/tests/parse/parse.js index 9838d6d0ca..ebadc4813d 100644 --- a/tests/parse/parse.js +++ b/tests/parse/parse.js @@ -764,11 +764,16 @@ R(["pyret-base/js/pyret-tokenizer", "pyret-base/js/pyret-parser", "fs"], functio }); it("should parse octal escape squences", function() { - expect(parse("\\0")).toBe(""); - expect(parse("\\101")).toBe("A"); - expect(parse("\\101bc")).toBe("Abc"); - expect(parse("\\77")).toBe("?"); - expect(parse("\\88")).toBe("88"); + expect(parse("a = '\\0'").toString()).toContain(stringAst('\\u0000')); + expect(parse("a = '\\101'").toString()).toContain(stringAst('A')); + expect(parse("a = '\\101bc'").toString()).toContain(stringAst('Abc')); + expect(parse("a = '\\77'").toString()).toContain(stringAst('?')); + + expect(parse("a = '\\88'")).toBe(false); + + function stringAst(str) { + return `'STRING "'${str}'"`; + } }); }); From ee8da84668140a0c0c745e21852fb9fe54d1c35f Mon Sep 17 00:00:00 2001 From: ayazhafiz Date: Mon, 9 Sep 2019 15:34:39 -0500 Subject: [PATCH 022/116] fixup! fix: properly parse octal escape sequences --- tests/parse/parse.js | 30 +++++++++++++++++------------- tests/pyret/tests/test-strings.arr | 5 +++++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/tests/parse/parse.js b/tests/parse/parse.js index ebadc4813d..eb45e25371 100644 --- a/tests/parse/parse.js +++ b/tests/parse/parse.js @@ -226,6 +226,23 @@ R(["pyret-base/js/pyret-tokenizer", "pyret-base/js/pyret-parser", "fs"], functio expect(parse("```asd``\\````")).not.toBe(false); expect(parse("```asd```asd```")).toBe(false); }); + + it('should lex octal escape sequences', function() { + const escapeSequences = ['\\0', '\\77', '\\101']; + const expectedSequences = ['0', '77', '101']; + for (let i = 0; i < escapeSequences.length; ++i) { + const expectedValues = ['\\', expectedSequences[i], undefined]; + + const lexedValues = lex(escapeSequences[i]).map(token => token.value); + expect(lexedValues).toEqual(expectedValues); + + const parseStr = `str = "${escapeSequences[i]}"`; + expect(parse(parseStr)).not.toBe(false); + } + + // invalid escape sequence + expect(parse('str = \'\\8\'')).toBe(false); + }); }); describe("parsing", function() { it("should parse lets and letrecs", function() { @@ -762,19 +779,6 @@ R(["pyret-base/js/pyret-tokenizer", "pyret-base/js/pyret-parser", "fs"], functio expect(parse("spy \"five\": x end")).not.toBe(false); expect(parse("spy \"five\": x: 5 end")).not.toBe(false); }); - - it("should parse octal escape squences", function() { - expect(parse("a = '\\0'").toString()).toContain(stringAst('\\u0000')); - expect(parse("a = '\\101'").toString()).toContain(stringAst('A')); - expect(parse("a = '\\101bc'").toString()).toContain(stringAst('Abc')); - expect(parse("a = '\\77'").toString()).toContain(stringAst('?')); - - expect(parse("a = '\\88'")).toBe(false); - - function stringAst(str) { - return `'STRING "'${str}'"`; - } - }); }); jazz.execute(); diff --git a/tests/pyret/tests/test-strings.arr b/tests/pyret/tests/test-strings.arr index fb193fa7ee..2fdced6acb 100644 --- a/tests/pyret/tests/test-strings.arr +++ b/tests/pyret/tests/test-strings.arr @@ -137,6 +137,11 @@ check: string-to-code-points("abcd") is [list: 97, 98, 99, 100] string-to-code-points("") is [list:] + # octal escape sequences + string-to-code-point("\0") is 0 + string-to-code-point("\77") is 63 + string-to-code-point("\101") is 65 + string-from-code-points([list: 955, 97, 10]) is "λa\n" string-from-code-points([list: 955, -1]) raises "Natural Number" string-from-code-points([list:]) is "" From 1cdf264ec24611b678ca91e736e00ac08871bc94 Mon Sep 17 00:00:00 2001 From: ayazhafiz Date: Mon, 9 Sep 2019 16:33:16 -0500 Subject: [PATCH 023/116] fixup! fix: properly parse octal escape sequences --- tests/parse/parse.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/parse/parse.js b/tests/parse/parse.js index eb45e25371..a1fd834bf9 100644 --- a/tests/parse/parse.js +++ b/tests/parse/parse.js @@ -228,20 +228,20 @@ R(["pyret-base/js/pyret-tokenizer", "pyret-base/js/pyret-parser", "fs"], functio }); it('should lex octal escape sequences', function() { - const escapeSequences = ['\\0', '\\77', '\\101']; - const expectedSequences = ['0', '77', '101']; + const escapeSequences = ["'\\0'", "'\\77'", "'\\101'"]; + const expectedValues = ["'\0'", "'?'", "'A'"]; for (let i = 0; i < escapeSequences.length; ++i) { - const expectedValues = ['\\', expectedSequences[i], undefined]; + const tokens = lex(escapeSequences[i]); + expect(tokens.length).toBe(2); + expect(tokens[0].value).toBe(expectedValues[i]); + expect(tokens[1].name).toBe("EOF"); - const lexedValues = lex(escapeSequences[i]).map(token => token.value); - expect(lexedValues).toEqual(expectedValues); - - const parseStr = `str = "${escapeSequences[i]}"`; + const parseStr = `str = ${escapeSequences[i]}`; expect(parse(parseStr)).not.toBe(false); } // invalid escape sequence - expect(parse('str = \'\\8\'')).toBe(false); + expect(parse("str = '\\8'")).toBe(false); }); }); describe("parsing", function() { From c5294391b36fa73bd3f46dfd0e96bf546fc90cad Mon Sep 17 00:00:00 2001 From: Liye Zhong Date: Sun, 15 Sep 2019 10:19:02 -0400 Subject: [PATCH 024/116] add sound demo --- SPGo.json | 0 ide/src/Interaction.tsx | 9 ++- ide/src/Sound.tsx | 17 ++++++ package-lock.json | 10 ++++ package.json | 4 +- src/arr/compiler/dependency-tree.js | 90 ++++++++++++++--------------- src/runtime/sound.arr.json | 15 +++++ src/runtime/sound.arr.ts | 20 +++++++ src/webworker/runner.ts | 4 +- 9 files changed, 121 insertions(+), 48 deletions(-) create mode 100644 SPGo.json create mode 100644 ide/src/Sound.tsx create mode 100644 src/runtime/sound.arr.json create mode 100644 src/runtime/sound.arr.ts diff --git a/SPGo.json b/SPGo.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ide/src/Interaction.tsx b/ide/src/Interaction.tsx index f5226302d6..cb6805bff5 100644 --- a/ide/src/Interaction.tsx +++ b/ide/src/Interaction.tsx @@ -1,6 +1,7 @@ import React from 'react'; import {TableWidget} from './Table'; import {ImageWidget} from './Image'; +import {SoundWidget} from './Sound'; type InteractionProps = { name: string; @@ -36,7 +37,13 @@ export class Interaction extends React.Component ); - } else if (typeof value === 'object') { + } else if (value.$brand === "sound") { + return ( + + + ); + } + else if (typeof value === 'object') { // TODO(michael) palceholder for better object display return JSON.stringify(value); } diff --git a/ide/src/Sound.tsx b/ide/src/Sound.tsx new file mode 100644 index 0000000000..ea3bb42018 --- /dev/null +++ b/ide/src/Sound.tsx @@ -0,0 +1,17 @@ +import React from 'react'; + +type SoundWidgetProps = { + sound: any +}; +type SoundWidgetState = {}; + +export class SoundWidget extends React.Component { + constructor(props : SoundWidgetProps) { + super(props); + } + render() { + return ( + + ) + } +} diff --git a/package-lock.json b/package-lock.json index 7f2a0fc4d8..c544256af9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -716,6 +716,11 @@ "@types/node": "*" } }, + "@types/howler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@types/howler/-/howler-2.1.1.tgz", + "integrity": "sha512-YLwc9L853r85WqZk4xCiROGGodmlAYlKb0rQWABt4opLd6QHn2QLXIApa6vRNqjZxkzbiPs6eZskaRGOw5fDAA==" + }, "@types/istanbul-lib-coverage": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", @@ -4139,6 +4144,11 @@ "integrity": "sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ==", "dev": true }, + "howler": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/howler/-/howler-2.1.2.tgz", + "integrity": "sha512-oKrTFaVXsDRoB/jik7cEpWKTj7VieoiuzMYJ7E/EU5ayvmpRhumCv3YQ3823zi9VTJkSWAhbryHnlZAionGAJg==" + }, "html-encoding-sniffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", diff --git a/package.json b/package.json index 84886538ea..8b05d65a98 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@stopify/stopify": "^0.7.2", - "csv": "^5.1.1", + "@types/howler": "^2.1.1", "@types/node": "^12.0.2", "ascii-table": "~0.0.9", "benchmark": "^2.1.4", @@ -20,7 +20,9 @@ "browserify": "^14.4.0", "command-line-args": "^3.0.1", "command-line-usage": "^4.0.1", + "csv": "^5.1.1", "error-stack-parser": "^2.0.1", + "howler": "^2.1.2", "http": "0.0.0", "immutable": "^3.8.2", "js-sha256": "^0.5.0", diff --git a/src/arr/compiler/dependency-tree.js b/src/arr/compiler/dependency-tree.js index 4f5db976b1..8e12467728 100644 --- a/src/arr/compiler/dependency-tree.js +++ b/src/arr/compiler/dependency-tree.js @@ -1,53 +1,53 @@ ({ - requires: [], - provides: { - values: { - "get-dependencies": "tany" - } - }, - nativeRequires: ["module-deps", "JSONStream", "path"], - theModule: function(runtime, _, _, moduleDeps, JSONStream, path) { - function getDeps(path) { - return runtime.pauseStack(function(restarter) { + requires: [], + provides: { + values: { + "get-dependencies": "tany" + } + }, + nativeRequires: ["module-deps", "JSONStream", "path"], + theModule: function(runtime, _, _, moduleDeps, JSONStream, path) { + function getDeps(path) { + return runtime.pauseStack(function(restarter) { + + /* + * Ignore requires on node modules (only available through builtins). + * Delay resolution to runtime (where it may throw a runtime error). + * + * Needed so that required node modules are ignored in the browser when + * compiling a user's program. + * Required node modules are provided by the webpage at runtime. + */ + // TODO(alex): Make this a flag or something + let nativeRequiresToIgnore = ["assert", "immutable", "csv-parse/lib/sync", "fs", "howler"]; - /* - * Ignore requires on node modules (only available through builtins). - * Delay resolution to runtime (where it may throw a runtime error). - * - * Needed so that required node modules are ignored in the browser when - * compiling a user's program. - * Required node modules are provided by the webpage at runtime. - */ - // TODO(alex): Make this a flag or something - let nativeRequiresToIgnore = ["assert", "immutable", "csv-parse/lib/sync", "fs"]; + let opts = { + filter: function(id) { + // Return true to include as a dependency + // Return false to exclude + return !nativeRequiresToIgnore.includes(id); + } + }; - let opts = { - filter: function(id) { - // Return true to include as a dependency - // Return false to exclude - return !nativeRequiresToIgnore.includes(id); - } - }; + var tree = moduleDeps(opts); - var tree = moduleDeps(opts); - - var dataCollector = tree.pipe(JSONStream.stringify()); + var dataCollector = tree.pipe(JSONStream.stringify()); - // https://stackoverflow.com/questions/10623798/read-contents-of-node-js-stream-into-a-string-variable - const chunks = []; + // https://stackoverflow.com/questions/10623798/read-contents-of-node-js-stream-into-a-string-variable + const chunks = []; - dataCollector.on("data", function(chunk) { - chunks.push(Buffer.from(chunk, 'utf8')); - }); - dataCollector.on("end", function () { - var result = JSON.parse(String(Buffer.concat(chunks))); - var paths = result.map(x => x["file"]); - restarter.resume(paths); - }); - tree.end({ file: path }); + dataCollector.on("data", function(chunk) { + chunks.push(Buffer.from(chunk, 'utf8')); + }); + dataCollector.on("end", function() { + var result = JSON.parse(String(Buffer.concat(chunks))); + var paths = result.map(x => x["file"]); + restarter.resume(paths); + }); + tree.end({ file: path }); - }); + }); + } + return runtime.makeModuleReturn({ "get-dependencies": runtime.makeFunction(getDeps) }, {}); } - return runtime.makeModuleReturn({ "get-dependencies": runtime.makeFunction(getDeps) }, {}); - } -}) +}) \ No newline at end of file diff --git a/src/runtime/sound.arr.json b/src/runtime/sound.arr.json new file mode 100644 index 0000000000..dadaa2630c --- /dev/null +++ b/src/runtime/sound.arr.json @@ -0,0 +1,15 @@ +{ + "provides": { + "values": { + "juliet": "String", + "demo": ["arrow", ["String"], "Boolean"], + "makesound": ["arrow", ["String"], + ["local", "Sound"] + ] + }, + "datatypes": { "Sound": ["data", "Sound", [], + [], {} + ] }, + "aliases": {} + } +} \ No newline at end of file diff --git a/src/runtime/sound.arr.ts b/src/runtime/sound.arr.ts new file mode 100644 index 0000000000..058fe949b7 --- /dev/null +++ b/src/runtime/sound.arr.ts @@ -0,0 +1,20 @@ +import {Howl, Howler} from 'howler'; + +export const juliet = "helllo world"; + + + +export function demo(path: string) { + var sound = new Howl({ + src: [path] + }); + sound.play(); + return true; +} + +export function makesound(path: string) { + return { + "$brand": "sound", + "play": () => demo(path) + }; +} \ No newline at end of file diff --git a/src/webworker/runner.ts b/src/webworker/runner.ts index c47ec6e387..c3134a0945 100644 --- a/src/webworker/runner.ts +++ b/src/webworker/runner.ts @@ -3,6 +3,7 @@ const assert = require('assert'); const immutable = require('immutable'); export const stopify = require('@stopify/stopify'); const browserFS = require('./browserfs-setup.ts'); +const howler = require('howler'); (window as any)["stopify"] = stopify; @@ -13,7 +14,8 @@ const nodeModules = { 'assert': assert, 'csv-parse/lib/sync': csv, 'fs': browserFS.fs, - 'immutable': immutable + 'immutable': immutable, + 'howler': howler }; function wrapContent(content: string): string { From 75187b92acb5bbc9c936edad67096e24b3e11198 Mon Sep 17 00:00:00 2001 From: Liye Zhong Date: Sun, 15 Sep 2019 11:26:41 -0400 Subject: [PATCH 025/116] remove spgo --- SPGo.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 SPGo.json diff --git a/SPGo.json b/SPGo.json deleted file mode 100644 index e69de29bb2..0000000000 From bec3ea6f38273a6abfcd83906a8064bf2f4e8a99 Mon Sep 17 00:00:00 2001 From: soumyamahalakshmi Date: Sun, 15 Sep 2019 16:49:25 -0400 Subject: [PATCH 026/116] Converting audio to float array --- src/runtime/sound.arr.json | 2 +- src/runtime/sound.arr.ts | 47 ++++++++++++++++++++++++++++++-------- src/webworker/runner.ts | 4 +++- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/runtime/sound.arr.json b/src/runtime/sound.arr.json index dadaa2630c..719634d734 100644 --- a/src/runtime/sound.arr.json +++ b/src/runtime/sound.arr.json @@ -2,7 +2,7 @@ "provides": { "values": { "juliet": "String", - "demo": ["arrow", ["String"], "Boolean"], + "getArray": ["arrow", ["String"], "tany"], "makesound": ["arrow", ["String"], ["local", "Sound"] ] diff --git a/src/runtime/sound.arr.ts b/src/runtime/sound.arr.ts index 058fe949b7..073796c5f5 100644 --- a/src/runtime/sound.arr.ts +++ b/src/runtime/sound.arr.ts @@ -1,20 +1,49 @@ -import {Howl, Howler} from 'howler'; +import { Howl, Howler } from 'howler'; +const RUNTIME = require('./runtime.js'); export const juliet = "helllo world"; +export function getArray(path: string) { + debugger; + //@ts-ignore + var audioCtx = AudioContext(); + var source; - -export function demo(path: string) { - var sound = new Howl({ - src: [path] - }); - sound.play(); - return true; + source = audioCtx.createBufferSource(); + //@ts-ignore + var request = XMLHttpRequest(); + + request.open('GET', path, true); + + request.responseType = 'arraybuffer'; + return RUNTIME.pauseStack(function (restarter){ + request.onload = function () { + var audioData = request.response; + + audioCtx.decodeAudioData(audioData, function (buffer) { + source.buffer = buffer; + + source.connect(audioCtx.destination); + source.loop = true; + console.log(buffer.getChannelData(0)); + restarter.resume(buffer.getChannelData(0)); + }, + + function (e) { + restarter.error(new Error("Error with decoding audio data")); + }); + + } + + request.send(); + + }) } export function makesound(path: string) { return { "$brand": "sound", - "play": () => demo(path) + "play": () => { }, + "getArray": () => getArray(path) }; } \ No newline at end of file diff --git a/src/webworker/runner.ts b/src/webworker/runner.ts index c3134a0945..b8c474ef2e 100644 --- a/src/webworker/runner.ts +++ b/src/webworker/runner.ts @@ -73,7 +73,9 @@ export const makeRequireAsync = ( console: console, parseFloat, isNaN, - isFinite + isFinite, + AudioContext: () => { return new AudioContext(); }, + XMLHttpRequest: () => { return new XMLHttpRequest(); } }); runner.path = nextPath; currentRunner = runner; From e86bcd2bc5aebf4afe5fc1d9414d95c0acfe8d3c Mon Sep 17 00:00:00 2001 From: Liye Zhong Date: Mon, 16 Sep 2019 12:22:45 -0400 Subject: [PATCH 027/116] add basic urlSound functionn --- src/runtime/sound.arr.json | 14 +++++++++---- src/runtime/sound.arr.ts | 41 +++++++++++++++++++++++++++----------- 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/src/runtime/sound.arr.json b/src/runtime/sound.arr.json index 719634d734..30b06080bf 100644 --- a/src/runtime/sound.arr.json +++ b/src/runtime/sound.arr.json @@ -2,14 +2,20 @@ "provides": { "values": { "juliet": "String", - "getArray": ["arrow", ["String"], "tany"], - "makesound": ["arrow", ["String"], + "getBuffer": ["arrow", ["String"], "tany"], + "_makesound": ["arrow", ["String"], + ["local", "Sound"] + ], + "_urlSound": ["arrow", ["String"], ["local", "Sound"] ] + }, - "datatypes": { "Sound": ["data", "Sound", [], + "datatypes": { + "Sound": ["data", "Sound", [], [], {} - ] }, + ] + }, "aliases": {} } } \ No newline at end of file diff --git a/src/runtime/sound.arr.ts b/src/runtime/sound.arr.ts index 073796c5f5..15ffc97fbe 100644 --- a/src/runtime/sound.arr.ts +++ b/src/runtime/sound.arr.ts @@ -3,7 +3,7 @@ const RUNTIME = require('./runtime.js'); export const juliet = "helllo world"; -export function getArray(path: string) { +export function getBuffer(path: string):AudioBuffer { debugger; //@ts-ignore var audioCtx = AudioContext(); @@ -16,17 +16,16 @@ export function getArray(path: string) { request.open('GET', path, true); request.responseType = 'arraybuffer'; - return RUNTIME.pauseStack(function (restarter){ + return RUNTIME.pauseStack(function (restarter) { request.onload = function () { var audioData = request.response; - + audioCtx.decodeAudioData(audioData, function (buffer) { source.buffer = buffer; - source.connect(audioCtx.destination); source.loop = true; console.log(buffer.getChannelData(0)); - restarter.resume(buffer.getChannelData(0)); + restarter.resume(buffer); }, function (e) { @@ -36,14 +35,32 @@ export function getArray(path: string) { } request.send(); - + }) } -export function makesound(path: string) { - return { - "$brand": "sound", - "play": () => { }, - "getArray": () => getArray(path) - }; +function _makesound(sample_rate: number, data_array: number[]): Sound { + const sound = { + '$brand': "$sound", + 'sample-rate': sample_rate, + 'data-array': data_array, + 'play': () => playSound() + } + return sound; +} + +export function playSound() { } + +export function _urlSound(path: string): Sound { + var buffer = getBuffer(path); + var data_array = Array.from(buffer.getChannelData(0)); + var sample_rate = buffer.sampleRate; + return _makesound(sample_rate, data_array); +} + +interface Sound { + '$brand': string, + 'sample-rate': number, + 'data-array': number[], + 'play': () => any } \ No newline at end of file From 0275666b1775cb008bd8fb6134c386ff89485601 Mon Sep 17 00:00:00 2001 From: Liye Zhong Date: Tue, 24 Sep 2019 22:30:28 -0400 Subject: [PATCH 028/116] added overlay function and other changes, play function to be updated --- src/runtime/sound.arr.json | 11 +++--- src/runtime/sound.arr.ts | 73 ++++++++++++++++++++++++++++++++------ 2 files changed, 70 insertions(+), 14 deletions(-) diff --git a/src/runtime/sound.arr.json b/src/runtime/sound.arr.json index 30b06080bf..0026797b3c 100644 --- a/src/runtime/sound.arr.json +++ b/src/runtime/sound.arr.json @@ -3,13 +3,16 @@ "values": { "juliet": "String", "getBuffer": ["arrow", ["String"], "tany"], - "_makesound": ["arrow", ["String"], + "makeSound": ["arrow", ["Any", "Any", "Any"], ["local", "Sound"] ], - "_urlSound": ["arrow", ["String"], + "urlSound": ["arrow", ["String"], ["local", "Sound"] - ] - + ], + "overlay": ["arrow", ["tany"], + ["local", "Sound"] + ], + "playSound": ["arrow", ["tany"], "Any"] }, "datatypes": { "Sound": ["data", "Sound", [], diff --git a/src/runtime/sound.arr.ts b/src/runtime/sound.arr.ts index 15ffc97fbe..d427197477 100644 --- a/src/runtime/sound.arr.ts +++ b/src/runtime/sound.arr.ts @@ -3,7 +3,7 @@ const RUNTIME = require('./runtime.js'); export const juliet = "helllo world"; -export function getBuffer(path: string):AudioBuffer { +export function getBuffer(path: string): AudioBuffer { debugger; //@ts-ignore var audioCtx = AudioContext(); @@ -19,7 +19,6 @@ export function getBuffer(path: string):AudioBuffer { return RUNTIME.pauseStack(function (restarter) { request.onload = function () { var audioData = request.response; - audioCtx.decodeAudioData(audioData, function (buffer) { source.buffer = buffer; source.connect(audioCtx.destination); @@ -39,28 +38,82 @@ export function getBuffer(path: string):AudioBuffer { }) } -function _makesound(sample_rate: number, data_array: number[]): Sound { +export function makeSound(sample_rate: number, duration: number, data_array: number[][]): Sound { const sound = { - '$brand': "$sound", + '$brand': "sound", 'sample-rate': sample_rate, + 'duration': duration, 'data-array': data_array, - 'play': () => playSound() + 'play': () => playSound(sound) } return sound; } -export function playSound() { } +export function playSound(sound: Sound) { + //@ts-ignore + var audioCtx = AudioContext(); + var source; + source = audioCtx.createBufferSource(); + var frameCount = sound.duration*sound['data-array'][0].length + source.buffer = audioCtx.createBuffer(sound['data-array'].length,frameCount,sound['sample-rate']); + source.connect(audioCtx.destination); + source.start(); +} -export function _urlSound(path: string): Sound { +export function urlSound(path: string): Sound { var buffer = getBuffer(path); - var data_array = Array.from(buffer.getChannelData(0)); + var numChannel = buffer.numberOfChannels; + var data_array = new Array(numChannel); + for (var channel = 0; channel < numChannel; channel++) { + var channel_array = Array.from(buffer.getChannelData(channel)); + data_array[channel] = channel_array; + } var sample_rate = buffer.sampleRate; - return _makesound(sample_rate, data_array); + var duration = buffer.duration; + return makeSound(sample_rate, duration, data_array); +} + +export function overlay(samples: Sound[]): Sound { + var numSamples = samples.length; + var maxChannels = 0; + var maxDuration = 0; + var sample_rate = samples[0]['sample-rate']; + for (var i = 0; i < numSamples; i++) { + if (samples[i]['data-array'].length > maxChannels) { + maxChannels = samples[i]['data-array'].length; + } + if (samples[i].duration > maxDuration) { + maxDuration = samples[i].duration; + } + } + var frameCount = maxDuration * sample_rate; + var mixed = new Array(maxChannels); + console.log(mixed); + console.log(frameCount); + for (var m = 0; m < maxChannels; m++) { + mixed[m] = new Array(frameCount); + for (var n = 0; n < frameCount; n++) { + mixed[m][n] = 0; + } + } + console.log(mixed); + for (var j = 0; j < numSamples; j++) { + for (var srcChannel = 0; srcChannel < samples[j]['data-array'].length; srcChannel++) { + var _in = samples[j]['data-array'][srcChannel]; + for (var i = 0; i < _in.length; i++) { + console.log(mixed); + mixed[srcChannel][i] += _in[i]; + console.log(mixed); + } + } + } + return makeSound(sample_rate, maxDuration, mixed); } interface Sound { '$brand': string, 'sample-rate': number, - 'data-array': number[], + 'duration': number, + 'data-array': number[][], 'play': () => any } \ No newline at end of file From 123c1b656f73a1a21ec1dfd724c8762381e3ccbe Mon Sep 17 00:00:00 2001 From: Andrew Tsakiris Date: Wed, 25 Sep 2019 11:10:26 -0400 Subject: [PATCH 029/116] test drawing on widget canvas --- .vscode/settings.json | 3 + ide/config/webpack.config.js | 160 +- ide/dist/asset-manifest.json | 12 + ide/dist/index.html | 14 + ide/dist/static/js/0.chunk.js | 172125 ++++++++++++++++++++++++ ide/dist/static/js/0.chunk.js.map | 1 + ide/dist/static/js/bundle.js | 864 + ide/dist/static/js/bundle.js.map | 1 + ide/dist/static/js/main.chunk.js | 3030 + ide/dist/static/js/main.chunk.js.map | 1 + ide/package-lock.json | 3 +- ide/package.json | 2 +- ide/src/Sound.tsx | 44 +- src/runtime/sound.arr.ts | 15 +- 14 files changed, 176186 insertions(+), 89 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 ide/dist/asset-manifest.json create mode 100644 ide/dist/index.html create mode 100644 ide/dist/static/js/0.chunk.js create mode 100644 ide/dist/static/js/0.chunk.js.map create mode 100644 ide/dist/static/js/bundle.js create mode 100644 ide/dist/static/js/bundle.js.map create mode 100644 ide/dist/static/js/main.chunk.js create mode 100644 ide/dist/static/js/main.chunk.js.map diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..ed94f44b10 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "git.ignoreLimitWarning": true +} \ No newline at end of file diff --git a/ide/config/webpack.config.js b/ide/config/webpack.config.js index 8b19fb2ea3..703e670ac5 100644 --- a/ide/config/webpack.config.js +++ b/ide/config/webpack.config.js @@ -53,7 +53,7 @@ const sassModuleRegex = /\.module\.(scss|sass)$/; // This is the production and development configuration. // It is focused on developer experience, fast rebuilds, and a minimal bundle. -module.exports = function(webpackEnv) { +module.exports = function (webpackEnv) { const isEnvDevelopment = webpackEnv === 'development'; const isEnvProduction = webpackEnv === 'production'; @@ -156,7 +156,7 @@ module.exports = function(webpackEnv) { // require.resolve('webpack-dev-server/client') + '?/', // require.resolve('webpack/hot/dev-server'), isEnvDevelopment && - require.resolve('react-dev-utils/webpackHotDevClient'), + require.resolve('react-dev-utils/webpackHotDevClient'), // Finally, this is your app's code: paths.appIndexJs, // We include the app code last so that if there is a runtime error during @@ -185,11 +185,11 @@ module.exports = function(webpackEnv) { // Point sourcemap entries to original disk location (format as URL on Windows) devtoolModuleFilenameTemplate: isEnvProduction ? info => - path - .relative(paths.appSrc, info.absoluteResourcePath) - .replace(/\\/g, '/') + path + .relative(paths.appSrc, info.absoluteResourcePath) + .replace(/\\/g, '/') : isEnvDevelopment && - (info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')), + (info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')), // Prevents conflicts when multiple Webpack runtimes (from different apps) // are used on the same page. jsonpFunction: `webpackJsonp${appPackageJson.name}`, @@ -248,13 +248,13 @@ module.exports = function(webpackEnv) { parser: safePostCssParser, map: shouldUseSourceMap ? { - // `inline: false` forces the sourcemap to be output into a - // separate file - inline: false, - // `annotation: true` appends the sourceMappingURL to the end of - // the css file, helping the browser find the sourcemap - annotation: true, - } + // `inline: false` forces the sourcemap to be output into a + // separate file + inline: false, + // `annotation: true` appends the sourceMappingURL to the end of + // the css file, helping the browser find the sourcemap + annotation: true, + } : false, }, }), @@ -329,7 +329,7 @@ module.exports = function(webpackEnv) { formatter: require.resolve('react-dev-utils/eslintFormatter'), eslintPath: require.resolve('eslint'), resolvePluginsRelativeTo: __dirname, - + }, loader: require.resolve('eslint-loader'), }, @@ -362,7 +362,7 @@ module.exports = function(webpackEnv) { customize: require.resolve( 'babel-preset-react-app/webpack-overrides' ), - + plugins: [ [ require.resolve('babel-plugin-named-asset-import'), @@ -402,7 +402,7 @@ module.exports = function(webpackEnv) { ], cacheDirectory: true, cacheCompression: isEnvProduction, - + // If an error happens in a package, it's possible to be // because it was compiled. Thus, we don't want the browser // debugger to show the original code. Instead, the code @@ -507,27 +507,27 @@ module.exports = function(webpackEnv) { }, isEnvProduction ? { - minify: { - removeComments: true, - collapseWhitespace: true, - removeRedundantAttributes: true, - useShortDoctype: true, - removeEmptyAttributes: true, - removeStyleLinkTypeAttributes: true, - keepClosingSlash: true, - minifyJS: true, - minifyCSS: true, - minifyURLs: true, - }, - } + minify: { + removeComments: true, + collapseWhitespace: true, + removeRedundantAttributes: true, + useShortDoctype: true, + removeEmptyAttributes: true, + removeStyleLinkTypeAttributes: true, + keepClosingSlash: true, + minifyJS: true, + minifyCSS: true, + minifyURLs: true, + }, + } : undefined ) ), // Inlines the webpack runtime script. This script is too small to warrant // a network request. isEnvProduction && - shouldInlineRuntimeChunk && - new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime~.+[.]js/]), + shouldInlineRuntimeChunk && + new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime~.+[.]js/]), // Makes some environment variables available in index.html. // The public URL is available as %PUBLIC_URL% in index.html, e.g.: // @@ -555,14 +555,14 @@ module.exports = function(webpackEnv) { // makes the discovery automatic so you don't have to restart. // See https://github.com/facebook/create-react-app/issues/186 isEnvDevelopment && - new WatchMissingNodeModulesPlugin(paths.appNodeModules), + new WatchMissingNodeModulesPlugin(paths.appNodeModules), isEnvProduction && - new MiniCssExtractPlugin({ - // Options similar to the same options in webpackOptions.output - // both options are optional - filename: 'static/css/[name].[contenthash:8].css', - chunkFilename: 'static/css/[name].[contenthash:8].chunk.css', - }), + new MiniCssExtractPlugin({ + // Options similar to the same options in webpackOptions.output + // both options are optional + filename: 'static/css/[name].[contenthash:8].css', + chunkFilename: 'static/css/[name].[contenthash:8].chunk.css', + }), // Generate a manifest file which contains a mapping of all asset filenames // to their corresponding output file so that tools can pick it up without // having to parse `index.html`. @@ -570,7 +570,7 @@ module.exports = function(webpackEnv) { fileName: 'asset-manifest.json', publicPath: publicPath, generate: (seed, files) => { - const manifestFiles = files.reduce(function(manifest, file) { + const manifestFiles = files.reduce(function (manifest, file) { manifest[file.name] = file.path; return manifest; }, seed); @@ -589,50 +589,50 @@ module.exports = function(webpackEnv) { // Generate a service worker script that will precache, and keep up to date, // the HTML & assets that are part of the Webpack build. isEnvProduction && - new WorkboxWebpackPlugin.GenerateSW({ - clientsClaim: true, - exclude: [/\.map$/, /asset-manifest\.json$/], - importWorkboxFrom: 'cdn', - navigateFallback: publicUrl + '/index.html', - navigateFallbackBlacklist: [ - // Exclude URLs starting with /_, as they're likely an API call - new RegExp('^/_'), - // Exclude any URLs whose last part seems to be a file extension - // as they're likely a resource and not a SPA route. - // URLs containing a "?" character won't be blacklisted as they're likely - // a route with query params (e.g. auth callbacks). - new RegExp('/[^/?]+\\.[^/]+$'), - ], - }), + new WorkboxWebpackPlugin.GenerateSW({ + clientsClaim: true, + exclude: [/\.map$/, /asset-manifest\.json$/], + importWorkboxFrom: 'cdn', + navigateFallback: publicUrl + '/index.html', + navigateFallbackBlacklist: [ + // Exclude URLs starting with /_, as they're likely an API call + new RegExp('^/_'), + // Exclude any URLs whose last part seems to be a file extension + // as they're likely a resource and not a SPA route. + // URLs containing a "?" character won't be blacklisted as they're likely + // a route with query params (e.g. auth callbacks). + new RegExp('/[^/?]+\\.[^/]+$'), + ], + }), // TypeScript type checking useTypeScript && - new ForkTsCheckerWebpackPlugin({ - typescript: resolve.sync('typescript', { - basedir: paths.appNodeModules, - }), - async: isEnvDevelopment, - useTypescriptIncrementalApi: true, - checkSyntacticErrors: true, - resolveModuleNameModule: process.versions.pnp - ? `${__dirname}/pnpTs.js` - : undefined, - resolveTypeReferenceDirectiveModule: process.versions.pnp - ? `${__dirname}/pnpTs.js` - : undefined, - tsconfig: paths.appTsConfig, - reportFiles: [ - '**', - '!**/__tests__/**', - '!**/?(*.)(spec|test).*', - '!**/src/setupProxy.*', - '!**/src/setupTests.*', - ], - watch: paths.appSrc, - silent: true, - // The formatter is invoked directly in WebpackDevServerUtils during development - formatter: isEnvProduction ? typescriptFormatter : undefined, + new ForkTsCheckerWebpackPlugin({ + typescript: resolve.sync('typescript', { + basedir: paths.appNodeModules, }), - new CopyPlugin([ + async: isEnvDevelopment, + useTypescriptIncrementalApi: true, + checkSyntacticErrors: true, + resolveModuleNameModule: process.versions.pnp + ? `${__dirname}/pnpTs.js` + : undefined, + resolveTypeReferenceDirectiveModule: process.versions.pnp + ? `${__dirname}/pnpTs.js` + : undefined, + tsconfig: paths.appTsConfig, + reportFiles: [ + '**', + '!**/__tests__/**', + '!**/?(*.)(spec|test).*', + '!**/src/setupProxy.*', + '!**/src/setupTests.*', + ], + watch: paths.appSrc, + silent: true, + // The formatter is invoked directly in WebpackDevServerUtils during development + formatter: isEnvProduction ? typescriptFormatter : undefined, + }), + new CopyPlugin([ { from: '../build/worker/pyret.jarr', to: './' }, ]) ].filter(Boolean), diff --git a/ide/dist/asset-manifest.json b/ide/dist/asset-manifest.json new file mode 100644 index 0000000000..840c6ad7d0 --- /dev/null +++ b/ide/dist/asset-manifest.json @@ -0,0 +1,12 @@ +{ + "files": { + "static/js/0.chunk.js": "/static/js/0.chunk.js", + "static/js/0.chunk.js.map": "/static/js/0.chunk.js.map", + "main.js": "/static/js/main.chunk.js", + "main.js.map": "/static/js/main.chunk.js.map", + "runtime~main.js": "/static/js/bundle.js", + "runtime~main.js.map": "/static/js/bundle.js.map", + "index.html": "/index.html", + "pyret.jarr": "/pyret.jarr" + } +} \ No newline at end of file diff --git a/ide/dist/index.html b/ide/dist/index.html new file mode 100644 index 0000000000..b69b53ace3 --- /dev/null +++ b/ide/dist/index.html @@ -0,0 +1,14 @@ + + + + + + + + ide + + + +
+ + diff --git a/ide/dist/static/js/0.chunk.js b/ide/dist/static/js/0.chunk.js new file mode 100644 index 0000000000..5ab029e78e --- /dev/null +++ b/ide/dist/static/js/0.chunk.js @@ -0,0 +1,172125 @@ +(window["webpackJsonpide"] = window["webpackJsonpide"] || []).push([[0],{ + +/***/ "./node_modules/@babel/runtime-corejs2/core-js/date/now.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/core-js/date/now.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! core-js/library/fn/date/now */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/date/now.js"); + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/core-js/number/is-integer.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/core-js/number/is-integer.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! core-js/library/fn/number/is-integer */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/number/is-integer.js"); + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/core-js/object/assign.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/core-js/object/assign.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! core-js/library/fn/object/assign */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/assign.js"); + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/core-js/object/create.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/core-js/object/create.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! core-js/library/fn/object/create */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/create.js"); + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/core-js/object/keys.js": +/*!********************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/core-js/object/keys.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! core-js/library/fn/object/keys */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/keys.js"); + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/core-js/object/values.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/core-js/object/values.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! core-js/library/fn/object/values */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/values.js"); + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/helpers/esm/extends.js": +/*!********************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/helpers/esm/extends.js ***! + \********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _extends; }); +/* harmony import */ var _core_js_object_assign__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core-js/object/assign */ "./node_modules/@babel/runtime-corejs2/core-js/object/assign.js"); +/* harmony import */ var _core_js_object_assign__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_core_js_object_assign__WEBPACK_IMPORTED_MODULE_0__); + +function _extends() { + _extends = _core_js_object_assign__WEBPACK_IMPORTED_MODULE_0___default.a || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/helpers/esm/inheritsLoose.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/helpers/esm/inheritsLoose.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inheritsLoose; }); +/* harmony import */ var _core_js_object_create__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core-js/object/create */ "./node_modules/@babel/runtime-corejs2/core-js/object/create.js"); +/* harmony import */ var _core_js_object_create__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_core_js_object_create__WEBPACK_IMPORTED_MODULE_0__); + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = _core_js_object_create__WEBPACK_IMPORTED_MODULE_0___default()(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/date/now.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/date/now.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.date.now */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.date.now.js"); +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js").Date.now; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/number/is-integer.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/number/is-integer.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.number.is-integer */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.number.is-integer.js"); +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js").Number.isInteger; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/assign.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/assign.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.object.assign */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.object.assign.js"); +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js").Object.assign; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/create.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/create.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.object.create */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.object.create.js"); +var $Object = __webpack_require__(/*! ../../modules/_core */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js").Object; +module.exports = function create(P, D) { + return $Object.create(P, D); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/keys.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/keys.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.object.keys */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.object.keys.js"); +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js").Object.keys; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/values.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/fn/object/values.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es7.object.values */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es7.object.values.js"); +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js").Object.values; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_a-function.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_a-function.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_an-object.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_an-object.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_is-object.js"); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_array-includes.js": +/*!*****************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_array-includes.js ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-iobject.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-length.js"); +var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-absolute-index.js"); +module.exports = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_cof.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_cof.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.6.9' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_ctx.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_ctx.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_a-function.js"); +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_defined.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_defined.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_descriptors.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_descriptors.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(/*! ./_fails */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_fails.js")(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_dom-create.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_dom-create.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_is-object.js"); +var document = __webpack_require__(/*! ./_global */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_global.js").document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_enum-bug-keys.js": +/*!****************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_enum-bug-keys.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_export.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_export.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_global.js"); +var core = __webpack_require__(/*! ./_core */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js"); +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_ctx.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_hide.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_has.js"); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && has(exports, key)) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_fails.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_fails.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_global.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_global.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_has.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_has.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_hide.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_hide.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-dp.js"); +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_property-desc.js"); +module.exports = __webpack_require__(/*! ./_descriptors */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_descriptors.js") ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_html.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_html.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var document = __webpack_require__(/*! ./_global */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_global.js").document; +module.exports = document && document.documentElement; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_ie8-dom-define.js": +/*!*****************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_ie8-dom-define.js ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(/*! ./_descriptors */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_descriptors.js") && !__webpack_require__(/*! ./_fails */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_fails.js")(function () { + return Object.defineProperty(__webpack_require__(/*! ./_dom-create */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_dom-create.js")('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_iobject.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_iobject.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_cof.js"); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_is-integer.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_is-integer.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_is-object.js"); +var floor = Math.floor; +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_is-object.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_is-object.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_library.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_library.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = true; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-assign.js": +/*!****************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-assign.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.2.1 Object.assign(target, source, ...) +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_descriptors.js"); +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-keys.js"); +var gOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-gops.js"); +var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-pie.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-object.js"); +var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_iobject.js"); +var $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || __webpack_require__(/*! ./_fails */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_fails.js")(function () { + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var S = Symbol(); + var K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function (k) { B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source) { // eslint-disable-line no-unused-vars + var T = toObject(target); + var aLen = arguments.length; + var index = 1; + var getSymbols = gOPS.f; + var isEnum = pIE.f; + while (aLen > index) { + var S = IObject(arguments[index++]); + var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) { + key = keys[j++]; + if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key]; + } + } return T; +} : $assign; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-create.js": +/*!****************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-create.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_an-object.js"); +var dPs = __webpack_require__(/*! ./_object-dps */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-dps.js"); +var enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_enum-bug-keys.js"); +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO'); +var Empty = function () { /* empty */ }; +var PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(/*! ./_dom-create */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_dom-create.js")('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(/*! ./_html */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_html.js").appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-dp.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-dp.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_an-object.js"); +var IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_ie8-dom-define.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-primitive.js"); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(/*! ./_descriptors */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_descriptors.js") ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-dps.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-dps.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-dp.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_an-object.js"); +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-keys.js"); + +module.exports = __webpack_require__(/*! ./_descriptors */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_descriptors.js") ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = getKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) dP.f(O, P = keys[i++], Properties[P]); + return O; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-gops.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-gops.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-keys-internal.js": +/*!***********************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-keys-internal.js ***! + \***********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(/*! ./_has */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_has.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-iobject.js"); +var arrayIndexOf = __webpack_require__(/*! ./_array-includes */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_array-includes.js")(false); +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO'); + +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-keys.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-keys.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(/*! ./_object-keys-internal */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-keys-internal.js"); +var enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_enum-bug-keys.js"); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-pie.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-pie.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-sap.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-sap.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(/*! ./_export */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_export.js"); +var core = __webpack_require__(/*! ./_core */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_fails.js"); +module.exports = function (KEY, exec) { + var fn = (core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-to-array.js": +/*!******************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-to-array.js ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_descriptors.js"); +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-keys.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-iobject.js"); +var isEnum = __webpack_require__(/*! ./_object-pie */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-pie.js").f; +module.exports = function (isEntries) { + return function (it) { + var O = toIObject(it); + var keys = getKeys(O); + var length = keys.length; + var i = 0; + var result = []; + var key; + while (length > i) { + key = keys[i++]; + if (!DESCRIPTORS || isEnum.call(O, key)) { + result.push(isEntries ? [key, O[key]] : O[key]); + } + } + return result; + }; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_property-desc.js": +/*!****************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_property-desc.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_shared-key.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_shared-key.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(/*! ./_shared */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_shared.js")('keys'); +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_uid.js"); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_shared.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_shared.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(/*! ./_core */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_core.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_global.js"); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: core.version, + mode: __webpack_require__(/*! ./_library */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_library.js") ? 'pure' : 'global', + copyright: '© 2019 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-absolute-index.js": +/*!********************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-absolute-index.js ***! + \********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-integer.js"); +var max = Math.max; +var min = Math.min; +module.exports = function (index, length) { + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-integer.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-integer.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-iobject.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-iobject.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_iobject.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_defined.js"); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-length.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-length.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-integer.js"); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-object.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-object.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_defined.js"); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-primitive.js": +/*!***************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-primitive.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_is-object.js"); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (it, S) { + if (!isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_uid.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_uid.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.date.now.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.date.now.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = __webpack_require__(/*! ./_export */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_export.js"); + +$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.number.is-integer.js": +/*!***********************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.number.is-integer.js ***! + \***********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_export.js"); + +$export($export.S, 'Number', { isInteger: __webpack_require__(/*! ./_is-integer */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_is-integer.js") }); + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.object.assign.js": +/*!*******************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.object.assign.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.1 Object.assign(target, source) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_export.js"); + +$export($export.S + $export.F, 'Object', { assign: __webpack_require__(/*! ./_object-assign */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-assign.js") }); + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.object.create.js": +/*!*******************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.object.create.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_export.js"); +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', { create: __webpack_require__(/*! ./_object-create */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-create.js") }); + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.object.keys.js": +/*!*****************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es6.object.keys.js ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 Object.keys(O) +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_to-object.js"); +var $keys = __webpack_require__(/*! ./_object-keys */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-keys.js"); + +__webpack_require__(/*! ./_object-sap */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-sap.js")('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); + + +/***/ }), + +/***/ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es7.object.values.js": +/*!*******************************************************************************************************!*\ + !*** ./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/es7.object.values.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(/*! ./_export */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_export.js"); +var $values = __webpack_require__(/*! ./_object-to-array */ "./node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_object-to-array.js")(false); + +$export($export.S, 'Object', { + values: function values(it) { + return $values(it); + } +}); + + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js": +/*!***************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; +} + +module.exports = _arrayWithHoles; + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***! + \*******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithHoles; }); +function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js": +/*!************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***! + \************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _extends; }); +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js ***! + \*************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArrayLimit; }); +function _iterableToArrayLimit(arr, i) { + 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; +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js": +/*!********************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***! + \********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableRest; }); +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***! + \*********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutPropertiesLoose; }); +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js": +/*!******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js ***! + \******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _slicedToArray; }); +/* harmony import */ var _arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles */ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js"); +/* harmony import */ var _iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit */ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js"); +/* harmony import */ var _nonIterableRest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableRest */ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js"); + + + +function _slicedToArray(arr, i) { + return Object(_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, i) || Object(_nonIterableRest__WEBPACK_IMPORTED_MODULE_2__["default"])(); +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js": +/*!****************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); +} + +module.exports = _iterableToArray; + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _iterableToArrayLimit(arr, i) { + 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; +} + +module.exports = _iterableToArrayLimit; + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/nonIterableRest.js": +/*!****************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); +} + +module.exports = _nonIterableRest; + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/slicedToArray.js": +/*!**************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles */ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js"); + +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit */ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); + +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest */ "./node_modules/@babel/runtime/helpers/nonIterableRest.js"); + +function _slicedToArray(arr, i) { + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest(); +} + +module.exports = _slicedToArray; + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/toArray.js": +/*!********************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/toArray.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles */ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js"); + +var iterableToArray = __webpack_require__(/*! ./iterableToArray */ "./node_modules/@babel/runtime/helpers/iterableToArray.js"); + +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest */ "./node_modules/@babel/runtime/helpers/nonIterableRest.js"); + +function _toArray(arr) { + return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest(); +} + +module.exports = _toArray; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations-runtime/dist/src/index.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@stopify/continuations-runtime/dist/src/index.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +__export(__webpack_require__(/*! ./runtime/runtime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/runtime.js")); + +/***/ }), + +/***/ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const assert = __webpack_require__(/*! assert */ "./node_modules/assert/assert.js"); // We throw this exception when a continuation value is applied. i.e., +// captureCC applies its argument to a function that throws this exception. + + +class Restore { + constructor(stack, savedStack) { + this.stack = stack; + this.savedStack = savedStack; + } + +} + +exports.Restore = Restore; // We throw this exception to end the current turn and continue execution on the +// next turn. + +class EndTurn { + constructor(callback) { + this.callback = callback; + } + +} + +exports.EndTurn = EndTurn; // This class is used by all the runtimes to start the stack capturing process. + +class Capture { + constructor(f, stack) { + this.f = f; + this.stack = stack; + } + +} + +exports.Capture = Capture; + +class RuntimeImpl { + constructor( // Maximum number of frames that can be consumed by this runtime. + stackSize, // Number of frames to be restored from the captured stack onto the JS stack. + restoreFrames, // True when the instrumented program is capturing the stack. + capturing = false) { + this.stackSize = stackSize; + this.restoreFrames = restoreFrames; + this.capturing = capturing; + /** + * A saved stack trace. This field is only used when a user-mode exception + * is thrown. + */ + + this.stackTrace = []; + + if (isFinite(stackSize)) { + assert(restoreFrames <= stackSize, 'Cannot restore more frames than stack size'); + } + + this.stack = []; + this.savedStack = []; + this.restoreFrames = restoreFrames; + this.stackSize = stackSize; + this.remainingStack = stackSize; + this.mode = true; + this.kind = undefined; // the worst + } + + topK(f) { + return { + kind: 'top', + f: () => { + this.stack = []; + this.mode = true; + return f(); + }, + this: this + }; + } + + runtime(body, onDone) { + while (true) { + const result = this.abstractRun(body); + + if (result.type === 'normal' || result.type === 'exception') { + if (this.savedStack.length > 0) { + const exception = result.type === 'exception'; + const ss = this.savedStack; + const restarter = this.topK(() => { + if (exception) { + throw result.value; + } else { + return result.value; + } + }); + this.stack = [restarter]; + + for (let i = 0; i < this.restoreFrames && ss.length - 1 - i >= 0; i++) { + this.stack.push(ss.pop()); + } + + body = () => { + this.mode = false; + return this.stack[this.stack.length - 1].f(); + }; + } else if (result.type === 'normal') { + assert(this.mode, 'execution completed in restore mode'); + return onDone(result); + } else if (result.type === 'exception') { + assert(this.mode, "execution completed in restore mode, error was: ".concat(result.value)); + const stack = this.stackTrace; + this.stackTrace = []; + return onDone({ + type: 'exception', + value: result.value, + stack + }); + } + } else if (result.type === 'capture') { + body = () => result.f.call(global, this.makeCont(result.stack)); + } else if (result.type === 'restore') { + body = () => { + if (result.stack.length === 0) { + throw new Error("Can't restore from empty stack"); + } + + this.mode = false; + this.stack = result.stack; + this.savedStack = result.savedStack; + const frame = this.stack[this.stack.length - 1]; + return this.stack[this.stack.length - 1].f.apply(frame.this || global, frame.params || []); + }; + } else if (result.type === 'end-turn') { + return result.callback(onDone); + } + } + } + /** jumper.ts and captureLogics.ts insert calls to pushTrace. */ + + + pushTrace(line) { + this.stackTrace.push(line); + } + /** jumper.ts inserts calls to clearTrace. */ + + + clearTrace() { + this.stackTrace = []; + } + +} + +exports.RuntimeImpl = RuntimeImpl; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/eagerRuntime.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations-runtime/dist/src/runtime/eagerRuntime.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const common = __webpack_require__(/*! ./abstractRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js"); + +__export(__webpack_require__(/*! ./abstractRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js")); + +class EagerRuntime extends common.RuntimeImpl { + constructor(stackSize, restoreFrames) { + super(stackSize, restoreFrames); + this.kind = 'eager'; + this.eagerStack = []; + } + + captureCC(f) { + this.capturing = true; + throw new common.Capture(f, [...this.eagerStack]); + } + + makeCont(stack) { + return x => { + let restarter = () => { + if (x.type === 'exception') { + throw x.value; + } else { + return x.value; + } + }; + + this.eagerStack = [...stack]; + throw new common.Restore([this.topK(restarter), ...stack], []); + }; + } + + endTurn(callback) { + throw new common.EndTurn(callback); + } + + abstractRun(body) { + try { + const v = body(); + return { + type: 'normal', + value: v + }; + } catch (exn) { + if (exn instanceof common.Capture) { + this.capturing = false; + return { + type: 'capture', + stack: exn.stack, + f: exn.f + }; + } else if (exn instanceof common.Restore) { + return { + type: 'restore', + stack: exn.stack, + savedStack: exn.savedStack + }; + } else if (exn instanceof common.EndTurn) { + return { + type: 'end-turn', + callback: exn.callback + }; + } else { + return { + type: 'exception', + value: exn + }; + } + } + } + +} + +exports.EagerRuntime = EagerRuntime; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/fudgeRuntime.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations-runtime/dist/src/runtime/fudgeRuntime.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const common = __webpack_require__(/*! ./abstractRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js"); + +__export(__webpack_require__(/*! ./abstractRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js")); + +class FudgedContinuationError { + constructor(v) { + this.v = v; + } + + toString() { + return "FudgedContinuationError(".concat(this.v, ")"); + } + +} +/** This runtime system doesn't actually implement any control operators. + * Functions such as 'captureCC' are defined and will call their argument, + * but don't save the stack. + * + * Unfortunately, all our program end by invoking the top continuation with + * "done". Therefore, a program that runs correctly will terminate with + * 'FudgedContinuationError(done)'. This is unfortunate. But, this + * transformation still helps with debugging. + */ + + +class FudgeRuntime extends common.RuntimeImpl { + constructor() { + super(Infinity, Infinity); + this.kind = 'fudge'; + } + + captureCC(f) { + throw new common.Capture(f, []); + } + + makeCont(stack) { + return v => { + throw new FudgedContinuationError(v); + }; + } + + abstractRun(body) { + try { + const v = body(); + return { + type: 'normal', + value: v + }; + } catch (exn) { + if (exn instanceof common.Capture) { + this.capturing = false; + return { + type: 'capture', + stack: exn.stack, + f: exn.f + }; + } else if (exn instanceof common.EndTurn) { + return { + type: 'end-turn', + callback: exn.callback + }; + } else { + return { + type: 'exception', + value: exn + }; + } + } + } + + handleNew(constr, ...args) { + return new constr(...args); + } + + endTurn(callback) { + throw new common.EndTurn(callback); + } + +} + +exports.FudgeRuntime = FudgeRuntime; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/lazyRuntime.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations-runtime/dist/src/runtime/lazyRuntime.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const common = __webpack_require__(/*! ./abstractRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js"); + +__export(__webpack_require__(/*! ./abstractRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js")); + +class LazyRuntime extends common.RuntimeImpl { + constructor(stackSize, restoreFrames) { + super(stackSize, restoreFrames); + this.kind = 'lazy'; + } + + captureCC(f) { + this.capturing = true; + throw new common.Capture(f, []); + } + + makeCont(stack) { + const savedStack = this.savedStack; + this.savedStack = []; + + for (let i = stack.length - 1; i >= this.restoreFrames; i -= 1) { + savedStack.push(stack.pop()); + } + + return x => { + let restarter = () => { + if (x.type === 'exception') { + throw x.value; + } else { + return x.value; + } + }; + + throw new common.Restore([this.topK(restarter), ...stack], savedStack); + }; + } + + endTurn(callback) { + this.savedStack = []; + this.stack = []; + throw new common.EndTurn(callback); + } + + abstractRun(body) { + try { + const v = body(); + return { + type: 'normal', + value: v + }; + } catch (exn) { + if (exn instanceof common.Capture) { + this.capturing = false; + return { + type: 'capture', + stack: exn.stack, + f: exn.f + }; + } else if (exn instanceof common.Restore) { + return { + type: 'restore', + stack: exn.stack, + savedStack: exn.savedStack + }; + } else if (exn instanceof common.EndTurn) { + return { + type: 'end-turn', + callback: exn.callback + }; + } else { + return { + type: 'exception', + value: exn + }; + } + } + } + +} + +exports.LazyRuntime = LazyRuntime; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/retvalRuntime.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations-runtime/dist/src/runtime/retvalRuntime.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const common = __webpack_require__(/*! ./abstractRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js"); + +__export(__webpack_require__(/*! ./abstractRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js")); + +class RetvalRuntime extends common.RuntimeImpl { + constructor(stackSize, restoreFrames) { + super(stackSize, restoreFrames); + this.kind = 'retval'; + } + + captureCC(f) { + this.capturing = true; + return new common.Capture(f, []); + } + + makeCont(stack) { + const savedStack = this.savedStack; + this.savedStack = []; + + for (let i = stack.length - 1; i >= this.restoreFrames; i -= 1) { + savedStack.push(stack.pop()); + } + + return x => { + let restarter = () => { + if (x.type === 'exception') { + throw x.value; + } else { + return x.value; + } + }; + + return new common.Restore([this.topK(restarter), ...stack], savedStack); + }; + } + + endTurn(callback) { + throw new common.EndTurn(callback); + } + + abstractRun(body) { + try { + const v = body(); + + if (v instanceof common.Capture) { + this.capturing = false; + return { + type: 'capture', + stack: v.stack, + f: v.f + }; + } else if (v instanceof common.Restore) { + return { + type: 'restore', + stack: v.stack, + savedStack: v.savedStack + }; + } else { + return { + type: 'normal', + value: v + }; + } + } catch (exn) { + if (exn instanceof common.EndTurn) { + return { + type: 'end-turn', + callback: exn.callback + }; + } + + return { + type: 'exception', + value: exn + }; + } + } + +} + +exports.RetvalRuntime = RetvalRuntime; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/runtime.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@stopify/continuations-runtime/dist/src/runtime/runtime.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * Entrypoint of the stopify-continuations bundle + */ + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const lazyRuntime_1 = __webpack_require__(/*! ./lazyRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/lazyRuntime.js"); + +const eagerRuntime_1 = __webpack_require__(/*! ./eagerRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/eagerRuntime.js"); + +const retvalRuntime_1 = __webpack_require__(/*! ./retvalRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/retvalRuntime.js"); + +const fudgeRuntime_1 = __webpack_require__(/*! ./fudgeRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/fudgeRuntime.js"); + +__export(__webpack_require__(/*! ./abstractRuntime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/abstractRuntime.js")); + +let savedRTS; + +function newRTS(transform) { + if (!savedRTS || savedRTS.kind !== transform) { + switch (transform) { + // Default to shallow runtime. + case 'catch': + savedRTS = new lazyRuntime_1.LazyRuntime(Infinity, Infinity); + savedRTS.kind = 'catch'; // TODO(arjun): Sloppy + + break; + + case 'lazy': + savedRTS = new lazyRuntime_1.LazyRuntime(Infinity, Infinity); + break; + + case 'eager': + savedRTS = new eagerRuntime_1.EagerRuntime(Infinity, Infinity); + break; + + case 'retval': + savedRTS = new retvalRuntime_1.RetvalRuntime(Infinity, Infinity); + break; + + case 'fudge': + savedRTS = new fudgeRuntime_1.FudgeRuntime(); + break; + + default: + throw new Error("bad runtime: ".concat(transform)); + } + } + + return savedRTS; +} + +exports.newRTS = newRTS; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/callcc/boxAssignables.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/callcc/boxAssignables.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process, module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * This transformation boxes certain assignable variables to preserve + * reference equality when the stack is reconstructed. + * + * Preconditions: + * 1. The freeIds pass has been applied. + */ + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const babel = __webpack_require__(/*! babel-core */ "./node_modules/babel-core/index.js"); + +const assert = __webpack_require__(/*! assert */ "./node_modules/assert/assert.js"); + +const h = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const normalize_js_1 = __webpack_require__(/*! @stopify/normalize-js */ "./node_modules/@stopify/normalize-js/dist/ts/index.js"); + +const immutable_1 = __webpack_require__(/*! immutable */ "./node_modules/immutable/dist/immutable.js"); + +const hygiene_1 = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +function box(e) { + return t.objectExpression([t.objectProperty(t.identifier('box'), e === null || e === undefined ? t.unaryExpression('void', t.numericLiteral(0)) : e)]); +} + +exports.box = box; + +function unbox(e) { + const res = t.memberExpression(e, t.identifier('box')); + res.mark = e.mark; + return res; +} +/** + * Produces 'true' if the identifier should be boxed. + * + * @param x an identifier + * @param path the path to the enclosing Function or Program + */ + + +function shouldBox(binding, path) { + if (binding.path.isFunctionDeclaration()) { + return true; + } + + if (path.node.type === 'FunctionExpression' && path.node.id && path.node.id.name === binding.identifier.name) { + return false; + } + + return normalize_js_1.freeIds.isNestedFree(path, binding.identifier.name); +} + +function liftDecl(self, decl) { + self.liftDeclStack[self.liftDeclStack.length - 1].push(decl); +} + +function liftAssign(self, assign) { + self.liftAssignStack[self.liftAssignStack.length - 1].push(assign); +} // NOTE(arjun): The following implements non-strict semantics, where +// arguments[i] and the ith formal argument are aliased. Recall that: +// +// > function F(x) { 'use strict'; arguments[0] = 100; return x }; F(200) +// 200 +// > function F(x) { arguments[0] = 100; return x }; F(200) +// 100 +// +// if (usesArgs) { +// params.forEach((x, i) => { +// if (boxedArgs.contains(x.name)) { +// const arg = t.identifier('argument'); +// const init = t.assignmentExpression('=', +// t.memberExpression(arg, t.numericLiteral(i), true), +// x); +// path.node.body.body.unshift(t.expressionStatement(init)); +// } +// }); +// } + + +function enterFunction(self, path) { + const locals = immutable_1.Set.of(...Object.keys(path.scope.bindings)); // Mutable variables from this scope that are not shadowed + + const vars0 = self.vars.subtract(locals); // Mutable variables from the inner scope + + const vars1 = locals.filter(x => shouldBox(path.scope.bindings[x], path)).toSet(); + const params = path.node.params; + const boxedArgs = immutable_1.Set.of(...params.filter(x => vars1.includes(x.name)).map(x => x.name)); + path.node.boxedArgs = boxedArgs; + self.parentPathStack.push(self.parentPath); + self.varsStack.push(self.vars); + self.parentPath = path; + self.vars = vars0.union(vars1); + self.liftDeclStack.push([]); + self.liftAssignStack.push([]); +} + +function exitFunction(self, path) { + // Lift boxed declarations and hoisted function decl assignments. + const decls = self.liftDeclStack.pop(); + const assigns = self.liftAssignStack.pop(); + path.node.body.body.unshift(...decls, ...assigns); // Box arguments if necessary. We do this after visiting the function + // body or the initialization statements get messed up. + + path.node.boxedArgs.valueSeq().forEach(x => { + const init = t.expressionStatement(t.assignmentExpression("=", t.identifier(x), box(t.identifier(x)))); + init.__boxVarsInit__ = true; + path.node.body.body.unshift(init); + }); + self.vars = self.varsStack.pop(); + self.parentPath = self.parentPathStack.pop(); +} + +const visitor = { + Program: { + enter(path) { + this.parentPathStack = []; + this.varsStack = []; + this.parentPath = path; // Stopify has used the top-level as a implicit continuation delimiter. + // i.e., Stopify's continuations are like Racket continuations, which + // don't capture the rest of a module: + // + // (define saved #f) + // (define f (call/cc (lambda (k) (set! saved k) 100))) + // (display 200) + // ; Applying saved will not run (display 200) again + // + // Since continuations don't capture top-level definitions, we do not + // need to box top-level assignable variables, which why we initialize + // this.vars to the empty set. + // + // Note that boxing top-level assignables is also wrong: a boxed top-level + // variable X is also available as window.X, which we would not know to + // unbox. + + /**this.vars = Set();**/ + + const vars = Object.keys(path.scope.bindings).filter(x => shouldBox(path.scope.bindings[x], path)); + this.vars = immutable_1.Set.of(...vars); + this.liftDeclStack = [[]]; + this.liftAssignStack = [[]]; + }, + + exit(path) { + const decls = this.liftDeclStack.pop(); + const assigns = this.liftAssignStack.pop(); + + if (this.liftDeclStack.length !== 0 || this.liftAssignStack.length !== 0) { + throw new Error("Not all declarations or assignments lifted during boxing"); + } + + path.node.body.unshift(...decls, ...assigns); + } + + }, + + ReferencedIdentifier(path) { + path.skip(); // NOTE(arjun): The parent type tests are because labels are + // categorized as ReferencedIdentifiers, which is a bug in + // Babel, in my opinion. + + if (path.parent.type === "BreakStatement" || path.parent.type === 'ContinueStatement' || path.parent.type === "LabeledStatement") { + return; + } + + if (this.vars.includes(path.node.name) || this.opts.boxes && this.opts.boxes.includes(path.node.name)) { + path.replaceWith(unbox(path.node)); + } + }, + + VariableDeclaration(path) { + assert(path.node.declarations.length === 1, 'variable declarations must have exactly one binding'); + const decl = path.node.declarations[0]; + + if (decl.id.type !== "Identifier") { + throw new assert.AssertionError({ + message: 'destructuring not supported' + }); + } + + if (this.vars.includes(decl.id.name)) { + liftDecl(this, t.variableDeclaration('var', [t.variableDeclarator(decl.id, box(h.eUndefined))])); + + if (decl.init === null) { + path.remove(); + } else { + path.replaceWith(t.assignmentExpression('=', decl.id, decl.init)); + } + } + }, + + BindingIdentifier(path) { + path.skip(); + + if (path.parent.type !== "AssignmentExpression") { + return; + } + + if (this.vars.includes(path.node.name) || this.opts.boxes && this.opts.boxes.includes(path.node.name)) { + path.replaceWith(unbox(path.node)); + } + }, + + FunctionExpression: { + enter(path, state) { + enterFunction(this, path); + }, + + exit(path, state) { + exitFunction(this, path); + } + + }, + FunctionDeclaration: { + enter(path, state) { + enterFunction(this, path); + }, + + exit(path, state) { + exitFunction(this, path); + const vars = this.vars; // NOTE(rachit): in `func` mode, the input function is marked with + // topFunction. It shouldn't be boxed since we want to preserve its + // signature. + + if (vars.includes(path.node.id.name) && !(state.opts.compileFunction && path.node.topFunction)) { + const fun = t.functionExpression(hygiene_1.fresh('fun'), path.node.params, path.node.body); // This is necessary to get the right function name in + // a stack trace. + + if (path.node.id.name !== undefined) { + fun.originalName = path.node.id.name; + } + + fun.mark = path.node.mark; + fun.boxedArgs = path.node.boxedArgs; // Little hack necessary to preserve annotation left by freeIds and singleVarDecls + + fun.nestedFunctionFree = path.node.nestedFunctionFree; + fun.renames = path.node.renames; + const decl = t.variableDeclaration('var', [t.variableDeclarator(path.node.id, box(h.eUndefined))]); + const stmt = t.expressionStatement(t.assignmentExpression('=', unbox(path.node.id), fun)); + liftDecl(this, decl); + liftAssign(this, stmt); + path.remove(); + path.skip(); + } + } + + } +}; + +function plugin() { + return { + visitor + }; +} + +exports.plugin = plugin; + +function main() { + const filename = process.argv[2]; + const opts = { + plugins: [() => ({ + visitor + })], + babelrc: false + }; + babel.transformFile(filename, opts, (err, result) => { + if (err !== null) { + throw err; + } + + console.log(result.code); + }); +} + +if (__webpack_require__.c[__webpack_require__.s] === module) { + main(); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/callcc/callcc.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/callcc/callcc.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process, module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Adds support for callCC. + * + * This module is a Node plugin. In addition, it can be applied from the + * command line: + * + * node built/src/callcc/callcc + */ + +const normalizeJs = __webpack_require__(/*! @stopify/normalize-js */ "./node_modules/@stopify/normalize-js/dist/ts/index.js"); + +const boxAssignables = __webpack_require__(/*! ./boxAssignables */ "./node_modules/@stopify/continuations/dist/src/callcc/boxAssignables.js"); + +const desugarNew = __webpack_require__(/*! ../common/desugarNew */ "./node_modules/@stopify/continuations/dist/src/common/desugarNew.js"); + +const label = __webpack_require__(/*! ./label */ "./node_modules/@stopify/continuations/dist/src/callcc/label.js"); + +const jumper = __webpack_require__(/*! ./jumper */ "./node_modules/@stopify/continuations/dist/src/callcc/jumper.js"); + +const declVars = __webpack_require__(/*! ./declVars */ "./node_modules/@stopify/continuations/dist/src/callcc/declVars.js"); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const babel = __webpack_require__(/*! babel-core */ "./node_modules/babel-core/index.js"); + +const exposeImplicitApps = __webpack_require__(/*! ../exposeImplicitApps */ "./node_modules/@stopify/continuations/dist/src/exposeImplicitApps.js"); + +const exposeGS = __webpack_require__(/*! ../exposeGettersSetters */ "./node_modules/@stopify/continuations/dist/src/exposeGettersSetters.js"); + +const bh = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const helpers_1 = __webpack_require__(/*! ../helpers */ "./node_modules/@stopify/continuations/dist/src/helpers.js"); + +const $__R = t.identifier('$__R'); +const $__C = t.identifier('$__C'); +const $top = t.identifier('$top'); +const visitor = { + Program(path, state) { + const opts = state.opts; + const doNotWrap = opts.renames || opts.compileFunction || opts.eval2 || opts.compileMode === 'library'; + + if (!doNotWrap) { + // Wrap the program in 'function $top() { body }' + path.node.body = [t.functionDeclaration($top, [], t.blockStatement(path.node.body))]; + } // For eval, wrap the expression in 'function() { body }', which lets the + // rest of the code insert instrumentation to pause during eval. Note that + // later passes will create a name for this anonymous function to allow + // reentry. + + + if (opts.eval2) { + path.node.body = [t.expressionStatement(t.functionExpression(undefined, [], t.blockStatement(bh.returnLast(path.node.body))))]; + } + + if (opts.getters) { + bh.transformFromAst(path, [exposeGS.plugin]); + } + + if (opts.newMethod === 'wrapper') { + bh.transformFromAst(path, [[desugarNew, opts]]); + } + + if (opts.es === 'es5') { + bh.transformFromAst(path, [[exposeImplicitApps.plugin, opts]]); + } + + bh.transformFromAst(path, [[normalizeJs.plugin, { + nameReturns: opts.captureMethod === 'catch' + }]]); + bh.transformFromAst(path, [[boxAssignables.plugin, opts]]); + bh.transformFromAst(path, [declVars]); // If stopifying eval'd string at runtime, don't delimit statements so that + // we can suspend through the eval. + + bh.transformFromAst(path, [label.plugin]); + bh.transformFromAst(path, [[jumper.plugin, opts]]); + path.stop(); + + if (!doNotWrap) { + const id = opts.onDone.id; // $__R.runtime($top, opts.onDone); + + path.node.body.push(bh.letExpression(id, opts.onDone, 'const')); + path.node.body.push(t.expressionStatement(t.callExpression(t.memberExpression($__R, t.identifier('runtime')), [t.memberExpression($top, t.identifier('box')), id]))); + } + + if (!state.opts.compileFunction) { + path.node.body.unshift(bh.letExpression($__R, t.callExpression(t.memberExpression(t.identifier('$__T'), t.identifier('newRTS')), [t.stringLiteral(opts.captureMethod)]), 'var')); + path.node.body.unshift(bh.letExpression(t.identifier("$__T"), !opts.requireRuntime ? t.identifier('stopify') : t.callExpression(t.identifier('require'), [t.stringLiteral("".concat(helpers_1.runtimePath, "/runtime"))]), 'var')); + } + + const req = opts.requireRuntime ? t.callExpression(t.identifier('require'), [t.stringLiteral('stopify/dist/src/stopify/compileFunction')]) : t.memberExpression(t.identifier('stopify'), t.identifier('compiler')); + path.node.body.unshift(bh.letExpression($__C, req, 'const')); + } + +}; + +function default_1() { + return { + visitor + }; +} + +exports.default = default_1; + +function main() { + const filename = process.argv[2]; + const opts = { + plugins: [[() => ({ + visitor + }), { + captureMethod: 'eager', + handleNew: 'wrapper' + }]], + babelrc: false + }; + babel.transformFile(filename, opts, (err, result) => { + if (err !== null) { + throw err; + } + + console.log(result.code); + }); +} + +if (__webpack_require__.c[__webpack_require__.s] === module) { + main(); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/callcc/captureLogics.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/callcc/captureLogics.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const hygiene_1 = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +const bh = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const h = __webpack_require__(/*! ../helpers */ "./node_modules/@stopify/continuations/dist/src/helpers.js"); + +const label_1 = __webpack_require__(/*! ./label */ "./node_modules/@stopify/continuations/dist/src/callcc/label.js"); + +const types = t.identifier('$__T'); +exports.types = types; +const restoreNextFrame = t.identifier('restoreNextFrame'); +exports.restoreNextFrame = restoreNextFrame; +const target = t.identifier('target'); +exports.target = target; +const captureLocals = t.identifier('captureLocals'); +exports.captureLocals = captureLocals; +const runtime = t.identifier('$__R'); +exports.runtime = runtime; +const runtimeStack = t.memberExpression(runtime, t.identifier('stack')); +exports.runtimeStack = runtimeStack; +const captureExn = t.memberExpression(types, t.identifier('Capture')); +exports.captureExn = captureExn; +exports.endTurnExn = t.memberExpression(types, t.identifier('EndTurn')); +const isNormalMode = t.memberExpression(runtime, t.identifier('mode')); +exports.isNormalMode = isNormalMode; +const topOfRuntimeStack = t.memberExpression(runtimeStack, t.binaryExpression("-", t.memberExpression(runtimeStack, t.identifier("length")), t.numericLiteral(1)), true); +exports.topOfRuntimeStack = topOfRuntimeStack; +const stackFrameCall = t.callExpression(t.memberExpression(topOfRuntimeStack, t.identifier('f')), []); +exports.stackFrameCall = stackFrameCall; +const eagerStack = t.memberExpression(runtime, t.identifier('eagerStack')); +const shiftEagerStack = t.memberExpression(eagerStack, t.identifier('shift')); +const pushEagerStack = t.memberExpression(eagerStack, t.identifier('unshift')); +/** + * Wrap callsites in try/catch block, lazily building the stack on catching a + * Capture exception, then rethrowing. + * + * jumper [[ x = f_n(...args) ]] = + * try { + * if (mode === 'normal') { + * x = f_n(...args); + * } else if (mode === restoring && target === n) { + * x = R.stack[R.stack.length-1].f(); + * } + * } catch (exn) { + * if (exn instanceof Capture) { + * exn.stack.push(stackFrame); + * } + * throw exn; + * } + */ + +function lazyCaptureLogic(path, opts) { + const applyLbl = t.numericLiteral(label_1.getLabels(path.node)[0]); + const exn = hygiene_1.fresh('exn'); + const nodeStmt = t.expressionStatement(path.node); + const restoreNode = t.assignmentExpression(path.node.operator, path.node.left, stackFrameCall); + const ifStmt = t.ifStatement(isNormalMode, t.blockStatement([nodeStmt]), t.ifStatement(t.binaryExpression('===', target, applyLbl), t.expressionStatement(restoreNode))); + const exnStack = t.memberExpression(exn, t.identifier('stack')); // A small hack to avoid showing reporting $top as the function name for + // top-level function calls + + let funName = bh.enclosingFunctionName(path); + + if (funName === '$top') { + funName = undefined; + } + + const tryStmt = t.tryStatement(t.blockStatement([ifStmt]), t.catchClause(exn, t.blockStatement([t.ifStatement(t.binaryExpression('instanceof', exn, captureExn), t.blockStatement([t.expressionStatement(t.callExpression(t.memberExpression(exnStack, t.identifier('push')), [t.objectExpression([t.objectProperty(t.identifier('kind'), t.stringLiteral('rest')), t.objectProperty(t.identifier('f'), restoreNextFrame), t.objectProperty(t.identifier('index'), applyLbl), t.objectProperty(t.identifier('this'), t.thisExpression())])])), t.expressionStatement(t.callExpression(captureLocals, [t.memberExpression(exnStack, t.binaryExpression('-', t.memberExpression(exnStack, t.identifier('length')), t.numericLiteral(1)), true)]))]), t.blockStatement([t.expressionStatement(t.callExpression(t.memberExpression(runtime, t.identifier('pushTrace')), [t.stringLiteral(h.locationString(funName, path, opts))]))])), t.throwStatement(exn)]))); + const stmtParent = path.getStatementParent(); + stmtParent.replaceWith(tryStmt); + stmtParent.skip(); +} + +exports.lazyCaptureLogic = lazyCaptureLogic; + +function lazyGlobalCatch(path, opts) { + const applyLbl = t.numericLiteral(label_1.getLabels(path.node)[0]); + const nodeStmt = t.expressionStatement(path.node); + const restoreNode = t.assignmentExpression(path.node.operator, path.node.left, t.callExpression(t.memberExpression(t.memberExpression(topOfRuntimeStack, t.identifier('f')), t.identifier('apply')), [t.memberExpression(topOfRuntimeStack, t.identifier('this')), t.memberExpression(topOfRuntimeStack, t.identifier('params'))])); + const ifStmt = t.ifStatement(isNormalMode, t.blockStatement([t.expressionStatement(t.assignmentExpression('=', target, applyLbl)), nodeStmt]), t.ifStatement(t.binaryExpression('===', target, applyLbl), t.expressionStatement(restoreNode))); + const stmtParent = path.getStatementParent(); + stmtParent.replaceWith(ifStmt); + stmtParent.skip(); +} + +exports.lazyGlobalCatch = lazyGlobalCatch; +/** + * Eagerly build the stack, pushing frames before applications and popping on + * their return. Capture exns are thrown straight to the runtime, passing the + * eagerly built stack along with it. + * + * jumper [[ x = f_n(...args) ]] = + * if (mode === 'normal') { + * eagerStack.unshift(stackFrame); + * x = f_n(...args); + * eagerStack.shift(); + * } else if (mode === 'restoring' && target === n) { + * // Don't have to `unshift` to rebuild stack because the eagerStack is + * // preserved from when the Capture exn was thrown. + * x = R.stack[R.stack.length-1].f(); + * eagerStack.shift(); + * } + */ + +function eagerCaptureLogic(path, opts) { + const applyLbl = t.numericLiteral(label_1.getLabels(path.node)[0]); + const nodeStmt = t.expressionStatement(path.node); + const stackFrame = t.objectExpression([t.objectProperty(t.identifier('kind'), t.stringLiteral('rest')), t.objectProperty(t.identifier('f'), restoreNextFrame), t.objectProperty(t.identifier('index'), applyLbl), t.objectProperty(t.identifier('this'), t.thisExpression())]); + const restoreNode = t.assignmentExpression(path.node.operator, path.node.left, stackFrameCall); + const ifStmt = t.ifStatement(isNormalMode, t.blockStatement([t.expressionStatement(t.callExpression(pushEagerStack, [stackFrame])), t.expressionStatement(t.callExpression(captureLocals, [t.memberExpression(eagerStack, t.numericLiteral(0), true)])), nodeStmt, t.expressionStatement(t.callExpression(shiftEagerStack, []))]), t.ifStatement(t.binaryExpression('===', target, applyLbl), t.blockStatement([t.expressionStatement(restoreNode), t.expressionStatement(t.callExpression(shiftEagerStack, []))]))); + ifStmt.isTransformed = true; + const stmtParent = path.getStatementParent(); + stmtParent.replaceWith(ifStmt); + stmtParent.skip(); +} + +exports.eagerCaptureLogic = eagerCaptureLogic; +/** + * Special return-value to conditionally capture stack frames and propogate + * returns up to the runtime. + * + * jumper [[ x = f_n(...args) ]] = + * { + * let ret; + * if (mode === 'normal') { + * ret = f_n(...args); + * } else if (mode === 'restoring' && target === n) { + * ret = R.stack[R.stack.length-1].f(); + * } + * if (ret instanceof Capture) { + * ret.stack.push(stackFrame); + * return ret; + * } + * if (mode === 'normal') x = ret; + * } + */ + +function retvalCaptureLogic(path, opts) { + const applyLbl = t.numericLiteral(label_1.getLabels(path.node)[0]); + const left = path.node.left; + const stackFrame = t.objectExpression([t.objectProperty(t.identifier('kind'), t.stringLiteral('rest')), t.objectProperty(t.identifier('f'), restoreNextFrame), t.objectProperty(t.identifier('index'), applyLbl), t.objectProperty(t.identifier('this'), t.thisExpression())]); + const retStack = t.memberExpression(left, t.identifier('stack')); + const restoreBlock = t.ifStatement(t.binaryExpression('instanceof', left, captureExn), t.blockStatement([t.expressionStatement(t.callExpression(t.memberExpression(retStack, t.identifier('push')), [stackFrame])), t.expressionStatement(t.callExpression(captureLocals, [t.memberExpression(retStack, t.binaryExpression('-', t.memberExpression(retStack, t.identifier('length')), t.numericLiteral(1)), true)])), t.returnStatement(left)])); + const ifStmt = t.ifStatement(isNormalMode, t.expressionStatement(path.node), t.ifStatement(t.binaryExpression('===', target, applyLbl), t.expressionStatement(t.assignmentExpression('=', left, stackFrameCall)))); + const replace = t.ifStatement(bh.or(isNormalMode, t.binaryExpression('===', target, applyLbl)), t.blockStatement([ifStmt, restoreBlock])); + replace.isTransformed = true; + const stmtParent = path.getStatementParent(); + stmtParent.replaceWith(replace); + stmtParent.skip(); +} + +exports.retvalCaptureLogic = retvalCaptureLogic; + +function fudgeCaptureLogic(path) { + return; +} + +exports.fudgeCaptureLogic = fudgeCaptureLogic; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/callcc/declVars.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/callcc/declVars.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Assumes that singleVarDecls has run before this and handled all the `let` + * and `const` declarations. + * + * Moves var statements to the top of functions. + * + * When a var is moved, it is initialized to undefined. The + * transformation introduces assignment statements where the var statement + * originally occurred. + */ + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const h = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const funWithBody = { + enter(path) { + path.node.decls = []; + }, + + exit(path) { + if (path.node.decls.length > 0) { + const decl = t.variableDeclaration('var', path.node.decls.map(id => t.variableDeclarator(id))); + path.node.body.body.unshift(decl); + } + } + +}; +const lift = { + Program: { + enter(path) { + path.node.decls = []; + }, + + exit(path) { + if (path.node.decls.length > 0) { + const decl = t.variableDeclaration('var', path.node.decls.map(id => t.variableDeclarator(id))); + path.node.body.unshift(decl); + } + } + + }, + FunctionDeclaration: funWithBody, + FunctionExpression: funWithBody, + ObjectMethod: funWithBody, + + VariableDeclaration(path) { + const declarations = path.node.declarations; + let fParent = path.getFunctionParent().node; + + if (!h.isFunWithBody(fParent) && !t.isProgram(fParent)) { + throw new Error("Variable declarations should be inside a function. Parent was ".concat(path.node.type)); + } + + const stmts = []; + + if (declarations[0].__boxVarsInit__) { + return; + } + + for (const decl of declarations) { + if (decl.id.type !== 'Identifier') { + throw new Error("Destructuring assignment not supported"); + } + + fParent.decls.push(decl.id); + + if (decl.init !== null) { + // If we call path.insertAfter here, we will add assignments in reverse + // order. Fortunately, path.replaceWithMultiple can take an array of nodes. + stmts.push(t.expressionStatement(t.assignmentExpression('=', decl.id, decl.init))); + } + } + + path.replaceWithMultiple(stmts); + } + +}; + +module.exports = function () { + return { + visitor: lift + }; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/callcc/jumper.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/callcc/jumper.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const assert = __webpack_require__(/*! assert */ "./node_modules/assert/assert.js"); + +const bh = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const normalize_js_1 = __webpack_require__(/*! @stopify/normalize-js */ "./node_modules/@stopify/normalize-js/dist/ts/index.js"); + +const hygiene_1 = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +const capture = __webpack_require__(/*! ./captureLogics */ "./node_modules/@stopify/continuations/dist/src/callcc/captureLogics.js"); + +const boxAssignables_1 = __webpack_require__(/*! ./boxAssignables */ "./node_modules/@stopify/continuations/dist/src/callcc/boxAssignables.js"); + +const label_1 = __webpack_require__(/*! ./label */ "./node_modules/@stopify/continuations/dist/src/callcc/label.js"); + +const h = __webpack_require__(/*! ../helpers */ "./node_modules/@stopify/continuations/dist/src/helpers.js"); + +const captureLogics_1 = __webpack_require__(/*! ./captureLogics */ "./node_modules/@stopify/continuations/dist/src/callcc/captureLogics.js"); + +exports.restoreNextFrame = captureLogics_1.restoreNextFrame; +let letExpression = bh.letExpression; +const frame = t.identifier('$frame'); +const newTarget = t.identifier('newTarget'); +const captureFrameId = t.identifier('frame'); +const matArgs = t.identifier('materializedArguments'); +const restoreExn = t.memberExpression(captureLogics_1.types, t.identifier('Restore')); +const isRestoringMode = t.unaryExpression('!', captureLogics_1.isNormalMode); +const popRuntimeStack = t.callExpression(t.memberExpression(captureLogics_1.runtimeStack, t.identifier('pop')), []); +const argsLen = t.identifier('argsLen'); +const increaseStackSize = t.expressionStatement(t.updateExpression('++', t.memberExpression(captureLogics_1.runtime, t.identifier('remainingStack')))); +const decreaseStackSize = t.expressionStatement(t.updateExpression('--', t.memberExpression(captureLogics_1.runtime, t.identifier('remainingStack')))); + +function func(path, state) { + const jsArgs = state.opts.jsArgs; + + if (path.node.mark === 'Flat') { + return; + } + + const restoreLocals = path.node.localVars; // We instrument every non-flat function to begin with a *restore block* + // that is able to re-construct a saved stack frame. When the function is + // invoked in restore mode, its formal arguments are already restored. + // The restore block must restore the local variables and deal with + // the *arguments* object. The arguments object is a real pain and hurts + // performance. So, we avoid restoring it faithfully unless we are explicitly + // configured to do so. + + const restoreBlock = [t.expressionStatement(t.assignmentExpression('=', frame, popRuntimeStack)), t.expressionStatement(t.assignmentExpression('=', captureLogics_1.target, t.memberExpression(frame, t.identifier('index'))))]; + + if (restoreLocals.length > 0) { + // Restore all local variables. Creates the expression: + // [local0, local1, ... ] = topStack.locals; + restoreBlock.push(t.expressionStatement(t.assignmentExpression('=', t.arrayPattern(restoreLocals), t.memberExpression(frame, t.identifier('locals'))))); + } + + if (path.node.__usesArgs__ && state.opts.jsArgs === 'full') { + // To fully support the arguments object, we need to ensure that the + // formal parameters alias the arguments array. This restores the + // aliases using: + // + // [param0, param1, ...] = topStack.formals + restoreBlock.push(t.expressionStatement(t.assignmentExpression('=', t.arrayPattern(path.node.params), t.memberExpression(frame, t.identifier('formals'))))); + restoreBlock.push(t.expressionStatement(t.assignmentExpression('=', argsLen, t.memberExpression(frame, argsLen)))); + restoreBlock.push(t.expressionStatement(t.assignmentExpression('=', matArgs, t.logicalExpression('||', t.memberExpression(frame, t.identifier('params')), matArgs)))); + } + + const ifRestoring = t.ifStatement(isRestoringMode, t.blockStatement(restoreBlock)); // The body of a local function that saves the the current stack frame. + + const captureBody = []; // Save all local variables as an array in frame.locals. + + if (restoreLocals.length > 0) { + captureBody.push(t.expressionStatement(t.assignmentExpression('=', t.memberExpression(captureFrameId, t.identifier('locals')), t.arrayExpression(restoreLocals)))); + } // To support 'full' arguments ... + + + if (path.node.__usesArgs__ && state.opts.jsArgs === 'full') { + // ... save a copy of the parameters in the stack frame and + captureBody.push(t.expressionStatement(t.assignmentExpression('=', t.memberExpression(captureFrameId, t.identifier('formals')), t.arrayExpression(path.node.params)))); // ... save the length of the arguments array in the stack frame + + captureBody.push(t.expressionStatement(t.assignmentExpression('=', t.memberExpression(captureFrameId, argsLen), argsLen))); + } + + const captureClosure = t.functionDeclaration(captureLogics_1.captureLocals, [captureFrameId], t.blockStatement(captureBody)); // A local function to restore the next stack frame + + const reenterExpr = path.node.__usesArgs__ ? t.callExpression(t.memberExpression(path.node.id, t.identifier('apply')), [t.thisExpression(), matArgs]) : t.callExpression(t.memberExpression(path.node.id, t.identifier('call')), [t.thisExpression(), ...path.node.params.map(paramToArg)]); + const reenterClosure = t.variableDeclaration('var', [t.variableDeclarator(captureLogics_1.restoreNextFrame, t.arrowFunctionExpression([], t.blockStatement(path.node.__usesArgs__ ? [t.expressionStatement(t.assignmentExpression('=', t.memberExpression(matArgs, t.identifier('length')), t.memberExpression(t.callExpression(t.memberExpression(t.identifier('Object'), t.identifier('keys')), [matArgs]), t.identifier('length')))), t.returnStatement(reenterExpr)] : [t.returnStatement(reenterExpr)])))]); + const mayMatArgs = []; + + if (path.node.__usesArgs__) { + const argExpr = jsArgs === 'faithful' || jsArgs === 'full' ? bh.arrayPrototypeSliceCall(t.identifier('arguments')) : t.identifier('arguments'); + mayMatArgs.push(t.variableDeclaration('let', [t.variableDeclarator(matArgs, argExpr)])); + const boxedArgs = path.node.boxedArgs; + + if (jsArgs === 'faithful' || jsArgs === 'full') { + const initMatArgs = []; + path.node.params.forEach((x, i) => { + if (boxedArgs.contains(x.name)) { + const cons = t.assignmentExpression('=', t.memberExpression(matArgs, t.numericLiteral(i), true), boxAssignables_1.box(t.identifier(x.name))); + initMatArgs.push(t.expressionStatement(cons)); + } + }); + mayMatArgs.push(bh.sIf(captureLogics_1.isNormalMode, t.blockStatement(initMatArgs))); + } + } + + const defineArgsLen = letExpression(argsLen, t.memberExpression(t.identifier('arguments'), t.identifier('length'))); + path.node.body.body.unshift(...[...(state.opts.jsArgs === 'full' ? [defineArgsLen] : []), ...mayMatArgs, decreaseStackSize, ifRestoring, captureClosure, reenterClosure]); + path.skip(); +} + +function catchFunc(path, state) { + const jsArgs = state.opts.jsArgs; + + if (path.node.mark === 'Flat') { + return; + } + + const restoreLocals = path.node.localVars; + const exn = hygiene_1.fresh('exn'); + const exnStack = t.memberExpression(exn, t.identifier('stack')); + const params = path.node.__usesArgs__ ? matArgs : t.arrayExpression(path.node.params.map(paramToArg)); + const captureObject = [t.objectProperty(t.identifier('kind'), t.stringLiteral('rest')), t.objectProperty(t.identifier('f'), path.node.id), t.objectProperty(t.identifier('index'), captureLogics_1.target), t.objectProperty(t.identifier('locals'), t.arrayExpression(restoreLocals)), t.objectProperty(t.identifier('params'), params), t.objectProperty(t.identifier('this'), t.thisExpression())]; + + if (path.node.__usesArgs__ && jsArgs === 'full') { + // ... save a copy of the parameters in the stack frame and + captureObject.push(t.objectProperty(t.identifier('formals'), t.arrayExpression(path.node.params))); // ... save the length of the arguments array in the stack frame + + captureObject.push(t.objectProperty(argsLen, argsLen)); + } + + const frame = t.identifier('$frame'); // We instrument every non-flat function to begin with a *restore block* + // that is able to re-construct a saved stack frame. When the function is + // invoked in restore mode, its formal arguments are already restored. + // The restore block must restore the local variables and deal with + // the *arguments* object. The arguments object is a real pain and hurts + // performance. So, we avoid restoring it faithfully unless we are explicitly + // configured to do so. + + const restoreBlock = [t.variableDeclaration('const', [t.variableDeclarator(frame, popRuntimeStack)]), t.expressionStatement(t.assignmentExpression('=', captureLogics_1.target, t.memberExpression(frame, t.identifier('index'))))]; + + if (restoreLocals.length > 0) { + // Restore all local variables. Creates the expression: + // [local0, local1, ... ] = topStack.locals; + restoreBlock.push(t.expressionStatement(t.assignmentExpression('=', t.arrayPattern(restoreLocals), t.memberExpression(frame, t.identifier('locals'))))); + } + + if (path.node.__usesArgs__ && jsArgs === 'full') { + // To fully support the arguments object, we need to ensure that the + // formal parameters alias the arguments array. This restores the + // aliases using: + // + // [param0, param1, ...] = topStack.formals + restoreBlock.push(t.expressionStatement(t.assignmentExpression('=', t.arrayPattern(path.node.params), t.memberExpression(frame, t.identifier('formals'))))); + restoreBlock.push(t.expressionStatement(t.assignmentExpression('=', argsLen, t.memberExpression(frame, argsLen)))); + restoreBlock.push(t.expressionStatement(t.assignmentExpression('=', matArgs, t.logicalExpression('||', t.memberExpression(frame, t.identifier('params')), matArgs)))); + } + + const ifRestoring = t.ifStatement(isRestoringMode, t.blockStatement(restoreBlock)); + const mayMatArgs = []; + + if (path.node.__usesArgs__) { + const argExpr = jsArgs === 'faithful' || jsArgs === 'full' ? bh.arrayPrototypeSliceCall(t.identifier('arguments')) : t.identifier('arguments'); + mayMatArgs.push(t.variableDeclaration('let', [t.variableDeclarator(matArgs, argExpr)])); + const boxedArgs = path.node.boxedArgs; + + if (jsArgs === 'faithful' || jsArgs === 'full') { + const initMatArgs = []; + path.node.params.forEach((x, i) => { + if (boxedArgs.contains(x.name)) { + const cons = t.assignmentExpression('=', t.memberExpression(matArgs, t.numericLiteral(i), true), boxAssignables_1.box(t.identifier(x.name))); + initMatArgs.push(t.expressionStatement(cons)); + } + }); + mayMatArgs.push(bh.sIf(captureLogics_1.isNormalMode, t.blockStatement(initMatArgs))); + } + } + + const defineArgsLen = letExpression(argsLen, t.memberExpression(t.identifier('arguments'), t.identifier('length'))); + const wrapBody = t.tryStatement(path.node.body, t.catchClause(exn, t.blockStatement([t.ifStatement(t.binaryExpression('instanceof', exn, captureLogics_1.captureExn), t.blockStatement([t.expressionStatement(t.callExpression(t.memberExpression(exnStack, t.identifier('push')), [t.objectExpression(captureObject)]))])), t.throwStatement(exn)]))); + path.node.body = t.blockStatement([...(jsArgs === 'full' ? [defineArgsLen] : []), ...mayMatArgs, decreaseStackSize, ifRestoring, wrapBody]); +} + +const captureLogics = { + lazy: capture.lazyCaptureLogic, + catch: capture.lazyGlobalCatch, + eager: capture.eagerCaptureLogic, + retval: capture.retvalCaptureLogic, + fudge: capture.fudgeCaptureLogic +}; +const instrumentLogics = { + catch: catchFunc, + lazy: func, + eager: func, + retval: func, + fudge: func +}; + +function isFlat(path) { + return path.getFunctionParent().node.mark === 'Flat'; +} + +function usesArguments(path) { + let r = false; + const visitor = { + ReferencedIdentifier(path) { + if (path.node.name === 'arguments') { + const parent = path.parent; + + if (t.isMemberExpression(parent) && parent.object === path.node && parent.computed === false && t.isIdentifier(parent.property) && parent.property.name === 'length') {// arguments.length is harmless and does not require materialization + } else { + r = true; + path.stop(); + } + } + }, + + Function(path) { + path.skip(); + } + + }; + path.traverse(visitor); + return r; +} + +function paramToArg(node) { + if (node.type === 'Identifier') { + return node; + } else if (node.type === 'RestElement' && node.argument.type === 'Identifier') { + return t.spreadElement(node.argument); + } else { + throw new Error("paramToArg: expected Identifier or RestElement, received ".concat(node.type)); + } +} + +function runtimeInvoke(method, ...args) { + return t.callExpression(t.memberExpression(captureLogics_1.runtime, t.identifier(method)), args); +} + +function labelsIncludeTarget(labels) { + return labels.reduce((acc, lbl) => bh.or(t.binaryExpression('===', captureLogics_1.target, t.numericLiteral(lbl)), acc), bh.eFalse); +} + +function isNormalGuarded(stmt) { + return t.isIfStatement(stmt) && stmt.test === captureLogics_1.isNormalMode && stmt.alternate === null; +} + +const jumper = { + Identifier: function (path, s) { + if (s.opts.jsArgs === 'full' && path.node.name === 'arguments' && t.isMemberExpression(path.parent) && path.parent.property.type === 'Identifier' && path.parent.property.name === 'length') { + path.parentPath.replaceWith(argsLen); + } else if (s.opts.jsArgs === 'full' && path.node.name === 'arguments') { + path.node.name = 'materializedArguments'; + } + }, + BlockStatement: { + exit(path) { + const stmts = path.node.body; + + if (stmts.length === 1) { + return; + } + + const blocks = normalize_js_1.generic.groupBy((x, y) => isNormalGuarded(x) && isNormalGuarded(y), stmts); + const result = []; + + for (const block of blocks) { + if (block.length === 1) { + result.push(block[0]); + } else { + block.forEach(stmt => { + assert(stmt.test === captureLogics_1.isNormalMode); + }); + result.push(bh.sIf(captureLogics_1.isNormalMode, t.blockStatement(block.map(stmt => stmt.consequent)))); + } + } + + path.node.body = result; + } + + }, + ExpressionStatement: { + exit(path, s) { + if (isFlat(path)) { + return; + } + + if (path.node.appType !== undefined && path.node.appType >= label_1.AppType.Tail) { + // Skip if the right hand-side is a flat call + if (path.node.expression.type === 'AssignmentExpression' && path.node.expression.right.mark === 'Flat') {// Do Nothing + } else { + const captureFun = captureLogics[s.opts.captureMethod]; + captureFun(path.get('expression'), s.opts); + return; + } + } + + path.replaceWith(t.ifStatement(captureLogics_1.isNormalMode, path.node)); + path.skip(); + } + + }, + "FunctionExpression|FunctionDeclaration": { + enter(path, s) { + path.node.__usesArgs__ = usesArguments(path); + + if (path.node.mark === 'Flat') { + return; + } + }, + + exit(path, state) { + if (path.node.mark === 'Flat') { + return; + } + + const instrumentFunction = instrumentLogics[state.opts.captureMethod]; + instrumentFunction(path, state); + const declTarget = bh.varDecl(captureLogics_1.target, t.nullLiteral()); + const declFrame = bh.varDecl(frame, t.nullLiteral()); + path.node.body.body.unshift(declTarget, declFrame); // Increment the remainingStack at the last line of the function. + // This does not break tail calls. + + path.node.body.body.push(increaseStackSize); + + if (state.opts.newMethod === 'direct') { + path.node.localVars.push(newTarget); + const declNewTarget = bh.varDecl(newTarget, t.memberExpression(t.identifier('new'), t.identifier('target'))); + path.node.body.body.unshift(declNewTarget); + const ifConstructor = bh.sIf(newTarget, t.returnStatement(t.thisExpression())); + ifConstructor.isTransformed = true; + path.node.body.body.push(ifConstructor); + } + } + + }, + WhileStatement: function (path) { + // No need for isFlat check here. Loops make functions not flat. + path.node.test = bh.or(bh.and(captureLogics_1.isNormalMode, path.node.test), bh.and(isRestoringMode, labelsIncludeTarget(label_1.getLabels(path.node)))); + }, + LabeledStatement: { + exit(path) { + if (isFlat(path)) { + return; + } + + path.replaceWith(bh.sIf(bh.or(captureLogics_1.isNormalMode, bh.and(isRestoringMode, labelsIncludeTarget(label_1.getLabels(path.node)))), path.node)); + path.skip(); + } + + }, + IfStatement: { + exit(path) { + if (path.node.isTransformed || isFlat(path)) { + return; + } + + const _path$node = path.node, + test = _path$node.test, + consequent = _path$node.consequent, + alternate = _path$node.alternate; + const alternateCond = bh.or(captureLogics_1.isNormalMode, bh.and(isRestoringMode, labelsIncludeTarget(label_1.getLabels(alternate)))); + const newAlt = alternate === null ? alternate : t.ifStatement(alternateCond, alternate); + const consequentCond = bh.or(bh.and(captureLogics_1.isNormalMode, test), bh.and(isRestoringMode, labelsIncludeTarget(label_1.getLabels(consequent)))); + const newIf = t.ifStatement(consequentCond, consequent, newAlt); + path.replaceWith(newIf); + path.skip(); + } + + }, + ReturnStatement: { + exit(path, s) { + switch (path.node.appType) { + case label_1.AppType.None: + { + if (isFlat(path)) { + return; + } + + if (s.opts.newMethod === 'direct') { + const retval = hygiene_1.fresh('retval'); + const declRetval = letExpression(retval, path.node.argument); + const isObject = t.binaryExpression('instanceof', retval, t.identifier('Object')); + const conditional = t.conditionalExpression(bh.and(newTarget, t.unaryExpression('!', isObject)), t.thisExpression(), retval); + path.replaceWith(t.blockStatement([declRetval, increaseStackSize, t.returnStatement(conditional)])); + path.skip(); + } else { + path.insertBefore(increaseStackSize); + } + + break; + } + + case label_1.AppType.Mixed: + return; + + case label_1.AppType.Tail: + // Increment the remainingStack before returning from a non-flat function. + if (!isFlat(path)) { + path.insertBefore(increaseStackSize); + } // Labels may occur if this return statement occurs in a try block. + + + const labels = label_1.getLabels(path.node); + const ifReturn = t.ifStatement(captureLogics_1.isNormalMode, path.node, bh.sIf(bh.and(isRestoringMode, labelsIncludeTarget(labels)), t.returnStatement(captureLogics_1.stackFrameCall))); + path.replaceWith(ifReturn); + path.skip(); + return; + } + } + + }, + CatchClause: { + exit(path, s) { + if (s.opts.captureMethod === 'retval' || isFlat(path)) { + return; + } + + const _path$node2 = path.node, + param = _path$node2.param, + body = _path$node2.body; + body.body.unshift(t.ifStatement(bh.or(t.binaryExpression('instanceof', param, captureLogics_1.captureExn), t.binaryExpression('instanceof', param, restoreExn), t.binaryExpression('instanceof', param, captureLogics_1.endTurnExn)), t.throwStatement(param)), t.expressionStatement(runtimeInvoke('clearTrace'))); + path.skip(); + } + + }, + TryStatement: { + exit(path) { + // To understand what's happening here, see jumperizeTry.ts + if (path.node.handler) { + path.node.block.body.unshift(bh.sIf(bh.and(isRestoringMode, labelsIncludeTarget(label_1.getLabels(path.node.handler.body))), t.throwStatement(path.node.handler.eVar))); + } + + if (path.node.finalizer) { + path.node.finalizer = t.blockStatement([bh.sIf(t.unaryExpression('!', t.memberExpression(captureLogics_1.runtime, t.identifier('capturing'))), path.node.finalizer)]); + } + } + + }, + ThrowStatement: { + // Transform `throw e;` to `runtime.pushTrace(l); throw e;`, where `l` + // is a string that represents the original source location of this + // statement. We assume that the `throw e` occurs in a block. + exit(path, s) { + const fName = bh.enclosingFunctionName(path); + const l = t.stringLiteral(h.locationString(fName, path, s.opts)); + path.insertBefore(t.expressionStatement(runtimeInvoke('pushTrace', l))); + } + + } +}; + +function plugin() { + return { + visitor: jumper + }; +} + +exports.plugin = plugin; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/callcc/label.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/callcc/label.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const cannotCapture_1 = __webpack_require__(/*! ../common/cannotCapture */ "./node_modules/@stopify/continuations/dist/src/common/cannotCapture.js"); + +const h = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const imm = __webpack_require__(/*! immutable */ "./node_modules/immutable/dist/immutable.js"); + +var AppType; + +(function (AppType) { + AppType[AppType["None"] = 0] = "None"; + AppType[AppType["Tail"] = 1] = "Tail"; + AppType[AppType["Mixed"] = 2] = "Mixed"; +})(AppType = exports.AppType || (exports.AppType = {})); + +function joinAppType(x, y) { + return Math.max(x, y); +} + +function joinAppTypes(...args) { + return args.reduce(joinAppType, AppType.None); +} + +function getLabels0(node) { + if (node === null) { + return []; + } + + return node.labels === undefined ? [] : [...node.labels]; +} + +function getLabels(...nodes) { + const r = []; + + for (const node of nodes) { + r.push(...getLabels0(node)); + } + + return [...new Set(r).values()]; +} + +exports.getLabels = getLabels; + +function getAppType(node) { + if (node === null) { + return AppType.None; + } + + return node.appType; +} // true if the expression is a function call that may capture a continuation + + +function isUnsafeCall(e) { + return (t.isCallExpression(e) || t.isNewExpression(e)) && !cannotCapture_1.cannotCapture(e); +} + +const visitFunction = { + enter(path) { + this.inTryBlockStack.push(this.inTryBlock); + this.inTryBlock = false; + const allVars = imm.Set.of(...Object.keys(path.scope.bindings)); + let otherVars = imm.Set.of(...path.node.params.map(h.lvaltoName)).union(path.node.id ? imm.Set.of(path.node.id.name) : imm.Set()); + path.node.localVars = allVars.subtract(otherVars).toArray().map(x => t.identifier(x)); + }, + + exit(path) { + this.inTryBlock = this.inTryBlockStack.pop(); + + if (path.node.type === 'FunctionDeclaration') { + path.node.appType = AppType.None; + } + } + +}; +const visitor = { + TryStatement: { + enter(path) { + this.inTryBlockStack.push(this.inTryBlock); + this.inTryBlock = true; + }, + + exit(path) { + const _path$node = path.node, + block = _path$node.block, + finalizer = _path$node.finalizer, + handler = _path$node.handler; + this.inTryBlock = this.inTryBlockStack.pop(); + path.node.labels = getLabels(block, finalizer, handler && handler.body); // TODO(arjun): This is not exactly right. A try statement has tail calls + // if and only if the try block has no function calls and all function + // calls in the catch and finally block are tail calls. + + const t = joinAppTypes(getAppType(block), getAppType(finalizer), getAppType(handler && handler.body)); + path.node.appType = t === AppType.None ? AppType.None : AppType.Mixed; + } + + }, + // TODO(arjun): I think an enclosing function will gather labels from + // an enclosed function. + FunctionDeclaration: visitFunction, + FunctionExpression: visitFunction, + ObjectMethod: visitFunction, + Program: { + enter(path) { + this.counter = 0; + this.inTryBlock = false; + this.inTryBlockStack = []; + } + + }, + ReturnStatement: { + exit(path) { + // Assumes no nested calls. + const isCall = isUnsafeCall(path.node.argument); + + if (!isCall) { + path.node.appType = AppType.None; + } else if (this.inTryBlock) { + path.node.appType = AppType.Mixed; + } else { + path.node.appType = AppType.Tail; + } + } + + }, + CallExpression: function (path) { + path.node.labels = [this.counter++]; + }, + NewExpression: function (path) { + path.node.labels = [this.counter++]; + }, + AssignmentExpression: { + exit(path) { + path.node.labels = getLabels(path.node.right); + } + + }, + VariableDeclaration: { + exit(path) { + path.node.appType = AppType.None; + } + + }, + ExpressionStatement: { + exit(path) { + const unsafe = t.isAssignmentExpression(path.node.expression) && isUnsafeCall(path.node.expression.right); + path.node.labels = getLabels(path.node.expression); + path.node.appType = unsafe ? AppType.Mixed : AppType.None; + } + + }, + IfStatement: { + exit(path) { + const _path$node2 = path.node, + consequent = _path$node2.consequent, + alternate = _path$node2.alternate; + path.node.labels = getLabels(consequent, alternate); + path.node.appType = joinAppTypes(getAppType(consequent), getAppType(alternate)); + } + + }, + WhileStatement: { + exit(path) { + const body = path.node.body; + path.node.labels = getLabels(body); + path.node.appType = getAppType(body); + } + + }, + LabeledStatement: { + exit(path) { + const body = path.node.body; + path.node.labels = getLabels(body); + path.node.appType = getAppType(body); + } + + }, + BlockStatement: { + exit(path) { + const body = path.node.body; + path.node.labels = getLabels(...body); + path.node.appType = joinAppTypes(...body.map(getAppType)); + } + + } +}; + +function plugin() { + return { + visitor + }; +} + +exports.plugin = plugin; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/common/cannotCapture.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/common/cannotCapture.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +const knowns = ['Object', 'Function', 'Boolean', 'Symbol', 'Error', 'EvalError', //'InternalError', +'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', 'Number', 'Math', 'Date', 'String', 'RegExp', 'Array', 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array', 'Map', 'Set', 'WeakMap', 'WeakSet', 'ArrayBuffer', 'TextDecoder']; +exports.knowns = knowns; + +function cannotCapture(node) { + if (node.callee.type !== 'Identifier') { + return false; + } + + return knowns.includes(node.callee.name); +} + +exports.cannotCapture = cannotCapture; +const unavailableOnNode = ['TextDecoder']; +const knownBuiltIns = knowns.filter(x => !unavailableOnNode.includes(x)).map(o => eval(o)); +exports.knownBuiltIns = knownBuiltIns; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/common/desugarNew.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/common/desugarNew.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * This transformation converts all instances of `new` to a function + * call. Note that the handler itself stil has a `new` expression to deal + * with native constructors. + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const cannotCapture_1 = __webpack_require__(/*! ./cannotCapture */ "./node_modules/@stopify/continuations/dist/src/common/cannotCapture.js"); +/** + * function handleNew(constr, ...args) { + * + * if (common.knownBuiltIns.includes(constr)) { + * return new constr(...args); + * } + * + * const obj = Object.create(constr.prototype); + * const result = constr.apply(obj, args); + * + * return (typeof result === 'object') ? result : obj; + * + * } + */ + + +module.exports = function () { + return { + visitor: { + Program: { + exit(path, state) { + if (!state.opts.compileFunction) { + const constr = t.identifier('constr'); + const args = t.identifier('args'); + const knownTest = t.callExpression(t.memberExpression(t.memberExpression(t.identifier('$__C'), t.identifier('knownBuiltIns')), t.identifier('includes')), [constr]); + knownTest.mark = 'Flat'; + const flatNew = t.newExpression(constr, [t.spreadElement(args)]); + flatNew.mark = 'Flat'; + const knownIf = t.ifStatement(knownTest, t.returnStatement(flatNew)); + const obj = t.identifier('obj'); + const createCall = t.callExpression(t.memberExpression(t.identifier('Object'), t.identifier('create')), [t.memberExpression(constr, t.identifier('prototype'))]); + createCall.mark = 'Flat'; + const createObj = util_1.letExpression(obj, createCall, 'const'); + const result = t.identifier('result'); + const applyConstr = util_1.letExpression(result, t.callExpression(t.memberExpression(constr, t.identifier('apply')), [obj, args]), 'const'); + const returnObj = t.returnStatement(t.conditionalExpression(t.binaryExpression('===', t.unaryExpression('typeof', result), t.stringLiteral('object')), result, obj)); + const handleNewFunction = t.functionDeclaration(t.identifier('handleNew'), [constr, t.restElement(args)], t.blockStatement([knownIf, createObj, applyConstr, returnObj])); + path.node.body.unshift(handleNewFunction); + } + } + + }, + + NewExpression(path) { + if (path.node.mark === 'Flat') { + return; + } + + if (t.isIdentifier(path.node.callee) && cannotCapture_1.knowns.includes(path.node.callee.name)) { + return; + } + + const _path$node = path.node, + callee = _path$node.callee, + args = _path$node.arguments; + + if (t.isIdentifier(callee) && cannotCapture_1.knowns.includes(callee.name)) { + return; + } + + path.replaceWith(t.callExpression(t.identifier('handleNew'), [callee, ...args])); + } + + } + }; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/compiler/check-compiler-opts.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/compiler/check-compiler-opts.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * This module contains functions to check and normalize compiler options. + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const sourceMaps = __webpack_require__(/*! ./sourceMaps */ "./node_modules/@stopify/continuations/dist/src/compiler/sourceMaps.js"); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const validFlags = ['compileFunction', 'getters', 'debug', 'captureMethod', 'newMethod', 'es', 'hofs', 'jsArgs', 'requireRuntime', 'sourceMap', 'onDone', 'eval2', 'compileMode']; +/** + * If 'src.key' exists: (1) throws if 'pred(src.key)' is false then (2) + * copies 'src.key' to 'dst.value'. + */ + +function copyProp(dst, src, key, pred, errorMessage) { + if (src[key] === undefined) { + return; + } + + if (!pred(src[key])) { + throw new Error(errorMessage); + } + + dst[key] = src[key]; +} + +exports.copyProp = copyProp; +/** + * If 'src.key' exists: (1) applies 'f(src.key)', (2) throws if 'pred' does not + * hold on the result, and (3) copies the result to 'dst.value'. + */ + +function transformProp(dst, src, key, f, pred, errorMessage) { + if (src[key] === undefined) { + return; + } + + const value = f(src[key]); + + if (!pred(value)) { + throw new Error(errorMessage); + } + + dst[key] = value; +} + +exports.transformProp = transformProp; +/** + * Given a partial 'CompilerOpts', fill in sensible defaults and dynamically + * enforce type and value checks. + * + * @param value a 'CompilerOpts' with elided fields + */ + +function checkAndFillCompilerOpts(value, sourceMap) { + if (value === null || typeof value !== 'object') { + throw new Error("expected an object for CompilerOpts"); + } + + Object.keys(value).forEach(key => { + if (!validFlags.includes(key)) { + throw new Error("invalid flag: ".concat(key)); + } + }); + const opts = { + compileFunction: false, + getters: false, + debug: false, + captureMethod: 'lazy', + newMethod: 'wrapper', + es: 'sane', + jsArgs: 'simple', + requireRuntime: false, + sourceMap: sourceMaps.generateLineMapping(sourceMap), + onDone: t.functionExpression(t.identifier('onDone'), [], t.blockStatement([])), + eval2: false, + compileMode: 'normal' + }; + copyProp(opts, value, 'compileFunction', x => typeof x === 'boolean', ".compileFunction must be a boolean"); + copyProp(opts, value, 'getters', x => typeof x === 'boolean', ".getters must be a boolean"); + copyProp(opts, value, 'debug', x => typeof x === 'boolean', ".debug must be a boolean"); + copyProp(opts, value, 'captureMethod', x => ['lazy', 'catch', 'eager', 'retval', 'original', 'fudge'].includes(x), ".captureMethod must be 'lazy', 'catch', 'eager', 'retval', 'original', or 'fudge'"); + copyProp(opts, value, 'newMethod', x => ['direct', 'wrapper'].includes(x), ".newMethod must be 'direct' or 'wrapper'"); + copyProp(opts, value, 'es', x => ['sane', 'es5'].includes(x), ".es must be either 'sane' or 'es5'"); + copyProp(opts, value, 'jsArgs', x => ['simple', 'faithful', 'full'].includes(x), ".jsArgs must be either 'simple', 'faithful', or 'full'"); + copyProp(opts, value, 'requireRuntime', x => typeof x === 'boolean', ".requireRuntime must be a boolean"); // TODO(arjun): enforce pre-condition + + copyProp(opts, value, 'sourceMap', x => true, ''); + copyProp(opts, value, 'onDone', x => t.isExpression(x), ".onDone must be an expression (Babylon)"); + copyProp(opts, value, 'compileMode', x => ['normal', 'library'].includes(x), ".compileMode must be 'normal' or 'library'"); + return opts; +} + +exports.checkAndFillCompilerOpts = checkAndFillCompilerOpts; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/compiler/flatness.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/compiler/flatness.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const markFlatFunctions_1 = __webpack_require__(/*! ./markFlatFunctions */ "./node_modules/@stopify/continuations/dist/src/compiler/markFlatFunctions.js"); + +const markAnnotated_1 = __webpack_require__(/*! ./markAnnotated */ "./node_modules/@stopify/continuations/dist/src/compiler/markAnnotated.js"); + +const markFlatApplications_1 = __webpack_require__(/*! ./markFlatApplications */ "./node_modules/@stopify/continuations/dist/src/compiler/markFlatApplications.js"); + +const util_1 = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const visitor = { + Program(path) { + util_1.transformFromAst(path, [markAnnotated_1.markAnnotated]); + util_1.transformFromAst(path, [[markFlatFunctions_1.markFlatFunctions]]); + util_1.transformFromAst(path, [markFlatApplications_1.markFlatApplications]); + } + +}; + +function flatness() { + return { + visitor: visitor + }; +} + +exports.flatness = flatness; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/compiler/markAnnotated.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/compiler/markAnnotated.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const helpers_1 = __webpack_require__(/*! ../helpers */ "./node_modules/@stopify/continuations/dist/src/helpers.js"); + +function markerVisitor(path) { + const leadingComments = path.node.leadingComments; + + if (leadingComments && leadingComments.length > 0 && helpers_1.isStopifyAnnotation(leadingComments[leadingComments.length - 1].value.trim())) { + path.node.mark = 'Flat'; + } +} + +const visitor = { + CallExpression: markerVisitor, + NewExpression: markerVisitor, + FunctionDeclaration: markerVisitor, + FunctionExpression: markerVisitor +}; + +function markAnnotated() { + return { + visitor + }; +} + +exports.markAnnotated = markAnnotated; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/compiler/markFlatApplications.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/compiler/markFlatApplications.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); +/** + * 0 -> No debugging + * 1 -> Display labels added to applications + * 2 -> 1 + Display state of the scope structure + */ + + +let debug = 0; + +class Scope { + constructor(init = []) { + this.bindings = new Map(init); + } + + toString() { + let ret = "["; + this.bindings.forEach((k, v) => ret += "".concat(v, " -> ").concat(k, ", ")); + return ret + "]"; + } + +} + +class Env { + constructor() { + this.scopes = new Array(new Scope([])); // TODO(rachit): Add more known globals here. + // This is not correct in presence of renaming. + + ['WeakMap', 'Map', 'Set', 'WeakSet', 'String', 'Number', 'Function', 'Object', 'Array', 'Date', 'RegExp', 'Error', 'console.*', 'Object.*', 'Math.*'].map(e => this.addBinding(e, 'Flat')); + } + + toString() { + return this.scopes.map(x => x.toString()).join("\n"); + } + + findBinding(id) { + for (let iter in this.scopes) { + let scope = this.scopes[iter]; + let res = scope.bindings.get(id); // This is member expression of the form a.b + + if (id.split(".").length === 2) { + res = scope.bindings.get(id.split(".")[0] + "." + "*"); + } + + if (res) { + return res; + } + } // NOTE(rachit): If can't find the tag, be conservative and return notflat. + + + return 'NotFlat'; + } + + pushScope(scope) { + this.scopes.unshift(scope); + } + + popScope() { + if (this.scopes.length > 0) { + this.scopes.shift(); + } + } + + addBinding(id, tag) { + if (this.scopes.length === 0) { + throw new Error("Tried to add ".concat(id, " with tag ").concat(tag, " in empty Env")); + } else { + this.scopes[0].bindings.set(id, tag); + this.scopes[0].bindings.set(id + '.call', tag); + this.scopes[0].bindings.set(id + '.apply', tag); + } + } + +} + +let globalEnv = new Env(); + +function nodeToString(node) { + switch (node.type) { + case 'Identifier': + return node.name; + + case 'MemberExpression': + { + const oname = nodeToString(node.object); + const pname = nodeToString(node.property); + return oname && pname ? oname + "." + pname : null; + } + + default: + { + return null; + } + } +} +/** + * Visitors that run mark call expressions as 'flat' + */ + + +const markCallExpression = function (path) { + if (path.node.mark === 'Flat') { + return; + } + + const node = path.node; + const name = nodeToString(node.callee); + + if (name) { + const tag = globalEnv.findBinding(name); + + if (debug > 0) { + console.error("".concat(name, " -> ").concat(tag, " on line ").concat(path.node.loc ? path.node.loc.start.line : "")); + } + + node.mark = tag; + node.callee.mark = tag; + } +}; + +const programMarkCallExpression = function (path) { + if (path.node.mark === 'Flat') { + return; + } + + const fParent = path.findParent(p => t.isFunctionDeclaration(p) || t.isFunctionExpression(p)); + + if (fParent === null || fParent === undefined) { + const node = path.node; + + if (t.isFunctionExpression(node.callee)) { + node.mark = node.callee.mark; + return; + } + + const name = nodeToString(node.callee); + + if (name) { + const tag = globalEnv.findBinding(name); + + if (debug > 0) { + console.error("".concat(name, " -> ").concat(tag, " on line ").concat(path.node.loc ? path.node.loc.start.line : "")); + } + + node.mark = tag; + node.callee.mark = tag; + } + } +}; + +const func = { + enter(path) { + let paramsBind = path.node.params.map(p => [p.name, 'NotFlat']); + + if (path.node.id) { + globalEnv.addBinding(path.node.id.name, path.node.mark); // The function name is bound to its own mark and all the params are + // marked as not flat. + + let binds = [[path.node.id.name, path.node.mark], ...paramsBind]; + globalEnv.pushScope(new Scope(binds)); + } else { + globalEnv.pushScope(new Scope(paramsBind)); + } + }, + + exit(path) { + if (debug > 1) { + console.error("\n-------".concat(path.node.id.name, "----------")); + console.error(globalEnv.toString()); + console.error("\n-------------------------"); + } + + path.traverse(markingVisitor); + globalEnv.popScope(); + } + +}; +const assign = { + // NOTE(rachit): This naively assumes that all IDs that are assigned to + // are not flat. A better alternative to this is to check if the assignment + // is itself a flat function and give a tag accordingly. + enter(path) { + const name = nodeToString(path.node.left); + + if (name) { + globalEnv.addBinding(name, 'NotFlat'); + + if (debug > 0) { + console.error("".concat(name, " -> NotFlat on line ").concat(path.node.loc ? path.node.loc.start.line : "", " because of assignment")); + } + } + } + +}; +const program = { + enter(path) { + globalEnv = new Env(); + }, + + exit(path) { + if (debug > 1) { + console.error("\n-------program----------"); + console.error(globalEnv.toString()); + console.error("\n-------------------------"); + } + + path.traverse(programMarkingVisitor); + } + +}; // The Program visitor needs to ignore all function bodies + +const programMarkingVisitor = { + CallExpression: programMarkCallExpression, + NewExpression: programMarkCallExpression +}; +const markingVisitor = { + CallExpression: markCallExpression, + NewExpression: markCallExpression +}; +const visitor = { + Program: program, + FunctionDeclaration: func, + FunctionExpression: func, + AssignmentExpression: assign +}; + +function markFlatApplications() { + return { + visitor + }; +} + +exports.markFlatApplications = markFlatApplications; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/compiler/markFlatFunctions.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/compiler/markFlatFunctions.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * Mark functions are not provably flat as 'Untransformed' and others as + * 'Transformed'. This only marks the approproiate AST nodes. It is the job of + * the transformation to use the information. + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +let debug = false; +const prog = { + // Mark the untransformed functions after running call expression markers. + exit(path) { + path.traverse(markUntransformed); + } + +}; +const funcMarkUntransformed = { + enter(path) { + if (!path.node.mark) { + path.node.mark = 'Flat'; + } + + if (debug && t.isFunctionDeclaration(path.node)) { + const _path$node = path.node, + loc = _path$node.loc, + mark = _path$node.mark; + const info = "".concat(mark, ": ").concat(path.node.id.name).concat(loc ? " on line ".concat(loc.start.line) : ''); + console.error(info); + } + + if (debug && t.isFunctionExpression(path.node)) { + const _path$node2 = path.node, + loc = _path$node2.loc, + mark = _path$node2.mark, + id = _path$node2.id; + const info = "".concat(mark, ": ").concat(id ? id.name : '') + "".concat(loc ? " on line ".concat(loc.start.line) : ''); + console.error(info); + } + } + +}; +const markUntransformed = { + FunctionDeclaration: funcMarkUntransformed, + FunctionExpression: funcMarkUntransformed +}; +const callExpr = { + enter(path) { + if (path.node.mark === 'Flat') { + return; + } + + const fParent = path.findParent(p => t.isFunctionDeclaration(p) || t.isFunctionExpression(p)); + + if (fParent !== null && !fParent.node.mark) { + fParent.node.mark = 'NotFlat'; + } + } + +}; +const visitor = { + Program: prog, + CallExpression: callExpr, + NewExpression: callExpr, + Loop: callExpr, + ThrowStatement: callExpr +}; + +function markFlatFunctions() { + return { + visitor + }; +} + +exports.markFlatFunctions = markFlatFunctions; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/compiler/sourceMaps.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/compiler/sourceMaps.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const source_map_1 = __webpack_require__(/*! source-map */ "./node_modules/@stopify/continuations/node_modules/source-map/source-map.js"); + +const convertSourceMap = __webpack_require__(/*! convert-source-map */ "./node_modules/convert-source-map/index.js"); + +class LineMappingImpl { + constructor(getLine) { + this.getLine = getLine; + } + +} + +function getSourceMap(jsCode) { + const mapConverter = convertSourceMap.fromSource(jsCode); + + if (mapConverter === null) { + return; + } + + return mapConverter.toObject(); +} + +exports.getSourceMap = getSourceMap; +/** + * Returns a custom line mapper which maps `node_modules` sources to `null`. + */ + +function generateLineMapping(map) { + if (map) { + const sourceMap = new source_map_1.SourceMapConsumer(map); + return new LineMappingImpl((line, column) => { + const mapping = sourceMap.originalPositionFor({ + line, + column + }); // NOTE(arjun): Ignoring these directories is a bit of a hack + + if (mapping.source === null || mapping.source.includes('node_modules/') || mapping.source.includes('https://') || mapping.source.includes('goog/') || mapping.source.includes('cljs/') || mapping.source.includes('opt/') || mapping.source.includes('user_code/') || mapping.line === null) { + return null; + } else { + return mapping.line; + } + }); + } else { + return new LineMappingImpl((line, column) => line); + } +} + +exports.generateLineMapping = generateLineMapping; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/exposeGettersSetters.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/exposeGettersSetters.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const helpers_1 = __webpack_require__(/*! ./helpers */ "./node_modules/@stopify/continuations/dist/src/helpers.js"); + +const gettersRuntime = t.identifier('$gs'); +const get_prop = t.memberExpression(gettersRuntime, t.identifier('get_prop')); +const set_prop = t.memberExpression(gettersRuntime, t.identifier('set_prop')); +const delete_prop = t.memberExpression(gettersRuntime, t.identifier('delete_prop')); // Stops $gs.get_prop and $gs.set_prop from causing an infinite loop. + +set_prop.exposed = true; +get_prop.exposed = true; +delete_prop.exposed = true; + +function $func(func, ...args) { + return t.callExpression(func, args); +} + +const gettersRuntimePath = "".concat(helpers_1.runtimePath, "/gettersSetters.js"); +let enableGetters = false; +const gettersUsedVisitor = { + ObjectMethod(path) { + if (path.node.kind !== 'method') { + enableGetters = true; + path.stop(); + } + }, + + MemberExpression(path) { + const _path$node = path.node, + object = _path$node.object, + property = _path$node.property; + + if (t.isIdentifier(object) && object.name === 'Object' && t.isIdentifier(property) && property.name === 'defineProperty') { + enableGetters = true; + path.stop(); + } + } + +}; +const visitor = { + Program(path, state) { + path.traverse(gettersUsedVisitor); + + if (!enableGetters) { + console.log('No uses of getters found, disabling --getters'); + path.stop(); + } + + const opts = state.opts; + + if (!opts.requireRuntime) { + return; + } + + path.node.body.unshift(t.variableDeclaration('var', [t.variableDeclarator(gettersRuntime, t.callExpression(t.identifier('require'), [t.stringLiteral(gettersRuntimePath)]))])); + }, + + UnaryExpression: { + enter(path) { + const _path$node2 = path.node, + operator = _path$node2.operator, + argument = _path$node2.argument; // Support property deletion. + + if (operator === 'delete' && t.isMemberExpression(argument)) { + const object = argument.object, + property = argument.property, + computed = argument.computed; + const prop = computed ? property : t.stringLiteral(property.name); + path.replaceWith($func(delete_prop, object, prop)); + } + } + + }, + + MemberExpression(path) { + const p = path.parent; + const _path$node3 = path.node, + object = _path$node3.object, + property = _path$node3.property; // Only useful for console.log and various function on Math. + + if (path.node.mark === 'Flat') { + return; + } // Setters + + + if (t.isAssignmentExpression(p) && p.left === path.node && p.operator === '=') { + const prop = path.node.computed ? property : t.stringLiteral(property.name); + path.parentPath.replaceWith($func(set_prop, object, prop, p.right)); + } else if (t.isUpdateExpression(p) || t.isAssignmentExpression(p) || path.node.exposed) { + return; + } // Getters + else { + const prop = path.node.computed ? property : t.stringLiteral(property.name); + path.replaceWith($func(get_prop, object, prop)); + } + } + +}; + +function plugin() { + return { + visitor + }; +} + +exports.plugin = plugin; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/exposeImplicitApps.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/exposeImplicitApps.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const imm = __webpack_require__(/*! immutable */ "./node_modules/immutable/dist/immutable.js"); + +const helpers_1 = __webpack_require__(/*! ./helpers */ "./node_modules/@stopify/continuations/dist/src/helpers.js"); + +exports.implicitsIdentifier = t.identifier('$i'); +const binopTable = imm.Map([['+', 'add'], ['-', 'sub'], ['/', 'div'], ['*', 'mul']]); + +function implicit(name, ...args) { + return t.callExpression(t.memberExpression(exports.implicitsIdentifier, t.identifier(name)), args); +} + +const implicitsPath = "".concat(helpers_1.runtimePath, "/implicitApps"); +const visitor = { + Program(path, state) { + const opts = state.opts; + + if (!opts.requireRuntime) { + return; + } + + path.node.body.unshift(t.variableDeclaration('var', [t.variableDeclarator(exports.implicitsIdentifier, t.callExpression(t.identifier('require'), [t.stringLiteral(implicitsPath)]))])); + }, + + BinaryExpression(path) { + const fun = binopTable.get(path.node.operator); + + if (typeof fun !== 'string') { + return; + } + + path.replaceWith(implicit(fun, path.node.left, path.node.right)); + }, + + MemberExpression: { + exit(path) { + if (!path.node.computed) { + return; + } + + path.node.property = implicit('toKey', path.node.property); + } + + } +}; + +function plugin() { + return { + visitor + }; +} + +exports.plugin = plugin; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/helpers.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/helpers.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +exports.runtimePath = 'continuations/dist/runtime'; +/** + * Produces a string that represents the source location of `path`. + * + * @param functionName the name of the enclosing function + * @param path the path of the node whose location to return + * @param opts compiler options, for the source map + */ + +function locationString(functionName, path, opts) { + let result = []; + const loc = t.isAssignmentExpression(path.node) ? path.node.right.loc : path.node.loc; // TODO(arjun): handleNew triggers this case + + if (loc !== undefined) { + const line = opts.sourceMap.getLine(loc.start.line, loc.start.column); + + if (typeof line === 'number') { + result.push("Line ".concat(line)); + } + } + + if (typeof functionName === 'string') { + result.push(": in ".concat(functionName)); + } + + return result.join(''); +} + +exports.locationString = locationString; + +function isStopifyAnnotation(v) { + return /^@stopify flat$/.test(v); +} + +exports.isStopifyAnnotation = isStopifyAnnotation; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/index.js": +/*!***************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/index.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const babel = __webpack_require__(/*! babel-core */ "./node_modules/babel-core/index.js"); + +const babylon = __webpack_require__(/*! babylon */ "./node_modules/babylon/lib/index.js"); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const callcc = __webpack_require__(/*! ./callcc/callcc */ "./node_modules/@stopify/continuations/dist/src/callcc/callcc.js"); + +const hygiene = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +const h = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const continuationsRTS = __webpack_require__(/*! @stopify/continuations-runtime */ "./node_modules/@stopify/continuations-runtime/dist/src/index.js"); + +const cannotCapture_1 = __webpack_require__(/*! ./common/cannotCapture */ "./node_modules/@stopify/continuations/dist/src/common/cannotCapture.js"); + +const exposeImplicitApps = __webpack_require__(/*! ./exposeImplicitApps */ "./node_modules/@stopify/continuations/dist/src/exposeImplicitApps.js"); + +const jumper_1 = __webpack_require__(/*! ./callcc/jumper */ "./node_modules/@stopify/continuations/dist/src/callcc/jumper.js"); + +var flatness_1 = __webpack_require__(/*! ./compiler/flatness */ "./node_modules/@stopify/continuations/dist/src/compiler/flatness.js"); + +exports.flatness = flatness_1.flatness; + +var sourceMaps_1 = __webpack_require__(/*! ./compiler/sourceMaps */ "./node_modules/@stopify/continuations/dist/src/compiler/sourceMaps.js"); + +exports.getSourceMap = sourceMaps_1.getSourceMap; + +var callcc_1 = __webpack_require__(/*! ./callcc/callcc */ "./node_modules/@stopify/continuations/dist/src/callcc/callcc.js"); + +exports.plugin = callcc_1.default; + +__export(__webpack_require__(/*! ./runtime/sentinels */ "./node_modules/@stopify/continuations/dist/src/runtime/sentinels.js")); + +var cannotCapture_2 = __webpack_require__(/*! ./common/cannotCapture */ "./node_modules/@stopify/continuations/dist/src/common/cannotCapture.js"); + +exports.knownBuiltIns = cannotCapture_2.knownBuiltIns; +exports.reserved = [...cannotCapture_1.knowns, "name", exposeImplicitApps.implicitsIdentifier.name, "$opts", "$result", "target", "newTarget", "captureLocals", jumper_1.restoreNextFrame.name, "frame", "RV_SENTINAL", "EXN_SENTINAL", "finally_rv", "finally_exn", "captureCC", 'materializedArguments', 'argsLen', '$top', '$S']; +const visitor = { + Program(path, state) { + const opts = { + getters: false, + debug: false, + captureMethod: 'lazy', + newMethod: 'direct', + es: 'sane', + jsArgs: 'simple', + requireRuntime: false, + sourceMap: { + getLine: () => null + }, + // function done(r) { return $rts.onDone(r); } + onDone: t.functionExpression(t.identifier('done'), [t.identifier('r')], t.blockStatement([t.returnStatement(t.callExpression(t.memberExpression(t.identifier('$rts'), t.identifier('onDone')), [t.identifier('r')]))])), + eval2: false, + compileMode: 'normal' + }; + h.transformFromAst(path, [[hygiene.plugin, state.opts]]); + h.transformFromAst(path, [[callcc.default, opts]]); + path.stop(); + } + +}; +/** + * Compiles a program to support callCC. + * + * @param src the program to compile, which may use callCC + * @returns an ordinary JavaScript program + */ + +function compileFromAst(src) { + try { + const babelOpts = { + plugins: [[() => ({ + visitor + }), { + reserved: [], + global: t.memberExpression(t.identifier('$rts'), t.identifier('g')) + }]], + babelrc: false, + ast: false, + code: true, + minified: false, + comments: false + }; + const result = babel.transformFromAst(src, undefined, babelOpts); + + if (typeof result.code === 'string') { + return h.ok(result.code); + } else { + return h.error('compile failed: no code returned'); + } + } catch (exn) { + return h.error(exn.toString()); + } +} + +exports.compileFromAst = compileFromAst; +/** + * Compiles a program to support callCC. + * + * @param src the program to compile, which may use callCC + * @returns an ordinary JavaScript program + */ + +function compile(src) { + return h.asResult(() => babylon.parse(src).program).then(p => compileFromAst(p)).map(code => new RunnerImpl(code)); +} + +exports.compile = compile; + +class RunnerImpl { + constructor(code) { + this.code = code; + this.g = Object.create(null); + } + + run(onDone) { + let stopify = continuationsRTS; + this.rts = stopify.newRTS('lazy'); + let $rts = { + g: this.g, + onDone: onDone + }; + return eval(this.code); + } + + control(f) { + return this.rts.captureCC(k => { + return f(x => k({ + type: 'normal', + value: x + })); + }); + } + + processEvent(body, receiver) { + this.rts.runtime(body, receiver); + } + +} + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/runtime/implicitApps.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/runtime/implicitApps.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function toPrimitive(x) { + // TODO(arjun): This isn't exactly the right order. + if (typeof x === 'object' && x !== 'null') { + let v = x.valueOf(); + + if (typeof v === 'object' && v !== 'null') { + v = x.toString(); + + if (typeof v === 'object' && v !== 'null') { + return undefined; + } + + return v; + } + + return v; + } + + return x; +} + +function toKey(x) { + const r = toPrimitive(x); + + if (typeof r === 'string' || typeof r === 'number') { + return r; + } else { + return String(r); + } +} + +exports.toKey = toKey; + +function add(x, y) { + return toPrimitive(x) + toPrimitive(y); +} + +exports.add = add; + +function mul(x, y) { + return toPrimitive(x) * toPrimitive(y); +} + +exports.mul = mul; + +function sub(x, y) { + return toPrimitive(x) - toPrimitive(y); +} + +exports.sub = sub; + +function div(x, y) { + return toPrimitive(x) / toPrimitive(y); +} + +exports.div = div; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/dist/src/runtime/sentinels.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/dist/src/runtime/sentinels.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * This file has private sentinal values that are necessary to implement + * certain transformations. + */ + +exports.RV_SENTINAL = Symbol('rv_sentinal'); +exports.EXN_SENTINAL = Symbol('exn_sentinal'); + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/lib/array-set.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/lib/array-set.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +var util = __webpack_require__(/*! ./util */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/util.js"); + +var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; +/** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + +function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); +} +/** + * Static method for creating ArraySet instances from an existing array. + */ + + +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + + return set; +}; +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + + +ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; +}; +/** + * Add the given string to this set. + * + * @param String aStr + */ + + +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } +}; +/** + * Is the given string a member of this set? + * + * @param String aStr + */ + + +ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } +}; +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ + + +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); +}; +/** + * What is the element at the given index? + * + * @param Number aIdx + */ + + +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + + throw new Error('No element indexed by ' + aIdx); +}; +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + + +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + +exports.ArraySet = ArraySet; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/lib/base64-vlq.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/lib/base64-vlq.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 THE COPYRIGHT + * OWNER OR CONTRIBUTORS 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. + */ +var base64 = __webpack_require__(/*! ./base64 */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/base64.js"); // A single base 64 digit can contain 6 bits of data. For the base 64 variable +// length quantities we use in the source map spec, the first bit is the sign, +// the next four bits are the actual value, and the 6th bit is the +// continuation bit. The continuation bit tells us whether there are more +// digits in this value following this digit. +// +// Continuation +// | Sign +// | | +// V V +// 101011 + + +var VLQ_BASE_SHIFT = 5; // binary: 100000 + +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; // binary: 011111 + +var VLQ_BASE_MASK = VLQ_BASE - 1; // binary: 100000 + +var VLQ_CONTINUATION_BIT = VLQ_BASE; +/** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + +function toVLQSigned(aValue) { + return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0; +} +/** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + + +function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative ? -shifted : shifted; +} +/** + * Returns the base 64 VLQ encoded value. + */ + + +exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; +}; +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + + +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/lib/base64.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/lib/base64.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); +/** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + +exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + + throw new TypeError("Must be between 0 and 63: " + number); +}; +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + + +exports.decode = function (charCode) { + var bigA = 65; // 'A' + + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + + var littleZ = 122; // 'z' + + var zero = 48; // '0' + + var nine = 57; // '9' + + var plus = 43; // '+' + + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + + if (bigA <= charCode && charCode <= bigZ) { + return charCode - bigA; + } // 26 - 51: abcdefghijklmnopqrstuvwxyz + + + if (littleA <= charCode && charCode <= littleZ) { + return charCode - littleA + littleOffset; + } // 52 - 61: 0123456789 + + + if (zero <= charCode && charCode <= nine) { + return charCode - zero + numberOffset; + } // 62: + + + + if (charCode == plus) { + return 62; + } // 63: / + + + if (charCode == slash) { + return 63; + } // Invalid base64 digit. + + + return -1; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/lib/binary-search.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/lib/binary-search.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.GREATEST_LOWER_BOUND = 1; +exports.LEAST_UPPER_BOUND = 2; +/** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + +function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + + + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } // we are in termination case (3) or (2) and return the appropriate thing. + + + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } +} +/** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + + +exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND); + + if (index < 0) { + return -1; + } // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + + + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + + --index; + } + + return index; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/lib/mapping-list.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/lib/mapping-list.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +var util = __webpack_require__(/*! ./util */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/util.js"); +/** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + + +function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; +} +/** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + + +function MappingList() { + this._array = []; + this._sorted = true; // Serves as infimum + + this._last = { + generatedLine: -1, + generatedColumn: 0 + }; +} +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + + +MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); +}; +/** + * Add the given source mapping. + * + * @param Object aMapping + */ + + +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + + this._array.push(aMapping); + } else { + this._sorted = false; + + this._array.push(aMapping); + } +}; +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + + +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + + this._sorted = true; + } + + return this._array; +}; + +exports.MappingList = MappingList; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/lib/quick-sort.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/lib/quick-sort.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +// It turns out that some (most?) JavaScript engines don't self-host +// `Array.prototype.sort`. This makes sense because C++ will likely remain +// faster than JS when doing raw CPU-intensive sorting. However, when using a +// custom comparator function, calling back and forth between the VM's C++ and +// JIT'd JS is rather slow *and* loses JIT type information, resulting in +// worse generated code for the comparator function than would be optimal. In +// fact, when sorting with a comparator, these costs outweigh the benefits of +// sorting in C++. By using our own JS-implemented Quick Sort (below), we get +// a ~3500ms mean speed-up in `bench/bench.html`. + +/** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ +function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; +} +/** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + + +function randomIntInRange(low, high) { + return Math.round(low + Math.random() * (high - low)); +} +/** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + + +function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + swap(ary, pivotIndex, r); + var pivot = ary[r]; // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } +} +/** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + + +exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); +}; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/lib/source-map-consumer.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/lib/source-map-consumer.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +var util = __webpack_require__(/*! ./util */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/util.js"); + +var binarySearch = __webpack_require__(/*! ./binary-search */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/binary-search.js"); + +var ArraySet = __webpack_require__(/*! ./array-set */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/array-set.js").ArraySet; + +var base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/base64-vlq.js"); + +var quickSort = __webpack_require__(/*! ./quick-sort */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/quick-sort.js").quickSort; + +function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); +} + +SourceMapConsumer.fromSourceMap = function (aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); +}; +/** + * The version of the source mapping spec that we are consuming. + */ + + +SourceMapConsumer.prototype._version = 3; // `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; +}; +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + + +SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); +}; + +SourceMapConsumer.GENERATED_ORDER = 1; +SourceMapConsumer.ORIGINAL_ORDER = 2; +SourceMapConsumer.GREATEST_LOWER_BOUND = 1; +SourceMapConsumer.LEAST_UPPER_BOUND = 2; +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + +SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + var mappings; + + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); +}; +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + + +SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + needle.source = this._findSourceIndex(needle.source); + + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + + while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; +}; + +exports.SourceMapConsumer = SourceMapConsumer; +/** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + +function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources.map(String) // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; + }); // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; +/** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + +BasicSourceMapConsumer.prototype._findSourceIndex = function (aSource) { + var relativeSource = aSource; + + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + + + var i; + + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; +}; +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + + +BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping(); + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + return smc; +}; +/** + * The version of the source mapping spec that we are consuming. + */ + + +BasicSourceMapConsumer.prototype._version = 3; +/** + * The list of original sources. + */ + +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } +}); +/** + * Provide the JIT with a nice shape / hidden class. + */ + +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + + +BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } else if (aStr.charAt(index) === ',') { + index++; + } else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + + str = aStr.slice(index, end); + segment = cachedSegments[str]; + + if (segment) { + index += str.length; + } else { + segment = []; + + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } // Generated column. + + + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; // Original line. + + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; // Lines are stored 0-based + + mapping.originalLine += 1; // Original column. + + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; +}; +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + + +BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]); + } + + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); +}; +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + + +BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } // The last mapping for each line spans the entire line. + + + mapping.lastGeneratedColumn = Infinity; + } +}; +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + + +BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + + var name = util.getArg(mapping, 'name', null); + + if (name !== null) { + name = this._names.at(name); + } + + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; +}; +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + + +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + + return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function (sc) { + return sc == null; + }); +}; +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + + +BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + + if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + + if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; + } + + if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + + + if (nullOnMissing) { + return null; + } else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } +}; +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + + +BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; +}; + +exports.BasicSourceMapConsumer = BasicSourceMapConsumer; +/** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + +function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + + lastOffset = offset; + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + }; + }); +} + +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; +/** + * The version of the source mapping spec that we are consuming. + */ + +IndexedSourceMapConsumer.prototype._version = 3; +/** + * The list of original sources. + */ + +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + + return sources; + } +}); +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + +IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; // Find the section containing the generated position we're trying to map + // to an original position. + + var sectionIndex = binarySearch.search(needle, this._sections, function (needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + + if (cmp) { + return cmp; + } + + return needle.generatedColumn - section.generatedOffset.generatedColumn; + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), + bias: aArgs.bias + }); +}; +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + + +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); +}; +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + + +IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var content = section.consumer.sourceContentFor(aSource, true); + + if (content) { + return content; + } + } + + if (nullOnMissing) { + return null; + } else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } +}; +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + + +IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; // Only consider this section if the requested source is in the list of + // sources of the consumer. + + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + + if (generatedPosition) { + var ret = { + line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; +}; +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + + +IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + + this._sources.add(source); + + source = this._sources.indexOf(source); + var name = null; + + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + + this._names.add(name); + + name = this._names.indexOf(name); + } // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + + + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); +}; + +exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/lib/source-map-generator.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/lib/source-map-generator.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +var base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/base64-vlq.js"); + +var util = __webpack_require__(/*! ./util */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/util.js"); + +var ArraySet = __webpack_require__(/*! ./array-set */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/array-set.js").ArraySet; + +var MappingList = __webpack_require__(/*! ./mapping-list */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/mapping-list.js").MappingList; +/** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + + +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} + +SourceMapGenerator.prototype._version = 3; +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + +SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; +}; +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + + +SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); +}; +/** + * Set the source content for a source file. + */ + + +SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } +}; +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + + +SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; // If aSourceFile is omitted, we will use the file property of the SourceMap + + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.'); + } + + sourceFile = aSourceMapConsumer.file; + } + + var sourceRoot = this._sourceRoot; // Make "sourceFile" relative if an absolute Url is passed. + + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } // Applying the SourceMap can add and remove items from the sources and + // the names array. + + + var newSources = new ArraySet(); + var newNames = new ArraySet(); // Find mappings for the "sourceFile" + + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source); + } + + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + }, this); + + this._sources = newSources; + this._names = newNames; // Copy sourcesContents of applied map. + + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + + this.setSourceContent(sourceFile, content); + } + }, this); +}; +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + + +SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error('original.line and original.column are not numbers -- you probably meant to omit ' + 'the original mapping entirely and only map the generated position. If so, pass ' + 'null for the original mapping instead of an object with empty or null values.'); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) { + // Cases 2 and 3. + return; + } else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } +}; +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + + +SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = ''; + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; // lines are stored 0-based in SourceMap spec version 3 + + next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; +}; + +SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; + }, this); +}; +/** + * Externalize the source map. + */ + + +SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + + if (this._file != null) { + map.file = this._file; + } + + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; +}; +/** + * Render the source map being generated to a string. + */ + + +SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); +}; + +exports.SourceMapGenerator = SourceMapGenerator; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/lib/source-node.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/lib/source-node.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +var SourceMapGenerator = __webpack_require__(/*! ./source-map-generator */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator; + +var util = __webpack_require__(/*! ./util */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/util.js"); // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other +// operating systems these days (capturing the result). + + +var REGEX_NEWLINE = /(\r?\n)/; // Newline character code for charCodeAt() comparisons + +var NEWLINE_CODE = 10; // Private symbol for identifying `SourceNode`s when multiple versions of +// the source-map library are loaded. This MUST NOT CHANGE across +// versions! + +var isSourceNode = "$$$isSourceNode$$$"; +/** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + + +SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + + var shiftNextLine = function () { + var lineContents = getNextLine(); // The last line of a file might not have a newline. + + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : undefined; + } + }; // We need to remember the position of "remainingLines" + + + var lastGeneratedLine = 1, + lastGeneratedColumn = 0; // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + + var lastMapping = null; + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); // No more remaining code, continue + + lastMapping = mapping; + return; + } + } // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + + + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + + lastMapping = mapping; + }, this); // We have processed all mappings. + + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } // and add the remaining lines without any mapping + + + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } // Copy sourcesContent into SourceNode + + + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + + node.setSourceContent(sourceFile, content); + } + }); + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; + node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name)); + } + } +}; +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + + +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } else { + throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk); + } + + return this; +}; +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + + +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length - 1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } else { + throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk); + } + + return this; +}; +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + + +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } else { + if (chunk !== '') { + aFn(chunk, { + source: this.source, + line: this.line, + column: this.column, + name: this.name + }); + } + } + } +}; +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + + +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + + if (len > 0) { + newChildren = []; + + for (i = 0; i < len - 1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + + newChildren.push(this.children[i]); + this.children = newChildren; + } + + return this; +}; +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + + +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } else { + this.children.push(''.replace(aPattern, aReplacement)); + } + + return this; +}; +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + + +SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; +}; +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + + +SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } +}; +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + + +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; +/** + * Returns the string representation of this source node along with a source + * map. + */ + + +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + + if (original.source !== null && original.line !== null && original.column !== null) { + if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; // Mappings end at eol + + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + return { + code: generated.code, + map: map + }; +}; + +exports.SourceNode = SourceNode; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/lib/util.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/lib/util.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* -*- Mode: js; js-indent-level: 2; -*- */ + +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +/** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ +function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } +} + +exports.getArg = getArg; +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; + +function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + + if (!match) { + return null; + } + + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; +} + +exports.urlParse = urlParse; + +function urlGenerate(aParsedUrl) { + var url = ''; + + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + + url += '//'; + + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port; + } + + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + + return url; +} + +exports.urlGenerate = urlGenerate; +/** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + +function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + + if (url) { + if (!url.path) { + return aPath; + } + + path = url.path; + } + + var isAbsolute = exports.isAbsolute(path); + var parts = path.split(/\/+/); + + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + + return path; +} + +exports.normalize = normalize; +/** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + +function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + if (aPath === "") { + aPath = "."; + } + + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } // `join(foo, '//www.example.org')` + + + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } // `join('http://', 'www.example.com')` + + + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' ? aPath : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + + return joined; +} + +exports.join = join; + +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); +}; +/** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + + +function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + + var level = 0; + + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + + if (index < 0) { + return aPath; + } // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + + + aRoot = aRoot.slice(0, index); + + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } // Make sure we add a "../" for each component we removed from the root. + + + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); +} + +exports.relative = relative; + +var supportsNullProto = function () { + var obj = Object.create(null); + return !('__proto__' in obj); +}(); + +function identity(s) { + return s; +} +/** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + + +function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; +} + +exports.toSetString = supportsNullProto ? identity : toSetString; + +function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; +} + +exports.fromSetString = supportsNullProto ? identity : fromSetString; + +function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 + /* "__proto__".length */ + ) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 + /* '_' */ + || s.charCodeAt(length - 2) !== 95 + /* '_' */ + || s.charCodeAt(length - 3) !== 111 + /* 'o' */ + || s.charCodeAt(length - 4) !== 116 + /* 't' */ + || s.charCodeAt(length - 5) !== 111 + /* 'o' */ + || s.charCodeAt(length - 6) !== 114 + /* 'r' */ + || s.charCodeAt(length - 7) !== 112 + /* 'p' */ + || s.charCodeAt(length - 8) !== 95 + /* '_' */ + || s.charCodeAt(length - 9) !== 95 + /* '_' */ + ) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 + /* '$' */ + ) { + return false; + } + } + + return true; +} +/** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + + +function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} + +exports.compareByOriginalPositions = compareByOriginalPositions; +/** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + +function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} + +exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + +function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; +} +/** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + + +function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} + +exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; +/** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + +function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); +} + +exports.parseSourceMapInput = parseSourceMapInput; +/** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + +function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + + + sourceURL = sourceRoot + sourceURL; + } // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + + + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); +} + +exports.computeSourceURL = computeSourceURL; + +/***/ }), + +/***/ "./node_modules/@stopify/continuations/node_modules/source-map/source-map.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@stopify/continuations/node_modules/source-map/source-map.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.SourceMapGenerator = __webpack_require__(/*! ./lib/source-map-generator */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator; +exports.SourceMapConsumer = __webpack_require__(/*! ./lib/source-map-consumer */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/source-map-consumer.js").SourceMapConsumer; +exports.SourceNode = __webpack_require__(/*! ./lib/source-node */ "./node_modules/@stopify/continuations/node_modules/source-map/lib/source-node.js").SourceNode; + +/***/ }), + +/***/ "./node_modules/@stopify/estimators/dist/src/elapsedTimeEstimator.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@stopify/estimators/dist/src/elapsedTimeEstimator.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Interface for an object that estimates elapsed time. + */ + +class ElapsedTimeEstimator { + /** + * Clean up any necessary state. Called from the runtime's `onEnd` function. + */ + cancel() {} + +} + +exports.ElapsedTimeEstimator = ElapsedTimeEstimator; + +class ExactTimeEstimator extends ElapsedTimeEstimator { + constructor(last = Date.now()) { + super(); + this.last = last; + } + + reset() { + this.last = Date.now(); + } + + elapsedTime() { + return Date.now() - this.last; + } + +} + +exports.ExactTimeEstimator = ExactTimeEstimator; + +class CountdownTimeEstimator extends ElapsedTimeEstimator { + constructor(timePerElapsed, i = 0) { + super(); + this.timePerElapsed = timePerElapsed; + this.i = i; + } + + reset() { + this.i = 0; + } + + elapsedTime() { + this.i++; + return this.i * this.timePerElapsed; + } + +} + +exports.CountdownTimeEstimator = CountdownTimeEstimator; +/** Draws a number from a geometric distribution. */ + +function geom(p) { + return Math.ceil(Math.log(1 - Math.random()) / Math.log(1 - p)); +} + +class SampleAverageTimeEstimator extends ElapsedTimeEstimator { + constructor( // total calls to elapsedTime + i = 1, // last value produced by Date.now() + last = Date.now(), // time between successive calls to elapsedTime + timePerElapsed = 100, // these many calls to elapsedTime between observations of time + countDownFrom = geom(1 / i), // countdown until we re-observe the time + countDown = countDownFrom, // number of times elapsedTime has been invoked since last reset + elapsedTimeCounter = 0) { + super(); + this.i = i; + this.last = last; + this.timePerElapsed = timePerElapsed; + this.countDownFrom = countDownFrom; + this.countDown = countDown; + this.elapsedTimeCounter = elapsedTimeCounter; + } + + elapsedTime() { + this.i = this.i + 1 | 0; + this.elapsedTimeCounter = this.elapsedTimeCounter + 1 | 0; + + if (this.countDown-- === 0) { + const now = Date.now(); + this.timePerElapsed = (now - this.last) / this.countDownFrom; + this.last = now; + this.countDownFrom = geom(1 / this.i); + this.countDown = this.countDownFrom; + } + + return this.timePerElapsed * this.elapsedTimeCounter; + } + + reset() { + this.elapsedTimeCounter = 0; + } + +} + +exports.SampleAverageTimeEstimator = SampleAverageTimeEstimator; + +class VelocityEstimator extends ElapsedTimeEstimator { + constructor( // Expected distance between resamples (units: time) + resample, // total calls to elapsedTime + i = 1, // Units: time + lastPosition = Date.now(), // Units: time / #elapsedTime + velocityEstimate = 100000, // Units: #elapsedTime; + resampleTimespanEstimate = velocityEstimate, // countdown until we re-observe the time + countDown = 1, // Distance since last reset. Units: #elapsedTime + distance = 0) { + super(); + this.resample = resample; + this.i = i; + this.lastPosition = lastPosition; + this.velocityEstimate = velocityEstimate; + this.resampleTimespanEstimate = resampleTimespanEstimate; + this.countDown = countDown; + this.distance = distance; + } + + elapsedTime() { + this.i = this.i + 1 | 0; + this.distance = this.distance + 1 | 0; + + if (this.countDown-- === 0) { + const currentPosition = Date.now(); // NOTE(arjun): This is a small float. It may be a good idea to scale + // everything up to an integer. + + this.velocityEstimate = this.resampleTimespanEstimate / (currentPosition - this.lastPosition); + this.lastPosition = currentPosition; + this.resampleTimespanEstimate = Math.max(this.resample * this.velocityEstimate | 0, 10); + this.countDown = this.resampleTimespanEstimate; + } + + return this.distance / this.velocityEstimate | 0; + } + + reset() { + this.distance = 0; + } + +} + +exports.VelocityEstimator = VelocityEstimator; + +/***/ }), + +/***/ "./node_modules/@stopify/hygiene/dist/ts/fastFreshId.js": +/*!**************************************************************!*\ + !*** ./node_modules/@stopify/hygiene/dist/ts/fastFreshId.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const util_1 = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const assert = __webpack_require__(/*! assert */ "./node_modules/assert/assert.js"); + +const trie = __webpack_require__(/*! trie */ "./node_modules/trie/trie.js"); // NOTE(arjun): No @types on 08/28/2017 + + +let isInitialized = false; // We populate this trie will all the identifiers in the program. + +let prefixes = new trie.Trie(); +const known = new Map(); // NOTE(arjun): the Visitor type does not have ReferencedIdentifier +// and BindingIdentifier on 08/28/2017. + +const visitor = { + ReferencedIdentifier(path) { + prefixes.addWord(path.node.name); + }, + + BindingIdentifier(path) { + prefixes.addWord(path.node.name); + } + +}; + +function plugin() { + return { + visitor: visitor + }; +} + +exports.plugin = plugin; + +function init(path) { + known.clear(); + util_1.transformFromAst(path, [plugin]); + isInitialized = true; +} + +exports.init = init; + +function reset() { + prefixes = new trie.Trie(); + isInitialized = false; +} + +exports.reset = reset; + +function fresh(base) { + assert(isInitialized, 'init() must be applied before fresh()'); + const k = known.get(base); + + if (typeof k !== 'undefined') { + const x = k.newBase + String(k.i); + k.i = k.i + 1; + return t.identifier(x); + } + + let j = 0; + let newBase = base; + + while (prefixes.isValidPrefix(newBase)) { + newBase = newBase + String(j); + j = j + 1; + } + + known.set(base, { + newBase: newBase, + i: 1 + }); + return t.identifier(newBase + String(0)); +} + +exports.fresh = fresh; + +function nameExprBefore(path, expr, base) { + if (t.isIdentifier(expr)) { + return expr; + } + + const x = fresh(base || "x"); + path.insertBefore(t.variableDeclaration('let', [t.variableDeclarator(x, expr)])); + return x; +} + +exports.nameExprBefore = nameExprBefore; + +/***/ }), + +/***/ "./node_modules/@stopify/hygiene/dist/ts/hygiene.js": +/*!**********************************************************!*\ + !*** ./node_modules/@stopify/hygiene/dist/ts/hygiene.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const fastFreshId = __webpack_require__(/*! ./fastFreshId */ "./node_modules/@stopify/hygiene/dist/ts/fastFreshId.js"); + +const visitor = { + Scope({ + scope + }, { + opts: { + reserved + } + }) { + const shadows = Object.keys(scope.bindings).filter(x => reserved.includes(x)); + + for (const x of shadows) { + const new_name = fastFreshId.fresh(x); + scope.rename(x, new_name.name); + } + } + +}; + +function default_1() { + return { + visitor: visitor + }; +} + +exports.default = default_1; + +/***/ }), + +/***/ "./node_modules/@stopify/hygiene/dist/ts/index.js": +/*!********************************************************!*\ + !*** ./node_modules/@stopify/hygiene/dist/ts/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const useGlobalObject = __webpack_require__(/*! ./useGlobalObject */ "./node_modules/@stopify/hygiene/dist/ts/useGlobalObject.js"); + +const fastFreshId = __webpack_require__(/*! ./fastFreshId */ "./node_modules/@stopify/hygiene/dist/ts/fastFreshId.js"); + +const hygiene = __webpack_require__(/*! ./hygiene */ "./node_modules/@stopify/hygiene/dist/ts/hygiene.js"); + +const util_1 = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +var fastFreshId_1 = __webpack_require__(/*! ./fastFreshId */ "./node_modules/@stopify/hygiene/dist/ts/fastFreshId.js"); + +exports.fresh = fastFreshId_1.fresh; +exports.nameExprBefore = fastFreshId_1.nameExprBefore; +exports.reset = fastFreshId_1.reset; +exports.init = fastFreshId_1.init; +const visitor = { + Program(path, state) { + fastFreshId.init(path); + util_1.transformFromAst(path, [[hygiene.default, state.opts]]); + + if (state.opts.global !== undefined) { + util_1.transformFromAst(path, [[useGlobalObject.plugin, state.opts]]); + } + + path.stop(); + } + +}; + +function plugin() { + return { + visitor + }; +} + +exports.plugin = plugin; + +/***/ }), + +/***/ "./node_modules/@stopify/hygiene/dist/ts/useGlobalObject.js": +/*!******************************************************************!*\ + !*** ./node_modules/@stopify/hygiene/dist/ts/useGlobalObject.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * This module transforms programs to use `$S.g` as the global object. We use + * the following algorithm: + * + * 1. At the top-level, transform `var x = e` into `$S.g.x = e`. + * 2. At the start of the program, insert the statement `$S.g.f = f` + * for each top-level `function f(...) { ... }`. i.e., function declarations + * are still lifted as expected. + * 3. Track the set of identifiers bound at non-global scopes. + * 4. If `x` is a non-binding occurrence of an identifier that isn't in the + * set of identifiers tracked in Step 3, transform `x` into `$S.g.x`. + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +exports.$S = t.identifier('$S'); +/** Produces the statement `$S.g.name = expr`. */ + +function setGlobal(global, name, expr) { + return t.expressionStatement(t.assignmentExpression('=', t.memberExpression(global, name, false), expr)); +} + +function visitId(path, state) { + if (path.node.name === exports.$S.name || state.boundIds.has(path.node.name)) { + return; + } + + const newNode = t.memberExpression(state.opts.global, path.node, false); + + if (path.node.mark) { + newNode.mark = path.node.mark; + } + + path.replaceWith(newNode); + path.skip(); +} + +const visitor = { + Program(path, state) { + state.boundIds = new Set(['arguments']); + state.boundIdStack = []; + state.programBody = path.node.body; + }, + + VariableDeclaration: { + enter(path, state) { + const isGlobal = state.boundIdStack.length === 0; + + if (!isGlobal) { + return; + } + + const nodes = []; + + for (const declarator of path.node.declarations) { + if (declarator.id.type !== 'Identifier') { + throw new Error("Stopify does not support patterns, found\n ".concat(declarator.id.type)); + } + + if (declarator.init === null) { + continue; + } + + nodes.push(t.expressionStatement(t.assignmentExpression('=', declarator.id, declarator.init))); + } + + path.replaceWithMultiple(nodes); + } + + }, + + FunctionDeclaration(path, state) { + // NOTE(arjun): This kind of path traversal may slow down Stopify. + // A better approach may to be maintain a stack. + const isGlobal = state.boundIdStack.length === 0; + + if (!isGlobal) { + return; + } + + state.programBody.unshift(setGlobal(state.opts.global, path.node.id, path.node.id)); + }, + + // Track the set of identifiers bound at all scopes, *except* for Program. + Scope: { + enter(path, state) { + if (path.node.type === 'Program') { + return; + } + + state.boundIdStack.push(state.boundIds); + const newIds = Object.keys(path.scope.bindings); + const oldIds = state.boundIds.values(); + state.boundIds = new Set([...newIds, ...oldIds]); + }, + + exit(path, state) { + if (path.node.type === 'Program') { + return; + } + + state.boundIds = state.boundIdStack.pop(); + } + + }, + BindingIdentifier: { + exit(path, state) { + // This is *not* a binding occurence! The Babel AST is wrong. + if (path.parent.type !== 'AssignmentExpression') { + return; + } + + visitId(path, state); + } + + }, + // Transforms non-binding occurrences of identifiers that are in the + // set of identifiers tracked above. + ReferencedIdentifier: { + exit(path, state) { + // The following three clauses only exist because the Babel AST treats + // labels as identifiers. + if (path.parent.type === 'ContinueStatement' || path.parent.type === 'BreakStatement' || path.parent.type === 'LabelledStatement') { + return; + } //`arguments` is a special keyword that is implicitly defined within + //function scopes. + + + if (path.node.name === 'arguments') { + return; + } + + visitId(path, state); + } + + }, + + // Transforms calls to global functions f(x ...) to f.call(void 0, x ...). + // Without this step, the call would turn into $S.g.f(x ...), which binds + // this to $S.g within the body of f. Stopify tries to implement strict-mode, + // so this would be a bad thing. + CallExpression(path, state) { + const fun = path.node.callee; + + if (!(fun.type === 'Identifier' && !state.boundIds.has(fun.name))) { + return; + } // Calling a global function. T + + + path.node.callee = t.memberExpression(path.node.callee, t.identifier('call'), false); + path.node.arguments = [t.unaryExpression('void', t.numericLiteral(0)), ...path.node.arguments]; + } + +}; + +function plugin() { + return { + visitor: visitor + }; +} + +exports.plugin = plugin; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/anf.js": +/*!***********************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/anf.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * Plugin to transform JS programs into ANF form. + * + * WARNING: + * The plugin assumes that the assumptions stated in ./src/desugarLoop.js + * hold. The resulting output is not guarenteed to be in ANF form if the + * assumptions do not hold. + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const h = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const hygiene_1 = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +function withinTryBlock(path) { + const funOrTryParent = path.findParent(p => p.isFunction() || p.isTryStatement()); + return t.isTryStatement(funOrTryParent); +} + +const anfVisitor = { + FunctionExpression: function (path) { + const p = path.parent; + + if (!t.isVariableDeclarator(p)) { + // Name the function application if it is not already named. + const name = hygiene_1.fresh('fun'); + const bind = h.letExpression(name, path.node); + path.getStatementParent().insertBefore(bind); + path.replaceWith(name); + } + }, + ArrayExpression: function (path) { + if (!h.containsCall(path)) { + return; + } + + const es = path.node.elements; + let elements = es; + elements.forEach((e, i) => { + const id = hygiene_1.fresh('element'); + path.getStatementParent().insertBefore(h.letExpression(id, e)); + path.node.elements[i] = id; + }); + }, + ObjectExpression: function (path) { + if (!h.containsCall(path)) { + return; + } + + const properties = path.node.properties; + properties.forEach((p2, i) => { + let p = p2; // TODO(arjun): Enable this code to expose a bug. + // if (!t.isObjectProperty(p)) { + // throw new Error(`Expected ObjectProperty but got ${p.type}`); + // } + + const id = hygiene_1.fresh('element'); + path.getStatementParent().insertBefore(h.letExpression(id, p.value)); + path.node.properties[i].value = id; + }); + }, + CallExpression: { + enter(path) { + if (h.containsCall(path)) { + if (t.isCallExpression(path.node.callee)) { + const id = hygiene_1.fresh('callee'); + path.getStatementParent().insertBefore(h.letExpression(id, path.node.callee)); + path.node.callee = id; + } + + path.node.arguments.forEach((e, i) => { + if (!t.isExpression(e)) { + throw new Error("Expected expression"); + } + + const id = hygiene_1.fresh('arg'); + path.getStatementParent().insertBefore(h.letExpression(id, e)); + path.node.arguments[i] = id; + }); + } + }, + + exit(path, state) { + if (path.node.callee.mark === 'Flat') { + return; + } + + const p = path.parent; + + if (!t.isVariableDeclarator(p) && (!t.isReturnStatement(p) || state.opts.nameReturns) || t.isReturnStatement(p) && withinTryBlock(path)) { + // Name the function application if it is not already named or + // if it is not a flat application. + const name = hygiene_1.fresh('app'); + const bind = h.letExpression(name, path.node); + path.getStatementParent().insertBefore(bind); + + if (path.parent.type === 'ExpressionStatement') { + path.remove(); + } else { + path.replaceWith(name); + } + } + } + + }, + NewExpression: function (path) { + if (path.node.callee.mark === 'Flat') { + return; + } + + const p = path.parent; + + if (!t.isVariableDeclarator(p)) { + // Name the function application if it is not already named. + const name = hygiene_1.fresh('app'); + const bind = h.letExpression(name, path.node); + path.getStatementParent().insertBefore(bind); + path.replaceWith(name); + } + } +}; + +module.exports = function () { + return { + visitor: anfVisitor + }; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/callcc.js": +/*!**************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/callcc.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Adds support for callCC. + * + * This module is a Node plugin. In addition, it can be applied from the + * command line: + * + * node built/src/callcc/callcc + */ + +const arrowFunctions = __webpack_require__(/*! babel-plugin-transform-es2015-arrow-functions */ "./node_modules/babel-plugin-transform-es2015-arrow-functions/lib/index.js"); + +const desugarLoop = __webpack_require__(/*! ./desugarLoop */ "./node_modules/@stopify/normalize-js/dist/ts/desugarLoop.js"); + +const desugarLabel = __webpack_require__(/*! ./desugarLabel */ "./node_modules/@stopify/normalize-js/dist/ts/desugarLabel.js"); + +const desugarSwitch = __webpack_require__(/*! ./desugarSwitch */ "./node_modules/@stopify/normalize-js/dist/ts/desugarSwitch.js"); + +const desugarLogical = __webpack_require__(/*! ./desugarLogical */ "./node_modules/@stopify/normalize-js/dist/ts/desugarLogical.js"); + +const singleVarDecls = __webpack_require__(/*! ./singleVarDecls */ "./node_modules/@stopify/normalize-js/dist/ts/singleVarDecls.js"); + +const makeBlocks = __webpack_require__(/*! ./makeBlockStmt */ "./node_modules/@stopify/normalize-js/dist/ts/makeBlockStmt.js"); + +const anf = __webpack_require__(/*! ./anf */ "./node_modules/@stopify/normalize-js/dist/ts/anf.js"); + +const nameExprs = __webpack_require__(/*! ./nameExprs */ "./node_modules/@stopify/normalize-js/dist/ts/nameExprs.js"); + +const jumperizeTry_1 = __webpack_require__(/*! ./jumperizeTry */ "./node_modules/@stopify/normalize-js/dist/ts/jumperizeTry.js"); + +const freeIds = __webpack_require__(/*! ./freeIds */ "./node_modules/@stopify/normalize-js/dist/ts/freeIds.js"); + +const cleanup_1 = __webpack_require__(/*! ./cleanup */ "./node_modules/@stopify/normalize-js/dist/ts/cleanup.js"); + +const h = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const generic_1 = __webpack_require__(/*! ./generic */ "./node_modules/@stopify/normalize-js/dist/ts/generic.js"); + +const visitor = { + Program(path, state) { + let nameReturns = typeof state.opts.nameReturns === 'boolean' ? state.opts.nameReturns : false; + generic_1.timeSlow('cleanup arguments.callee', () => h.transformFromAst(path, [cleanup_1.default])); + generic_1.timeSlow('arrow functions', () => h.transformFromAst(path, [arrowFunctions])); + generic_1.timeSlow('singleVarDecl', () => h.transformFromAst(path, [[singleVarDecls]])); + generic_1.timeSlow('free ID initialization', () => freeIds.annotate(path)); + generic_1.timeSlow('desugaring passes', () => h.transformFromAst(path, [makeBlocks, desugarLoop, desugarLabel, desugarSwitch, nameExprs, jumperizeTry_1.default, nameExprs])); + generic_1.timeSlow('desugar logical', () => h.transformFromAst(path, [desugarLogical])); + generic_1.timeSlow('ANF', () => h.transformFromAst(path, [[anf, { + nameReturns: nameReturns + }]])); + path.stop(); + } + +}; + +function default_1() { + return { + visitor + }; +} + +exports.default = default_1; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/cleanup.js": +/*!***************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/cleanup.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const hygiene_1 = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +const visitor = { + MemberExpression(path) { + const object = path.node.object; + const property = path.node.property; // Look for arguments['callee'] or arguments.callee + + if (object.type === 'Identifier' && object.name === 'arguments' && (path.node.computed && property.type === 'StringLiteral' && property.value === 'callee' || !path.node.computed && property.type === 'Identifier' && property.name === 'callee')) { + const functionParent = path.getFunctionParent(); + let id; + + if (!functionParent.node.id) { + id = hygiene_1.fresh('funExpr'); + functionParent.node.id = id; + } else { + id = functionParent.node.id; + } + + path.replaceWith(id); + } + } + +}; + +function default_1() { + return { + visitor: visitor + }; +} + +exports.default = default_1; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/desugarLabel.js": +/*!********************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/desugarLabel.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * Module to add labels to breaks and continues according to tagged AST nodes + * generated by desugarLoop. + * + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const labelVisitor = { + ContinueStatement: function (path) { + const label = path.node.label; + + if (label) { + const breakStatement = t.breakStatement(label); + path.replaceWith(breakStatement); + } else { + const loopParent = path.findParent(p => p.isWhileStatement()); + const continueLabel = loopParent.node.continue_label; + const breakStatement = t.breakStatement(continueLabel); + path.replaceWith(breakStatement); + } + }, + BreakStatement: function (path) { + const label = path.node.label; + + if (label === null) { + const labeledParent = path.findParent(p => p.isLoop() || p.isSwitchStatement()); + + if (labeledParent === null) { + return; + } + + path.node.label = labeledParent.node.break_label; + } + } +}; + +module.exports = function () { + return { + visitor: labelVisitor + }; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/desugarLogical.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/desugarLogical.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process, module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Preconditions: + * + * 1. The program only contains while loops + * + * Postconditions: + * + * 1. Function calls do not occur within &&-expressions, ||-expressions, + * ternary expressions, and expression sequences (the comma operator). + * 2. Function applications do not occur in a loop guard. + */ + +const babel = __webpack_require__(/*! babel-core */ "./node_modules/babel-core/index.js"); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const util_1 = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const hygiene_1 = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +const bh = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +exports.visitor = { + WhileStatement: function (path) { + if (!util_1.containsCall(path.get('test')) && path.node.test.type !== 'CallExpression') { + return; + } + + const test = path.node.test; + path.get('test').replaceWith(t.booleanLiteral(true)); + path.get('body').replaceWith(t.blockStatement([bh.sIf(test, path.node.body, t.breakStatement())])); + }, + + LogicalExpression(path) { + if (!util_1.containsCall(path)) { + return; + } + + const op = path.node.operator; + const stmt = path.getStatementParent(); + const lhs = hygiene_1.nameExprBefore(stmt, path.node.left); + const r = hygiene_1.fresh(op === "&&" ? "and" : "or"); + stmt.insertBefore(t.variableDeclaration("let", [t.variableDeclarator(r)])); + const x = t.blockStatement([t.expressionStatement(t.assignmentExpression("=", r, path.node.right))]); + const y = t.blockStatement([t.expressionStatement(t.assignmentExpression("=", r, lhs))]); + + if (op === "&&") { + stmt.insertBefore(t.ifStatement(lhs, x, y)); + } else { + stmt.insertBefore(t.ifStatement(lhs, y, x)); + } + + path.replaceWith(r); + }, + + SequenceExpression(path) { + if (util_1.containsCall(path) === false) { + return; + } + + const exprs = path.node.expressions; + + if (exprs.length < 2) { + // This probably won't happen in a parsed program. + path.replaceWith(exprs[0]); + return; + } + + const last = exprs[exprs.length - 1]; + const rest = exprs.slice(0, exprs.length - 1); + const stmt = path.getStatementParent(); + + for (const expr of rest) { + stmt.insertBefore(t.expressionStatement(expr)); + } + + path.replaceWith(last); + }, + + ConditionalExpression(path) { + if (!util_1.containsCall(path)) { + return; + } + + const r = hygiene_1.fresh("cond"); + const stmt = path.getStatementParent(); + stmt.insertBefore(t.variableDeclaration("let", [t.variableDeclarator(r)])); + const test = hygiene_1.nameExprBefore(stmt, path.node.test); + stmt.insertBefore(t.ifStatement(test, t.blockStatement([t.expressionStatement(t.assignmentExpression("=", r, path.node.consequent))]), t.blockStatement([t.expressionStatement(t.assignmentExpression("=", r, path.node.alternate))]))); + path.replaceWith(r); + } + +}; + +function main() { + const filename = process.argv[2]; + const opts = { + plugins: [() => ({ + visitor: exports.visitor + })], + babelrc: false + }; + babel.transformFile(filename, opts, (err, result) => { + if (err !== null) { + throw err; + } + + console.log(result.code); + }); +} + +if (__webpack_require__.c[__webpack_require__.s] === module) { + main(); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/desugarLoop.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/desugarLoop.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * Module to desugar all loops to while loops. This requires + * the following transformations to be done: + * + * This plugin must enforce the following assumption about loops: + * + * Loop bodies are BlockStatements: + * Loops can have an ExpressionStatement for their body. This messes + * up the anf pass since it tries to added the complex named expression + * to the nearest statement. In this case, the statement will be + * outside the body of the for loop, effectively hoisting them outside + * the function body. To fix this, the body of all loops should a statement. + * + * Postconditions: + * + * 1. The program only has while loops. + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const h = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const hygiene_1 = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); // Object containing the visitor functions + + +const loopVisitor = { + ForInStatement(path) { + const _path$node = path.node, + left = _path$node.left, + right = _path$node.right, + body = _path$node.body; + const it_obj = hygiene_1.fresh('it_obj'); + const keys = hygiene_1.fresh('keys'); + const idx = hygiene_1.fresh('idx'); + const prop = t.isVariableDeclaration(left) ? t.variableDeclaration(left.kind, [t.variableDeclarator(left.declarations[0].id, t.memberExpression(keys, idx, true))]) : t.expressionStatement(t.assignmentExpression('=', left, t.memberExpression(keys, idx, true))); + path.insertBefore(h.letExpression(it_obj, right)); + let newBody = h.flatBodyStatement([h.letExpression(keys, t.callExpression(t.memberExpression(t.identifier('Object'), t.identifier('keys')), [it_obj]), 'const'), t.forStatement(h.letExpression(idx, t.numericLiteral(0)), t.binaryExpression('<', idx, t.memberExpression(keys, t.identifier('length'))), t.updateExpression('++', idx), h.flatBodyStatement([prop, body])), t.expressionStatement(t.assignmentExpression('=', it_obj, t.callExpression(t.memberExpression(t.identifier('Object'), t.identifier('getPrototypeOf')), [it_obj])))]); + + if (path.node.continue_label) { + newBody = t.labeledStatement(path.node.continue_label, newBody); + newBody.skip = true; + } + + path.replaceWith(h.continueLbl(t.whileStatement(t.binaryExpression('!==', it_obj, t.nullLiteral()), newBody), path.node.continue_label)); + }, + + // Convert For Statements into While Statements + ForStatement(path) { + const node = path.node; + let init = node.init, + test = node.test, + update = node.update, + wBody = node.body; + let nupdate = update; // New body is a the old body with the update appended to the end. + + if (nupdate === null) { + nupdate = t.emptyStatement(); + } else { + nupdate = t.expressionStatement(update); + } + + const loopContinue = path.node.continue_label || hygiene_1.fresh('loop_continue'); + const labelContinue = t.labeledStatement(loopContinue, wBody); + labelContinue.skip = true; + wBody = t.blockStatement([labelContinue, nupdate]); // Test can be null + + if (test === null) { + test = t.booleanLiteral(true); + } + + const wl = h.continueLbl(t.whileStatement(test, wBody), loopContinue); // The init can either be a variable declaration or an expression + + let nInit = t.emptyStatement(); + + if (init !== null) { + nInit = t.isExpression(init) ? t.expressionStatement(init) : init; + } + + h.replaceWithStatements(path, nInit, wl); + }, + + // Convert do-while statements into while statements. + DoWhileStatement(path) { + const node = path.node; + let test = node.test, + body = node.body; // Add flag to run the while loop at least once + + const runOnce = hygiene_1.fresh('runOnce'); + const runOnceInit = t.variableDeclaration('let', [t.variableDeclarator(runOnce, t.booleanLiteral(true))]); + const runOnceSetFalse = t.expressionStatement(t.assignmentExpression('=', runOnce, t.booleanLiteral(false))); + body = h.flatBodyStatement([runOnceSetFalse, body]); + + if (path.node.continue_label) { + body = t.labeledStatement(path.node.continue_label, body); + body.skip = true; + } + + test = t.logicalExpression('||', runOnce, test); + h.replaceWithStatements(path, runOnceInit, h.continueLbl(t.whileStatement(test, body), path.node.continue_label)); + }, + + WhileStatement(path) { + if (!path.node.continue_label) { + const loopContinue = hygiene_1.fresh('loop_continue'); // Wrap the body in a labeled continue block. + + path.node = h.continueLbl(path.node, loopContinue); + path.node.body = t.labeledStatement(loopContinue, path.node.body); + path.node.body.skip = true; + } // Wrap the loop in labeled break block. + + + if (!path.node.break_label) { + const loopBreak = hygiene_1.fresh('loop_break'); + path.node = h.breakLbl(path.node, loopBreak); + const labeledStatement = t.labeledStatement(loopBreak, path.node); + labeledStatement.skip = true; + path.replaceWith(labeledStatement); + } + }, + + LabeledStatement: { + enter(path, s) { + if (path.node.skip) { + return; + } + + const _path$node2 = path.node, + label = _path$node2.label, + body = _path$node2.body; + + if (t.isLoop(body) && !body.continue_label) { + const lbl = hygiene_1.fresh('loop_continue'); + + if (!(label.name in s)) { + s[label.name] = [lbl]; + } else { + s[label.name].push(lbl); + } + + if (t.isWhileStatement(path.node.body)) { + const lblWhileBody = t.labeledStatement(lbl, body.body); + lblWhileBody.skip = true; + path.node.body.body = h.continueLbl(lblWhileBody, lbl); + } else { + path.node.body = h.continueLbl(body, lbl); + } + } + }, + + exit(path, s) { + if (path.node.skip) { + return; + } + + const _path$node3 = path.node, + label = _path$node3.label, + body = _path$node3.body; + + if (t.isLoop(body)) { + s[label.name].pop(); + } + } + + }, + + ContinueStatement(path, s) { + const label = path.node.label; + + if (label) { + const lbls = s[label.name]; + path.node.label = lbls[lbls.length - 1]; + } + } + +}; + +module.exports = function () { + return { + visitor: loopVisitor + }; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/desugarSwitch.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/desugarSwitch.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _toArray = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/toArray */ "./node_modules/@babel/runtime/helpers/toArray.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const util_1 = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +function ifTest(e, discriminant, fallthrough) { + return t.logicalExpression('||', t.binaryExpression('===', discriminant, e), fallthrough); +} + +function desugarCases(cases, discriminant, fallthrough) { + if (cases.length === 0) { + return []; + } + + const _cases = _toArray(cases), + hd = _cases[0], + tail = _cases.slice(1); + + const test = hd.test, + consequent = hd.consequent; + + if (test === null) { + return consequent; + } else { + const cond = ifTest(test, discriminant, fallthrough); + const newTail = desugarCases(tail, discriminant, fallthrough); + newTail.unshift(t.ifStatement(cond, t.blockStatement([t.expressionStatement(t.assignmentExpression('=', fallthrough, t.booleanLiteral(true))), ...consequent]))); + return newTail; + } +} + +const switchVisitor = { + BreakStatement: function (path) { + const label = path.node.label; + + if (label === null) { + const labeledParent = path.findParent(p => p.isLoop() || p.isSwitchStatement()); + + if (labeledParent === null) { + return; + } + + path.node.label = labeledParent.node.break_label; + } + }, + SwitchStatement: { + enter(path) { + if (t.isLabeledStatement(path.parent)) { + return; + } + + const breakLabel = path.scope.generateUidIdentifier('switch'); + path.node = util_1.breakLbl(path.node, breakLabel); + const labeledStatement = t.labeledStatement(breakLabel, path.node); + path.replaceWith(labeledStatement); + }, + + exit(path) { + const _path$node = path.node, + discriminant = _path$node.discriminant, + cases = _path$node.cases; + const test = path.scope.generateUidIdentifier('test'); + const fallthrough = path.scope.generateUidIdentifier('fallthrough'); + let desugared = []; + desugared.unshift(...desugarCases(cases, test, fallthrough)); + desugared.unshift(util_1.letExpression(fallthrough, t.booleanLiteral(false))); + desugared.unshift(util_1.letExpression(test, discriminant)); + path.replaceWith(t.blockStatement(desugared)); + } + + } +}; + +module.exports = function () { + return { + visitor: switchVisitor + }; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/freeIds.js": +/*!***************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/freeIds.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process, module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const babel = __webpack_require__(/*! babel-core */ "./node_modules/babel-core/index.js"); + +const SetExt = __webpack_require__(/*! ./setExt */ "./node_modules/@stopify/normalize-js/dist/ts/setExt.js"); + +const hasNff = ["FunctionDeclaration", "FunctionExpression", "Program"]; +const functionTypes = ['FunctionDeclaration', 'FunctionExpression']; +const visitor = { + Scope: { + enter(path) { + path.node.nestedFunctionFree = new Set(); + this.refIdStack.push(this.refIds); + this.refIds = new Set(); + }, + + exit(path) { + const boundIds = new Set(Object.keys(path.scope.bindings)); + let freeIds = SetExt.diff(this.refIds, boundIds); + path.node.freeIds = freeIds; + this.refIds = this.refIdStack.pop(); + + for (const x of freeIds) { + this.refIds.add(x); + } + + if (functionTypes.includes(path.node.type)) { + const parent = enclosingFunction(path); + const nestedFunctionFree = parent.node.nestedFunctionFree; + + for (const x of path.node.freeIds) { + nestedFunctionFree.add(x); + } + } + } + + }, + + ReferencedIdentifier(path) { + const parentType = path.parent.type; + + if (parentType === "BreakStatement" || parentType === 'ContinueStatement' || parentType === "LabeledStatement") { + return; + } + + this.refIds.add(path.node.name); + }, + + BindingIdentifier(path) { + const parentType = path.parent.type; + + if (parentType !== "AssignmentExpression") { + return; + } + + this.refIds.add(path.node.name); + }, + + Program(path) { + path.node.nestedFunctionFree = new Set(); + this.refIdStack = []; + this.refIds = new Set(); + } + +}; + +function annotate(path) { + const opts = { + plugins: [[() => ({ + visitor + })]], + babelrc: false, + code: false, + ast: false + }; + babel.transformFromAst(path.node, undefined, opts); +} + +exports.annotate = annotate; + +function enclosingFunction(path) { + const p = path.findParent(p => hasNff.includes(p.node.type)); + return p; +} + +exports.enclosingFunction = enclosingFunction; + +function isNestedFree(path, x) { + return path.node.nestedFunctionFree.has(x); +} + +exports.isNestedFree = isNestedFree; + +function main() { + const filename = process.argv[2]; + const opts = { + plugins: [() => ({ + visitor + })], + babelrc: false + }; + babel.transformFile(filename, opts, (err, result) => { + if (err !== null) { + throw err; + } + + console.log(result.code); + }); +} + +if (__webpack_require__.c[__webpack_require__.s] === module) { + main(); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/generic.js": +/*!***************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/generic.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function sum(arr) { + return arr.reduce((x, y) => x + y, 0); +} + +exports.sum = sum; + +function dropWhile(f, arr) { + for (let i = 0; i < arr.length; i++) { + if (f(arr[i]) === false) { + return arr.slice(i); + } + } + + return []; +} + +exports.dropWhile = dropWhile; + +function takeWhile(f, arr) { + for (let i = 0; i < arr.length; i++) { + if (f(arr[i]) === false) { + return arr.slice(0, i); + } + } + + return arr.slice(0); +} + +exports.takeWhile = takeWhile; + +function timeSlow(label, thunk) { + const start = Date.now(); + const result = thunk(); + const end = Date.now(); + const delay = end - start; + + if (delay > 2000) { + console.info("".concat(label, " (").concat(delay, " ms)")); + } + + return result; +} + +exports.timeSlow = timeSlow; + +function groupBy(inGroup, arr) { + if (arr.length === 0) { + return []; + } + + const groups = [[arr[0]]]; + let currentGroup = groups[0]; + let last = arr[0]; + + for (let i = 1; i < arr.length; i++) { + const current = arr[i]; + + if (inGroup(last, current)) { + currentGroup.push(current); + last = current; + } else { + currentGroup = [current]; + groups.push(currentGroup); + last = current; + } + } + + return groups; +} + +exports.groupBy = groupBy; + +function parseArg(convert, validate, error) { + return arg => { + const parsed = convert(arg); + + if (validate(parsed)) { + return parsed; + } else { + throw new Error(error); + } + }; +} + +exports.parseArg = parseArg; + +function unreachable() { + throw new Error("unreachable code was reached!"); +} + +exports.unreachable = unreachable; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/index.js": +/*!*************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/index.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const babel = __webpack_require__(/*! babel-core */ "./node_modules/babel-core/index.js"); + +const callcc = __webpack_require__(/*! ./callcc */ "./node_modules/@stopify/normalize-js/dist/ts/callcc.js"); + +const freeIds = __webpack_require__(/*! ./freeIds */ "./node_modules/@stopify/normalize-js/dist/ts/freeIds.js"); + +exports.freeIds = freeIds; + +const generic = __webpack_require__(/*! ./generic */ "./node_modules/@stopify/normalize-js/dist/ts/generic.js"); + +exports.generic = generic; + +const babylon = __webpack_require__(/*! babylon */ "./node_modules/babylon/lib/index.js"); + +var callcc_1 = __webpack_require__(/*! ./callcc */ "./node_modules/@stopify/normalize-js/dist/ts/callcc.js"); + +exports.plugin = callcc_1.default; + +var generic_1 = __webpack_require__(/*! ./generic */ "./node_modules/@stopify/normalize-js/dist/ts/generic.js"); + +exports.unreachable = generic_1.unreachable; + +const hygiene = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +const h = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const visitor = { + Program(path) { + h.transformFromAst(path, [[hygiene.plugin, { + reserved: [] + }]]); + h.transformFromAst(path, [callcc.default]); + path.stop(); + } + +}; + +function normalize(code) { + let ast = babylon.parse(code); + const result = babel.transformFromAst(ast.program, undefined, { + babelrc: false, + code: true, + ast: false, + plugins: [() => ({ + visitor + })] + }); + return result.code; +} + +exports.normalize = normalize; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/jumperizeTry.js": +/*!********************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/jumperizeTry.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const bh = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +const hygiene_1 = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +const returnSentinal = t.identifier('finally_rv'); +const throwSentinal = t.identifier('finally_exn'); +const sentinal = t.memberExpression(t.identifier('$__C'), t.identifier('RV_SENTINAL')); +const sentinalExn = t.memberExpression(t.identifier('$__C'), t.identifier('EXN_SENTINAL')); +const visitor = { + TryStatement: { + enter(path) { + if (path.node.finalizer) { + this.inTryBlockStack.push(this.inTryWithFinally); + this.inTryWithFinally = true; + } + + if (path.node.handler) { + const x = hygiene_1.fresh('e'); + path.insertBefore(t.variableDeclaration('var', [t.variableDeclarator(x)])); + path.node.handler.eVar = x; + path.node.handler.body.body.unshift(t.expressionStatement(t.assignmentExpression('=', x, path.node.handler.param))); + + if (path.node.finalizer) { + path.node.handler.body.body.unshift(t.expressionStatement(t.assignmentExpression('=', throwSentinal, sentinalExn))); + } + } + }, + + exit(path) { + if (path.node.finalizer) { + // NOTE(arjun): If we have several finally blocks in the same scope, + // this probably creates duplicate declarations. + const sentinalDecl0 = t.variableDeclaration('let', [t.variableDeclarator(returnSentinal, sentinal)]); + const sentinalDecl1 = t.variableDeclaration('let', [t.variableDeclarator(throwSentinal, sentinalExn)]); + bh.enclosingScopeBlock(path).unshift(sentinalDecl0); + bh.enclosingScopeBlock(path).unshift(sentinalDecl1); + path.node.finalizer.body.push(bh.sIf(t.binaryExpression('!==', returnSentinal, sentinal), t.returnStatement(returnSentinal), bh.sIf(t.binaryExpression('!==', throwSentinal, sentinalExn), t.throwStatement(throwSentinal)))); + } + + this.inTryWithFinally = this.inTryBlockStack.pop(); + } + + }, + ReturnStatement: { + exit(path) { + if (this.inTryWithFinally) { + const arg = path.node.argument || t.unaryExpression('void', t.numericLiteral(0)); + path.insertBefore(t.expressionStatement(t.assignmentExpression('=', returnSentinal, arg))); + path.replaceWith(t.returnStatement(returnSentinal)); + path.skip(); + } + } + + }, + ThrowStatement: { + exit(path) { + if (this.inTryWithFinally) { + const arg = path.node.argument || t.unaryExpression('void', t.numericLiteral(0)); + path.insertBefore(t.expressionStatement(t.assignmentExpression('=', throwSentinal, arg))); + path.replaceWith(t.throwStatement(throwSentinal)); + path.skip(); + } + } + + }, + Function: { + enter(path) { + this.inTryBlockStack.push(this.inTryWithFinally); + this.inTryWithFinally = false; + }, + + exit(path) { + this.inTryWithFinally = this.inTryBlockStack.pop(); + } + + }, + Program: { + enter(path) { + this.inTryWithFinally = false; + this.inTryBlockStack = []; + } + + } +}; + +function default_1() { + return { + visitor + }; +} + +exports.default = default_1; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/makeBlockStmt.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/makeBlockStmt.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); // Consequents and alternatives in if statements must always be blocked, +// otherwise variable declaration get pulled outside the branch. + + +const ifStatement = function (path) { + const _path$node = path.node, + consequent = _path$node.consequent, + alternate = _path$node.alternate; + + if (t.isBlockStatement(consequent) === false) { + path.node.consequent = t.blockStatement([consequent]); + } + + if (alternate !== null && t.isBlockStatement(alternate) === false) { + path.node.alternate = t.blockStatement([alternate]); + } +}; + +const loop = function (path) { + if (t.isBlockStatement(path.node.body)) { + return; + } + + path.node.body = t.blockStatement([path.node.body]); +}; + +const visitor = { + IfStatement: ifStatement, + "Loop": loop +}; + +module.exports = function () { + return { + visitor: visitor + }; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/nameExprs.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/nameExprs.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const hygiene_1 = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +const names = { + ObjectMethod: function (path) { + if (path.node.kind === "method") { + let fun = t.functionExpression(hygiene_1.fresh('method'), path.node.params, path.node.body); // Little hack necessary to preserve annotation left by freeIds and singleVarDecls + + fun.nestedFunctionFree = path.node.nestedFunctionFree; + fun.renames = path.node.renames; + path.replaceWith(t.objectProperty(path.node.key, fun, path.node.computed)); + } + }, + FunctionExpression: function (path) { + if (path.node.id === undefined || path.node.id === null) { + path.node.id = hygiene_1.fresh('funExpr'); + path.node.originalName = '(anonymous function)'; + } + /* + * This deals with the following kind of code: + * + * function F() { var F; } + * + * We need to able to reference F within its body to restore its stack + * frame. Therefore, we rename the local variable F. + */ + else if (path.scope.hasOwnBinding(path.node.id.name) && path.scope.bindings[path.node.id.name].kind !== 'local') { + const new_id = hygiene_1.fresh('x'); + path.scope.rename(path.node.id.name, new_id.name); + } + }, + // NOTE(arjun): Dead code? I think no FunctionDeclarations exist at this + // point. + FunctionDeclaration: function (path) { + if (path.scope.hasOwnBinding(path.node.id.name) && path.scope.bindings[path.node.id.name].kind !== 'local') { + const new_id = hygiene_1.fresh('funExpr'); + path.scope.rename(path.node.id.name, new_id.name); + } + } +}; + +module.exports = function () { + return { + visitor: names + }; +}; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/setExt.js": +/*!**************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/setExt.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** Set difference */ + +function diff(setA, setB) { + var difference = new Set(setA); + + for (const elem of setB) { + difference.delete(elem); + } + + return difference; +} + +exports.diff = diff; + +function union(setA, setB) { + let union = new Set(setA); + + for (const elem of setB) { + union.add(elem); + } + + return union; +} + +exports.union = union; + +/***/ }), + +/***/ "./node_modules/@stopify/normalize-js/dist/ts/singleVarDecls.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@stopify/normalize-js/dist/ts/singleVarDecls.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process, module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const babel = __webpack_require__(/*! babel-core */ "./node_modules/babel-core/index.js"); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const hygiene_1 = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +function getFunctionArgs(path) { + const node = path.node; + + if (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') { + return node.params.map(x => x.name); + } else { + return []; + } +} + +const visitFunWithBody = { + enter(path) { + this.functionParentStack.push(this.functionParent); + this.functionParent = path; + }, + + exit(path) { + this.functionParent = this.functionParentStack.pop(); + } + +}; +const visitor = { + Program(path) { + this.renameStack = []; + this.functionParent = path; + this.functionParentStack = []; + }, + + FunctionExpression: visitFunWithBody, + FunctionDeclaration: visitFunWithBody, + ObjectMethod: visitFunWithBody, + + ArrowFunctionExpression(path) { + throw new Error("ArrowFunctionExpressions are unsupported"); + }, + + Scope: { + enter(path) { + path.node.renames = {}; + this.renameStack.push(path.node.renames); + }, + + exit(path) { + this.renameStack.pop(); + } + + }, + VariableDeclaration: { + enter(path) { + if (path.node.declarations.length !== 1) { + return; + } + + const decl = path.node.declarations[0]; + const id = decl.id; + + if (id.type !== 'Identifier') { + throw new Error("destructuring is not supported"); + } // This checks for the following case: + // + // function(x) { var x = 10; } + // + // is the same as: + // + // function(x) { x = 10; } + // + // Therefore, we do not need to lift x. Instead, we eliminate the + // declaration and only turn it into an assignment. + + + if (path.node.kind === 'var') { + const funArgs = getFunctionArgs(this.functionParent); + + if (funArgs.includes(id.name)) { + if (decl.init === null) { + // Case "function (x) { var x; }", we can remove "var x"; + path.remove(); + } else { + // Case "function(x) { var x = 10; }", we turn the declaration + // into "x = 10" and lift the declaration to the top of the + // enclosing function (or program). + path.replaceWith(t.assignmentExpression('=', id, decl.init)); + } + } + } else { + // This is a 'const x = ...' or a 'let x = ...' declaration that needs + // to be eliminated. Babel's 'transform-es2015-block-scoping' plugin is + // too slow for our purposes. Instead, we do something dumber: we use + // 'fastFreshId' to rename these variables (even if renaming is + // unnecessary) and declare them as 'var' statements. + const decl = path.node.declarations[0]; + const x = hygiene_1.fresh(id.name); + const oldId = id.name, + newId = x.name; // NOTE(arjun): using rename is likely quadratic. If we have performance + // issues with this phase, we can maintain a set of renamed variables + // and avoid repeated traversals. + + path.scope.rename(id.name, x.name); + path.replaceWith(t.variableDeclaration('var', [decl])); + this.renameStack[this.renameStack.length - 1][oldId] = newId; + } + }, + + exit(path) { + if (path.node.declarations.length > 1) { + let l = path.node.declarations.map(d => t.variableDeclaration(path.node.kind, [d])); + path.replaceWithMultiple(l); + } + } + + } +}; + +module.exports = function () { + return { + visitor + }; +}; + +function main() { + const filename = process.argv[2]; + const opts = { + plugins: [() => ({ + visitor + })], + babelrc: false + }; + babel.transformFile(filename, opts, (err, result) => { + if (err !== null) { + throw err; + } + + console.log(result.code); + }); +} + +if (__webpack_require__.c[__webpack_require__.s] === module) { + main(); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/compiler/compiler.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/compiler/compiler.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const babel = __webpack_require__(/*! babel-core */ "./node_modules/babel-core/index.js"); + +const stopifyCallCC = __webpack_require__(/*! ../stopify/stopifyCallCC */ "./node_modules/@stopify/stopify/dist/src/stopify/stopifyCallCC.js"); + +const babylon = __webpack_require__(/*! babylon */ "./node_modules/babylon/lib/index.js"); +/** + * Compiles (i.e., "stopifies") a program. This function should not be used + * directly by clients of Stopify. + * + * @param src the program to Stopify + * @param opts compiler options + * @returns the stopified program + */ + + +function compileFromAst(src, opts) { + const babelOpts = { + plugins: [[stopifyCallCC.plugin, opts]], + babelrc: false, + ast: false, + code: true, + minified: true, + comments: false + }; + + const _babel$transformFromA = babel.transformFromAst(src, undefined, babelOpts), + code = _babel$transformFromA.code; + + return code; +} + +exports.compileFromAst = compileFromAst; +/** + * Compiles (i.e., "stopifies") a program. This function should not be used + * directly by clients of Stopify. + * + * @param src the program to Stopify + * @param opts compiler options + * @returns the stopified program + */ + +function compile(src, opts) { + return compileFromAst(babylon.parse(src).program, opts); +} + +exports.compile = compile; + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/entrypoints/compiler.js": +/*!************************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/entrypoints/compiler.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * This is the entrypoint for stopify-full.bundle.js. A page that includes + * this entrypoint can compile programs in the browser. + */ + +const babylon = __webpack_require__(/*! babylon */ "./node_modules/babylon/lib/index.js"); + +const abstractRunner_1 = __webpack_require__(/*! ../runtime/abstractRunner */ "./node_modules/@stopify/stopify/dist/src/runtime/abstractRunner.js"); + +const compiler_1 = __webpack_require__(/*! ../compiler/compiler */ "./node_modules/@stopify/stopify/dist/src/compiler/compiler.js"); + +const check_compiler_opts_1 = __webpack_require__(/*! @stopify/continuations/dist/src/compiler/check-compiler-opts */ "./node_modules/@stopify/continuations/dist/src/compiler/check-compiler-opts.js"); + +const check_runtime_opts_1 = __webpack_require__(/*! ../runtime/check-runtime-opts */ "./node_modules/@stopify/stopify/dist/src/runtime/check-runtime-opts.js"); + +const continuations_1 = __webpack_require__(/*! @stopify/continuations */ "./node_modules/@stopify/continuations/dist/src/index.js"); // We need to provide these for stopify-continuations + + +__export(__webpack_require__(/*! @stopify/continuations-runtime/dist/src/runtime/runtime */ "./node_modules/@stopify/continuations-runtime/dist/src/runtime/runtime.js")); + +__export(__webpack_require__(/*! @stopify/continuations/dist/src/runtime/implicitApps */ "./node_modules/@stopify/continuations/dist/src/runtime/implicitApps.js")); + +var cannotCapture_1 = __webpack_require__(/*! @stopify/continuations/dist/src/common/cannotCapture */ "./node_modules/@stopify/continuations/dist/src/common/cannotCapture.js"); + +exports.knownBuiltIns = cannotCapture_1.knownBuiltIns; + +const compiler = __webpack_require__(/*! ../stopify/compileFunction */ "./node_modules/@stopify/stopify/dist/src/stopify/compileFunction.js"); + +exports.compiler = compiler; +let runner; + +function copyCompilerOpts(compileOpts) { + return { + compileFunction: compileOpts.compileFunction, + getters: compileOpts.getters, + debug: compileOpts.debug, + captureMethod: compileOpts.captureMethod, + newMethod: compileOpts.newMethod, + es: compileOpts.es, + jsArgs: compileOpts.jsArgs, + requireRuntime: compileOpts.requireRuntime, + sourceMap: compileOpts.sourceMap, + onDone: compileOpts.onDone, + eval2: compileOpts.eval2, + compileMode: compileOpts.compileMode + }; +} + +class Runner extends abstractRunner_1.AbstractRunner { + constructor(code, compilerOpts, runtimeOpts) { + super(runtimeOpts); + this.code = code; + this.evalOpts = copyCompilerOpts(compilerOpts); + this.evalOpts.eval2 = true; + } + + run(onDone, onYield, onBreakpoint) { + this.runInit(onDone, onYield, onBreakpoint); + eval.call(global, this.code); + } + + compile(src) { + const ast = babylon.parse(src).program; + return compiler_1.compileFromAst(ast, this.evalOpts); + } + + compileFromAst(ast) { + return compiler_1.compileFromAst(ast, this.evalOpts); + } + + evalCompiled(stopifiedCode, onDone) { + this.eventMode = abstractRunner_1.EventProcessingMode.Running; + this.continuationsRTS.runtime(eval(stopifiedCode), onDone); + } + + evalAsyncFromAst(ast, onDone) { + const stopifiedCode = compiler_1.compileFromAst(ast, this.evalOpts); + this.evalCompiled(stopifiedCode, onDone); + } + + evalAsync(src, onDone) { + this.evalAsyncFromAst(babylon.parse(src).program, onDone); + } + +} +/** + * Called by the stopified program to get suspend() and other functions. + */ + + +function init(rts) { + if (runner === undefined) { + throw new Error('stopify not called'); + } + + return runner.init(rts); +} + +exports.init = init; + +function stopifyLocallyFromAst(src, sourceMap, optionalCompileOpts, optionalRuntimeOpts) { + try { + const compileOpts = check_compiler_opts_1.checkAndFillCompilerOpts(optionalCompileOpts || {}, sourceMap); + const runtimeOpts = check_runtime_opts_1.checkAndFillRuntimeOpts(optionalRuntimeOpts || {}); + const stopifiedCode = compiler_1.compileFromAst(src, compileOpts); + runner = new Runner(stopifiedCode, compileOpts, runtimeOpts); + return runner; + } catch (exn) { + return { + kind: 'error', + exception: exn + }; + } +} + +exports.stopifyLocallyFromAst = stopifyLocallyFromAst; +/** + * Control the execution of a pre-compiled program. + * + * @param url URL of a pre-compiled program + * @param opts runtime settings + */ + +function stopifyLocally(src, optionalCompileOpts, optionalRuntimeOpts) { + return stopifyLocallyFromAst(babylon.parse(src).program, continuations_1.getSourceMap(src), optionalCompileOpts, optionalRuntimeOpts); +} + +exports.stopifyLocally = stopifyLocally; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/generic.js": +/*!***********************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/generic.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function sum(arr) { + return arr.reduce((x, y) => x + y, 0); +} + +exports.sum = sum; + +function dropWhile(f, arr) { + for (let i = 0; i < arr.length; i++) { + if (f(arr[i]) === false) { + return arr.slice(i); + } + } + + return []; +} + +exports.dropWhile = dropWhile; + +function takeWhile(f, arr) { + for (let i = 0; i < arr.length; i++) { + if (f(arr[i]) === false) { + return arr.slice(0, i); + } + } + + return arr.slice(0); +} + +exports.takeWhile = takeWhile; + +function timeSlow(label, thunk) { + const start = Date.now(); + const result = thunk(); + const end = Date.now(); + const delay = end - start; + + if (delay > 2000) { + console.info("".concat(label, " (").concat(delay, " ms)")); + } + + return result; +} + +exports.timeSlow = timeSlow; + +function groupBy(inGroup, arr) { + if (arr.length === 0) { + return []; + } + + const groups = [[arr[0]]]; + let currentGroup = groups[0]; + let last = arr[0]; + + for (let i = 1; i < arr.length; i++) { + const current = arr[i]; + + if (inGroup(last, current)) { + currentGroup.push(current); + last = current; + } else { + currentGroup = [current]; + groups.push(currentGroup); + last = current; + } + } + + return groups; +} + +exports.groupBy = groupBy; + +function parseArg(convert, validate, error) { + return arg => { + const parsed = convert(arg); + + if (validate(parsed)) { + return parsed; + } else { + throw new Error(error); + } + }; +} + +exports.parseArg = parseArg; + +function unreachable() { + throw new Error("unreachable code was reached!"); +} + +exports.unreachable = unreachable; + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/index.js": +/*!*********************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/index.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const compiler_1 = __webpack_require__(/*! ./compiler/compiler */ "./node_modules/@stopify/stopify/dist/src/compiler/compiler.js"); + +const check_compiler_opts_1 = __webpack_require__(/*! @stopify/continuations/dist/src/compiler/check-compiler-opts */ "./node_modules/@stopify/continuations/dist/src/compiler/check-compiler-opts.js"); + +const continuations_1 = __webpack_require__(/*! @stopify/continuations */ "./node_modules/@stopify/continuations/dist/src/index.js"); + +__export(__webpack_require__(/*! ./entrypoints/compiler */ "./node_modules/@stopify/stopify/dist/src/entrypoints/compiler.js")); + +function stopify(src, opts) { + if (opts && opts.captureMethod === 'original') { + return "".concat(src, ";window.originalOnDone();"); + } + + return compiler_1.compile(src, check_compiler_opts_1.checkAndFillCompilerOpts(opts, continuations_1.getSourceMap(src))); +} + +exports.stopify = stopify; + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/runtime/abstractRunner.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/runtime/abstractRunner.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const suspend_1 = __webpack_require__(/*! ./suspend */ "./node_modules/@stopify/stopify/dist/src/runtime/suspend.js"); + +const makeEstimator_1 = __webpack_require__(/*! ./makeEstimator */ "./node_modules/@stopify/stopify/dist/src/runtime/makeEstimator.js"); + +const setImmediate_1 = __webpack_require__(/*! ./setImmediate */ "./node_modules/@stopify/stopify/dist/src/runtime/setImmediate.js"); + +var EventProcessingMode; + +(function (EventProcessingMode) { + EventProcessingMode[EventProcessingMode["Running"] = 0] = "Running"; + EventProcessingMode[EventProcessingMode["Paused"] = 1] = "Paused"; + EventProcessingMode[EventProcessingMode["Waiting"] = 2] = "Waiting"; +})(EventProcessingMode = exports.EventProcessingMode || (exports.EventProcessingMode = {})); + +class AbstractRunner { + constructor(opts) { + this.opts = opts; + this.kind = 'ok'; + + this.onDone = result => {}; + + this.onYield = function () {}; + + this.onBreakpoint = function () {}; + + this.breakpoints = []; // The runtime system starts executing the main body of the program. + + this.eventMode = EventProcessingMode.Running; + this.eventQueue = []; + this.onYieldFlag = { + kind: 'resume' + }; + this.mayYieldFlag = { + kind: 'resume' + }; // The global object for Stopified code. + + this.g = Object.create(null); + } + + mayYieldRunning() { + const n = this.suspendRTS.linenum; + + if (typeof n !== 'number') { + return false; + } + + return this.breakpoints.includes(n); + } + /** + * Indirectly called by the stopified program. + */ + + + init(rts) { + this.continuationsRTS = rts; + const estimator = makeEstimator_1.makeEstimator(this.opts); + this.suspendRTS = new suspend_1.RuntimeWithSuspend(this.continuationsRTS, this.opts.yieldInterval, estimator, () => { + switch (this.mayYieldFlag.kind) { + case 'resume': + return this.mayYieldRunning(); + + default: + //Step + // Yield control if the line number changes. + const maybeLine = this.suspendRTS.linenum; + + if (typeof maybeLine !== 'number' || maybeLine === this.mayYieldFlag.currentLine) { + return false; + } else { + this.mayYieldFlag.onStep(maybeLine); + return true; + } + + } + }, () => { + if (this.eventMode === EventProcessingMode.Waiting) { + throw new Error('Stopify internal error: onYield invoked during pause+wait'); + } + + switch (this.onYieldFlag.kind) { + case 'paused': + this.onYieldFlag.onPaused(this.suspendRTS.linenum); + this.onYieldFlag = { + kind: 'pausedAndMayYield' + }; + return false; + + case 'pausedAndMayYield': + throw new Error("onYield called while paused. Do not call .resume()\n in the callback passed to .pause(). Resume in another turn."); + + case 'resume': + if (this.mayYieldRunning()) { + this.onYieldFlag = { + kind: 'paused', + onPaused: line => { + if (line === undefined) { + throw new Error("Calling onBreakpoint with undefined as the line"); + } + + this.onBreakpoint(line); + } + }; + this.eventMode = EventProcessingMode.Paused; // Invoke the breakpoint handler on the next turn, after the stack + // is fully reified. + + setImmediate_1.setImmediate(() => this.onBreakpoint(this.suspendRTS.linenum)); + return false; + } + + this.onYield(); + return true; + + default: + // Step + return !this.suspendRTS.mayYield(); + } + }); + return this; + } + /** + * Called by the stopified program. + */ + + + suspend() { + return this.suspendRTS.suspend(); + } + /** + * Called by the stopified program. + */ + + + onEnd(result) { + this.eventMode = EventProcessingMode.Waiting; + this.onDone(result); + this.processQueuedEvents(); + } + + runInit(onDone, onYield, onBreakpoint) { + if (onYield) { + this.onYield = onYield; + } + + if (onBreakpoint) { + this.onBreakpoint = onBreakpoint; + } + + this.onDone = onDone; + } + + pause(onPaused) { + if (this.eventMode === EventProcessingMode.Paused) { + throw new Error('the program is already paused'); + } + + if (this.eventMode === EventProcessingMode.Waiting) { + onPaused(); // onYield will not be invoked + } else { + this.onYieldFlag = { + kind: 'paused', + onPaused + }; + } + + this.eventMode = EventProcessingMode.Paused; + } + + setBreakpoints(lines) { + this.breakpoints = lines; + } + + resume() { + if (this.eventMode === EventProcessingMode.Waiting) { + return; + } + + if (this.eventMode === EventProcessingMode.Running) { + throw new Error("invokes .resume() while the program is running"); + } // Program was paused, but there was no active continuation. + + + if (this.suspendRTS.continuation === suspend_1.badResume) { + this.eventMode = EventProcessingMode.Waiting; + this.processQueuedEvents(); + } else { + this.eventMode = EventProcessingMode.Running; + this.mayYieldFlag = { + kind: 'resume' + }; + this.onYieldFlag = { + kind: 'resume' + }; + this.suspendRTS.resumeFromCaptured(); + } + } // NOTE: The program remains Paused while stepping. + + + step(onStep) { + if (this.eventMode !== EventProcessingMode.Paused) { + throw new Error("step(onStep) requires the program to be paused"); + } + + this.mayYieldFlag = { + kind: 'step', + currentLine: this.suspendRTS.linenum, + onStep + }; + this.onYieldFlag = { + kind: 'step' + }; + this.suspendRTS.resumeFromCaptured(); + } // NOTE: In both of the pause functions below, we don't switch the mode to + // paused! This is because we don't want the user to be able to hit "step" at + // this point. + + + pauseK(callback) { + return this.continuationsRTS.captureCC(k => { + return this.continuationsRTS.endTurn(onDone => { + return callback(x => { + return this.continuationsRTS.runtime(() => k(x), onDone); + }); + }); + }); + } + + pauseImmediate(callback) { + return this.continuationsRTS.captureCC(k => { + return this.continuationsRTS.endTurn(onDone => { + this.k = { + k, + onDone + }; + callback(); + }); + }); + } + + continueImmediate(x) { + if (this.k === undefined) { + throw new Error("called continueImmediate before pauseImmediate"); + } + + const _this$k = this.k, + k = _this$k.k, + onDone = _this$k.onDone; + this.k = undefined; + return this.continuationsRTS.runtime(() => k(x), onDone); + } + + externalHOF(body) { + return this.continuationsRTS.captureCC(k => this.continuationsRTS.endTurn(onDone => body(result => this.continuationsRTS.runtime(() => k(result), onDone)))); + } + + runStopifiedCode(body, callback) { + this.continuationsRTS.runtime(body, callback); + } + + processEvent(body, receiver) { + this.eventQueue.push({ + body, + receiver + }); + this.processQueuedEvents(); + } + + processQueuedEvents() { + if (this.eventMode !== EventProcessingMode.Waiting) { + return; + } + + const eventHandler = this.eventQueue.shift(); + + if (eventHandler === undefined) { + return; + } + + const body = eventHandler.body, + receiver = eventHandler.receiver; + this.eventMode = EventProcessingMode.Running; + this.continuationsRTS.runtime(body, result => { + this.eventMode = EventProcessingMode.Waiting; + receiver(result); + this.processQueuedEvents(); + }); + } + +} + +exports.AbstractRunner = AbstractRunner; + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/runtime/check-runtime-opts.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/runtime/check-runtime-opts.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const check_compiler_opts_1 = __webpack_require__(/*! @stopify/continuations/dist/src/compiler/check-compiler-opts */ "./node_modules/@stopify/continuations/dist/src/compiler/check-compiler-opts.js"); + +const validFlags = ['filename', 'estimator', 'yieldInterval', 'resampleInterval', 'timePerElapsed', 'stop', 'variance', 'env', 'stackSize', 'restoreFrames']; +/** + * Given a partial 'Opts', fill in sensible defaults and dynamically + * enforce type and value checks. + * + * @param value a 'CompilerOpts' with elided fields + */ + +function checkAndFillRuntimeOpts(value) { + if (value === null || typeof value !== 'object') { + throw new Error("expected an object for Opts"); + } + + Object.keys(value).forEach(key => { + if (!validFlags.includes(key)) { + throw new Error("invalid flag: ".concat(key)); + } + }); + const opts = { + estimator: 'velocity', + yieldInterval: 100, + resampleInterval: 100, + timePerElapsed: 1, + stackSize: Infinity, + restoreFrames: Infinity, + filename: '', + stop: undefined, + variance: false, + env: 'chrome' + }; + check_compiler_opts_1.copyProp(opts, value, 'estimator', x => ['exact', 'reservoir', 'velocity', 'interrupt', 'countdown'].includes(x), ".estimator must be either 'reservoir', 'velocity', 'interrupt', 'countdown', or 'exact'"); + check_compiler_opts_1.transformProp(opts, value, 'yieldInterval', x => Number(x), x => typeof x === 'number' && x > 0, ".yieldInterval must be a number greater than zero"); + check_compiler_opts_1.transformProp(opts, value, 'resampleInterval', x => Number(x), x => typeof x === 'number' && x > 0, ".resampleInterval must be a number greater than zero"); + check_compiler_opts_1.transformProp(opts, value, 'timePerElapsed', x => Number(x), x => typeof x === 'number' && x > 0, ".timePerElapsed must be a number greater than zero"); + check_compiler_opts_1.transformProp(opts, value, 'stackSize', x => Number(x), x => typeof x === 'number' && x > 0, ".stackSize must be a number greater than zero"); + check_compiler_opts_1.transformProp(opts, value, 'restoreFrames', x => Number(x), x => typeof x === 'number' && x > 0, ".restoreFrames must be a number greater than zero"); // TODO(arjun): The following flags only exist for benchmarking and testing + // They don't really belong in the system. + + check_compiler_opts_1.copyProp(opts, value, 'stop', x => true, ''); + check_compiler_opts_1.copyProp(opts, value, 'variance', x => true, ''); + check_compiler_opts_1.copyProp(opts, value, 'env', x => true, ''); + check_compiler_opts_1.copyProp(opts, value, 'filename', x => true, ''); + return opts; +} + +exports.checkAndFillRuntimeOpts = checkAndFillRuntimeOpts; + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/runtime/makeEstimator.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/runtime/makeEstimator.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const generic_1 = __webpack_require__(/*! ../generic */ "./node_modules/@stopify/stopify/dist/src/generic.js"); + +const estimators_1 = __webpack_require__(/*! @stopify/estimators */ "./node_modules/@stopify/estimators/dist/src/elapsedTimeEstimator.js"); +/** + * Checks the current time whenever 'elapsedTime' is applied, instead of + * estimating the elapsed time. + */ + + +function makeExact() { + return new estimators_1.ExactTimeEstimator(); +} + +exports.makeExact = makeExact; +/** + * Assumes that 'elapsedTime' is applied every 'timePerElapsed' milliseconds + * and uses this to estimate the elapsed time. + * + * @param timePerElapsed time (in milliseconds) between successive calls to + * 'elapsedTime' + */ + +function makeCountdown(timePerElapsed) { + return new estimators_1.CountdownTimeEstimator(timePerElapsed); +} + +exports.makeCountdown = makeCountdown; +/** + * Estimates 'elapsedTime' by sampling the current time when 'elapsedTime' + * is applied. + * + * We use reservoir sampling with a reservoir of size 1, thus all times are + * equally likely to be selected. + */ + +function makeSampleAverage() { + return new estimators_1.SampleAverageTimeEstimator(); +} + +exports.makeSampleAverage = makeSampleAverage; +/** + * Estimates 'elapsedTime' by periodically resampling the current time. + * + * @param resample Period between resamples. + */ + +function makeVelocityEstimator(resample = 100) { + return new estimators_1.VelocityEstimator(resample); +} + +exports.makeVelocityEstimator = makeVelocityEstimator; + +function makeEstimator(opts) { + if (opts.estimator === 'exact') { + return makeExact(); + } else if (opts.estimator === 'countdown') { + return makeCountdown(opts.timePerElapsed); + } else if (opts.estimator === 'reservoir') { + return makeSampleAverage(); + } else if (opts.estimator === 'velocity') { + return makeVelocityEstimator(opts.resampleInterval); + } else { + return generic_1.unreachable(); + } +} + +exports.makeEstimator = makeEstimator; + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/runtime/setImmediate.js": +/*!************************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/runtime/setImmediate.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * A browser-dependent implementation of setImmediate. We have performed + * simple experiments to determine which implementation of setImmediate is + * fastest on each browser. We use postMessage for any browser that we haven't + * tested. + */ + +const browser = __webpack_require__(/*! detect-browser */ "./node_modules/detect-browser/browser.js"); + +function makeSetImmediateMC() { + const chan = new MessageChannel(); // We can't send closures over MessageChannels. + + const chanThunks = []; + + chan.port2.onmessage = function (evt) { + const func = chanThunks.pop(); + + if (typeof func === 'function') { + return func(); + } else { + throw new Error("makeSetImmediateMC expected a function, received: ".concat(func)); + } + }; + + return thunk => { + chanThunks.push(thunk); + return chan.port1.postMessage(true); + }; +} + +function setImmediateT0(thunk) { + setTimeout(thunk, 0); +} + +exports.setImmediateT0 = setImmediateT0; + +function makeSetImmediatePM() { + const thunks = []; + window.addEventListener('message', evt => { + if (evt.data === true) { + const func = thunks.pop(); + + if (typeof func === 'function') { + return func(); + } else { + throw new Error("makeSetImmediatePM expected a function, received: ".concat(func)); + } + } + }); + return thunk => { + thunks.push(thunk); // NOTE(arjun): This likely conflicts with other uses of postMessage. + + window.postMessage(true, '*'); + }; +} + +function makeSetImmediate() { + if (typeof self === "object" && typeof self.importScripts === 'function') { + return setImmediateT0; + } // browser can be null + else if (!browser || browser.name === 'node') { + return setImmediateT0; + } else if (browser.name === 'safari') { + return makeSetImmediateMC(); + } else if (browser.name === 'firefox') { + return makeSetImmediateMC(); + } else if (browser.name === 'chrome') { + return makeSetImmediatePM(); + } else if (browser.name === 'edge') { + return makeSetImmediateMC(); + } else { + console.warn("Stopify has not been benchmarked with ".concat(browser.name, ". Defaulting to slow window.postMessage.")); + return makeSetImmediatePM(); + } +} + +exports.setImmediate = makeSetImmediate(); + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/runtime/suspend.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/runtime/suspend.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const setImmediate_1 = __webpack_require__(/*! ./setImmediate */ "./node_modules/@stopify/stopify/dist/src/runtime/setImmediate.js"); + +function badResume(x) { + throw new Error('program is not paused. (Did you call .resume() twice?)'); +} + +exports.badResume = badResume; + +function defaultDone(x) { + if (x.type === 'exception') { + console.error(x.value); + } +} + +exports.defaultDone = defaultDone; +const normalUndefResult = { + type: 'normal', + value: undefined +}; +/** + * Instance of a runtime extended with the suspend() function. Used by + * instrumented programs produced by stopify. + */ + +class RuntimeWithSuspend { + constructor( + /** + * Abstract runtime used to implement stack saving and restoring logic + */ + rts, yieldInterval, estimator, + /** The runtime system yields control whenever this function produces + * 'true' or when the estimated elapsed time exceeds 'yieldInterval'. + */ + mayYield = function () { + return false; + }, + /** This function is applied immediately before stopify yields control to + * the browser's event loop. If the function produces 'false', the + * computation does not resume. + */ + onYield = function () { + return true; + }, + /** + * Called when execution reaches the end of any stopified module. + */ + onEnd = function (x) { + this.estimator.cancel(); + defaultDone(x); + }, continuation = badResume, onDone = defaultDone, + /** + * Current line number in the source program. Used in `--debug` mode. + */ + linenum = undefined) { + this.rts = rts; + this.yieldInterval = yieldInterval; + this.estimator = estimator; + this.mayYield = mayYield; + this.onYield = onYield; + this.onEnd = onEnd; + this.continuation = continuation; + this.onDone = onDone; + this.linenum = linenum; + } // Resume a suspended program. + + + resumeFromCaptured() { + const cont = this.continuation; + const onDone = this.onDone; // Clear the saved continuation, or invoking .resumeFromCaptured() twice + // in a row will restart the computation. + + this.continuation = badResume; + this.onDone = defaultDone; + return this.rts.runtime(() => cont(normalUndefResult), onDone); + } + /** + * Call this function to suspend a running program. When called, it initiates + * stack capturing by calling the `captureCC` function defined by the current + * runtime. + * + * Internally uses stopify's timing mechanism to decide whether or not to + * suspend. + * + * @param force forces a suspension when `true`. + */ + + + suspend(force) { + // If there are no more stack frame left to be consumed, save the stack + // and continue running the program. + if (isFinite(this.rts.stackSize) && this.rts.remainingStack <= 0) { + this.rts.remainingStack = this.rts.stackSize; + return this.rts.captureCC(continuation => { + if (this.onYield()) { + return continuation(normalUndefResult); + } + }); + } + + if (force || this.mayYield() || this.estimator.elapsedTime() >= this.yieldInterval) { + if (isFinite(this.rts.stackSize)) { + this.rts.remainingStack = this.rts.stackSize; + } + + this.estimator.reset(); + return this.rts.captureCC(continuation => { + return this.rts.endTurn(onDone => { + this.continuation = continuation; + this.onDone = onDone; + + if (this.onYield()) { + return setImmediate_1.setImmediate(() => { + this.rts.runtime(() => continuation(normalUndefResult), onDone); + }); + } + }); + }); + } + } + +} + +exports.RuntimeWithSuspend = RuntimeWithSuspend; + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/stopify/compileFunction.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/stopify/compileFunction.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * `func` compile mode should be used when function bodies need to be compiled + * while preserving the function signatures. This is currently being used in + * the pyret compiler. + * + * This passes around information to make sure that: + * - the function signature is preserved + * - globals are not redeclared (since the input function might capture variables) + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const babel = __webpack_require__(/*! babel-core */ "./node_modules/babel-core/index.js"); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const stopifyCallCC = __webpack_require__(/*! ./stopifyCallCC */ "./node_modules/@stopify/stopify/dist/src/stopify/stopifyCallCC.js"); + +const assert = __webpack_require__(/*! assert */ "./node_modules/assert/assert.js"); + +const util = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +var continuations_1 = __webpack_require__(/*! @stopify/continuations */ "./node_modules/@stopify/continuations/dist/src/index.js"); + +exports.RV_SENTINAL = continuations_1.RV_SENTINAL; +exports.EXN_SENTINAL = continuations_1.EXN_SENTINAL; +exports.knownBuiltIns = continuations_1.knownBuiltIns; +const visitor = { + Program: { + enter(path, { + opts + }) { + path.stop(); + assert.equal(path.node.body.length, 1); + const func = path.node.body[0]; + + if (func.type !== 'FunctionDeclaration') { + throw new Error('Must compile a top-level function'); + } else { + // If compile a string to be eval'd, convert last statement to a return + // statement + if (opts.eval) { + const lastStatement = func.body.body.pop(); + + if (lastStatement.type === 'ExpressionStatement') { + func.body.body.push(t.returnStatement(lastStatement.expression)); + } else { + func.body.body.push(lastStatement); + } + } + } + + util.transformFromAst(path, [[stopifyCallCC.plugin, opts]]); + } + + } +}; +const defaultOpts = { + getters: false, + compileFunction: true, + debug: false, + captureMethod: 'lazy', + newMethod: 'wrapper', + es: 'sane', + jsArgs: 'simple', + requireRuntime: false, + onDone: t.functionExpression(t.identifier('onDone'), [], t.blockStatement([])), + sourceMap: { + getLine: (x, y) => null + }, + eval2: false, + compileMode: 'normal' +}; + +function compileFunction(code, opts = defaultOpts) { + const babelOpts = { + plugins: [[() => ({ + visitor + }), opts]], + babelrc: false + }; + + const _babel$transform = babel.transform(code, babelOpts), + transformed = _babel$transform.code; + + if (!transformed) { + throw new Error("Failed to transform function"); + } + + return transformed; +} + +exports.compileFunction = compileFunction; + +function compileEval(code, compilerOpts, renames, boxes) { + const toCompile = "function __eval__function() { ".concat(code, " }"); + const transformed = compileFunction(toCompile, Object.assign({}, compilerOpts, { + renames, + boxes + })); + return "(".concat(transformed, ")()"); +} + +exports.compileEval = compileEval; + +function default_1() { + return { + visitor + }; +} + +exports.default = default_1; + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/stopify/stopifyCallCC.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/stopify/stopifyCallCC.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +const callcc = __webpack_require__(/*! @stopify/continuations */ "./node_modules/@stopify/continuations/dist/src/index.js"); + +const suspendStop_1 = __webpack_require__(/*! ./suspendStop */ "./node_modules/@stopify/stopify/dist/src/stopify/suspendStop.js"); + +const suspendStep_1 = __webpack_require__(/*! ./suspendStep */ "./node_modules/@stopify/stopify/dist/src/stopify/suspendStep.js"); + +const generic_1 = __webpack_require__(/*! ../generic */ "./node_modules/@stopify/stopify/dist/src/generic.js"); + +const hygiene = __webpack_require__(/*! @stopify/hygiene */ "./node_modules/@stopify/hygiene/dist/ts/index.js"); + +const util = __webpack_require__(/*! @stopify/util */ "./node_modules/@stopify/util/dist/ts/index.js"); + +exports.visitor = { + Program(path, state) { + const opts = state.opts; + const insertSuspend = state.opts.debug ? suspendStep_1.default : suspendStop_1.default; + const onDoneBody = []; + opts.onDone = t.functionExpression(t.identifier('onDone'), [t.identifier('result')], t.blockStatement(onDoneBody)); + + if (!opts.compileFunction) { + onDoneBody.push(t.expressionStatement(t.callExpression(t.memberExpression(t.identifier('$S'), t.identifier('onEnd')), [t.identifier('result')]))); + } + + path.stop(); + const filename = state.file.opts.filename; // NOTE(arjun): Small hack to force the implicitApps file to be in + // "sane mode". Without something like this, we get non-terminating + // behavior. + + if (filename.endsWith('implicitApps.js')) { + state.opts.esMode = 'sane'; + } + + hygiene.init(path); + util.transformFromAst(path, [[hygiene.plugin, { + reserved: callcc.reserved, + global: t.memberExpression(t.identifier('$S'), t.identifier('g')) + }]]); + + if (!state.opts.debug) { + util.transformFromAst(path, [callcc.flatness]); + } + + generic_1.timeSlow('insertSuspend', () => util.transformFromAst(path, [[insertSuspend, opts]])); + generic_1.timeSlow('(control ...) elimination', () => util.transformFromAst(path, [[callcc.plugin, opts]])); + hygiene.reset(); + + if (opts.compileFunction) {// Do nothing + } else if (opts.requireRuntime) { + // var $S = require('stopify/dist/src/runtime/rts').init($__R);; + path.node.body.splice(3, 0, t.variableDeclaration('var', [t.variableDeclarator(t.identifier('$S'), t.callExpression(t.memberExpression(t.callExpression(t.identifier('require'), [t.stringLiteral('stopify/dist/src/runtime/node')]), t.identifier('init')), [t.identifier('$__R')]))])); + } else { + // var $S = stopify.init($__R); + path.node.body.splice(3, 0, t.variableDeclaration('var', [t.variableDeclarator(t.identifier('$S'), t.callExpression(t.memberExpression(t.identifier('stopify'), t.identifier('init')), [t.identifier('$__R')]))])); + } + } + +}; + +function plugin() { + return { + visitor: exports.visitor + }; +} + +exports.plugin = plugin; + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/stopify/suspendStep.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/stopify/suspendStep.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +function insertSuspendHelper(body, opts) { + const newBody = []; + newBody.suspends = false; + body.forEach((v, i) => { + const loc = v.loc; + let ln; + + if (loc) { + ln = opts.sourceMap.getLine(loc.start.line, loc.start.column); + + if (ln) { + newBody.push(t.expressionStatement(t.assignmentExpression('=', t.memberExpression(t.memberExpression(t.identifier('$S'), t.identifier('suspendRTS')), t.identifier('linenum')), t.numericLiteral(ln))), t.expressionStatement(t.callExpression(t.memberExpression(t.identifier("$S"), t.identifier("suspend")), [])), v); + newBody.suspends = true; + } else { + newBody.push(v); + } + } else { + newBody.push(v); + } + }); + return newBody; +} + +const insertSuspend = { + BlockStatement: { + exit(path, s) { + path.node.body = insertSuspendHelper(path.node.body, s.opts); + } + + }, + + IfStatement(path) { + if (path.node.consequent.type !== "BlockStatement") { + const block = t.blockStatement([path.node.consequent]); + path.node.consequent = block; + } + + if (path.node.alternate && path.node.alternate.type !== "BlockStatement") { + const block = t.blockStatement([path.node.alternate]); + path.node.alternate = block; + } + }, + + Loop: { + enter(path) { + if (path.node.body.type !== "BlockStatement") { + const body = t.blockStatement([path.node.body]); + path.node.body = body; + } + }, + + exit(path) { + if (t.isBlockStatement(path.node.body) && !path.node.body.suspends) { + path.node.body.body.push(t.expressionStatement(t.callExpression(t.memberExpression(t.identifier("$S"), t.identifier("suspend")), []))); + } + } + + }, + Program: { + exit(path, { + opts + }) { + if (opts.compileFunction && !opts.eval) { + if (path.node.body[0].type === 'FunctionDeclaration') { + path.node.body[0].topFunction = true; + } else { + throw new Error("Compile function expected top-level functionDeclaration"); + } + } + + path.node.body = insertSuspendHelper(path.node.body, opts); + } + + } +}; + +function default_1() { + return { + visitor: insertSuspend + }; +} + +exports.default = default_1; + +/***/ }), + +/***/ "./node_modules/@stopify/stopify/dist/src/stopify/suspendStop.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@stopify/stopify/dist/src/stopify/suspendStop.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +function handleBlock(body) { + body.body.unshift(t.expressionStatement(t.callExpression(t.memberExpression(t.identifier("$S"), t.identifier("suspend")), []))); +} + +function handleFunction(path) { + if (path.node.mark === 'Flat') { + return; + } + + handleBlock(path.node.body); +} + +const insertSuspend = { + FunctionDeclaration(path) { + handleFunction(path); + }, + + FunctionExpression(path) { + handleFunction(path); + }, + + Loop(path) { + if (path.node.body.type === "BlockStatement") { + handleBlock(path.node.body); + } else { + const body = t.blockStatement([path.node.body]); + path.node.body = body; + handleBlock(body); + } + }, + + Program: { + exit(path, { + opts + }) { + if (opts.compileFunction && !opts.eval) { + if (path.node.body[0].type === 'FunctionDeclaration') { + path.node.body[0].topFunction = true; + } else { + throw new Error("Compile function expected top-level functionDeclaration"); + } + } + } + + } +}; + +function default_1() { + return { + visitor: insertSuspend + }; +} + +exports.default = default_1; + +/***/ }), + +/***/ "./node_modules/@stopify/util/dist/ts/babelHelpers.js": +/*!************************************************************!*\ + !*** ./node_modules/@stopify/util/dist/ts/babelHelpers.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +function isFunWithBody(node) { + return t.isFunctionDeclaration(node) || t.isFunctionExpression(node) || t.isObjectMethod(node); +} + +exports.isFunWithBody = isFunWithBody; +exports.eTrue = t.booleanLiteral(true); +exports.eFalse = t.booleanLiteral(false); +exports.eUndefined = t.identifier('undefined'); + +function enclosingScopeBlock(path) { + const parent = path.getFunctionParent().node; + + if (t.isProgram(parent)) { + return parent.body; + } else if (t.isFunctionExpression(parent) || t.isFunctionDeclaration(parent) || t.isObjectMethod(parent)) { + return parent.body.body; + } else { + throw new Error("parent is a ".concat(parent.type)); + } +} + +exports.enclosingScopeBlock = enclosingScopeBlock; +/** Constructs an 'e1 && e2', but simplifies when either sub-expression is + * a literal. + */ + +function and(e1, e2) { + if (e1.type === 'BooleanLiteral' && e1.value === true) { + return e2; + } else if (e2.type === 'BooleanLiteral' && e2.value === true) { + return e1; + } else if (e1.type === 'BooleanLiteral' && e1.value === false || e2.type === 'BooleanLiteral' && e2.value === false) { + return exports.eFalse; + } else { + return t.logicalExpression('&&', e1, e2); + } +} + +exports.and = and; +/** Constructs an 'e1 || e2', but simplifies when either sub-expression is + * a literal. + */ + +function or(...es) { + let r = t.booleanLiteral(false); + + for (const e of es) { + r = orBin(r, e); + } + + return r; +} + +exports.or = or; + +function orBin(e1, e2) { + if (e1.type === 'BooleanLiteral' && e1.value === false) { + return e2; + } else if (e2.type === 'BooleanLiteral' && e2.value === false) { + return e1; + } else if (e1.type === 'BooleanLiteral' && e1.value === true || e2.type === 'BooleanLiteral' && e2.value === true) { + return exports.eTrue; + } else { + return t.logicalExpression('||', e1, e2); + } +} + +function sIf(e, s1, s2) { + if (s2 === undefined) { + s2 = t.emptyStatement(); + } + + if (e.type === 'BooleanLiteral' && e.value === true) { + return s1; + } else if (e.type === 'BooleanLiteral' && e.value === false) { + return s2; + } else { + if (t.isEmptyStatement(s2)) { + return t.ifStatement(e, s1); + } else { + return t.ifStatement(e, s1, s2); + } + } +} + +exports.sIf = sIf; +/** + * Replaces a statement with a sequence of statements, creating a BlockStatement + * if necessary. + * + * NOTE(arjun): There appears to be a bug with Babel's path.replaceWithMultiple + * that this function works around. To witness the bug, try the ClojureScript + * benchmarks using Babel's replaceWithMultiple instead of this function. + * + * @param path the path to a statement to replace + * @param stmts a sequence of statements + */ + +function replaceWithStatements(path, ...stmts) { + if (path.parent.type === 'BlockStatement') { + path.replaceWithMultiple(stmts); + } else { + path.replaceWith(t.blockStatement(stmts)); + } +} + +exports.replaceWithStatements = replaceWithStatements; +/** + * Given an 'LVal' that is an identifier, produces the identifier's name. + * Throws an exception if the 'LVal' is not an identifier. + * + * @param lval an l-value + * @returns the name of the identifier, if 'lval' is an identifier + */ + +function lvaltoName(lval) { + if (lval.type === 'Identifier') { + return lval.name; + } else if (lval.type === 'RestElement' && lval.argument.type === 'Identifier') { + return lval.argument.name; + } else { + throw new Error("Expected Identifier, received ".concat(lval.type)); + } +} + +exports.lvaltoName = lvaltoName; + +function isPropertyValue(p) { + return t.isObjectMethod(p) || t.isObjectProperty(p) && p.computed === false && t.isExpression(p.value) && isValue(p.value); +} +/** + * Produces 'true' if 'e' is a value. + * + * @param e + */ + + +function isValue(e) { + if (e === null) { + return false; + } + + if (t.isLiteral(e) || t.isFunction(e) || t.isIdentifier(e)) { + return true; + } + + if (t.isArrayExpression(e)) { + return e.elements.every(isValue); + } + + if (t.isObjectExpression(e)) { + return e.properties.every(isPropertyValue); + } + + return false; +} + +exports.isValue = isValue; + +function arrayPrototypeSliceCall(e) { + return t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier('Array'), t.identifier('prototype')), t.identifier('slice')), t.identifier('call')), [e]); +} + +exports.arrayPrototypeSliceCall = arrayPrototypeSliceCall; + +function varDecl(x, init) { + const id = typeof x === 'string' ? t.identifier(x) : x; + return t.variableDeclaration('var', [t.variableDeclarator(id, init)]); +} + +exports.varDecl = varDecl; + +function enclosingFunctionName(path) { + // TODO(arjun): this traversal is slow + const f = path.getFunctionParent().node; + + if (t.isFunctionExpression(f)) { + return f.originalName || f.id.name; + } else if (t.isFunctionDeclaration(f)) { + return f.id.name; + } else { + return; + } +} + +exports.enclosingFunctionName = enclosingFunctionName; + +function returnLast(statements) { + const N = statements.length - 1; + const last = statements[N]; + + if (t.isExpressionStatement(last)) { + statements[N] = t.returnStatement(last.expression); + } + + return statements; +} + +exports.returnLast = returnLast; + +function letExpression(name, value, kind = 'let') { + return t.variableDeclaration(kind, [t.variableDeclarator(name, value)]); +} + +exports.letExpression = letExpression; + +/***/ }), + +/***/ "./node_modules/@stopify/util/dist/ts/helpers.js": +/*!*******************************************************!*\ + !*** ./node_modules/@stopify/util/dist/ts/helpers.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +const babel = __webpack_require__(/*! babel-core */ "./node_modules/babel-core/index.js"); + +const t = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var babelHelpers_1 = __webpack_require__(/*! ./babelHelpers */ "./node_modules/@stopify/util/dist/ts/babelHelpers.js"); + +exports.letExpression = babelHelpers_1.letExpression; // Helper to generate tagging function for AST tags preserved between traversals. + +function tag(tag, t, v) { + const tagged = t; + tagged[tag] = v; + return tagged; +} + +exports.tag = tag; + +exports.breakLbl = (t, v) => tag('break_label', t, v); + +exports.continueLbl = (t, v) => tag('continue_label', t, v); + +exports.newTag = t => tag('new', t, true); + +const containsCallVisitor = { + FunctionExpression(path) { + path.skip(); + }, + + CallExpression(path) { + this.containsCall = true; + path.stop(); + }, + + NewExpression(path) { + this.containsCall = true; + path.stop(); + } + +}; +/** + * Traverses children of `path` and returns true if it contains any applications. + */ + +function containsCall(path) { + let o = { + containsCall: false + }; + path.traverse(containsCallVisitor, o); + return o.containsCall; +} + +exports.containsCall = containsCall; +/** + * Use this when the contents of the body need to be flattened. + * @param body An array of statements + * @returns a new block (does not update the argument) + */ + +function flatBodyStatement(body) { + const newBody = []; + body.forEach(elem => { + if (t.isBlockStatement(elem)) { + elem.body.forEach(e => { + if (t.isStatement(e)) { + newBody.push(e); + } else if (t.isEmptyStatement(e)) {} else { + throw new Error('Could not flatten body, element was not a statement'); + } + }); + } else { + newBody.push(elem); + } + }); + return t.blockStatement(newBody); +} + +exports.flatBodyStatement = flatBodyStatement; +/** + * A simple wrapper around Babel's `transformFromAst` function. + */ + +function transformFromAst(path, plugins, ast = false, code = false) { + const opts = { + plugins: plugins, + babelrc: false, + code: false, + ast: false + }; + return babel.transformFromAst(path.node, undefined, opts); +} + +exports.transformFromAst = transformFromAst; + +/***/ }), + +/***/ "./node_modules/@stopify/util/dist/ts/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/@stopify/util/dist/ts/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +__export(__webpack_require__(/*! ./babelHelpers */ "./node_modules/@stopify/util/dist/ts/babelHelpers.js")); + +__export(__webpack_require__(/*! ./helpers */ "./node_modules/@stopify/util/dist/ts/helpers.js")); + +__export(__webpack_require__(/*! ./result */ "./node_modules/@stopify/util/dist/ts/result.js")); + +/***/ }), + +/***/ "./node_modules/@stopify/util/dist/ts/result.js": +/*!******************************************************!*\ + !*** ./node_modules/@stopify/util/dist/ts/result.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +class Ok { + constructor(value) { + this.value = value; + this.kind = 'ok'; + } + + then(f) { + return f(this.value); + } + + map(f) { + return asResult(() => f(this.value)); + } + + unwrap() { + return this.value; + } + +} + +class Error { + constructor(message) { + this.message = message; + this.kind = 'error'; + } + + then(f) { + return error(this.message); + } + + map(f) { + return error(this.message); + } + + unwrap() { + throw new Error(this.message); + } + +} + +function ok(v) { + return new Ok(v); +} + +exports.ok = ok; + +function error(message) { + return new Error(message); +} + +exports.error = error; + +function asResult(f) { + try { + return ok(f()); + } catch (exn) { + return error(exn.toString()); + } +} + +exports.asResult = asResult; + +/***/ }), + +/***/ "./node_modules/ansi-regex/index.js": +/*!******************************************!*\ + !*** ./node_modules/ansi-regex/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = options => { + options = Object.assign({ + onlyFirst: false + }, options); + const pattern = ['[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|'); + return new RegExp(pattern, options.onlyFirst ? undefined : 'g'); +}; + +/***/ }), + +/***/ "./node_modules/ansi-styles/index.js": +/*!*******************************************!*\ + !*** ./node_modules/ansi-styles/index.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(module) { + +const colorConvert = __webpack_require__(/*! color-convert */ "./node_modules/color-convert/index.js"); + +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return "\x1B[".concat(code + offset, "m"); +}; + +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return "\x1B[".concat(38 + offset, ";5;").concat(code, "m"); +}; + +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return "\x1B[".concat(38 + offset, ";2;").concat(rgb[0], ";").concat(rgb[1], ";").concat(rgb[2], "m"); +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; // Fix humans + + styles.color.grey = styles.color.gray; + + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + + for (const styleName of Object.keys(group)) { + const style = group[styleName]; + styles[styleName] = { + open: "\x1B[".concat(style[0], "m"), + close: "\x1B[".concat(style[1], "m") + }; + group[styleName] = styles[styleName]; + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } + + const ansi2ansi = n => n; + + const rgb2rgb = (r, g, b) => [r, g, b]; + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if (key === 'ansi16') { + key = 'ansi'; + } + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } + + return styles; +} // Make the export immutable + + +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/assert/assert.js": +/*!***************************************!*\ + !*** ./node_modules/assert/assert.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js +// original notice: + +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +function compare(a, b) { + if (a === b) { + return 0; + } + + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) { + return -1; + } + + if (y < x) { + return 1; + } + + return 0; +} + +function isBuffer(b) { + if (global.Buffer && typeof global.Buffer.isBuffer === 'function') { + return global.Buffer.isBuffer(b); + } + + return !!(b != null && b._isBuffer); +} // based on node assert, original notice: +// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 +// +// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! +// +// Originally from narwhal.js (http://narwhaljs.org) +// Copyright (c) 2009 Thomas Robinson <280north.com> +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the 'Software'), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +var util = __webpack_require__(/*! util/ */ "./node_modules/node-libs-browser/node_modules/util/util.js"); + +var hasOwn = Object.prototype.hasOwnProperty; +var pSlice = Array.prototype.slice; + +var functionsHaveNames = function () { + return function foo() {}.name === 'foo'; +}(); + +function pToString(obj) { + return Object.prototype.toString.call(obj); +} + +function isView(arrbuf) { + if (isBuffer(arrbuf)) { + return false; + } + + if (typeof global.ArrayBuffer !== 'function') { + return false; + } + + if (typeof ArrayBuffer.isView === 'function') { + return ArrayBuffer.isView(arrbuf); + } + + if (!arrbuf) { + return false; + } + + if (arrbuf instanceof DataView) { + return true; + } + + if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) { + return true; + } + + return false; +} // 1. The assert module provides functions that throw +// AssertionError's when particular conditions are not met. The +// assert module must conform to the following interface. + + +var assert = module.exports = ok; // 2. The AssertionError is defined in assert. +// new assert.AssertionError({ message: message, +// actual: actual, +// expected: expected }) + +var regex = /\s*function\s+([^\(\s]*)\s*/; // based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js + +function getName(func) { + if (!util.isFunction(func)) { + return; + } + + if (functionsHaveNames) { + return func.name; + } + + var str = func.toString(); + var match = str.match(regex); + return match && match[1]; +} + +assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + + if (options.message) { + this.message = options.message; + this.generatedMessage = false; + } else { + this.message = getMessage(this); + this.generatedMessage = true; + } + + var stackStartFunction = options.stackStartFunction || fail; + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, stackStartFunction); + } else { + // non v8 browsers so we can have a stacktrace + var err = new Error(); + + if (err.stack) { + var out = err.stack; // try to strip useless frames + + var fn_name = getName(stackStartFunction); + var idx = out.indexOf('\n' + fn_name); + + if (idx >= 0) { + // once we have located the function frame + // we need to strip out everything before it (and its line) + var next_line = out.indexOf('\n', idx + 1); + out = out.substring(next_line + 1); + } + + this.stack = out; + } + } +}; // assert.AssertionError instanceof Error + + +util.inherits(assert.AssertionError, Error); + +function truncate(s, n) { + if (typeof s === 'string') { + return s.length < n ? s : s.slice(0, n); + } else { + return s; + } +} + +function inspect(something) { + if (functionsHaveNames || !util.isFunction(something)) { + return util.inspect(something); + } + + var rawname = getName(something); + var name = rawname ? ': ' + rawname : ''; + return '[Function' + name + ']'; +} + +function getMessage(self) { + return truncate(inspect(self.actual), 128) + ' ' + self.operator + ' ' + truncate(inspect(self.expected), 128); +} // At present only the three keys mentioned above are used and +// understood by the spec. Implementations or sub modules can pass +// other keys to the AssertionError's constructor - they will be +// ignored. +// 3. All of the following functions must throw an AssertionError +// when a corresponding condition is not met, with a message that +// may be undefined if not provided. All assertion methods provide +// both the actual and expected values to the assertion error for +// display purposes. + + +function fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); +} // EXTENSION! allows for well behaved errors defined elsewhere. + + +assert.fail = fail; // 4. Pure assertion tests whether a value is truthy, as determined +// by !!guard. +// assert.ok(guard, message_opt); +// This statement is equivalent to assert.equal(true, !!guard, +// message_opt);. To test strictly for the value true, use +// assert.strictEqual(true, guard, message_opt);. + +function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); +} + +assert.ok = ok; // 5. The equality assertion tests shallow, coercive equality with +// ==. +// assert.equal(actual, expected, message_opt); + +assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); +}; // 6. The non-equality assertion tests for whether two objects are not equal +// with != assert.notEqual(actual, expected, message_opt); + + +assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } +}; // 7. The equivalence assertion tests a deep equality relation. +// assert.deepEqual(actual, expected, message_opt); + + +assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); + } +}; + +assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual); + } +}; + +function _deepEqual(actual, expected, strict, memos) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + } else if (isBuffer(actual) && isBuffer(expected)) { + return compare(actual, expected) === 0; // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && actual.global === expected.global && actual.multiline === expected.multiline && actual.lastIndex === expected.lastIndex && actual.ignoreCase === expected.ignoreCase; // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if ((actual === null || typeof actual !== 'object') && (expected === null || typeof expected !== 'object')) { + return strict ? actual === expected : actual == expected; // If both values are instances of typed arrays, wrap their underlying + // ArrayBuffers in a Buffer each to increase performance + // This optimization requires the arrays to have the same type as checked by + // Object.prototype.toString (aka pToString). Never perform binary + // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their + // bit patterns are not identical. + } else if (isView(actual) && isView(expected) && pToString(actual) === pToString(expected) && !(actual instanceof Float32Array || actual instanceof Float64Array)) { + return compare(new Uint8Array(actual.buffer), new Uint8Array(expected.buffer)) === 0; // 7.5 For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else if (isBuffer(actual) !== isBuffer(expected)) { + return false; + } else { + memos = memos || { + actual: [], + expected: [] + }; + var actualIndex = memos.actual.indexOf(actual); + + if (actualIndex !== -1) { + if (actualIndex === memos.expected.indexOf(expected)) { + return true; + } + } + + memos.actual.push(actual); + memos.expected.push(expected); + return objEquiv(actual, expected, strict, memos); + } +} + +function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} + +function objEquiv(a, b, strict, actualVisitedObjects) { + if (a === null || a === undefined || b === null || b === undefined) return false; // if one is a primitive, the other must be same + + if (util.isPrimitive(a) || util.isPrimitive(b)) return a === b; + if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false; + var aIsArgs = isArguments(a); + var bIsArgs = isArguments(b); + if (aIsArgs && !bIsArgs || !aIsArgs && bIsArgs) return false; + + if (aIsArgs) { + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b, strict); + } + + var ka = objectKeys(a); + var kb = objectKeys(b); + var key, i; // having the same number of owned properties (keys incorporates + // hasOwnProperty) + + if (ka.length !== kb.length) return false; //the same set of keys (although not necessarily the same order), + + ka.sort(); + kb.sort(); //~~~cheap key test + + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] !== kb[i]) return false; + } //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + + + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) return false; + } + + return true; +} // 8. The non-equivalence assertion tests for any deep inequality. +// assert.notDeepEqual(actual, expected, message_opt); + + +assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); + } +}; + +assert.notDeepStrictEqual = notDeepStrictEqual; + +function notDeepStrictEqual(actual, expected, message) { + if (_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual); + } +} // 9. The strict equality assertion tests strict equality, as determined by ===. +// assert.strictEqual(actual, expected, message_opt); + + +assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } +}; // 10. The strict non-equality assertion tests for strict inequality, as +// determined by !==. assert.notStrictEqual(actual, expected, message_opt); + + +assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } +}; + +function expectedException(actual, expected) { + if (!actual || !expected) { + return false; + } + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } + + try { + if (actual instanceof expected) { + return true; + } + } catch (e) {// Ignore. The instanceof check doesn't work for arrow functions. + } + + if (Error.isPrototypeOf(expected)) { + return false; + } + + return expected.call({}, actual) === true; +} + +function _tryBlock(block) { + var error; + + try { + block(); + } catch (e) { + error = e; + } + + return error; +} + +function _throws(shouldThrow, block, expected, message) { + var actual; + + if (typeof block !== 'function') { + throw new TypeError('"block" argument must be a function'); + } + + if (typeof expected === 'string') { + message = expected; + expected = null; + } + + actual = _tryBlock(block); + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); + } + + var userProvidedMessage = typeof message === 'string'; + var isUnwantedException = !shouldThrow && util.isError(actual); + var isUnexpectedException = !shouldThrow && actual && !expected; + + if (isUnwantedException && userProvidedMessage && expectedException(actual, expected) || isUnexpectedException) { + fail(actual, expected, 'Got unwanted exception' + message); + } + + if (shouldThrow && actual && expected && !expectedException(actual, expected) || !shouldThrow && actual) { + throw actual; + } +} // 11. Expected to throw an error: +// assert.throws(block, Error_opt, message_opt); + + +assert.throws = function (block, +/*optional*/ +error, +/*optional*/ +message) { + _throws(true, block, error, message); +}; // EXTENSION! This is annoying to write outside this module. + + +assert.doesNotThrow = function (block, +/*optional*/ +error, +/*optional*/ +message) { + _throws(false, block, error, message); +}; + +assert.ifError = function (err) { + if (err) throw err; +}; + +var objectKeys = Object.keys || function (obj) { + var keys = []; + + for (var key in obj) { + if (hasOwn.call(obj, key)) keys.push(key); + } + + return keys; +}; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/babel-code-frame/lib/index.js": +/*!****************************************************!*\ + !*** ./node_modules/babel-code-frame/lib/index.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function (rawLines, lineNumber, colNumber) { + var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + colNumber = Math.max(colNumber, 0); + var highlighted = opts.highlightCode && _chalk2.default.supportsColor || opts.forceColor; + var chalk = _chalk2.default; + + if (opts.forceColor) { + chalk = new _chalk2.default.constructor({ + enabled: true + }); + } + + var maybeHighlight = function maybeHighlight(chalkFn, string) { + return highlighted ? chalkFn(string) : string; + }; + + var defs = getDefs(chalk); + if (highlighted) rawLines = highlight(defs, rawLines); + var linesAbove = opts.linesAbove || 2; + var linesBelow = opts.linesBelow || 3; + var lines = rawLines.split(NEWLINE); + var start = Math.max(lineNumber - (linesAbove + 1), 0); + var end = Math.min(lines.length, lineNumber + linesBelow); + + if (!lineNumber && !colNumber) { + start = 0; + end = lines.length; + } + + var numberMaxWidth = String(end).length; + var frame = lines.slice(start, end).map(function (line, index) { + var number = start + 1 + index; + var paddedNumber = (" " + number).slice(-numberMaxWidth); + var gutter = " " + paddedNumber + " | "; + + if (number === lineNumber) { + var markerLine = ""; + + if (colNumber) { + var markerSpacing = line.slice(0, colNumber - 1).replace(/[^\t]/g, " "); + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^")].join(""); + } + + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); + } else { + return " " + maybeHighlight(defs.gutter, gutter) + line; + } + }).join("\n"); + + if (highlighted) { + return chalk.reset(frame); + } else { + return frame; + } +}; + +var _jsTokens = __webpack_require__(/*! js-tokens */ "./node_modules/babel-code-frame/node_modules/js-tokens/index.js"); + +var _jsTokens2 = _interopRequireDefault(_jsTokens); + +var _esutils = __webpack_require__(/*! esutils */ "./node_modules/esutils/lib/utils.js"); + +var _esutils2 = _interopRequireDefault(_esutils); + +var _chalk = __webpack_require__(/*! chalk */ "./node_modules/babel-code-frame/node_modules/chalk/index.js"); + +var _chalk2 = _interopRequireDefault(_chalk); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function getDefs(chalk) { + return { + keyword: chalk.cyan, + capitalized: chalk.yellow, + jsx_tag: chalk.yellow, + punctuator: chalk.yellow, + number: chalk.magenta, + string: chalk.green, + regex: chalk.magenta, + comment: chalk.grey, + invalid: chalk.white.bgRed.bold, + gutter: chalk.grey, + marker: chalk.red.bold + }; +} + +var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +var JSX_TAG = /^[a-z][\w-]*$/i; +var BRACKET = /^[()\[\]{}]$/; + +function getTokenType(match) { + var _match$slice = match.slice(-2), + offset = _match$slice[0], + text = _match$slice[1]; + + var token = (0, _jsTokens.matchToToken)(match); + + if (token.type === "name") { + if (_esutils2.default.keyword.isReservedWordES6(token.value)) { + return "keyword"; + } + + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "<]/g; +}; + +/***/ }), + +/***/ "./node_modules/babel-code-frame/node_modules/ansi-styles/index.js": +/*!*************************************************************************!*\ + !*** ./node_modules/babel-code-frame/node_modules/ansi-styles/index.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(module) { + +function assembleStyles() { + var styles = { + modifiers: { + reset: [0, 0], + bold: [1, 22], + // 21 isn't widely supported and 22 does the same thing + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + colors: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39] + }, + bgColors: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49] + } + }; // fix humans + + styles.colors.grey = styles.colors.gray; + Object.keys(styles).forEach(function (groupName) { + var group = styles[groupName]; + Object.keys(group).forEach(function (styleName) { + var style = group[styleName]; + styles[styleName] = group[styleName] = { + open: '\u001b[' + style[0] + 'm', + close: '\u001b[' + style[1] + 'm' + }; + }); + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + }); + return styles; +} + +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/babel-code-frame/node_modules/chalk/index.js": +/*!*******************************************************************!*\ + !*** ./node_modules/babel-code-frame/node_modules/chalk/index.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +var escapeStringRegexp = __webpack_require__(/*! escape-string-regexp */ "./node_modules/escape-string-regexp/index.js"); + +var ansiStyles = __webpack_require__(/*! ansi-styles */ "./node_modules/babel-code-frame/node_modules/ansi-styles/index.js"); + +var stripAnsi = __webpack_require__(/*! strip-ansi */ "./node_modules/babel-code-frame/node_modules/strip-ansi/index.js"); + +var hasAnsi = __webpack_require__(/*! has-ansi */ "./node_modules/has-ansi/index.js"); + +var supportsColor = __webpack_require__(/*! supports-color */ "./node_modules/babel-code-frame/node_modules/supports-color/index.js"); + +var defineProps = Object.defineProperties; +var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(Object({"NODE_ENV":"development","PUBLIC_URL":""}).TERM); + +function Chalk(options) { + // detect mode if not set manually + this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; +} // use bright blue on Windows as the normal blue color is illegible + + +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001b[94m'; +} + +var styles = function () { + var ret = {}; + Object.keys(ansiStyles).forEach(function (key) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + ret[key] = { + get: function () { + return build.call(this, this._styles.concat(key)); + } + }; + }); + return ret; +}(); + +var proto = defineProps(function chalk() {}, styles); + +function build(_styles) { + var builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder.enabled = this.enabled; // __proto__ is used because we must return a function, but there is + // no way to create a function with a different prototype. + + /* eslint-disable no-proto */ + + builder.__proto__ = proto; + return builder; +} + +function applyStyle() { + // support varags, but simply cast to string in case there's only one arg + var args = arguments; + var argsLen = args.length; + var str = argsLen !== 0 && String(arguments[0]); + + if (argsLen > 1) { + // don't slice `arguments`, it prevents v8 optimizations + for (var a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || !str) { + return str; + } + + var nestedStyles = this._styles; + var i = nestedStyles.length; // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + + var originalDim = ansiStyles.dim.open; + + if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { + ansiStyles.dim.open = ''; + } + + while (i--) { + var code = ansiStyles[nestedStyles[i]]; // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + + str = code.open + str.replace(code.closeRe, code.open) + code.close; + } // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. + + + ansiStyles.dim.open = originalDim; + return str; +} + +function init() { + var ret = {}; + Object.keys(styles).forEach(function (name) { + ret[name] = { + get: function () { + return build.call(this, [name]); + } + }; + }); + return ret; +} + +defineProps(Chalk.prototype, init()); +module.exports = new Chalk(); +module.exports.styles = ansiStyles; +module.exports.hasColor = hasAnsi; +module.exports.stripColor = stripAnsi; +module.exports.supportsColor = supportsColor; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/babel-code-frame/node_modules/js-tokens/index.js": +/*!***********************************************************************!*\ + !*** ./node_modules/babel-code-frame/node_modules/js-tokens/index.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// Copyright 2014, 2015, 2016, 2017 Simon Lydell +// License: MIT. (See LICENSE.) +Object.defineProperty(exports, "__esModule", { + value: true +}); // This regex comes from regex.coffee, and is inserted here by generate-index.js +// (run `npm run build`). + +exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g; + +exports.matchToToken = function (match) { + var token = { + type: "invalid", + value: match[0] + }; + if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);else if (match[5]) token.type = "comment";else if (match[6]) token.type = "comment", token.closed = !!match[7];else if (match[8]) token.type = "regex";else if (match[9]) token.type = "number";else if (match[10]) token.type = "name";else if (match[11]) token.type = "punctuator";else if (match[12]) token.type = "whitespace"; + return token; +}; + +/***/ }), + +/***/ "./node_modules/babel-code-frame/node_modules/strip-ansi/index.js": +/*!************************************************************************!*\ + !*** ./node_modules/babel-code-frame/node_modules/strip-ansi/index.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ansiRegex = __webpack_require__(/*! ansi-regex */ "./node_modules/babel-code-frame/node_modules/ansi-regex/index.js")(); + +module.exports = function (str) { + return typeof str === 'string' ? str.replace(ansiRegex, '') : str; +}; + +/***/ }), + +/***/ "./node_modules/babel-code-frame/node_modules/supports-color/index.js": +/*!****************************************************************************!*\ + !*** ./node_modules/babel-code-frame/node_modules/supports-color/index.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +var argv = process.argv; +var terminator = argv.indexOf('--'); + +var hasFlag = function (flag) { + flag = '--' + flag; + var pos = argv.indexOf(flag); + return pos !== -1 && (terminator !== -1 ? pos < terminator : true); +}; + +module.exports = function () { + if ('FORCE_COLOR' in Object({"NODE_ENV":"development","PUBLIC_URL":""})) { + return true; + } + + if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) { + return false; + } + + if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { + return true; + } + + if (process.stdout && !process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in Object({"NODE_ENV":"development","PUBLIC_URL":""})) { + return true; + } + + if (Object({"NODE_ENV":"development","PUBLIC_URL":""}).TERM === 'dumb') { + return false; + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(Object({"NODE_ENV":"development","PUBLIC_URL":""}).TERM)) { + return true; + } + + return false; +}(); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/babel-core/index.js": +/*!******************************************!*\ + !*** ./node_modules/babel-core/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/api/node.js */ "./node_modules/babel-core/lib/api/node.js"); + +/***/ }), + +/***/ "./node_modules/babel-core/lib/api/node.js": +/*!*************************************************!*\ + !*** ./node_modules/babel-core/lib/api/node.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.transformFromAst = exports.transform = exports.analyse = exports.Pipeline = exports.OptionManager = exports.traverse = exports.types = exports.messages = exports.util = exports.version = exports.resolvePreset = exports.resolvePlugin = exports.template = exports.buildExternalHelpers = exports.options = exports.File = undefined; + +var _file = __webpack_require__(/*! ../transformation/file */ "./node_modules/babel-core/lib/transformation/file/index.js"); + +Object.defineProperty(exports, "File", { + enumerable: true, + get: function get() { + return _interopRequireDefault(_file).default; + } +}); + +var _config = __webpack_require__(/*! ../transformation/file/options/config */ "./node_modules/babel-core/lib/transformation/file/options/config.js"); + +Object.defineProperty(exports, "options", { + enumerable: true, + get: function get() { + return _interopRequireDefault(_config).default; + } +}); + +var _buildExternalHelpers = __webpack_require__(/*! ../tools/build-external-helpers */ "./node_modules/babel-core/lib/tools/build-external-helpers.js"); + +Object.defineProperty(exports, "buildExternalHelpers", { + enumerable: true, + get: function get() { + return _interopRequireDefault(_buildExternalHelpers).default; + } +}); + +var _babelTemplate = __webpack_require__(/*! babel-template */ "./node_modules/babel-template/lib/index.js"); + +Object.defineProperty(exports, "template", { + enumerable: true, + get: function get() { + return _interopRequireDefault(_babelTemplate).default; + } +}); + +var _resolvePlugin = __webpack_require__(/*! ../helpers/resolve-plugin */ "./node_modules/babel-core/lib/helpers/resolve-plugin.js"); + +Object.defineProperty(exports, "resolvePlugin", { + enumerable: true, + get: function get() { + return _interopRequireDefault(_resolvePlugin).default; + } +}); + +var _resolvePreset = __webpack_require__(/*! ../helpers/resolve-preset */ "./node_modules/babel-core/lib/helpers/resolve-preset.js"); + +Object.defineProperty(exports, "resolvePreset", { + enumerable: true, + get: function get() { + return _interopRequireDefault(_resolvePreset).default; + } +}); + +var _package = __webpack_require__(/*! ../../package */ "./node_modules/babel-core/package.json"); + +Object.defineProperty(exports, "version", { + enumerable: true, + get: function get() { + return _package.version; + } +}); +exports.Plugin = Plugin; +exports.transformFile = transformFile; +exports.transformFileSync = transformFileSync; + +var _fs = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js"); + +var _fs2 = _interopRequireDefault(_fs); + +var _util = __webpack_require__(/*! ../util */ "./node_modules/babel-core/lib/util.js"); + +var util = _interopRequireWildcard(_util); + +var _babelMessages = __webpack_require__(/*! babel-messages */ "./node_modules/babel-messages/lib/index.js"); + +var messages = _interopRequireWildcard(_babelMessages); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +var _babelTraverse = __webpack_require__(/*! babel-traverse */ "./node_modules/babel-traverse/lib/index.js"); + +var _babelTraverse2 = _interopRequireDefault(_babelTraverse); + +var _optionManager = __webpack_require__(/*! ../transformation/file/options/option-manager */ "./node_modules/babel-core/lib/transformation/file/options/option-manager.js"); + +var _optionManager2 = _interopRequireDefault(_optionManager); + +var _pipeline = __webpack_require__(/*! ../transformation/pipeline */ "./node_modules/babel-core/lib/transformation/pipeline.js"); + +var _pipeline2 = _interopRequireDefault(_pipeline); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +exports.util = util; +exports.messages = messages; +exports.types = t; +exports.traverse = _babelTraverse2.default; +exports.OptionManager = _optionManager2.default; + +function Plugin(alias) { + throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6."); +} + +exports.Pipeline = _pipeline2.default; +var pipeline = new _pipeline2.default(); +var analyse = exports.analyse = pipeline.analyse.bind(pipeline); +var transform = exports.transform = pipeline.transform.bind(pipeline); +var transformFromAst = exports.transformFromAst = pipeline.transformFromAst.bind(pipeline); + +function transformFile(filename, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = {}; + } + + opts.filename = filename; + + _fs2.default.readFile(filename, function (err, code) { + var result = void 0; + + if (!err) { + try { + result = transform(code, opts); + } catch (_err) { + err = _err; + } + } + + if (err) { + callback(err); + } else { + callback(null, result); + } + }); +} + +function transformFileSync(filename) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + opts.filename = filename; + return transform(_fs2.default.readFileSync(filename, "utf8"), opts); +} + +/***/ }), + +/***/ "./node_modules/babel-core/lib/helpers/get-possible-plugin-names.js": +/*!**************************************************************************!*\ + !*** ./node_modules/babel-core/lib/helpers/get-possible-plugin-names.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.default = getPossiblePluginNames; + +function getPossiblePluginNames(pluginName) { + return ["babel-plugin-" + pluginName, pluginName]; +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/helpers/get-possible-preset-names.js": +/*!**************************************************************************!*\ + !*** ./node_modules/babel-core/lib/helpers/get-possible-preset-names.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.default = getPossiblePresetNames; + +function getPossiblePresetNames(presetName) { + var possibleNames = ["babel-preset-" + presetName, presetName]; + var matches = presetName.match(/^(@[^/]+)\/(.+)$/); + + if (matches) { + var orgName = matches[1], + presetPath = matches[2]; + possibleNames.push(orgName + "/babel-preset-" + presetPath); + } + + return possibleNames; +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/helpers/merge.js": +/*!******************************************************!*\ + !*** ./node_modules/babel-core/lib/helpers/merge.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.default = function (dest, src) { + if (!dest || !src) return; + return (0, _mergeWith2.default)(dest, src, function (a, b) { + if (b && Array.isArray(a)) { + var newArray = b.slice(0); + + for (var _iterator = a, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var item = _ref; + + if (newArray.indexOf(item) < 0) { + newArray.push(item); + } + } + + return newArray; + } + }); +}; + +var _mergeWith = __webpack_require__(/*! lodash/mergeWith */ "./node_modules/lodash/mergeWith.js"); + +var _mergeWith2 = _interopRequireDefault(_mergeWith); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/helpers/normalize-ast.js": +/*!**************************************************************!*\ + !*** ./node_modules/babel-core/lib/helpers/normalize-ast.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function (ast, comments, tokens) { + if (ast) { + if (ast.type === "Program") { + return t.file(ast, comments || [], tokens || []); + } else if (ast.type === "File") { + return ast; + } + } + + throw new Error("Not a valid ast?"); +}; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/helpers/resolve-from-possible-names.js": +/*!****************************************************************************!*\ + !*** ./node_modules/babel-core/lib/helpers/resolve-from-possible-names.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.default = resolveFromPossibleNames; + +var _resolve = __webpack_require__(/*! ./resolve */ "./node_modules/babel-core/lib/helpers/resolve.js"); + +var _resolve2 = _interopRequireDefault(_resolve); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function resolveFromPossibleNames(possibleNames, dirname) { + return possibleNames.reduce(function (accum, curr) { + return accum || (0, _resolve2.default)(curr, dirname); + }, null); +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/helpers/resolve-plugin.js": +/*!***************************************************************!*\ + !*** ./node_modules/babel-core/lib/helpers/resolve-plugin.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +exports.__esModule = true; +exports.default = resolvePlugin; + +var _resolveFromPossibleNames = __webpack_require__(/*! ./resolve-from-possible-names */ "./node_modules/babel-core/lib/helpers/resolve-from-possible-names.js"); + +var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames); + +var _getPossiblePluginNames = __webpack_require__(/*! ./get-possible-plugin-names */ "./node_modules/babel-core/lib/helpers/get-possible-plugin-names.js"); + +var _getPossiblePluginNames2 = _interopRequireDefault(_getPossiblePluginNames); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function resolvePlugin(pluginName) { + var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); + return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePluginNames2.default)(pluginName), dirname); +} + +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/babel-core/lib/helpers/resolve-preset.js": +/*!***************************************************************!*\ + !*** ./node_modules/babel-core/lib/helpers/resolve-preset.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +exports.__esModule = true; +exports.default = resolvePreset; + +var _resolveFromPossibleNames = __webpack_require__(/*! ./resolve-from-possible-names */ "./node_modules/babel-core/lib/helpers/resolve-from-possible-names.js"); + +var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames); + +var _getPossiblePresetNames = __webpack_require__(/*! ./get-possible-preset-names */ "./node_modules/babel-core/lib/helpers/get-possible-preset-names.js"); + +var _getPossiblePresetNames2 = _interopRequireDefault(_getPossiblePresetNames); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function resolvePreset(presetName) { + var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); + return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePresetNames2.default)(presetName), dirname); +} + +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/babel-core/lib/helpers/resolve.js": +/*!********************************************************!*\ + !*** ./node_modules/babel-core/lib/helpers/resolve.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +exports.__esModule = true; + +var _typeof2 = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +exports.default = function (loc) { + var relative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); + if ((typeof _module2.default === "undefined" ? "undefined" : (0, _typeof3.default)(_module2.default)) === "object") return null; + var relativeMod = relativeModules[relative]; + + if (!relativeMod) { + relativeMod = new _module2.default(); + + var filename = _path2.default.join(relative, ".babelrc"); + + relativeMod.id = filename; + relativeMod.filename = filename; + relativeMod.paths = _module2.default._nodeModulePaths(relative); + relativeModules[relative] = relativeMod; + } + + try { + return _module2.default._resolveFilename(loc, relativeMod); + } catch (err) { + return null; + } +}; + +var _module = __webpack_require__(/*! module */ "./node_modules/node-libs-browser/mock/empty.js"); + +var _module2 = _interopRequireDefault(_module); + +var _path = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); + +var _path2 = _interopRequireDefault(_path); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var relativeModules = {}; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/babel-core/lib/store.js": +/*!**********************************************!*\ + !*** ./node_modules/babel-core/lib/store.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _map = __webpack_require__(/*! babel-runtime/core-js/map */ "./node_modules/babel-runtime/core-js/map.js"); + +var _map2 = _interopRequireDefault(_map); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); + +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); + +var _inherits3 = _interopRequireDefault(_inherits2); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var Store = function (_Map) { + (0, _inherits3.default)(Store, _Map); + + function Store() { + (0, _classCallCheck3.default)(this, Store); + + var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this)); + + _this.dynamicData = {}; + return _this; + } + + Store.prototype.setDynamic = function setDynamic(key, fn) { + this.dynamicData[key] = fn; + }; + + Store.prototype.get = function get(key) { + if (this.has(key)) { + return _Map.prototype.get.call(this, key); + } else { + if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) { + var val = this.dynamicData[key](); + this.set(key, val); + return val; + } + } + }; + + return Store; +}(_map2.default); + +exports.default = Store; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/tools/build-external-helpers.js": +/*!*********************************************************************!*\ + !*** ./node_modules/babel-core/lib/tools/build-external-helpers.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function (whitelist) { + var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "global"; + var namespace = t.identifier("babelHelpers"); + + var builder = function builder(body) { + return buildHelpers(body, namespace, whitelist); + }; + + var tree = void 0; + var build = { + global: buildGlobal, + umd: buildUmd, + var: buildVar + }[outputType]; + + if (build) { + tree = build(namespace, builder); + } else { + throw new Error(messages.get("unsupportedOutputType", outputType)); + } + + return (0, _babelGenerator2.default)(tree).code; +}; + +var _babelHelpers = __webpack_require__(/*! babel-helpers */ "./node_modules/babel-helpers/lib/index.js"); + +var helpers = _interopRequireWildcard(_babelHelpers); + +var _babelGenerator = __webpack_require__(/*! babel-generator */ "./node_modules/babel-generator/lib/index.js"); + +var _babelGenerator2 = _interopRequireDefault(_babelGenerator); + +var _babelMessages = __webpack_require__(/*! babel-messages */ "./node_modules/babel-messages/lib/index.js"); + +var messages = _interopRequireWildcard(_babelMessages); + +var _babelTemplate = __webpack_require__(/*! babel-template */ "./node_modules/babel-template/lib/index.js"); + +var _babelTemplate2 = _interopRequireDefault(_babelTemplate); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +var buildUmdWrapper = (0, _babelTemplate2.default)("\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n"); + +function buildGlobal(namespace, builder) { + var body = []; + var container = t.functionExpression(null, [t.identifier("global")], t.blockStatement(body)); + var tree = t.program([t.expressionStatement(t.callExpression(container, [helpers.get("selfGlobal")]))]); + body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.assignmentExpression("=", t.memberExpression(t.identifier("global"), namespace), t.objectExpression([])))])); + builder(body); + return tree; +} + +function buildUmd(namespace, builder) { + var body = []; + body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.identifier("global"))])); + builder(body); + return t.program([buildUmdWrapper({ + FACTORY_PARAMETERS: t.identifier("global"), + BROWSER_ARGUMENTS: t.assignmentExpression("=", t.memberExpression(t.identifier("root"), namespace), t.objectExpression([])), + COMMON_ARGUMENTS: t.identifier("exports"), + AMD_ARGUMENTS: t.arrayExpression([t.stringLiteral("exports")]), + FACTORY_BODY: body, + UMD_ROOT: t.identifier("this") + })]); +} + +function buildVar(namespace, builder) { + var body = []; + body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.objectExpression([]))])); + builder(body); + body.push(t.expressionStatement(namespace)); + return t.program(body); +} + +function buildHelpers(body, namespace, whitelist) { + helpers.list.forEach(function (name) { + if (whitelist && whitelist.indexOf(name) < 0) return; + var key = t.identifier(name); + body.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(namespace, key), helpers.get(name)))); + }); +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/file/index.js": +/*!******************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/file/index.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +exports.__esModule = true; +exports.File = undefined; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _create = __webpack_require__(/*! babel-runtime/core-js/object/create */ "./node_modules/babel-runtime/core-js/object/create.js"); + +var _create2 = _interopRequireDefault(_create); + +var _assign = __webpack_require__(/*! babel-runtime/core-js/object/assign */ "./node_modules/babel-runtime/core-js/object/assign.js"); + +var _assign2 = _interopRequireDefault(_assign); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); + +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); + +var _inherits3 = _interopRequireDefault(_inherits2); + +var _babelHelpers = __webpack_require__(/*! babel-helpers */ "./node_modules/babel-helpers/lib/index.js"); + +var _babelHelpers2 = _interopRequireDefault(_babelHelpers); + +var _metadata = __webpack_require__(/*! ./metadata */ "./node_modules/babel-core/lib/transformation/file/metadata.js"); + +var metadataVisitor = _interopRequireWildcard(_metadata); + +var _convertSourceMap = __webpack_require__(/*! convert-source-map */ "./node_modules/convert-source-map/index.js"); + +var _convertSourceMap2 = _interopRequireDefault(_convertSourceMap); + +var _optionManager = __webpack_require__(/*! ./options/option-manager */ "./node_modules/babel-core/lib/transformation/file/options/option-manager.js"); + +var _optionManager2 = _interopRequireDefault(_optionManager); + +var _pluginPass = __webpack_require__(/*! ../plugin-pass */ "./node_modules/babel-core/lib/transformation/plugin-pass.js"); + +var _pluginPass2 = _interopRequireDefault(_pluginPass); + +var _babelTraverse = __webpack_require__(/*! babel-traverse */ "./node_modules/babel-traverse/lib/index.js"); + +var _babelTraverse2 = _interopRequireDefault(_babelTraverse); + +var _babelGenerator = __webpack_require__(/*! babel-generator */ "./node_modules/babel-generator/lib/index.js"); + +var _babelGenerator2 = _interopRequireDefault(_babelGenerator); + +var _babelCodeFrame = __webpack_require__(/*! babel-code-frame */ "./node_modules/babel-code-frame/lib/index.js"); + +var _babelCodeFrame2 = _interopRequireDefault(_babelCodeFrame); + +var _defaults = __webpack_require__(/*! lodash/defaults */ "./node_modules/lodash/defaults.js"); + +var _defaults2 = _interopRequireDefault(_defaults); + +var _logger = __webpack_require__(/*! ./logger */ "./node_modules/babel-core/lib/transformation/file/logger.js"); + +var _logger2 = _interopRequireDefault(_logger); + +var _store = __webpack_require__(/*! ../../store */ "./node_modules/babel-core/lib/store.js"); + +var _store2 = _interopRequireDefault(_store); + +var _babylon = __webpack_require__(/*! babylon */ "./node_modules/babylon/lib/index.js"); + +var _util = __webpack_require__(/*! ../../util */ "./node_modules/babel-core/lib/util.js"); + +var util = _interopRequireWildcard(_util); + +var _path = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); + +var _path2 = _interopRequireDefault(_path); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +var _mergeMap = __webpack_require__(/*! ./merge-map */ "./node_modules/babel-core/lib/transformation/file/merge-map.js"); + +var _mergeMap2 = _interopRequireDefault(_mergeMap); + +var _resolve = __webpack_require__(/*! ../../helpers/resolve */ "./node_modules/babel-core/lib/helpers/resolve.js"); + +var _resolve2 = _interopRequireDefault(_resolve); + +var _blockHoist = __webpack_require__(/*! ../internal-plugins/block-hoist */ "./node_modules/babel-core/lib/transformation/internal-plugins/block-hoist.js"); + +var _blockHoist2 = _interopRequireDefault(_blockHoist); + +var _shadowFunctions = __webpack_require__(/*! ../internal-plugins/shadow-functions */ "./node_modules/babel-core/lib/transformation/internal-plugins/shadow-functions.js"); + +var _shadowFunctions2 = _interopRequireDefault(_shadowFunctions); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var shebangRegex = /^#!.*/; +var INTERNAL_PLUGINS = [[_blockHoist2.default], [_shadowFunctions2.default]]; +var errorVisitor = { + enter: function enter(path, state) { + var loc = path.node.loc; + + if (loc) { + state.loc = loc; + path.stop(); + } + } +}; + +var File = function (_Store) { + (0, _inherits3.default)(File, _Store); + + function File() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var pipeline = arguments[1]; + (0, _classCallCheck3.default)(this, File); + + var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); + + _this.pipeline = pipeline; + _this.log = new _logger2.default(_this, opts.filename || "unknown"); + _this.opts = _this.initOptions(opts); + _this.parserOpts = { + sourceType: _this.opts.sourceType, + sourceFileName: _this.opts.filename, + plugins: [] + }; + _this.pluginVisitors = []; + _this.pluginPasses = []; + + _this.buildPluginsForOptions(_this.opts); + + if (_this.opts.passPerPreset) { + _this.perPresetOpts = []; + + _this.opts.presets.forEach(function (presetOpts) { + var perPresetOpts = (0, _assign2.default)((0, _create2.default)(_this.opts), presetOpts); + + _this.perPresetOpts.push(perPresetOpts); + + _this.buildPluginsForOptions(perPresetOpts); + }); + } + + _this.metadata = { + usedHelpers: [], + marked: [], + modules: { + imports: [], + exports: { + exported: [], + specifiers: [] + } + } + }; + _this.dynamicImportTypes = {}; + _this.dynamicImportIds = {}; + _this.dynamicImports = []; + _this.declarations = {}; + _this.usedHelpers = {}; + _this.path = null; + _this.ast = {}; + _this.code = ""; + _this.shebang = ""; + _this.hub = new _babelTraverse.Hub(_this); + return _this; + } + + File.prototype.getMetadata = function getMetadata() { + var has = false; + + for (var _iterator = this.ast.program.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var node = _ref; + + if (t.isModuleDeclaration(node)) { + has = true; + break; + } + } + + if (has) { + this.path.traverse(metadataVisitor, this); + } + }; + + File.prototype.initOptions = function initOptions(opts) { + opts = new _optionManager2.default(this.log, this.pipeline).init(opts); + + if (opts.inputSourceMap) { + opts.sourceMaps = true; + } + + if (opts.moduleId) { + opts.moduleIds = true; + } + + opts.basename = _path2.default.basename(opts.filename, _path2.default.extname(opts.filename)); + opts.ignore = util.arrayify(opts.ignore, util.regexify); + if (opts.only) opts.only = util.arrayify(opts.only, util.regexify); + (0, _defaults2.default)(opts, { + moduleRoot: opts.sourceRoot + }); + (0, _defaults2.default)(opts, { + sourceRoot: opts.moduleRoot + }); + (0, _defaults2.default)(opts, { + filenameRelative: opts.filename + }); + + var basenameRelative = _path2.default.basename(opts.filenameRelative); + + (0, _defaults2.default)(opts, { + sourceFileName: basenameRelative, + sourceMapTarget: basenameRelative + }); + return opts; + }; + + File.prototype.buildPluginsForOptions = function buildPluginsForOptions(opts) { + if (!Array.isArray(opts.plugins)) { + return; + } + + var plugins = opts.plugins.concat(INTERNAL_PLUGINS); + var currentPluginVisitors = []; + var currentPluginPasses = []; + + for (var _iterator2 = plugins, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var ref = _ref2; + var plugin = ref[0], + pluginOpts = ref[1]; + currentPluginVisitors.push(plugin.visitor); + currentPluginPasses.push(new _pluginPass2.default(this, plugin, pluginOpts)); + + if (plugin.manipulateOptions) { + plugin.manipulateOptions(opts, this.parserOpts, this); + } + } + + this.pluginVisitors.push(currentPluginVisitors); + this.pluginPasses.push(currentPluginPasses); + }; + + File.prototype.getModuleName = function getModuleName() { + var opts = this.opts; + + if (!opts.moduleIds) { + return null; + } + + if (opts.moduleId != null && !opts.getModuleId) { + return opts.moduleId; + } + + var filenameRelative = opts.filenameRelative; + var moduleName = ""; + + if (opts.moduleRoot != null) { + moduleName = opts.moduleRoot + "/"; + } + + if (!opts.filenameRelative) { + return moduleName + opts.filename.replace(/^\//, ""); + } + + if (opts.sourceRoot != null) { + var sourceRootRegEx = new RegExp("^" + opts.sourceRoot + "\/?"); + filenameRelative = filenameRelative.replace(sourceRootRegEx, ""); + } + + filenameRelative = filenameRelative.replace(/\.(\w*?)$/, ""); + moduleName += filenameRelative; + moduleName = moduleName.replace(/\\/g, "/"); + + if (opts.getModuleId) { + return opts.getModuleId(moduleName) || moduleName; + } else { + return moduleName; + } + }; + + File.prototype.resolveModuleSource = function resolveModuleSource(source) { + var resolveModuleSource = this.opts.resolveModuleSource; + if (resolveModuleSource) source = resolveModuleSource(source, this.opts.filename); + return source; + }; + + File.prototype.addImport = function addImport(source, imported) { + var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : imported; + var alias = source + ":" + imported; + var id = this.dynamicImportIds[alias]; + + if (!id) { + source = this.resolveModuleSource(source); + id = this.dynamicImportIds[alias] = this.scope.generateUidIdentifier(name); + var specifiers = []; + + if (imported === "*") { + specifiers.push(t.importNamespaceSpecifier(id)); + } else if (imported === "default") { + specifiers.push(t.importDefaultSpecifier(id)); + } else { + specifiers.push(t.importSpecifier(id, t.identifier(imported))); + } + + var declar = t.importDeclaration(specifiers, t.stringLiteral(source)); + declar._blockHoist = 3; + this.path.unshiftContainer("body", declar); + } + + return id; + }; + + File.prototype.addHelper = function addHelper(name) { + var declar = this.declarations[name]; + if (declar) return declar; + + if (!this.usedHelpers[name]) { + this.metadata.usedHelpers.push(name); + this.usedHelpers[name] = true; + } + + var generator = this.get("helperGenerator"); + var runtime = this.get("helpersNamespace"); + + if (generator) { + var res = generator(name); + if (res) return res; + } else if (runtime) { + return t.memberExpression(runtime, t.identifier(name)); + } + + var ref = (0, _babelHelpers2.default)(name); + var uid = this.declarations[name] = this.scope.generateUidIdentifier(name); + + if (t.isFunctionExpression(ref) && !ref.id) { + ref.body._compact = true; + ref._generated = true; + ref.id = uid; + ref.type = "FunctionDeclaration"; + this.path.unshiftContainer("body", ref); + } else { + ref._compact = true; + this.scope.push({ + id: uid, + init: ref, + unique: true + }); + } + + return uid; + }; + + File.prototype.addTemplateObject = function addTemplateObject(helperName, strings, raw) { + var stringIds = raw.elements.map(function (string) { + return string.value; + }); + var name = helperName + "_" + raw.elements.length + "_" + stringIds.join(","); + var declar = this.declarations[name]; + if (declar) return declar; + var uid = this.declarations[name] = this.scope.generateUidIdentifier("templateObject"); + var helperId = this.addHelper(helperName); + var init = t.callExpression(helperId, [strings, raw]); + init._compact = true; + this.scope.push({ + id: uid, + init: init, + _blockHoist: 1.9 + }); + return uid; + }; + + File.prototype.buildCodeFrameError = function buildCodeFrameError(node, msg) { + var Error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SyntaxError; + var loc = node && (node.loc || node._loc); + var err = new Error(msg); + + if (loc) { + err.loc = loc.start; + } else { + (0, _babelTraverse2.default)(node, errorVisitor, this.scope, err); + err.message += " (This is an error on an internal node. Probably an internal error"; + + if (err.loc) { + err.message += ". Location has been estimated."; + } + + err.message += ")"; + } + + return err; + }; + + File.prototype.mergeSourceMap = function mergeSourceMap(map) { + var inputMap = this.opts.inputSourceMap; + + if (inputMap && map) { + return (0, _mergeMap2.default)(inputMap, map); + } else { + return map; + } + }; + + File.prototype.parse = function parse(code) { + var parseCode = _babylon.parse; + var parserOpts = this.opts.parserOpts; + + if (parserOpts) { + parserOpts = (0, _assign2.default)({}, this.parserOpts, parserOpts); + + if (parserOpts.parser) { + if (typeof parserOpts.parser === "string") { + var dirname = _path2.default.dirname(this.opts.filename) || process.cwd(); + var parser = (0, _resolve2.default)(parserOpts.parser, dirname); + + if (parser) { + parseCode = __webpack_require__("./node_modules/babel-core/lib/transformation/file sync recursive")(parser).parse; + } else { + throw new Error("Couldn't find parser " + parserOpts.parser + " with \"parse\" method " + ("relative to directory " + dirname)); + } + } else { + parseCode = parserOpts.parser; + } + + parserOpts.parser = { + parse: function parse(source) { + return (0, _babylon.parse)(source, parserOpts); + } + }; + } + } + + this.log.debug("Parse start"); + var ast = parseCode(code, parserOpts || this.parserOpts); + this.log.debug("Parse stop"); + return ast; + }; + + File.prototype._addAst = function _addAst(ast) { + this.path = _babelTraverse.NodePath.get({ + hub: this.hub, + parentPath: null, + parent: ast, + container: ast, + key: "program" + }).setContext(); + this.scope = this.path.scope; + this.ast = ast; + this.getMetadata(); + }; + + File.prototype.addAst = function addAst(ast) { + this.log.debug("Start set AST"); + + this._addAst(ast); + + this.log.debug("End set AST"); + }; + + File.prototype.transform = function transform() { + for (var i = 0; i < this.pluginPasses.length; i++) { + var pluginPasses = this.pluginPasses[i]; + this.call("pre", pluginPasses); + this.log.debug("Start transform traverse"); + + var visitor = _babelTraverse2.default.visitors.merge(this.pluginVisitors[i], pluginPasses, this.opts.wrapPluginVisitorMethod); + + (0, _babelTraverse2.default)(this.ast, visitor, this.scope); + this.log.debug("End transform traverse"); + this.call("post", pluginPasses); + } + + return this.generate(); + }; + + File.prototype.wrap = function wrap(code, callback) { + code = code + ""; + + try { + if (this.shouldIgnore()) { + return this.makeResult({ + code: code, + ignored: true + }); + } else { + return callback(); + } + } catch (err) { + if (err._babel) { + throw err; + } else { + err._babel = true; + } + + var message = err.message = this.opts.filename + ": " + err.message; + var loc = err.loc; + + if (loc) { + err.codeFrame = (0, _babelCodeFrame2.default)(code, loc.line, loc.column + 1, this.opts); + message += "\n" + err.codeFrame; + } + + if (process.browser) { + err.message = message; + } + + if (err.stack) { + var newStack = err.stack.replace(err.message, message); + err.stack = newStack; + } + + throw err; + } + }; + + File.prototype.addCode = function addCode(code) { + code = (code || "") + ""; + code = this.parseInputSourceMap(code); + this.code = code; + }; + + File.prototype.parseCode = function parseCode() { + this.parseShebang(); + var ast = this.parse(this.code); + this.addAst(ast); + }; + + File.prototype.shouldIgnore = function shouldIgnore() { + var opts = this.opts; + return util.shouldIgnore(opts.filename, opts.ignore, opts.only); + }; + + File.prototype.call = function call(key, pluginPasses) { + for (var _iterator3 = pluginPasses, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var pass = _ref3; + var plugin = pass.plugin; + var fn = plugin[key]; + if (fn) fn.call(pass, this); + } + }; + + File.prototype.parseInputSourceMap = function parseInputSourceMap(code) { + var opts = this.opts; + + if (opts.inputSourceMap !== false) { + var inputMap = _convertSourceMap2.default.fromSource(code); + + if (inputMap) { + opts.inputSourceMap = inputMap.toObject(); + code = _convertSourceMap2.default.removeComments(code); + } + } + + return code; + }; + + File.prototype.parseShebang = function parseShebang() { + var shebangMatch = shebangRegex.exec(this.code); + + if (shebangMatch) { + this.shebang = shebangMatch[0]; + this.code = this.code.replace(shebangRegex, ""); + } + }; + + File.prototype.makeResult = function makeResult(_ref4) { + var code = _ref4.code, + map = _ref4.map, + ast = _ref4.ast, + ignored = _ref4.ignored; + var result = { + metadata: null, + options: this.opts, + ignored: !!ignored, + code: null, + ast: null, + map: map || null + }; + + if (this.opts.code) { + result.code = code; + } + + if (this.opts.ast) { + result.ast = ast; + } + + if (this.opts.metadata) { + result.metadata = this.metadata; + } + + return result; + }; + + File.prototype.generate = function generate() { + var opts = this.opts; + var ast = this.ast; + var result = { + ast: ast + }; + if (!opts.code) return this.makeResult(result); + var gen = _babelGenerator2.default; + + if (opts.generatorOpts.generator) { + gen = opts.generatorOpts.generator; + + if (typeof gen === "string") { + var dirname = _path2.default.dirname(this.opts.filename) || process.cwd(); + var generator = (0, _resolve2.default)(gen, dirname); + + if (generator) { + gen = __webpack_require__("./node_modules/babel-core/lib/transformation/file sync recursive")(generator).print; + } else { + throw new Error("Couldn't find generator " + gen + " with \"print\" method relative " + ("to directory " + dirname)); + } + } + } + + this.log.debug("Generation start"); + + var _result = gen(ast, opts.generatorOpts ? (0, _assign2.default)(opts, opts.generatorOpts) : opts, this.code); + + result.code = _result.code; + result.map = _result.map; + this.log.debug("Generation end"); + + if (this.shebang) { + result.code = this.shebang + "\n" + result.code; + } + + if (result.map) { + result.map = this.mergeSourceMap(result.map); + } + + if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") { + result.code += "\n" + _convertSourceMap2.default.fromObject(result.map).toComment(); + } + + if (opts.sourceMaps === "inline") { + result.map = null; + } + + return this.makeResult(result); + }; + + return File; +}(_store2.default); + +exports.default = File; +exports.File = File; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/file/logger.js": +/*!*******************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/file/logger.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _node = __webpack_require__(/*! debug/node */ "./node_modules/babel-core/node_modules/debug/node.js"); + +var _node2 = _interopRequireDefault(_node); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var verboseDebug = (0, _node2.default)("babel:verbose"); +var generalDebug = (0, _node2.default)("babel"); +var seenDeprecatedMessages = []; + +var Logger = function () { + function Logger(file, filename) { + (0, _classCallCheck3.default)(this, Logger); + this.filename = filename; + this.file = file; + } + + Logger.prototype._buildMessage = function _buildMessage(msg) { + var parts = "[BABEL] " + this.filename; + if (msg) parts += ": " + msg; + return parts; + }; + + Logger.prototype.warn = function warn(msg) { + console.warn(this._buildMessage(msg)); + }; + + Logger.prototype.error = function error(msg) { + var Constructor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Error; + throw new Constructor(this._buildMessage(msg)); + }; + + Logger.prototype.deprecate = function deprecate(msg) { + if (this.file.opts && this.file.opts.suppressDeprecationMessages) return; + msg = this._buildMessage(msg); + if (seenDeprecatedMessages.indexOf(msg) >= 0) return; + seenDeprecatedMessages.push(msg); + console.error(msg); + }; + + Logger.prototype.verbose = function verbose(msg) { + if (verboseDebug.enabled) verboseDebug(this._buildMessage(msg)); + }; + + Logger.prototype.debug = function debug(msg) { + if (generalDebug.enabled) generalDebug(this._buildMessage(msg)); + }; + + Logger.prototype.deopt = function deopt(node, msg) { + this.debug(msg); + }; + + return Logger; +}(); + +exports.default = Logger; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/file/merge-map.js": +/*!**********************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/file/merge-map.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _from = __webpack_require__(/*! babel-runtime/core-js/array/from */ "./node_modules/babel-runtime/core-js/array/from.js"); + +var _from2 = _interopRequireDefault(_from); + +var _extends2 = __webpack_require__(/*! babel-runtime/helpers/extends */ "./node_modules/babel-runtime/helpers/extends.js"); + +var _extends3 = _interopRequireDefault(_extends2); + +var _stringify = __webpack_require__(/*! babel-runtime/core-js/json/stringify */ "./node_modules/babel-runtime/core-js/json/stringify.js"); + +var _stringify2 = _interopRequireDefault(_stringify); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _map = __webpack_require__(/*! babel-runtime/core-js/map */ "./node_modules/babel-runtime/core-js/map.js"); + +var _map2 = _interopRequireDefault(_map); + +exports.default = mergeSourceMap; + +var _sourceMap = __webpack_require__(/*! source-map */ "./node_modules/source-map/source-map.js"); + +var _sourceMap2 = _interopRequireDefault(_sourceMap); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function mergeSourceMap(inputMap, map) { + var input = buildMappingData(inputMap); + var output = buildMappingData(map); + var mergedGenerator = new _sourceMap2.default.SourceMapGenerator(); + + for (var _iterator = input.sources, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var _ref4 = _ref2; + var _source = _ref4.source; + + if (typeof _source.content === "string") { + mergedGenerator.setSourceContent(_source.path, _source.content); + } + } + + if (output.sources.length === 1) { + var defaultSource = output.sources[0]; + var insertedMappings = new _map2.default(); + eachInputGeneratedRange(input, function (generated, original, source) { + eachOverlappingGeneratedOutputRange(defaultSource, generated, function (item) { + var key = makeMappingKey(item); + if (insertedMappings.has(key)) return; + insertedMappings.set(key, item); + mergedGenerator.addMapping({ + source: source.path, + original: { + line: original.line, + column: original.columnStart + }, + generated: { + line: item.line, + column: item.columnStart + }, + name: original.name + }); + }); + }); + + for (var _iterator2 = insertedMappings.values(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var item = _ref3; + + if (item.columnEnd === Infinity) { + continue; + } + + var clearItem = { + line: item.line, + columnStart: item.columnEnd + }; + var key = makeMappingKey(clearItem); + + if (insertedMappings.has(key)) { + continue; + } + + mergedGenerator.addMapping({ + generated: { + line: clearItem.line, + column: clearItem.columnStart + } + }); + } + } + + var result = mergedGenerator.toJSON(); + + if (typeof input.sourceRoot === "string") { + result.sourceRoot = input.sourceRoot; + } + + return result; +} + +function makeMappingKey(item) { + return (0, _stringify2.default)([item.line, item.columnStart]); +} + +function eachOverlappingGeneratedOutputRange(outputFile, inputGeneratedRange, callback) { + var overlappingOriginal = filterApplicableOriginalRanges(outputFile, inputGeneratedRange); + + for (var _iterator3 = overlappingOriginal, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref6; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref6 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref6 = _i3.value; + } + + var _ref7 = _ref6; + var _generated = _ref7.generated; + + for (var _iterator4 = _generated, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { + var _ref8; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref8 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref8 = _i4.value; + } + + var item = _ref8; + callback(item); + } + } +} + +function filterApplicableOriginalRanges(_ref9, _ref10) { + var mappings = _ref9.mappings; + var line = _ref10.line, + columnStart = _ref10.columnStart, + columnEnd = _ref10.columnEnd; + return filterSortedArray(mappings, function (_ref11) { + var outOriginal = _ref11.original; + if (line > outOriginal.line) return -1; + if (line < outOriginal.line) return 1; + if (columnStart >= outOriginal.columnEnd) return -1; + if (columnEnd <= outOriginal.columnStart) return 1; + return 0; + }); +} + +function eachInputGeneratedRange(map, callback) { + for (var _iterator5 = map.sources, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { + var _ref13; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref13 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref13 = _i5.value; + } + + var _ref14 = _ref13; + var _source2 = _ref14.source, + _mappings = _ref14.mappings; + + for (var _iterator6 = _mappings, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { + var _ref16; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref16 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref16 = _i6.value; + } + + var _ref17 = _ref16; + var _original = _ref17.original, + _generated2 = _ref17.generated; + + for (var _iterator7 = _generated2, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { + var _ref18; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref18 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref18 = _i7.value; + } + + var item = _ref18; + callback(item, _original, _source2); + } + } + } +} + +function buildMappingData(map) { + var consumer = new _sourceMap2.default.SourceMapConsumer((0, _extends3.default)({}, map, { + sourceRoot: null + })); + var sources = new _map2.default(); + var mappings = new _map2.default(); + var last = null; + consumer.computeColumnSpans(); + consumer.eachMapping(function (m) { + if (m.originalLine === null) return; + var source = sources.get(m.source); + + if (!source) { + source = { + path: m.source, + content: consumer.sourceContentFor(m.source, true) + }; + sources.set(m.source, source); + } + + var sourceData = mappings.get(source); + + if (!sourceData) { + sourceData = { + source: source, + mappings: [] + }; + mappings.set(source, sourceData); + } + + var obj = { + line: m.originalLine, + columnStart: m.originalColumn, + columnEnd: Infinity, + name: m.name + }; + + if (last && last.source === source && last.mapping.line === m.originalLine) { + last.mapping.columnEnd = m.originalColumn; + } + + last = { + source: source, + mapping: obj + }; + sourceData.mappings.push({ + original: obj, + generated: consumer.allGeneratedPositionsFor({ + source: m.source, + line: m.originalLine, + column: m.originalColumn + }).map(function (item) { + return { + line: item.line, + columnStart: item.column, + columnEnd: item.lastColumn + 1 + }; + }) + }); + }, null, _sourceMap2.default.SourceMapConsumer.ORIGINAL_ORDER); + return { + file: map.file, + sourceRoot: map.sourceRoot, + sources: (0, _from2.default)(mappings.values()) + }; +} + +function findInsertionLocation(array, callback) { + var left = 0; + var right = array.length; + + while (left < right) { + var mid = Math.floor((left + right) / 2); + var item = array[mid]; + var result = callback(item); + + if (result === 0) { + left = mid; + break; + } + + if (result >= 0) { + right = mid; + } else { + left = mid + 1; + } + } + + var i = left; + + if (i < array.length) { + while (i > 0 && callback(array[i]) >= 0) { + i--; + } + + return i + 1; + } + + return i; +} + +function filterSortedArray(array, callback) { + var start = findInsertionLocation(array, callback); + var results = []; + + for (var i = start; i < array.length && callback(array[i]) === 0; i++) { + results.push(array[i]); + } + + return results; +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/file/metadata.js": +/*!*********************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/file/metadata.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.ImportDeclaration = exports.ModuleDeclaration = undefined; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.ExportDeclaration = ExportDeclaration; +exports.Scope = Scope; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var ModuleDeclaration = exports.ModuleDeclaration = { + enter: function enter(path, file) { + var node = path.node; + + if (node.source) { + node.source.value = file.resolveModuleSource(node.source.value); + } + } +}; +var ImportDeclaration = exports.ImportDeclaration = { + exit: function exit(path, file) { + var node = path.node; + var specifiers = []; + var imported = []; + file.metadata.modules.imports.push({ + source: node.source.value, + imported: imported, + specifiers: specifiers + }); + + for (var _iterator = path.get("specifiers"), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var specifier = _ref; + var local = specifier.node.local.name; + + if (specifier.isImportDefaultSpecifier()) { + imported.push("default"); + specifiers.push({ + kind: "named", + imported: "default", + local: local + }); + } + + if (specifier.isImportSpecifier()) { + var importedName = specifier.node.imported.name; + imported.push(importedName); + specifiers.push({ + kind: "named", + imported: importedName, + local: local + }); + } + + if (specifier.isImportNamespaceSpecifier()) { + imported.push("*"); + specifiers.push({ + kind: "namespace", + local: local + }); + } + } + } +}; + +function ExportDeclaration(path, file) { + var node = path.node; + var source = node.source ? node.source.value : null; + var exports = file.metadata.modules.exports; + var declar = path.get("declaration"); + + if (declar.isStatement()) { + var bindings = declar.getBindingIdentifiers(); + + for (var name in bindings) { + exports.exported.push(name); + exports.specifiers.push({ + kind: "local", + local: name, + exported: path.isExportDefaultDeclaration() ? "default" : name + }); + } + } + + if (path.isExportNamedDeclaration() && node.specifiers) { + for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var specifier = _ref2; + var exported = specifier.exported.name; + exports.exported.push(exported); + + if (t.isExportDefaultSpecifier(specifier)) { + exports.specifiers.push({ + kind: "external", + local: exported, + exported: exported, + source: source + }); + } + + if (t.isExportNamespaceSpecifier(specifier)) { + exports.specifiers.push({ + kind: "external-namespace", + exported: exported, + source: source + }); + } + + var local = specifier.local; + if (!local) continue; + + if (source) { + exports.specifiers.push({ + kind: "external", + local: local.name, + exported: exported, + source: source + }); + } + + if (!source) { + exports.specifiers.push({ + kind: "local", + local: local.name, + exported: exported + }); + } + } + } + + if (path.isExportAllDeclaration()) { + exports.specifiers.push({ + kind: "external-all", + source: source + }); + } +} + +function Scope(path) { + path.skip(); +} + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/file/options/build-config-chain.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/file/options/build-config-chain.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +exports.__esModule = true; + +var _assign = __webpack_require__(/*! babel-runtime/core-js/object/assign */ "./node_modules/babel-runtime/core-js/object/assign.js"); + +var _assign2 = _interopRequireDefault(_assign); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +exports.default = buildConfigChain; + +var _resolve = __webpack_require__(/*! ../../../helpers/resolve */ "./node_modules/babel-core/lib/helpers/resolve.js"); + +var _resolve2 = _interopRequireDefault(_resolve); + +var _json = __webpack_require__(/*! json5 */ "./node_modules/babel-core/node_modules/json5/lib/json5.js"); + +var _json2 = _interopRequireDefault(_json); + +var _pathIsAbsolute = __webpack_require__(/*! path-is-absolute */ "./node_modules/path-is-absolute/index.js"); + +var _pathIsAbsolute2 = _interopRequireDefault(_pathIsAbsolute); + +var _path = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); + +var _path2 = _interopRequireDefault(_path); + +var _fs = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js"); + +var _fs2 = _interopRequireDefault(_fs); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var existsCache = {}; +var jsonCache = {}; +var BABELIGNORE_FILENAME = ".babelignore"; +var BABELRC_FILENAME = ".babelrc"; +var PACKAGE_FILENAME = "package.json"; + +function exists(filename) { + var cached = existsCache[filename]; + + if (cached == null) { + return existsCache[filename] = _fs2.default.existsSync(filename); + } else { + return cached; + } +} + +function buildConfigChain() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var log = arguments[1]; + var filename = opts.filename; + var builder = new ConfigChainBuilder(log); + + if (opts.babelrc !== false) { + builder.findConfigs(filename); + } + + builder.mergeConfig({ + options: opts, + alias: "base", + dirname: filename && _path2.default.dirname(filename) + }); + return builder.configs; +} + +var ConfigChainBuilder = function () { + function ConfigChainBuilder(log) { + (0, _classCallCheck3.default)(this, ConfigChainBuilder); + this.resolvedConfigs = []; + this.configs = []; + this.log = log; + } + + ConfigChainBuilder.prototype.findConfigs = function findConfigs(loc) { + if (!loc) return; + + if (!(0, _pathIsAbsolute2.default)(loc)) { + loc = _path2.default.join(process.cwd(), loc); + } + + var foundConfig = false; + var foundIgnore = false; + + while (loc !== (loc = _path2.default.dirname(loc))) { + if (!foundConfig) { + var configLoc = _path2.default.join(loc, BABELRC_FILENAME); + + if (exists(configLoc)) { + this.addConfig(configLoc); + foundConfig = true; + } + + var pkgLoc = _path2.default.join(loc, PACKAGE_FILENAME); + + if (!foundConfig && exists(pkgLoc)) { + foundConfig = this.addConfig(pkgLoc, "babel", JSON); + } + } + + if (!foundIgnore) { + var ignoreLoc = _path2.default.join(loc, BABELIGNORE_FILENAME); + + if (exists(ignoreLoc)) { + this.addIgnoreConfig(ignoreLoc); + foundIgnore = true; + } + } + + if (foundIgnore && foundConfig) return; + } + }; + + ConfigChainBuilder.prototype.addIgnoreConfig = function addIgnoreConfig(loc) { + var file = _fs2.default.readFileSync(loc, "utf8"); + + var lines = file.split("\n"); + lines = lines.map(function (line) { + return line.replace(/#(.*?)$/, "").trim(); + }).filter(function (line) { + return !!line; + }); + + if (lines.length) { + this.mergeConfig({ + options: { + ignore: lines + }, + alias: loc, + dirname: _path2.default.dirname(loc) + }); + } + }; + + ConfigChainBuilder.prototype.addConfig = function addConfig(loc, key) { + var json = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _json2.default; + + if (this.resolvedConfigs.indexOf(loc) >= 0) { + return false; + } + + this.resolvedConfigs.push(loc); + + var content = _fs2.default.readFileSync(loc, "utf8"); + + var options = void 0; + + try { + options = jsonCache[content] = jsonCache[content] || json.parse(content); + if (key) options = options[key]; + } catch (err) { + err.message = loc + ": Error while parsing JSON - " + err.message; + throw err; + } + + this.mergeConfig({ + options: options, + alias: loc, + dirname: _path2.default.dirname(loc) + }); + return !!options; + }; + + ConfigChainBuilder.prototype.mergeConfig = function mergeConfig(_ref) { + var options = _ref.options, + alias = _ref.alias, + loc = _ref.loc, + dirname = _ref.dirname; + + if (!options) { + return false; + } + + options = (0, _assign2.default)({}, options); + dirname = dirname || process.cwd(); + loc = loc || alias; + + if (options.extends) { + var extendsLoc = (0, _resolve2.default)(options.extends, dirname); + + if (extendsLoc) { + this.addConfig(extendsLoc); + } else { + if (this.log) this.log.error("Couldn't resolve extends clause of " + options.extends + " in " + alias); + } + + delete options.extends; + } + + this.configs.push({ + options: options, + alias: alias, + loc: loc, + dirname: dirname + }); + var envOpts = void 0; + var envKey = Object({"NODE_ENV":"development","PUBLIC_URL":""}).BABEL_ENV || "development" || "development"; + + if (options.env) { + envOpts = options.env[envKey]; + delete options.env; + } + + this.mergeConfig({ + options: envOpts, + alias: alias + ".env." + envKey, + dirname: dirname + }); + }; + + return ConfigChainBuilder; +}(); + +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/file/options/config.js": +/*!***************************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/file/options/config.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + filename: { + type: "filename", + description: "filename to use when reading from stdin - this will be used in source-maps, errors etc", + default: "unknown", + shorthand: "f" + }, + filenameRelative: { + hidden: true, + type: "string" + }, + inputSourceMap: { + hidden: true + }, + env: { + hidden: true, + default: {} + }, + mode: { + description: "", + hidden: true + }, + retainLines: { + type: "boolean", + default: false, + description: "retain line numbers - will result in really ugly code" + }, + highlightCode: { + description: "enable/disable ANSI syntax highlighting of code frames (on by default)", + type: "boolean", + default: true + }, + suppressDeprecationMessages: { + type: "boolean", + default: false, + hidden: true + }, + presets: { + type: "list", + description: "", + default: [] + }, + plugins: { + type: "list", + default: [], + description: "" + }, + ignore: { + type: "list", + description: "list of glob paths to **not** compile", + default: [] + }, + only: { + type: "list", + description: "list of glob paths to **only** compile" + }, + code: { + hidden: true, + default: true, + type: "boolean" + }, + metadata: { + hidden: true, + default: true, + type: "boolean" + }, + ast: { + hidden: true, + default: true, + type: "boolean" + }, + extends: { + type: "string", + hidden: true + }, + comments: { + type: "boolean", + default: true, + description: "write comments to generated output (true by default)" + }, + shouldPrintComment: { + hidden: true, + description: "optional callback to control whether a comment should be inserted, when this is used the comments option is ignored" + }, + wrapPluginVisitorMethod: { + hidden: true, + description: "optional callback to wrap all visitor methods" + }, + compact: { + type: "booleanString", + default: "auto", + description: "do not include superfluous whitespace characters and line terminators [true|false|auto]" + }, + minified: { + type: "boolean", + default: false, + description: "save as much bytes when printing [true|false]" + }, + sourceMap: { + alias: "sourceMaps", + hidden: true + }, + sourceMaps: { + type: "booleanString", + description: "[true|false|inline]", + default: false, + shorthand: "s" + }, + sourceMapTarget: { + type: "string", + description: "set `file` on returned source map" + }, + sourceFileName: { + type: "string", + description: "set `sources[0]` on returned source map" + }, + sourceRoot: { + type: "filename", + description: "the root from which all sources are relative" + }, + babelrc: { + description: "Whether or not to look up .babelrc and .babelignore files", + type: "boolean", + default: true + }, + sourceType: { + description: "", + default: "module" + }, + auxiliaryCommentBefore: { + type: "string", + description: "print a comment before any injected non-user code" + }, + auxiliaryCommentAfter: { + type: "string", + description: "print a comment after any injected non-user code" + }, + resolveModuleSource: { + hidden: true + }, + getModuleId: { + hidden: true + }, + moduleRoot: { + type: "filename", + description: "optional prefix for the AMD module formatter that will be prepend to the filename on module definitions" + }, + moduleIds: { + type: "boolean", + default: false, + shorthand: "M", + description: "insert an explicit id for modules" + }, + moduleId: { + description: "specify a custom name for module ids", + type: "string" + }, + passPerPreset: { + description: "Whether to spawn a traversal pass per a preset. By default all presets are merged.", + type: "boolean", + default: false, + hidden: true + }, + parserOpts: { + description: "Options to pass into the parser, or to change parsers (parserOpts.parser)", + default: false + }, + generatorOpts: { + description: "Options to pass into the generator, or to change generators (generatorOpts.generator)", + default: false + } +}; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/file/options/index.js": +/*!**************************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/file/options/index.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.config = undefined; +exports.normaliseOptions = normaliseOptions; + +var _parsers = __webpack_require__(/*! ./parsers */ "./node_modules/babel-core/lib/transformation/file/options/parsers.js"); + +var parsers = _interopRequireWildcard(_parsers); + +var _config = __webpack_require__(/*! ./config */ "./node_modules/babel-core/lib/transformation/file/options/config.js"); + +var _config2 = _interopRequireDefault(_config); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +exports.config = _config2.default; + +function normaliseOptions() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + for (var key in options) { + var val = options[key]; + if (val == null) continue; + var opt = _config2.default[key]; + if (opt && opt.alias) opt = _config2.default[opt.alias]; + if (!opt) continue; + var parser = parsers[opt.type]; + if (parser) val = parser(val); + options[key] = val; + } + + return options; +} + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/file/options/option-manager.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/file/options/option-manager.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +exports.__esModule = true; + +var _objectWithoutProperties2 = __webpack_require__(/*! babel-runtime/helpers/objectWithoutProperties */ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js"); + +var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); + +var _stringify = __webpack_require__(/*! babel-runtime/core-js/json/stringify */ "./node_modules/babel-runtime/core-js/json/stringify.js"); + +var _stringify2 = _interopRequireDefault(_stringify); + +var _assign = __webpack_require__(/*! babel-runtime/core-js/object/assign */ "./node_modules/babel-runtime/core-js/object/assign.js"); + +var _assign2 = _interopRequireDefault(_assign); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _typeof2 = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _node = __webpack_require__(/*! ../../../api/node */ "./node_modules/babel-core/lib/api/node.js"); + +var context = _interopRequireWildcard(_node); + +var _plugin2 = __webpack_require__(/*! ../../plugin */ "./node_modules/babel-core/lib/transformation/plugin.js"); + +var _plugin3 = _interopRequireDefault(_plugin2); + +var _babelMessages = __webpack_require__(/*! babel-messages */ "./node_modules/babel-messages/lib/index.js"); + +var messages = _interopRequireWildcard(_babelMessages); + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-core/lib/transformation/file/options/index.js"); + +var _resolvePlugin = __webpack_require__(/*! ../../../helpers/resolve-plugin */ "./node_modules/babel-core/lib/helpers/resolve-plugin.js"); + +var _resolvePlugin2 = _interopRequireDefault(_resolvePlugin); + +var _resolvePreset = __webpack_require__(/*! ../../../helpers/resolve-preset */ "./node_modules/babel-core/lib/helpers/resolve-preset.js"); + +var _resolvePreset2 = _interopRequireDefault(_resolvePreset); + +var _cloneDeepWith = __webpack_require__(/*! lodash/cloneDeepWith */ "./node_modules/lodash/cloneDeepWith.js"); + +var _cloneDeepWith2 = _interopRequireDefault(_cloneDeepWith); + +var _clone = __webpack_require__(/*! lodash/clone */ "./node_modules/lodash/clone.js"); + +var _clone2 = _interopRequireDefault(_clone); + +var _merge = __webpack_require__(/*! ../../../helpers/merge */ "./node_modules/babel-core/lib/helpers/merge.js"); + +var _merge2 = _interopRequireDefault(_merge); + +var _config2 = __webpack_require__(/*! ./config */ "./node_modules/babel-core/lib/transformation/file/options/config.js"); + +var _config3 = _interopRequireDefault(_config2); + +var _removed = __webpack_require__(/*! ./removed */ "./node_modules/babel-core/lib/transformation/file/options/removed.js"); + +var _removed2 = _interopRequireDefault(_removed); + +var _buildConfigChain = __webpack_require__(/*! ./build-config-chain */ "./node_modules/babel-core/lib/transformation/file/options/build-config-chain.js"); + +var _buildConfigChain2 = _interopRequireDefault(_buildConfigChain); + +var _path = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); + +var _path2 = _interopRequireDefault(_path); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var OptionManager = function () { + function OptionManager(log) { + (0, _classCallCheck3.default)(this, OptionManager); + this.resolvedConfigs = []; + this.options = OptionManager.createBareOptions(); + this.log = log; + } + + OptionManager.memoisePluginContainer = function memoisePluginContainer(fn, loc, i, alias) { + for (var _iterator = OptionManager.memoisedPlugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var cache = _ref; + if (cache.container === fn) return cache.plugin; + } + + var obj = void 0; + + if (typeof fn === "function") { + obj = fn(context); + } else { + obj = fn; + } + + if ((typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) === "object") { + var _plugin = new _plugin3.default(obj, alias); + + OptionManager.memoisedPlugins.push({ + container: fn, + plugin: _plugin + }); + return _plugin; + } else { + throw new TypeError(messages.get("pluginNotObject", loc, i, typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) + loc + i); + } + }; + + OptionManager.createBareOptions = function createBareOptions() { + var opts = {}; + + for (var _key in _config3.default) { + var opt = _config3.default[_key]; + opts[_key] = (0, _clone2.default)(opt.default); + } + + return opts; + }; + + OptionManager.normalisePlugin = function normalisePlugin(plugin, loc, i, alias) { + plugin = plugin.__esModule ? plugin.default : plugin; + + if (!(plugin instanceof _plugin3.default)) { + if (typeof plugin === "function" || (typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin)) === "object") { + plugin = OptionManager.memoisePluginContainer(plugin, loc, i, alias); + } else { + throw new TypeError(messages.get("pluginNotFunction", loc, i, typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin))); + } + } + + plugin.init(loc, i); + return plugin; + }; + + OptionManager.normalisePlugins = function normalisePlugins(loc, dirname, plugins) { + return plugins.map(function (val, i) { + var plugin = void 0, + options = void 0; + + if (!val) { + throw new TypeError("Falsy value found in plugins"); + } + + if (Array.isArray(val)) { + plugin = val[0]; + options = val[1]; + } else { + plugin = val; + } + + var alias = typeof plugin === "string" ? plugin : loc + "$" + i; + + if (typeof plugin === "string") { + var pluginLoc = (0, _resolvePlugin2.default)(plugin, dirname); + + if (pluginLoc) { + plugin = __webpack_require__("./node_modules/babel-core/lib/transformation/file/options sync recursive")(pluginLoc); + } else { + throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i, dirname)); + } + } + + plugin = OptionManager.normalisePlugin(plugin, loc, i, alias); + return [plugin, options]; + }); + }; + + OptionManager.prototype.mergeOptions = function mergeOptions(_ref2) { + var _this = this; + + var rawOpts = _ref2.options, + extendingOpts = _ref2.extending, + alias = _ref2.alias, + loc = _ref2.loc, + dirname = _ref2.dirname; + alias = alias || "foreign"; + if (!rawOpts) return; + + if ((typeof rawOpts === "undefined" ? "undefined" : (0, _typeof3.default)(rawOpts)) !== "object" || Array.isArray(rawOpts)) { + this.log.error("Invalid options type for " + alias, TypeError); + } + + var opts = (0, _cloneDeepWith2.default)(rawOpts, function (val) { + if (val instanceof _plugin3.default) { + return val; + } + }); + dirname = dirname || process.cwd(); + loc = loc || alias; + + for (var _key2 in opts) { + var option = _config3.default[_key2]; + + if (!option && this.log) { + if (_removed2.default[_key2]) { + this.log.error("Using removed Babel 5 option: " + alias + "." + _key2 + " - " + _removed2.default[_key2].message, ReferenceError); + } else { + var unknownOptErr = "Unknown option: " + alias + "." + _key2 + ". Check out http://babeljs.io/docs/usage/options/ for more information about options."; + var presetConfigErr = "A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see https://babeljs.io/docs/en/plugins#pluginpresets-options."; + this.log.error(unknownOptErr + "\n\n" + presetConfigErr, ReferenceError); + } + } + } + + (0, _index.normaliseOptions)(opts); + + if (opts.plugins) { + opts.plugins = OptionManager.normalisePlugins(loc, dirname, opts.plugins); + } + + if (opts.presets) { + if (opts.passPerPreset) { + opts.presets = this.resolvePresets(opts.presets, dirname, function (preset, presetLoc) { + _this.mergeOptions({ + options: preset, + extending: preset, + alias: presetLoc, + loc: presetLoc, + dirname: dirname + }); + }); + } else { + this.mergePresets(opts.presets, dirname); + delete opts.presets; + } + } + + if (rawOpts === extendingOpts) { + (0, _assign2.default)(extendingOpts, opts); + } else { + (0, _merge2.default)(extendingOpts || this.options, opts); + } + }; + + OptionManager.prototype.mergePresets = function mergePresets(presets, dirname) { + var _this2 = this; + + this.resolvePresets(presets, dirname, function (presetOpts, presetLoc) { + _this2.mergeOptions({ + options: presetOpts, + alias: presetLoc, + loc: presetLoc, + dirname: _path2.default.dirname(presetLoc || "") + }); + }); + }; + + OptionManager.prototype.resolvePresets = function resolvePresets(presets, dirname, onResolve) { + return presets.map(function (val) { + var options = void 0; + + if (Array.isArray(val)) { + if (val.length > 2) { + throw new Error("Unexpected extra options " + (0, _stringify2.default)(val.slice(2)) + " passed to preset."); + } + + var _val = val; + val = _val[0]; + options = _val[1]; + } + + var presetLoc = void 0; + + try { + if (typeof val === "string") { + presetLoc = (0, _resolvePreset2.default)(val, dirname); + + if (!presetLoc) { + throw new Error("Couldn't find preset " + (0, _stringify2.default)(val) + " relative to directory " + (0, _stringify2.default)(dirname)); + } + + val = __webpack_require__("./node_modules/babel-core/lib/transformation/file/options sync recursive")(presetLoc); + } + + if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.__esModule) { + if (val.default) { + val = val.default; + } else { + var _val2 = val, + __esModule = _val2.__esModule, + rest = (0, _objectWithoutProperties3.default)(_val2, ["__esModule"]); + val = rest; + } + } + + if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.buildPreset) val = val.buildPreset; + + if (typeof val !== "function" && options !== undefined) { + throw new Error("Options " + (0, _stringify2.default)(options) + " passed to " + (presetLoc || "a preset") + " which does not accept options."); + } + + if (typeof val === "function") val = val(context, options, { + dirname: dirname + }); + + if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) !== "object") { + throw new Error("Unsupported preset format: " + val + "."); + } + + onResolve && onResolve(val, presetLoc); + } catch (e) { + if (presetLoc) { + e.message += " (While processing preset: " + (0, _stringify2.default)(presetLoc) + ")"; + } + + throw e; + } + + return val; + }); + }; + + OptionManager.prototype.normaliseOptions = function normaliseOptions() { + var opts = this.options; + + for (var _key3 in _config3.default) { + var option = _config3.default[_key3]; + var val = opts[_key3]; + if (!val && option.optional) continue; + + if (option.alias) { + opts[option.alias] = opts[option.alias] || val; + } else { + opts[_key3] = val; + } + } + }; + + OptionManager.prototype.init = function init() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + for (var _iterator2 = (0, _buildConfigChain2.default)(opts, this.log), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var _config = _ref3; + this.mergeOptions(_config); + } + + this.normaliseOptions(opts); + return this.options; + }; + + return OptionManager; +}(); + +exports.default = OptionManager; +OptionManager.memoisedPlugins = []; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/file/options/parsers.js": +/*!****************************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/file/options/parsers.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.filename = undefined; +exports.boolean = boolean; +exports.booleanString = booleanString; +exports.list = list; + +var _slash = __webpack_require__(/*! slash */ "./node_modules/slash/index.js"); + +var _slash2 = _interopRequireDefault(_slash); + +var _util = __webpack_require__(/*! ../../../util */ "./node_modules/babel-core/lib/util.js"); + +var util = _interopRequireWildcard(_util); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var filename = exports.filename = _slash2.default; + +function boolean(val) { + return !!val; +} + +function booleanString(val) { + return util.booleanify(val); +} + +function list(val) { + return util.list(val); +} + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/file/options/removed.js": +/*!****************************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/file/options/removed.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + "auxiliaryComment": { + "message": "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`" + }, + "blacklist": { + "message": "Put the specific transforms you want in the `plugins` option" + }, + "breakConfig": { + "message": "This is not a necessary option in Babel 6" + }, + "experimental": { + "message": "Put the specific transforms you want in the `plugins` option" + }, + "externalHelpers": { + "message": "Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/" + }, + "extra": { + "message": "" + }, + "jsxPragma": { + "message": "use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/" + }, + "loose": { + "message": "Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option." + }, + "metadataUsedHelpers": { + "message": "Not required anymore as this is enabled by default" + }, + "modules": { + "message": "Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules" + }, + "nonStandard": { + "message": "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/" + }, + "optional": { + "message": "Put the specific transforms you want in the `plugins` option" + }, + "sourceMapName": { + "message": "Use the `sourceMapTarget` option" + }, + "stage": { + "message": "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets" + }, + "whitelist": { + "message": "Put the specific transforms you want in the `plugins` option" + } +}; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/internal-plugins/block-hoist.js": +/*!************************************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/internal-plugins/block-hoist.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _plugin = __webpack_require__(/*! ../plugin */ "./node_modules/babel-core/lib/transformation/plugin.js"); + +var _plugin2 = _interopRequireDefault(_plugin); + +var _sortBy = __webpack_require__(/*! lodash/sortBy */ "./node_modules/lodash/sortBy.js"); + +var _sortBy2 = _interopRequireDefault(_sortBy); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +exports.default = new _plugin2.default({ + name: "internal.blockHoist", + visitor: { + Block: { + exit: function exit(_ref) { + var node = _ref.node; + var hasChange = false; + + for (var i = 0; i < node.body.length; i++) { + var bodyNode = node.body[i]; + + if (bodyNode && bodyNode._blockHoist != null) { + hasChange = true; + break; + } + } + + if (!hasChange) return; + node.body = (0, _sortBy2.default)(node.body, function (bodyNode) { + var priority = bodyNode && bodyNode._blockHoist; + if (priority == null) priority = 1; + if (priority === true) priority = 2; + return -1 * priority; + }); + } + } + } +}); +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/internal-plugins/shadow-functions.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/internal-plugins/shadow-functions.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _symbol = __webpack_require__(/*! babel-runtime/core-js/symbol */ "./node_modules/babel-runtime/core-js/symbol.js"); + +var _symbol2 = _interopRequireDefault(_symbol); + +var _plugin = __webpack_require__(/*! ../plugin */ "./node_modules/babel-core/lib/transformation/plugin.js"); + +var _plugin2 = _interopRequireDefault(_plugin); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var SUPER_THIS_BOUND = (0, _symbol2.default)("super this bound"); +var superVisitor = { + CallExpression: function CallExpression(path) { + if (!path.get("callee").isSuper()) return; + var node = path.node; + if (node[SUPER_THIS_BOUND]) return; + node[SUPER_THIS_BOUND] = true; + path.replaceWith(t.assignmentExpression("=", this.id, node)); + } +}; +exports.default = new _plugin2.default({ + name: "internal.shadowFunctions", + visitor: { + ThisExpression: function ThisExpression(path) { + remap(path, "this"); + }, + ReferencedIdentifier: function ReferencedIdentifier(path) { + if (path.node.name === "arguments") { + remap(path, "arguments"); + } + } + } +}); + +function shouldShadow(path, shadowPath) { + if (path.is("_forceShadow")) { + return true; + } else { + return shadowPath; + } +} + +function remap(path, key) { + var shadowPath = path.inShadow(key); + if (!shouldShadow(path, shadowPath)) return; + var shadowFunction = path.node._shadowedFunctionLiteral; + var currentFunction = void 0; + var passedShadowFunction = false; + var fnPath = path.find(function (innerPath) { + if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value") { + return true; + } + + if (path === innerPath) return false; + + if (innerPath.isProgram() || innerPath.isFunction()) { + currentFunction = currentFunction || innerPath; + } + + if (innerPath.isProgram()) { + passedShadowFunction = true; + return true; + } else if (innerPath.isFunction() && !innerPath.isArrowFunctionExpression()) { + if (shadowFunction) { + if (innerPath === shadowFunction || innerPath.node === shadowFunction.node) return true; + } else { + if (!innerPath.is("shadow")) return true; + } + + passedShadowFunction = true; + return false; + } + + return false; + }); + + if (shadowFunction && fnPath.isProgram() && !shadowFunction.isProgram()) { + fnPath = path.findParent(function (p) { + return p.isProgram() || p.isFunction(); + }); + } + + if (fnPath === currentFunction) return; + if (!passedShadowFunction) return; + var cached = fnPath.getData(key); + + if (!cached) { + var id = path.scope.generateUidIdentifier(key); + fnPath.setData(key, id); + cached = id; + var classPath = fnPath.findParent(function (p) { + return p.isClass(); + }); + var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass); + + if (key === "this" && fnPath.isMethod({ + kind: "constructor" + }) && hasSuperClass) { + fnPath.scope.push({ + id: id + }); + fnPath.traverse(superVisitor, { + id: id + }); + } else { + var init = key === "this" ? t.thisExpression() : t.identifier(key); + if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction; + fnPath.scope.push({ + id: id, + init: init + }); + } + } + + var node = t.cloneDeep(cached); + node.loc = path.node.loc; + return path.replaceWith(node); +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/pipeline.js": +/*!****************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/pipeline.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _normalizeAst = __webpack_require__(/*! ../helpers/normalize-ast */ "./node_modules/babel-core/lib/helpers/normalize-ast.js"); + +var _normalizeAst2 = _interopRequireDefault(_normalizeAst); + +var _plugin = __webpack_require__(/*! ./plugin */ "./node_modules/babel-core/lib/transformation/plugin.js"); + +var _plugin2 = _interopRequireDefault(_plugin); + +var _file = __webpack_require__(/*! ./file */ "./node_modules/babel-core/lib/transformation/file/index.js"); + +var _file2 = _interopRequireDefault(_file); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var Pipeline = function () { + function Pipeline() { + (0, _classCallCheck3.default)(this, Pipeline); + } + + Pipeline.prototype.lint = function lint(code) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + opts.code = false; + opts.mode = "lint"; + return this.transform(code, opts); + }; + + Pipeline.prototype.pretransform = function pretransform(code, opts) { + var file = new _file2.default(opts, this); + return file.wrap(code, function () { + file.addCode(code); + file.parseCode(code); + return file; + }); + }; + + Pipeline.prototype.transform = function transform(code, opts) { + var file = new _file2.default(opts, this); + return file.wrap(code, function () { + file.addCode(code); + file.parseCode(code); + return file.transform(); + }); + }; + + Pipeline.prototype.analyse = function analyse(code) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var visitor = arguments[2]; + opts.code = false; + + if (visitor) { + opts.plugins = opts.plugins || []; + opts.plugins.push(new _plugin2.default({ + visitor: visitor + })); + } + + return this.transform(code, opts).metadata; + }; + + Pipeline.prototype.transformFromAst = function transformFromAst(ast, code, opts) { + ast = (0, _normalizeAst2.default)(ast); + var file = new _file2.default(opts, this); + return file.wrap(code, function () { + file.addCode(code); + file.addAst(ast); + return file.transform(); + }); + }; + + return Pipeline; +}(); + +exports.default = Pipeline; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/plugin-pass.js": +/*!*******************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/plugin-pass.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); + +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); + +var _inherits3 = _interopRequireDefault(_inherits2); + +var _store = __webpack_require__(/*! ../store */ "./node_modules/babel-core/lib/store.js"); + +var _store2 = _interopRequireDefault(_store); + +var _file5 = __webpack_require__(/*! ./file */ "./node_modules/babel-core/lib/transformation/file/index.js"); + +var _file6 = _interopRequireDefault(_file5); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var PluginPass = function (_Store) { + (0, _inherits3.default)(PluginPass, _Store); + + function PluginPass(file, plugin) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + (0, _classCallCheck3.default)(this, PluginPass); + + var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); + + _this.plugin = plugin; + _this.key = plugin.key; + _this.file = file; + _this.opts = options; + return _this; + } + + PluginPass.prototype.addHelper = function addHelper() { + var _file; + + return (_file = this.file).addHelper.apply(_file, arguments); + }; + + PluginPass.prototype.addImport = function addImport() { + var _file2; + + return (_file2 = this.file).addImport.apply(_file2, arguments); + }; + + PluginPass.prototype.getModuleName = function getModuleName() { + var _file3; + + return (_file3 = this.file).getModuleName.apply(_file3, arguments); + }; + + PluginPass.prototype.buildCodeFrameError = function buildCodeFrameError() { + var _file4; + + return (_file4 = this.file).buildCodeFrameError.apply(_file4, arguments); + }; + + return PluginPass; +}(_store2.default); + +exports.default = PluginPass; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/transformation/plugin.js": +/*!**************************************************************!*\ + !*** ./node_modules/babel-core/lib/transformation/plugin.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); + +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); + +var _inherits3 = _interopRequireDefault(_inherits2); + +var _optionManager = __webpack_require__(/*! ./file/options/option-manager */ "./node_modules/babel-core/lib/transformation/file/options/option-manager.js"); + +var _optionManager2 = _interopRequireDefault(_optionManager); + +var _babelMessages = __webpack_require__(/*! babel-messages */ "./node_modules/babel-messages/lib/index.js"); + +var messages = _interopRequireWildcard(_babelMessages); + +var _store = __webpack_require__(/*! ../store */ "./node_modules/babel-core/lib/store.js"); + +var _store2 = _interopRequireDefault(_store); + +var _babelTraverse = __webpack_require__(/*! babel-traverse */ "./node_modules/babel-traverse/lib/index.js"); + +var _babelTraverse2 = _interopRequireDefault(_babelTraverse); + +var _assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); + +var _assign2 = _interopRequireDefault(_assign); + +var _clone = __webpack_require__(/*! lodash/clone */ "./node_modules/lodash/clone.js"); + +var _clone2 = _interopRequireDefault(_clone); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var GLOBAL_VISITOR_PROPS = ["enter", "exit"]; + +var Plugin = function (_Store) { + (0, _inherits3.default)(Plugin, _Store); + + function Plugin(plugin, key) { + (0, _classCallCheck3.default)(this, Plugin); + + var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); + + _this.initialized = false; + _this.raw = (0, _assign2.default)({}, plugin); + _this.key = _this.take("name") || key; + _this.manipulateOptions = _this.take("manipulateOptions"); + _this.post = _this.take("post"); + _this.pre = _this.take("pre"); + _this.visitor = _this.normaliseVisitor((0, _clone2.default)(_this.take("visitor")) || {}); + return _this; + } + + Plugin.prototype.take = function take(key) { + var val = this.raw[key]; + delete this.raw[key]; + return val; + }; + + Plugin.prototype.chain = function chain(target, key) { + if (!target[key]) return this[key]; + if (!this[key]) return target[key]; + var fns = [target[key], this[key]]; + return function () { + var val = void 0; + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var fn = _ref; + + if (fn) { + var ret = fn.apply(this, args); + if (ret != null) val = ret; + } + } + + return val; + }; + }; + + Plugin.prototype.maybeInherit = function maybeInherit(loc) { + var inherits = this.take("inherits"); + if (!inherits) return; + inherits = _optionManager2.default.normalisePlugin(inherits, loc, "inherits"); + this.manipulateOptions = this.chain(inherits, "manipulateOptions"); + this.post = this.chain(inherits, "post"); + this.pre = this.chain(inherits, "pre"); + this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor]); + }; + + Plugin.prototype.init = function init(loc, i) { + if (this.initialized) return; + this.initialized = true; + this.maybeInherit(loc); + + for (var key in this.raw) { + throw new Error(messages.get("pluginInvalidProperty", loc, i, key)); + } + }; + + Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) { + for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var key = _ref2; + + if (visitor[key]) { + throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. " + "Please target individual nodes."); + } + } + + _babelTraverse2.default.explode(visitor); + + return visitor; + }; + + return Plugin; +}(_store2.default); + +exports.default = Plugin; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-core/lib/util.js": +/*!*********************************************!*\ + !*** ./node_modules/babel-core/lib/util.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.inspect = exports.inherits = undefined; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _util = __webpack_require__(/*! util */ "./node_modules/node-libs-browser/node_modules/util/util.js"); + +Object.defineProperty(exports, "inherits", { + enumerable: true, + get: function get() { + return _util.inherits; + } +}); +Object.defineProperty(exports, "inspect", { + enumerable: true, + get: function get() { + return _util.inspect; + } +}); +exports.canCompile = canCompile; +exports.list = list; +exports.regexify = regexify; +exports.arrayify = arrayify; +exports.booleanify = booleanify; +exports.shouldIgnore = shouldIgnore; + +var _escapeRegExp = __webpack_require__(/*! lodash/escapeRegExp */ "./node_modules/lodash/escapeRegExp.js"); + +var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); + +var _startsWith = __webpack_require__(/*! lodash/startsWith */ "./node_modules/lodash/startsWith.js"); + +var _startsWith2 = _interopRequireDefault(_startsWith); + +var _minimatch = __webpack_require__(/*! minimatch */ "./node_modules/minimatch/minimatch.js"); + +var _minimatch2 = _interopRequireDefault(_minimatch); + +var _includes = __webpack_require__(/*! lodash/includes */ "./node_modules/lodash/includes.js"); + +var _includes2 = _interopRequireDefault(_includes); + +var _isRegExp = __webpack_require__(/*! lodash/isRegExp */ "./node_modules/lodash/isRegExp.js"); + +var _isRegExp2 = _interopRequireDefault(_isRegExp); + +var _path = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); + +var _path2 = _interopRequireDefault(_path); + +var _slash = __webpack_require__(/*! slash */ "./node_modules/slash/index.js"); + +var _slash2 = _interopRequireDefault(_slash); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function canCompile(filename, altExts) { + var exts = altExts || canCompile.EXTENSIONS; + + var ext = _path2.default.extname(filename); + + return (0, _includes2.default)(exts, ext); +} + +canCompile.EXTENSIONS = [".js", ".jsx", ".es6", ".es"]; + +function list(val) { + if (!val) { + return []; + } else if (Array.isArray(val)) { + return val; + } else if (typeof val === "string") { + return val.split(","); + } else { + return [val]; + } +} + +function regexify(val) { + if (!val) { + return new RegExp(/.^/); + } + + if (Array.isArray(val)) { + val = new RegExp(val.map(_escapeRegExp2.default).join("|"), "i"); + } + + if (typeof val === "string") { + val = (0, _slash2.default)(val); + if ((0, _startsWith2.default)(val, "./") || (0, _startsWith2.default)(val, "*/")) val = val.slice(2); + if ((0, _startsWith2.default)(val, "**/")) val = val.slice(3); + + var regex = _minimatch2.default.makeRe(val, { + nocase: true + }); + + return new RegExp(regex.source.slice(1, -1), "i"); + } + + if ((0, _isRegExp2.default)(val)) { + return val; + } + + throw new TypeError("illegal type for regexify"); +} + +function arrayify(val, mapFn) { + if (!val) return []; + if (typeof val === "boolean") return arrayify([val], mapFn); + if (typeof val === "string") return arrayify(list(val), mapFn); + + if (Array.isArray(val)) { + if (mapFn) val = val.map(mapFn); + return val; + } + + return [val]; +} + +function booleanify(val) { + if (val === "true" || val == 1) { + return true; + } + + if (val === "false" || val == 0 || !val) { + return false; + } + + return val; +} + +function shouldIgnore(filename) { + var ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var only = arguments[2]; + filename = filename.replace(/\\/g, "/"); + + if (only) { + for (var _iterator = only, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var pattern = _ref; + if (_shouldIgnore(pattern, filename)) return false; + } + + return true; + } else if (ignore.length) { + for (var _iterator2 = ignore, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var _pattern = _ref2; + if (_shouldIgnore(_pattern, filename)) return true; + } + } + + return false; +} + +function _shouldIgnore(pattern, filename) { + if (typeof pattern === "function") { + return pattern(filename); + } else { + return pattern.test(filename); + } +} + +/***/ }), + +/***/ "./node_modules/babel-core/node_modules/debug/node.js": +/*!************************************************************!*\ + !*** ./node_modules/babel-core/node_modules/debug/node.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./src/node */ "./node_modules/babel-core/node_modules/debug/src/node.js"); + +/***/ }), + +/***/ "./node_modules/babel-core/node_modules/debug/src/debug.js": +/*!*****************************************************************!*\ + !*** ./node_modules/babel-core/node_modules/debug/src/debug.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = __webpack_require__(/*! ms */ "./node_modules/babel-core/node_modules/ms/index.js"); +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; +/** + * Previous log timestamp. + */ + +var prevTime; +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, + i; + + for (i in namespace) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + + +function createDebug(namespace) { + function debug() { + // disabled? + if (!debug.enabled) return; + var self = debug; // set `diff` timestamp + + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; // turn the `arguments` into a proper Array + + var args = new Array(arguments.length); + + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } // apply any `formatters` transformations + + + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format` + + args.splice(index, 1); + index--; + } + + return match; + }); // apply env-specific formatting (colors, etc.) + + exports.formatArgs.call(self, args); + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); // env-specific initialization logic for debug instances + + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + +function enable(namespaces) { + exports.save(namespaces); + exports.names = []; + exports.skips = []; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} +/** + * Disable debug output. + * + * @api public + */ + + +function disable() { + exports.enable(''); +} +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + +function enabled(name) { + var i, len; + + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + + return false; +} +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} + +/***/ }), + +/***/ "./node_modules/babel-core/node_modules/debug/src/node.js": +/*!****************************************************************!*\ + !*** ./node_modules/babel-core/node_modules/debug/src/node.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {/** + * Module dependencies. + */ +var tty = __webpack_require__(/*! tty */ "./node_modules/tty-browserify/index.js"); + +var util = __webpack_require__(/*! util */ "./node_modules/node-libs-browser/node_modules/util/util.js"); +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + + +exports = module.exports = __webpack_require__(/*! ./debug */ "./node_modules/babel-core/node_modules/debug/src/debug.js"); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(Object({"NODE_ENV":"development","PUBLIC_URL":""})).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) { + return k.toUpperCase(); + }); // coerce string value into JS value + + var val = Object({"NODE_ENV":"development","PUBLIC_URL":""})[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true;else if (/^(no|off|false|disabled)$/i.test(val)) val = false;else if (val === 'null') val = null;else val = Number(val); + obj[prop] = val; + return obj; +}, {}); +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(Object({"NODE_ENV":"development","PUBLIC_URL":""}).DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function () {}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')(); +} + +var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd); +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd); +} +/** + * Map %o to `util.inspect()`, all on a single line. + */ + + +exports.formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts).split('\n').map(function (str) { + return str.trim(); + }).join(' '); +}; +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + + +exports.formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + ' ' + name + ' ' + args[0]; + } +} +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete Object({"NODE_ENV":"development","PUBLIC_URL":""}).DEBUG; + } else { + Object({"NODE_ENV":"development","PUBLIC_URL":""}).DEBUG = namespaces; + } +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + +function load() { + return Object({"NODE_ENV":"development","PUBLIC_URL":""}).DEBUG; +} +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + + +function createWritableStdioStream(fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + + break; + + case 'FILE': + var fs = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js"); + + stream = new fs.SyncWriteStream(fd, { + autoClose: false + }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = __webpack_require__(/*! net */ "./node_modules/node-libs-browser/mock/empty.js"); + + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } // For supporting legacy API we put the FD here. + + + stream.fd = fd; + stream._isStdio = true; + return stream; +} +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + + +function init(debug) { + debug.inspectOpts = {}; + var keys = Object.keys(exports.inspectOpts); + + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + + +exports.enable(load()); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/babel-core/node_modules/json5/lib/json5.js": +/*!*****************************************************************!*\ + !*** ./node_modules/babel-core/node_modules/json5/lib/json5.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// json5.js +// Modern JSON. See README.md for details. +// +// This file is based directly off of Douglas Crockford's json_parse.js: +// https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js +var JSON5 = true ? exports : undefined; + +JSON5.parse = function () { + "use strict"; // This is a function that can parse a JSON5 text, producing a JavaScript + // data structure. It is a simple, recursive descent parser. It does not use + // eval or regular expressions, so it can be used as a model for implementing + // a JSON5 parser in other languages. + // We are defining the function inside of another function to avoid creating + // global variables. + + var at, + // The index of the current character + lineNumber, + // The current line number + columnNumber, + // The current column number + ch, + // The current character + escapee = { + "'": "'", + '"': '"', + '\\': '\\', + '/': '/', + '\n': '', + // Replace escaped newlines in strings w/ empty string + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + ws = [' ', '\t', '\r', '\n', '\v', '\f', '\xA0', '\uFEFF'], + text, + renderChar = function (chr) { + return chr === '' ? 'EOF' : "'" + chr + "'"; + }, + error = function (m) { + // Call error when something is wrong. + var error = new SyntaxError(); // beginning of message suffix to agree with that provided by Gecko - see https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse + + error.message = m + " at line " + lineNumber + " column " + columnNumber + " of the JSON5 data. Still to read: " + JSON.stringify(text.substring(at - 1, at + 19)); + error.at = at; // These two property names have been chosen to agree with the ones in Gecko, the only popular + // environment which seems to supply this info on JSON.parse + + error.lineNumber = lineNumber; + error.columnNumber = columnNumber; + throw error; + }, + next = function (c) { + // If a c parameter is provided, verify that it matches the current character. + if (c && c !== ch) { + error("Expected " + renderChar(c) + " instead of " + renderChar(ch)); + } // Get the next character. When there are no more characters, + // return the empty string. + + + ch = text.charAt(at); + at++; + columnNumber++; + + if (ch === '\n' || ch === '\r' && peek() !== '\n') { + lineNumber++; + columnNumber = 0; + } + + return ch; + }, + peek = function () { + // Get the next character without consuming it or + // assigning it to the ch varaible. + return text.charAt(at); + }, + identifier = function () { + // Parse an identifier. Normally, reserved words are disallowed here, but we + // only use this for unquoted object keys, where reserved words are allowed, + // so we don't check for those here. References: + // - http://es5.github.com/#x7.6 + // - https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Variables + // - http://docstore.mik.ua/orelly/webprog/jscript/ch02_07.htm + // TODO Identifiers can have Unicode "letters" in them; add support for those. + var key = ch; // Identifiers must start with a letter, _ or $. + + if (ch !== '_' && ch !== '$' && (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z')) { + error("Bad identifier as unquoted key"); + } // Subsequent characters can contain digits. + + + while (next() && (ch === '_' || ch === '$' || ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch >= '0' && ch <= '9')) { + key += ch; + } + + return key; + }, + number = function () { + // Parse a number value. + var number, + sign = '', + string = '', + base = 10; + + if (ch === '-' || ch === '+') { + sign = ch; + next(ch); + } // support for Infinity (could tweak to allow other words): + + + if (ch === 'I') { + number = word(); + + if (typeof number !== 'number' || isNaN(number)) { + error('Unexpected word for number'); + } + + return sign === '-' ? -number : number; + } // support for NaN + + + if (ch === 'N') { + number = word(); + + if (!isNaN(number)) { + error('expected word to be NaN'); + } // ignore sign as -NaN also is NaN + + + return number; + } + + if (ch === '0') { + string += ch; + next(); + + if (ch === 'x' || ch === 'X') { + string += ch; + next(); + base = 16; + } else if (ch >= '0' && ch <= '9') { + error('Octal literal'); + } + } + + switch (base) { + case 10: + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + + if (ch === '.') { + string += '.'; + + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + + break; + + case 16: + while (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'F' || ch >= 'a' && ch <= 'f') { + string += ch; + next(); + } + + break; + } + + if (sign === '-') { + number = -string; + } else { + number = +string; + } + + if (!isFinite(number)) { + error("Bad number"); + } else { + return number; + } + }, + string = function () { + // Parse a string value. + var hex, + i, + string = '', + delim, + // double quote or single quote + uffff; // When parsing for string values, we must look for ' or " and \ characters. + + if (ch === '"' || ch === "'") { + delim = ch; + + while (next()) { + if (ch === delim) { + next(); + return string; + } else if (ch === '\\') { + next(); + + if (ch === 'u') { + uffff = 0; + + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + + if (!isFinite(hex)) { + break; + } + + uffff = uffff * 16 + hex; + } + + string += String.fromCharCode(uffff); + } else if (ch === '\r') { + if (peek() === '\n') { + next(); + } + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else if (ch === '\n') { + // unescaped newlines are invalid; see: + // https://github.com/aseemk/json5/issues/24 + // TODO this feels special-cased; are there other + // invalid unescaped chars? + break; + } else { + string += ch; + } + } + } + + error("Bad string"); + }, + inlineComment = function () { + // Skip an inline comment, assuming this is one. The current character should + // be the second / character in the // pair that begins this inline comment. + // To finish the inline comment, we look for a newline or the end of the text. + if (ch !== '/') { + error("Not an inline comment"); + } + + do { + next(); + + if (ch === '\n' || ch === '\r') { + next(); + return; + } + } while (ch); + }, + blockComment = function () { + // Skip a block comment, assuming this is one. The current character should be + // the * character in the /* pair that begins this block comment. + // To finish the block comment, we look for an ending */ pair of characters, + // but we also watch for the end of text before the comment is terminated. + if (ch !== '*') { + error("Not a block comment"); + } + + do { + next(); + + while (ch === '*') { + next('*'); + + if (ch === '/') { + next('/'); + return; + } + } + } while (ch); + + error("Unterminated block comment"); + }, + comment = function () { + // Skip a comment, whether inline or block-level, assuming this is one. + // Comments always begin with a / character. + if (ch !== '/') { + error("Not a comment"); + } + + next('/'); + + if (ch === '/') { + inlineComment(); + } else if (ch === '*') { + blockComment(); + } else { + error("Unrecognized comment"); + } + }, + white = function () { + // Skip whitespace and comments. + // Note that we're detecting comments by only a single / character. + // This works since regular expressions are not valid JSON(5), but this will + // break if there are other valid values that begin with a / character! + while (ch) { + if (ch === '/') { + comment(); + } else if (ws.indexOf(ch) >= 0) { + next(); + } else { + return; + } + } + }, + word = function () { + // true, false, or null. + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + + case 'I': + next('I'); + next('n'); + next('f'); + next('i'); + next('n'); + next('i'); + next('t'); + next('y'); + return Infinity; + + case 'N': + next('N'); + next('a'); + next('N'); + return NaN; + } + + error("Unexpected " + renderChar(ch)); + }, + value, + // Place holder for the value function. + array = function () { + // Parse an array value. + var array = []; + + if (ch === '[') { + next('['); + white(); + + while (ch) { + if (ch === ']') { + next(']'); + return array; // Potentially empty array + } // ES5 allows omitting elements in arrays, e.g. [,] and + // [,null]. We don't allow this in JSON5. + + + if (ch === ',') { + error("Missing array element"); + } else { + array.push(value()); + } + + white(); // If there's no comma after this value, this needs to + // be the end of the array. + + if (ch !== ',') { + next(']'); + return array; + } + + next(','); + white(); + } + } + + error("Bad array"); + }, + object = function () { + // Parse an object value. + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + + while (ch) { + if (ch === '}') { + next('}'); + return object; // Potentially empty object + } // Keys can be unquoted. If they are, they need to be + // valid JS identifiers. + + + if (ch === '"' || ch === "'") { + key = string(); + } else { + key = identifier(); + } + + white(); + next(':'); + object[key] = value(); + white(); // If there's no comma after this pair, this needs to be + // the end of the object. + + if (ch !== ',') { + next('}'); + return object; + } + + next(','); + white(); + } + } + + error("Bad object"); + }; + + value = function () { + // Parse a JSON value. It could be an object, an array, a string, a number, + // or a word. + white(); + + switch (ch) { + case '{': + return object(); + + case '[': + return array(); + + case '"': + case "'": + return string(); + + case '-': + case '+': + case '.': + return number(); + + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } + }; // Return the json_parse function. It will have access to all of the above + // functions and variables. + + + return function (source, reviver) { + var result; + text = String(source); + at = 0; + lineNumber = 1; + columnNumber = 1; + ch = ' '; + result = value(); + white(); + + if (ch) { + error("Syntax error"); + } // If there is a reviver function, we recursively walk the new structure, + // passing each name/value pair to the reviver function for possible + // transformation, starting with a temporary root object that holds the result + // in an empty key. If there is not a reviver function, we simply return the + // result. + + + return typeof reviver === 'function' ? function walk(holder, key) { + var k, + v, + value = holder[key]; + + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + + return reviver.call(holder, key, value); + }({ + '': result + }, '') : result; + }; +}(); // JSON5 stringify will not quote keys where appropriate + + +JSON5.stringify = function (obj, replacer, space) { + if (replacer && typeof replacer !== "function" && !isArray(replacer)) { + throw new Error('Replacer must be a function or an array'); + } + + var getReplacedValueOrUndefined = function (holder, key, isTopLevel) { + var value = holder[key]; // Replace the value with its toJSON value first, if possible + + if (value && value.toJSON && typeof value.toJSON === "function") { + value = value.toJSON(); + } // If the user-supplied replacer if a function, call it. If it's an array, check objects' string keys for + // presence in the array (removing the key/value pair from the resulting JSON if the key is missing). + + + if (typeof replacer === "function") { + return replacer.call(holder, key, value); + } else if (replacer) { + if (isTopLevel || isArray(holder) || replacer.indexOf(key) >= 0) { + return value; + } else { + return undefined; + } + } else { + return value; + } + }; + + function isWordChar(c) { + return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c === '_' || c === '$'; + } + + function isWordStart(c) { + return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '_' || c === '$'; + } + + function isWord(key) { + if (typeof key !== 'string') { + return false; + } + + if (!isWordStart(key[0])) { + return false; + } + + var i = 1, + length = key.length; + + while (i < length) { + if (!isWordChar(key[i])) { + return false; + } + + i++; + } + + return true; + } // export for use in tests + + + JSON5.isWord = isWord; // polyfills + + function isArray(obj) { + if (Array.isArray) { + return Array.isArray(obj); + } else { + return Object.prototype.toString.call(obj) === '[object Array]'; + } + } + + function isDate(obj) { + return Object.prototype.toString.call(obj) === '[object Date]'; + } + + var objStack = []; + + function checkForCircular(obj) { + for (var i = 0; i < objStack.length; i++) { + if (objStack[i] === obj) { + throw new TypeError("Converting circular structure to JSON"); + } + } + } + + function makeIndent(str, num, noNewLine) { + if (!str) { + return ""; + } // indentation no more than 10 chars + + + if (str.length > 10) { + str = str.substring(0, 10); + } + + var indent = noNewLine ? "" : "\n"; + + for (var i = 0; i < num; i++) { + indent += str; + } + + return indent; + } + + var indentStr; + + if (space) { + if (typeof space === "string") { + indentStr = space; + } else if (typeof space === "number" && space >= 0) { + indentStr = makeIndent(" ", space, true); + } else {// ignore space parameter + } + } // Copied from Crokford's implementation of JSON + // See https://github.com/douglascrockford/JSON-js/blob/e39db4b7e6249f04a195e7dd0840e610cc9e941e/json2.js#L195 + // Begin + + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + meta = { + // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"': '\\"', + '\\': '\\\\' + }; + + function escapeString(string) { + // If the string contains no control characters, no quote characters, and no + // backslash characters, then we can safely slap some quotes around it. + // Otherwise we must also replace the offending characters with safe escape + // sequences. + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; + } // End + + + function internalStringify(holder, key, isTopLevel) { + var buffer, res; // Replace the value, if necessary + + var obj_part = getReplacedValueOrUndefined(holder, key, isTopLevel); + + if (obj_part && !isDate(obj_part)) { + // unbox objects + // don't unbox dates, since will turn it into number + obj_part = obj_part.valueOf(); + } + + switch (typeof obj_part) { + case "boolean": + return obj_part.toString(); + + case "number": + if (isNaN(obj_part) || !isFinite(obj_part)) { + return "null"; + } + + return obj_part.toString(); + + case "string": + return escapeString(obj_part.toString()); + + case "object": + if (obj_part === null) { + return "null"; + } else if (isArray(obj_part)) { + checkForCircular(obj_part); + buffer = "["; + objStack.push(obj_part); + + for (var i = 0; i < obj_part.length; i++) { + res = internalStringify(obj_part, i, false); + buffer += makeIndent(indentStr, objStack.length); + + if (res === null || typeof res === "undefined") { + buffer += "null"; + } else { + buffer += res; + } + + if (i < obj_part.length - 1) { + buffer += ","; + } else if (indentStr) { + buffer += "\n"; + } + } + + objStack.pop(); + + if (obj_part.length) { + buffer += makeIndent(indentStr, objStack.length, true); + } + + buffer += "]"; + } else { + checkForCircular(obj_part); + buffer = "{"; + var nonEmpty = false; + objStack.push(obj_part); + + for (var prop in obj_part) { + if (obj_part.hasOwnProperty(prop)) { + var value = internalStringify(obj_part, prop, false); + isTopLevel = false; + + if (typeof value !== "undefined" && value !== null) { + buffer += makeIndent(indentStr, objStack.length); + nonEmpty = true; + key = isWord(prop) ? prop : escapeString(prop); + buffer += key + ":" + (indentStr ? ' ' : '') + value + ","; + } + } + } + + objStack.pop(); + + if (nonEmpty) { + buffer = buffer.substring(0, buffer.length - 1) + makeIndent(indentStr, objStack.length) + "}"; + } else { + buffer = '{}'; + } + } + + return buffer; + + default: + // functions and undefined should be ignored + return undefined; + } + } // special case...when undefined is used inside of + // a compound object/array, return null. + // but when top-level, return undefined + + + var topLevelHolder = { + "": obj + }; + + if (obj === undefined) { + return getReplacedValueOrUndefined(topLevelHolder, '', true); + } + + return internalStringify(topLevelHolder, '', true); +}; + +/***/ }), + +/***/ "./node_modules/babel-core/node_modules/ms/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/babel-core/node_modules/ms/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Helpers. + */ +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + + throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); +}; +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + +function parse(str) { + str = String(str); + + if (str.length > 100) { + return; + } + + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); + + if (!match) { + return; + } + + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + + case 'days': + case 'day': + case 'd': + return n * d; + + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + + default: + return undefined; + } +} +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; + } + + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + + return ms + 'ms'; +} +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtLong(ms) { + return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; +} +/** + * Pluralization helper. + */ + + +function plural(ms, n, name) { + if (ms < n) { + return; + } + + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + + return Math.ceil(ms / n) + ' ' + name + 's'; +} + +/***/ }), + +/***/ "./node_modules/babel-core/package.json": +/*!**********************************************!*\ + !*** ./node_modules/babel-core/package.json ***! + \**********************************************/ +/*! exports provided: _args, _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _spec, _where, author, dependencies, description, devDependencies, homepage, keywords, license, name, repository, scripts, version, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"_args\":[[\"babel-core@6.26.3\",\"/mnt/c/users/andro/Desktop/cs5152/pyret-lang/ide\"]],\"_from\":\"babel-core@6.26.3\",\"_id\":\"babel-core@6.26.3\",\"_inBundle\":false,\"_integrity\":\"sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==\",\"_location\":\"/babel-core\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"babel-core@6.26.3\",\"name\":\"babel-core\",\"escapedName\":\"babel-core\",\"rawSpec\":\"6.26.3\",\"saveSpec\":null,\"fetchSpec\":\"6.26.3\"},\"_requiredBy\":[\"/@stopify/continuations\",\"/@stopify/hygiene\",\"/@stopify/normalize-js\",\"/@stopify/stopify\",\"/@stopify/util\",\"/babel-register\"],\"_resolved\":\"https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz\",\"_spec\":\"6.26.3\",\"_where\":\"/mnt/c/users/andro/Desktop/cs5152/pyret-lang/ide\",\"author\":{\"name\":\"Sebastian McKenzie\",\"email\":\"sebmck@gmail.com\"},\"dependencies\":{\"babel-code-frame\":\"^6.26.0\",\"babel-generator\":\"^6.26.0\",\"babel-helpers\":\"^6.24.1\",\"babel-messages\":\"^6.23.0\",\"babel-register\":\"^6.26.0\",\"babel-runtime\":\"^6.26.0\",\"babel-template\":\"^6.26.0\",\"babel-traverse\":\"^6.26.0\",\"babel-types\":\"^6.26.0\",\"babylon\":\"^6.18.0\",\"convert-source-map\":\"^1.5.1\",\"debug\":\"^2.6.9\",\"json5\":\"^0.5.1\",\"lodash\":\"^4.17.4\",\"minimatch\":\"^3.0.4\",\"path-is-absolute\":\"^1.0.1\",\"private\":\"^0.1.8\",\"slash\":\"^1.0.0\",\"source-map\":\"^0.5.7\"},\"description\":\"Babel compiler core.\",\"devDependencies\":{\"babel-helper-fixtures\":\"^6.26.2\",\"babel-helper-transform-fixture-test-runner\":\"^6.26.2\",\"babel-polyfill\":\"^6.26.0\"},\"homepage\":\"https://babeljs.io/\",\"keywords\":[\"6to5\",\"babel\",\"classes\",\"const\",\"es6\",\"harmony\",\"let\",\"modules\",\"transpile\",\"transpiler\",\"var\",\"babel-core\",\"compiler\"],\"license\":\"MIT\",\"name\":\"babel-core\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/babel/babel/tree/master/packages/babel-core\"},\"scripts\":{\"bench\":\"make bench\",\"test\":\"make test\"},\"version\":\"6.26.3\"}"); + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/buffer.js": +/*!****************************************************!*\ + !*** ./node_modules/babel-generator/lib/buffer.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _trimRight = __webpack_require__(/*! trim-right */ "./node_modules/trim-right/index.js"); + +var _trimRight2 = _interopRequireDefault(_trimRight); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var SPACES_RE = /^[ \t]+$/; + +var Buffer = function () { + function Buffer(map) { + (0, _classCallCheck3.default)(this, Buffer); + this._map = null; + this._buf = []; + this._last = ""; + this._queue = []; + this._position = { + line: 1, + column: 0 + }; + this._sourcePosition = { + identifierName: null, + line: null, + column: null, + filename: null + }; + this._map = map; + } + + Buffer.prototype.get = function get() { + this._flush(); + + var map = this._map; + var result = { + code: (0, _trimRight2.default)(this._buf.join("")), + map: null, + rawMappings: map && map.getRawMappings() + }; + + if (map) { + Object.defineProperty(result, "map", { + configurable: true, + enumerable: true, + get: function get() { + return this.map = map.get(); + }, + set: function set(value) { + Object.defineProperty(this, "map", { + value: value, + writable: true + }); + } + }); + } + + return result; + }; + + Buffer.prototype.append = function append(str) { + this._flush(); + + var _sourcePosition = this._sourcePosition, + line = _sourcePosition.line, + column = _sourcePosition.column, + filename = _sourcePosition.filename, + identifierName = _sourcePosition.identifierName; + + this._append(str, line, column, identifierName, filename); + }; + + Buffer.prototype.queue = function queue(str) { + if (str === "\n") while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) { + this._queue.shift(); + } + var _sourcePosition2 = this._sourcePosition, + line = _sourcePosition2.line, + column = _sourcePosition2.column, + filename = _sourcePosition2.filename, + identifierName = _sourcePosition2.identifierName; + + this._queue.unshift([str, line, column, identifierName, filename]); + }; + + Buffer.prototype._flush = function _flush() { + var item = void 0; + + while (item = this._queue.pop()) { + this._append.apply(this, item); + } + }; + + Buffer.prototype._append = function _append(str, line, column, identifierName, filename) { + if (this._map && str[0] !== "\n") { + this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename); + } + + this._buf.push(str); + + this._last = str[str.length - 1]; + + for (var i = 0; i < str.length; i++) { + if (str[i] === "\n") { + this._position.line++; + this._position.column = 0; + } else { + this._position.column++; + } + } + }; + + Buffer.prototype.removeTrailingNewline = function removeTrailingNewline() { + if (this._queue.length > 0 && this._queue[0][0] === "\n") this._queue.shift(); + }; + + Buffer.prototype.removeLastSemicolon = function removeLastSemicolon() { + if (this._queue.length > 0 && this._queue[0][0] === ";") this._queue.shift(); + }; + + Buffer.prototype.endsWith = function endsWith(suffix) { + if (suffix.length === 1) { + var last = void 0; + + if (this._queue.length > 0) { + var str = this._queue[0][0]; + last = str[str.length - 1]; + } else { + last = this._last; + } + + return last === suffix; + } + + var end = this._last + this._queue.reduce(function (acc, item) { + return item[0] + acc; + }, ""); + + if (suffix.length <= end.length) { + return end.slice(-suffix.length) === suffix; + } + + return false; + }; + + Buffer.prototype.hasContent = function hasContent() { + return this._queue.length > 0 || !!this._last; + }; + + Buffer.prototype.source = function source(prop, loc) { + if (prop && !loc) return; + var pos = loc ? loc[prop] : null; + this._sourcePosition.identifierName = loc && loc.identifierName || null; + this._sourcePosition.line = pos ? pos.line : null; + this._sourcePosition.column = pos ? pos.column : null; + this._sourcePosition.filename = loc && loc.filename || null; + }; + + Buffer.prototype.withSource = function withSource(prop, loc, cb) { + if (!this._map) return cb(); + var originalLine = this._sourcePosition.line; + var originalColumn = this._sourcePosition.column; + var originalFilename = this._sourcePosition.filename; + var originalIdentifierName = this._sourcePosition.identifierName; + this.source(prop, loc); + cb(); + this._sourcePosition.line = originalLine; + this._sourcePosition.column = originalColumn; + this._sourcePosition.filename = originalFilename; + this._sourcePosition.identifierName = originalIdentifierName; + }; + + Buffer.prototype.getCurrentColumn = function getCurrentColumn() { + var extra = this._queue.reduce(function (acc, item) { + return item[0] + acc; + }, ""); + + var lastIndex = extra.lastIndexOf("\n"); + return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex; + }; + + Buffer.prototype.getCurrentLine = function getCurrentLine() { + var extra = this._queue.reduce(function (acc, item) { + return item[0] + acc; + }, ""); + + var count = 0; + + for (var i = 0; i < extra.length; i++) { + if (extra[i] === "\n") count++; + } + + return this._position.line + count; + }; + + return Buffer; +}(); + +exports.default = Buffer; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/generators/base.js": +/*!*************************************************************!*\ + !*** ./node_modules/babel-generator/lib/generators/base.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.File = File; +exports.Program = Program; +exports.BlockStatement = BlockStatement; +exports.Noop = Noop; +exports.Directive = Directive; + +var _types = __webpack_require__(/*! ./types */ "./node_modules/babel-generator/lib/generators/types.js"); + +Object.defineProperty(exports, "DirectiveLiteral", { + enumerable: true, + get: function get() { + return _types.StringLiteral; + } +}); + +function File(node) { + this.print(node.program, node); +} + +function Program(node) { + this.printInnerComments(node, false); + this.printSequence(node.directives, node); + if (node.directives && node.directives.length) this.newline(); + this.printSequence(node.body, node); +} + +function BlockStatement(node) { + this.token("{"); + this.printInnerComments(node); + var hasDirectives = node.directives && node.directives.length; + + if (node.body.length || hasDirectives) { + this.newline(); + this.printSequence(node.directives, node, { + indent: true + }); + if (hasDirectives) this.newline(); + this.printSequence(node.body, node, { + indent: true + }); + this.removeTrailingNewline(); + this.source("end", node.loc); + if (!this.endsWith("\n")) this.newline(); + this.rightBrace(); + } else { + this.source("end", node.loc); + this.token("}"); + } +} + +function Noop() {} + +function Directive(node) { + this.print(node.value, node); + this.semicolon(); +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/generators/classes.js": +/*!****************************************************************!*\ + !*** ./node_modules/babel-generator/lib/generators/classes.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.ClassDeclaration = ClassDeclaration; +exports.ClassBody = ClassBody; +exports.ClassProperty = ClassProperty; +exports.ClassMethod = ClassMethod; + +function ClassDeclaration(node) { + this.printJoin(node.decorators, node); + this.word("class"); + + if (node.id) { + this.space(); + this.print(node.id, node); + } + + this.print(node.typeParameters, node); + + if (node.superClass) { + this.space(); + this.word("extends"); + this.space(); + this.print(node.superClass, node); + this.print(node.superTypeParameters, node); + } + + if (node.implements) { + this.space(); + this.word("implements"); + this.space(); + this.printList(node.implements, node); + } + + this.space(); + this.print(node.body, node); +} + +exports.ClassExpression = ClassDeclaration; + +function ClassBody(node) { + this.token("{"); + this.printInnerComments(node); + + if (node.body.length === 0) { + this.token("}"); + } else { + this.newline(); + this.indent(); + this.printSequence(node.body, node); + this.dedent(); + if (!this.endsWith("\n")) this.newline(); + this.rightBrace(); + } +} + +function ClassProperty(node) { + this.printJoin(node.decorators, node); + + if (node.static) { + this.word("static"); + this.space(); + } + + if (node.computed) { + this.token("["); + this.print(node.key, node); + this.token("]"); + } else { + this._variance(node); + + this.print(node.key, node); + } + + this.print(node.typeAnnotation, node); + + if (node.value) { + this.space(); + this.token("="); + this.space(); + this.print(node.value, node); + } + + this.semicolon(); +} + +function ClassMethod(node) { + this.printJoin(node.decorators, node); + + if (node.static) { + this.word("static"); + this.space(); + } + + if (node.kind === "constructorCall") { + this.word("call"); + this.space(); + } + + this._method(node); +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/generators/expressions.js": +/*!********************************************************************!*\ + !*** ./node_modules/babel-generator/lib/generators/expressions.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.LogicalExpression = exports.BinaryExpression = exports.AwaitExpression = exports.YieldExpression = undefined; +exports.UnaryExpression = UnaryExpression; +exports.DoExpression = DoExpression; +exports.ParenthesizedExpression = ParenthesizedExpression; +exports.UpdateExpression = UpdateExpression; +exports.ConditionalExpression = ConditionalExpression; +exports.NewExpression = NewExpression; +exports.SequenceExpression = SequenceExpression; +exports.ThisExpression = ThisExpression; +exports.Super = Super; +exports.Decorator = Decorator; +exports.CallExpression = CallExpression; +exports.Import = Import; +exports.EmptyStatement = EmptyStatement; +exports.ExpressionStatement = ExpressionStatement; +exports.AssignmentPattern = AssignmentPattern; +exports.AssignmentExpression = AssignmentExpression; +exports.BindExpression = BindExpression; +exports.MemberExpression = MemberExpression; +exports.MetaProperty = MetaProperty; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +var _node = __webpack_require__(/*! ../node */ "./node_modules/babel-generator/lib/node/index.js"); + +var n = _interopRequireWildcard(_node); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function UnaryExpression(node) { + if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof") { + this.word(node.operator); + this.space(); + } else { + this.token(node.operator); + } + + this.print(node.argument, node); +} + +function DoExpression(node) { + this.word("do"); + this.space(); + this.print(node.body, node); +} + +function ParenthesizedExpression(node) { + this.token("("); + this.print(node.expression, node); + this.token(")"); +} + +function UpdateExpression(node) { + if (node.prefix) { + this.token(node.operator); + this.print(node.argument, node); + } else { + this.print(node.argument, node); + this.token(node.operator); + } +} + +function ConditionalExpression(node) { + this.print(node.test, node); + this.space(); + this.token("?"); + this.space(); + this.print(node.consequent, node); + this.space(); + this.token(":"); + this.space(); + this.print(node.alternate, node); +} + +function NewExpression(node, parent) { + this.word("new"); + this.space(); + this.print(node.callee, node); + if (node.arguments.length === 0 && this.format.minified && !t.isCallExpression(parent, { + callee: node + }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) return; + this.token("("); + this.printList(node.arguments, node); + this.token(")"); +} + +function SequenceExpression(node) { + this.printList(node.expressions, node); +} + +function ThisExpression() { + this.word("this"); +} + +function Super() { + this.word("super"); +} + +function Decorator(node) { + this.token("@"); + this.print(node.expression, node); + this.newline(); +} + +function commaSeparatorNewline() { + this.token(","); + this.newline(); + if (!this.endsWith("\n")) this.space(); +} + +function CallExpression(node) { + this.print(node.callee, node); + this.token("("); + var isPrettyCall = node._prettyCall; + var separator = void 0; + + if (isPrettyCall) { + separator = commaSeparatorNewline; + this.newline(); + this.indent(); + } + + this.printList(node.arguments, node, { + separator: separator + }); + + if (isPrettyCall) { + this.newline(); + this.dedent(); + } + + this.token(")"); +} + +function Import() { + this.word("import"); +} + +function buildYieldAwait(keyword) { + return function (node) { + this.word(keyword); + + if (node.delegate) { + this.token("*"); + } + + if (node.argument) { + this.space(); + var terminatorState = this.startTerminatorless(); + this.print(node.argument, node); + this.endTerminatorless(terminatorState); + } + }; +} + +var YieldExpression = exports.YieldExpression = buildYieldAwait("yield"); +var AwaitExpression = exports.AwaitExpression = buildYieldAwait("await"); + +function EmptyStatement() { + this.semicolon(true); +} + +function ExpressionStatement(node) { + this.print(node.expression, node); + this.semicolon(); +} + +function AssignmentPattern(node) { + this.print(node.left, node); + if (node.left.optional) this.token("?"); + this.print(node.left.typeAnnotation, node); + this.space(); + this.token("="); + this.space(); + this.print(node.right, node); +} + +function AssignmentExpression(node, parent) { + var parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent); + + if (parens) { + this.token("("); + } + + this.print(node.left, node); + this.space(); + + if (node.operator === "in" || node.operator === "instanceof") { + this.word(node.operator); + } else { + this.token(node.operator); + } + + this.space(); + this.print(node.right, node); + + if (parens) { + this.token(")"); + } +} + +function BindExpression(node) { + this.print(node.object, node); + this.token("::"); + this.print(node.callee, node); +} + +exports.BinaryExpression = AssignmentExpression; +exports.LogicalExpression = AssignmentExpression; + +function MemberExpression(node) { + this.print(node.object, node); + + if (!node.computed && t.isMemberExpression(node.property)) { + throw new TypeError("Got a MemberExpression for MemberExpression property"); + } + + var computed = node.computed; + + if (t.isLiteral(node.property) && typeof node.property.value === "number") { + computed = true; + } + + if (computed) { + this.token("["); + this.print(node.property, node); + this.token("]"); + } else { + this.token("."); + this.print(node.property, node); + } +} + +function MetaProperty(node) { + this.print(node.meta, node); + this.token("."); + this.print(node.property, node); +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/generators/flow.js": +/*!*************************************************************!*\ + !*** ./node_modules/babel-generator/lib/generators/flow.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.TypeParameterDeclaration = exports.StringLiteralTypeAnnotation = exports.NumericLiteralTypeAnnotation = exports.GenericTypeAnnotation = exports.ClassImplements = undefined; +exports.AnyTypeAnnotation = AnyTypeAnnotation; +exports.ArrayTypeAnnotation = ArrayTypeAnnotation; +exports.BooleanTypeAnnotation = BooleanTypeAnnotation; +exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation; +exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation; +exports.DeclareClass = DeclareClass; +exports.DeclareFunction = DeclareFunction; +exports.DeclareInterface = DeclareInterface; +exports.DeclareModule = DeclareModule; +exports.DeclareModuleExports = DeclareModuleExports; +exports.DeclareTypeAlias = DeclareTypeAlias; +exports.DeclareOpaqueType = DeclareOpaqueType; +exports.DeclareVariable = DeclareVariable; +exports.DeclareExportDeclaration = DeclareExportDeclaration; +exports.ExistentialTypeParam = ExistentialTypeParam; +exports.FunctionTypeAnnotation = FunctionTypeAnnotation; +exports.FunctionTypeParam = FunctionTypeParam; +exports.InterfaceExtends = InterfaceExtends; +exports._interfaceish = _interfaceish; +exports._variance = _variance; +exports.InterfaceDeclaration = InterfaceDeclaration; +exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation; +exports.MixedTypeAnnotation = MixedTypeAnnotation; +exports.EmptyTypeAnnotation = EmptyTypeAnnotation; +exports.NullableTypeAnnotation = NullableTypeAnnotation; + +var _types = __webpack_require__(/*! ./types */ "./node_modules/babel-generator/lib/generators/types.js"); + +Object.defineProperty(exports, "NumericLiteralTypeAnnotation", { + enumerable: true, + get: function get() { + return _types.NumericLiteral; + } +}); +Object.defineProperty(exports, "StringLiteralTypeAnnotation", { + enumerable: true, + get: function get() { + return _types.StringLiteral; + } +}); +exports.NumberTypeAnnotation = NumberTypeAnnotation; +exports.StringTypeAnnotation = StringTypeAnnotation; +exports.ThisTypeAnnotation = ThisTypeAnnotation; +exports.TupleTypeAnnotation = TupleTypeAnnotation; +exports.TypeofTypeAnnotation = TypeofTypeAnnotation; +exports.TypeAlias = TypeAlias; +exports.OpaqueType = OpaqueType; +exports.TypeAnnotation = TypeAnnotation; +exports.TypeParameter = TypeParameter; +exports.TypeParameterInstantiation = TypeParameterInstantiation; +exports.ObjectTypeAnnotation = ObjectTypeAnnotation; +exports.ObjectTypeCallProperty = ObjectTypeCallProperty; +exports.ObjectTypeIndexer = ObjectTypeIndexer; +exports.ObjectTypeProperty = ObjectTypeProperty; +exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty; +exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier; +exports.UnionTypeAnnotation = UnionTypeAnnotation; +exports.TypeCastExpression = TypeCastExpression; +exports.VoidTypeAnnotation = VoidTypeAnnotation; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function AnyTypeAnnotation() { + this.word("any"); +} + +function ArrayTypeAnnotation(node) { + this.print(node.elementType, node); + this.token("["); + this.token("]"); +} + +function BooleanTypeAnnotation() { + this.word("boolean"); +} + +function BooleanLiteralTypeAnnotation(node) { + this.word(node.value ? "true" : "false"); +} + +function NullLiteralTypeAnnotation() { + this.word("null"); +} + +function DeclareClass(node, parent) { + if (!t.isDeclareExportDeclaration(parent)) { + this.word("declare"); + this.space(); + } + + this.word("class"); + this.space(); + + this._interfaceish(node); +} + +function DeclareFunction(node, parent) { + if (!t.isDeclareExportDeclaration(parent)) { + this.word("declare"); + this.space(); + } + + this.word("function"); + this.space(); + this.print(node.id, node); + this.print(node.id.typeAnnotation.typeAnnotation, node); + this.semicolon(); +} + +function DeclareInterface(node) { + this.word("declare"); + this.space(); + this.InterfaceDeclaration(node); +} + +function DeclareModule(node) { + this.word("declare"); + this.space(); + this.word("module"); + this.space(); + this.print(node.id, node); + this.space(); + this.print(node.body, node); +} + +function DeclareModuleExports(node) { + this.word("declare"); + this.space(); + this.word("module"); + this.token("."); + this.word("exports"); + this.print(node.typeAnnotation, node); +} + +function DeclareTypeAlias(node) { + this.word("declare"); + this.space(); + this.TypeAlias(node); +} + +function DeclareOpaqueType(node, parent) { + if (!t.isDeclareExportDeclaration(parent)) { + this.word("declare"); + this.space(); + } + + this.OpaqueType(node); +} + +function DeclareVariable(node, parent) { + if (!t.isDeclareExportDeclaration(parent)) { + this.word("declare"); + this.space(); + } + + this.word("var"); + this.space(); + this.print(node.id, node); + this.print(node.id.typeAnnotation, node); + this.semicolon(); +} + +function DeclareExportDeclaration(node) { + this.word("declare"); + this.space(); + this.word("export"); + this.space(); + + if (node.default) { + this.word("default"); + this.space(); + } + + FlowExportDeclaration.apply(this, arguments); +} + +function FlowExportDeclaration(node) { + if (node.declaration) { + var declar = node.declaration; + this.print(declar, node); + if (!t.isStatement(declar)) this.semicolon(); + } else { + this.token("{"); + + if (node.specifiers.length) { + this.space(); + this.printList(node.specifiers, node); + this.space(); + } + + this.token("}"); + + if (node.source) { + this.space(); + this.word("from"); + this.space(); + this.print(node.source, node); + } + + this.semicolon(); + } +} + +function ExistentialTypeParam() { + this.token("*"); +} + +function FunctionTypeAnnotation(node, parent) { + this.print(node.typeParameters, node); + this.token("("); + this.printList(node.params, node); + + if (node.rest) { + if (node.params.length) { + this.token(","); + this.space(); + } + + this.token("..."); + this.print(node.rest, node); + } + + this.token(")"); + + if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction") { + this.token(":"); + } else { + this.space(); + this.token("=>"); + } + + this.space(); + this.print(node.returnType, node); +} + +function FunctionTypeParam(node) { + this.print(node.name, node); + if (node.optional) this.token("?"); + this.token(":"); + this.space(); + this.print(node.typeAnnotation, node); +} + +function InterfaceExtends(node) { + this.print(node.id, node); + this.print(node.typeParameters, node); +} + +exports.ClassImplements = InterfaceExtends; +exports.GenericTypeAnnotation = InterfaceExtends; + +function _interfaceish(node) { + this.print(node.id, node); + this.print(node.typeParameters, node); + + if (node.extends.length) { + this.space(); + this.word("extends"); + this.space(); + this.printList(node.extends, node); + } + + if (node.mixins && node.mixins.length) { + this.space(); + this.word("mixins"); + this.space(); + this.printList(node.mixins, node); + } + + this.space(); + this.print(node.body, node); +} + +function _variance(node) { + if (node.variance === "plus") { + this.token("+"); + } else if (node.variance === "minus") { + this.token("-"); + } +} + +function InterfaceDeclaration(node) { + this.word("interface"); + this.space(); + + this._interfaceish(node); +} + +function andSeparator() { + this.space(); + this.token("&"); + this.space(); +} + +function IntersectionTypeAnnotation(node) { + this.printJoin(node.types, node, { + separator: andSeparator + }); +} + +function MixedTypeAnnotation() { + this.word("mixed"); +} + +function EmptyTypeAnnotation() { + this.word("empty"); +} + +function NullableTypeAnnotation(node) { + this.token("?"); + this.print(node.typeAnnotation, node); +} + +function NumberTypeAnnotation() { + this.word("number"); +} + +function StringTypeAnnotation() { + this.word("string"); +} + +function ThisTypeAnnotation() { + this.word("this"); +} + +function TupleTypeAnnotation(node) { + this.token("["); + this.printList(node.types, node); + this.token("]"); +} + +function TypeofTypeAnnotation(node) { + this.word("typeof"); + this.space(); + this.print(node.argument, node); +} + +function TypeAlias(node) { + this.word("type"); + this.space(); + this.print(node.id, node); + this.print(node.typeParameters, node); + this.space(); + this.token("="); + this.space(); + this.print(node.right, node); + this.semicolon(); +} + +function OpaqueType(node) { + this.word("opaque"); + this.space(); + this.word("type"); + this.space(); + this.print(node.id, node); + this.print(node.typeParameters, node); + + if (node.supertype) { + this.token(":"); + this.space(); + this.print(node.supertype, node); + } + + if (node.impltype) { + this.space(); + this.token("="); + this.space(); + this.print(node.impltype, node); + } + + this.semicolon(); +} + +function TypeAnnotation(node) { + this.token(":"); + this.space(); + if (node.optional) this.token("?"); + this.print(node.typeAnnotation, node); +} + +function TypeParameter(node) { + this._variance(node); + + this.word(node.name); + + if (node.bound) { + this.print(node.bound, node); + } + + if (node.default) { + this.space(); + this.token("="); + this.space(); + this.print(node.default, node); + } +} + +function TypeParameterInstantiation(node) { + this.token("<"); + this.printList(node.params, node, {}); + this.token(">"); +} + +exports.TypeParameterDeclaration = TypeParameterInstantiation; + +function ObjectTypeAnnotation(node) { + var _this = this; + + if (node.exact) { + this.token("{|"); + } else { + this.token("{"); + } + + var props = node.properties.concat(node.callProperties, node.indexers); + + if (props.length) { + this.space(); + this.printJoin(props, node, { + addNewlines: function addNewlines(leading) { + if (leading && !props[0]) return 1; + }, + indent: true, + statement: true, + iterator: function iterator() { + if (props.length !== 1) { + if (_this.format.flowCommaSeparator) { + _this.token(","); + } else { + _this.semicolon(); + } + + _this.space(); + } + } + }); + this.space(); + } + + if (node.exact) { + this.token("|}"); + } else { + this.token("}"); + } +} + +function ObjectTypeCallProperty(node) { + if (node.static) { + this.word("static"); + this.space(); + } + + this.print(node.value, node); +} + +function ObjectTypeIndexer(node) { + if (node.static) { + this.word("static"); + this.space(); + } + + this._variance(node); + + this.token("["); + this.print(node.id, node); + this.token(":"); + this.space(); + this.print(node.key, node); + this.token("]"); + this.token(":"); + this.space(); + this.print(node.value, node); +} + +function ObjectTypeProperty(node) { + if (node.static) { + this.word("static"); + this.space(); + } + + this._variance(node); + + this.print(node.key, node); + if (node.optional) this.token("?"); + this.token(":"); + this.space(); + this.print(node.value, node); +} + +function ObjectTypeSpreadProperty(node) { + this.token("..."); + this.print(node.argument, node); +} + +function QualifiedTypeIdentifier(node) { + this.print(node.qualification, node); + this.token("."); + this.print(node.id, node); +} + +function orSeparator() { + this.space(); + this.token("|"); + this.space(); +} + +function UnionTypeAnnotation(node) { + this.printJoin(node.types, node, { + separator: orSeparator + }); +} + +function TypeCastExpression(node) { + this.token("("); + this.print(node.expression, node); + this.print(node.typeAnnotation, node); + this.token(")"); +} + +function VoidTypeAnnotation() { + this.word("void"); +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/generators/jsx.js": +/*!************************************************************!*\ + !*** ./node_modules/babel-generator/lib/generators/jsx.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.JSXAttribute = JSXAttribute; +exports.JSXIdentifier = JSXIdentifier; +exports.JSXNamespacedName = JSXNamespacedName; +exports.JSXMemberExpression = JSXMemberExpression; +exports.JSXSpreadAttribute = JSXSpreadAttribute; +exports.JSXExpressionContainer = JSXExpressionContainer; +exports.JSXSpreadChild = JSXSpreadChild; +exports.JSXText = JSXText; +exports.JSXElement = JSXElement; +exports.JSXOpeningElement = JSXOpeningElement; +exports.JSXClosingElement = JSXClosingElement; +exports.JSXEmptyExpression = JSXEmptyExpression; + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function JSXAttribute(node) { + this.print(node.name, node); + + if (node.value) { + this.token("="); + this.print(node.value, node); + } +} + +function JSXIdentifier(node) { + this.word(node.name); +} + +function JSXNamespacedName(node) { + this.print(node.namespace, node); + this.token(":"); + this.print(node.name, node); +} + +function JSXMemberExpression(node) { + this.print(node.object, node); + this.token("."); + this.print(node.property, node); +} + +function JSXSpreadAttribute(node) { + this.token("{"); + this.token("..."); + this.print(node.argument, node); + this.token("}"); +} + +function JSXExpressionContainer(node) { + this.token("{"); + this.print(node.expression, node); + this.token("}"); +} + +function JSXSpreadChild(node) { + this.token("{"); + this.token("..."); + this.print(node.expression, node); + this.token("}"); +} + +function JSXText(node) { + this.token(node.value); +} + +function JSXElement(node) { + var open = node.openingElement; + this.print(open, node); + if (open.selfClosing) return; + this.indent(); + + for (var _iterator = node.children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var child = _ref; + this.print(child, node); + } + + this.dedent(); + this.print(node.closingElement, node); +} + +function spaceSeparator() { + this.space(); +} + +function JSXOpeningElement(node) { + this.token("<"); + this.print(node.name, node); + + if (node.attributes.length > 0) { + this.space(); + this.printJoin(node.attributes, node, { + separator: spaceSeparator + }); + } + + if (node.selfClosing) { + this.space(); + this.token("/>"); + } else { + this.token(">"); + } +} + +function JSXClosingElement(node) { + this.token(""); +} + +function JSXEmptyExpression() {} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/generators/methods.js": +/*!****************************************************************!*\ + !*** ./node_modules/babel-generator/lib/generators/methods.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.FunctionDeclaration = undefined; +exports._params = _params; +exports._method = _method; +exports.FunctionExpression = FunctionExpression; +exports.ArrowFunctionExpression = ArrowFunctionExpression; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _params(node) { + var _this = this; + + this.print(node.typeParameters, node); + this.token("("); + this.printList(node.params, node, { + iterator: function iterator(node) { + if (node.optional) _this.token("?"); + + _this.print(node.typeAnnotation, node); + } + }); + this.token(")"); + + if (node.returnType) { + this.print(node.returnType, node); + } +} + +function _method(node) { + var kind = node.kind; + var key = node.key; + + if (kind === "method" || kind === "init") { + if (node.generator) { + this.token("*"); + } + } + + if (kind === "get" || kind === "set") { + this.word(kind); + this.space(); + } + + if (node.async) { + this.word("async"); + this.space(); + } + + if (node.computed) { + this.token("["); + this.print(key, node); + this.token("]"); + } else { + this.print(key, node); + } + + this._params(node); + + this.space(); + this.print(node.body, node); +} + +function FunctionExpression(node) { + if (node.async) { + this.word("async"); + this.space(); + } + + this.word("function"); + if (node.generator) this.token("*"); + + if (node.id) { + this.space(); + this.print(node.id, node); + } else { + this.space(); + } + + this._params(node); + + this.space(); + this.print(node.body, node); +} + +exports.FunctionDeclaration = FunctionExpression; + +function ArrowFunctionExpression(node) { + if (node.async) { + this.word("async"); + this.space(); + } + + var firstParam = node.params[0]; + + if (node.params.length === 1 && t.isIdentifier(firstParam) && !hasTypes(node, firstParam)) { + this.print(firstParam, node); + } else { + this._params(node); + } + + this.space(); + this.token("=>"); + this.space(); + this.print(node.body, node); +} + +function hasTypes(node, param) { + return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments; +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/generators/modules.js": +/*!****************************************************************!*\ + !*** ./node_modules/babel-generator/lib/generators/modules.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.ImportSpecifier = ImportSpecifier; +exports.ImportDefaultSpecifier = ImportDefaultSpecifier; +exports.ExportDefaultSpecifier = ExportDefaultSpecifier; +exports.ExportSpecifier = ExportSpecifier; +exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier; +exports.ExportAllDeclaration = ExportAllDeclaration; +exports.ExportNamedDeclaration = ExportNamedDeclaration; +exports.ExportDefaultDeclaration = ExportDefaultDeclaration; +exports.ImportDeclaration = ImportDeclaration; +exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function ImportSpecifier(node) { + if (node.importKind === "type" || node.importKind === "typeof") { + this.word(node.importKind); + this.space(); + } + + this.print(node.imported, node); + + if (node.local && node.local.name !== node.imported.name) { + this.space(); + this.word("as"); + this.space(); + this.print(node.local, node); + } +} + +function ImportDefaultSpecifier(node) { + this.print(node.local, node); +} + +function ExportDefaultSpecifier(node) { + this.print(node.exported, node); +} + +function ExportSpecifier(node) { + this.print(node.local, node); + + if (node.exported && node.local.name !== node.exported.name) { + this.space(); + this.word("as"); + this.space(); + this.print(node.exported, node); + } +} + +function ExportNamespaceSpecifier(node) { + this.token("*"); + this.space(); + this.word("as"); + this.space(); + this.print(node.exported, node); +} + +function ExportAllDeclaration(node) { + this.word("export"); + this.space(); + this.token("*"); + this.space(); + this.word("from"); + this.space(); + this.print(node.source, node); + this.semicolon(); +} + +function ExportNamedDeclaration() { + this.word("export"); + this.space(); + ExportDeclaration.apply(this, arguments); +} + +function ExportDefaultDeclaration() { + this.word("export"); + this.space(); + this.word("default"); + this.space(); + ExportDeclaration.apply(this, arguments); +} + +function ExportDeclaration(node) { + if (node.declaration) { + var declar = node.declaration; + this.print(declar, node); + if (!t.isStatement(declar)) this.semicolon(); + } else { + if (node.exportKind === "type") { + this.word("type"); + this.space(); + } + + var specifiers = node.specifiers.slice(0); + var hasSpecial = false; + + while (true) { + var first = specifiers[0]; + + if (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) { + hasSpecial = true; + this.print(specifiers.shift(), node); + + if (specifiers.length) { + this.token(","); + this.space(); + } + } else { + break; + } + } + + if (specifiers.length || !specifiers.length && !hasSpecial) { + this.token("{"); + + if (specifiers.length) { + this.space(); + this.printList(specifiers, node); + this.space(); + } + + this.token("}"); + } + + if (node.source) { + this.space(); + this.word("from"); + this.space(); + this.print(node.source, node); + } + + this.semicolon(); + } +} + +function ImportDeclaration(node) { + this.word("import"); + this.space(); + + if (node.importKind === "type" || node.importKind === "typeof") { + this.word(node.importKind); + this.space(); + } + + var specifiers = node.specifiers.slice(0); + + if (specifiers && specifiers.length) { + while (true) { + var first = specifiers[0]; + + if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) { + this.print(specifiers.shift(), node); + + if (specifiers.length) { + this.token(","); + this.space(); + } + } else { + break; + } + } + + if (specifiers.length) { + this.token("{"); + this.space(); + this.printList(specifiers, node); + this.space(); + this.token("}"); + } + + this.space(); + this.word("from"); + this.space(); + } + + this.print(node.source, node); + this.semicolon(); +} + +function ImportNamespaceSpecifier(node) { + this.token("*"); + this.space(); + this.word("as"); + this.space(); + this.print(node.local, node); +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/generators/statements.js": +/*!*******************************************************************!*\ + !*** ./node_modules/babel-generator/lib/generators/statements.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForAwaitStatement = exports.ForOfStatement = exports.ForInStatement = undefined; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.WithStatement = WithStatement; +exports.IfStatement = IfStatement; +exports.ForStatement = ForStatement; +exports.WhileStatement = WhileStatement; +exports.DoWhileStatement = DoWhileStatement; +exports.LabeledStatement = LabeledStatement; +exports.TryStatement = TryStatement; +exports.CatchClause = CatchClause; +exports.SwitchStatement = SwitchStatement; +exports.SwitchCase = SwitchCase; +exports.DebuggerStatement = DebuggerStatement; +exports.VariableDeclaration = VariableDeclaration; +exports.VariableDeclarator = VariableDeclarator; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function WithStatement(node) { + this.word("with"); + this.space(); + this.token("("); + this.print(node.object, node); + this.token(")"); + this.printBlock(node); +} + +function IfStatement(node) { + this.word("if"); + this.space(); + this.token("("); + this.print(node.test, node); + this.token(")"); + this.space(); + var needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent)); + + if (needsBlock) { + this.token("{"); + this.newline(); + this.indent(); + } + + this.printAndIndentOnComments(node.consequent, node); + + if (needsBlock) { + this.dedent(); + this.newline(); + this.token("}"); + } + + if (node.alternate) { + if (this.endsWith("}")) this.space(); + this.word("else"); + this.space(); + this.printAndIndentOnComments(node.alternate, node); + } +} + +function getLastStatement(statement) { + if (!t.isStatement(statement.body)) return statement; + return getLastStatement(statement.body); +} + +function ForStatement(node) { + this.word("for"); + this.space(); + this.token("("); + this.inForStatementInitCounter++; + this.print(node.init, node); + this.inForStatementInitCounter--; + this.token(";"); + + if (node.test) { + this.space(); + this.print(node.test, node); + } + + this.token(";"); + + if (node.update) { + this.space(); + this.print(node.update, node); + } + + this.token(")"); + this.printBlock(node); +} + +function WhileStatement(node) { + this.word("while"); + this.space(); + this.token("("); + this.print(node.test, node); + this.token(")"); + this.printBlock(node); +} + +var buildForXStatement = function buildForXStatement(op) { + return function (node) { + this.word("for"); + this.space(); + + if (op === "await") { + this.word("await"); + this.space(); + } + + this.token("("); + this.print(node.left, node); + this.space(); + this.word(op === "await" ? "of" : op); + this.space(); + this.print(node.right, node); + this.token(")"); + this.printBlock(node); + }; +}; + +var ForInStatement = exports.ForInStatement = buildForXStatement("in"); +var ForOfStatement = exports.ForOfStatement = buildForXStatement("of"); +var ForAwaitStatement = exports.ForAwaitStatement = buildForXStatement("await"); + +function DoWhileStatement(node) { + this.word("do"); + this.space(); + this.print(node.body, node); + this.space(); + this.word("while"); + this.space(); + this.token("("); + this.print(node.test, node); + this.token(")"); + this.semicolon(); +} + +function buildLabelStatement(prefix) { + var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "label"; + return function (node) { + this.word(prefix); + var label = node[key]; + + if (label) { + this.space(); + var terminatorState = this.startTerminatorless(); + this.print(label, node); + this.endTerminatorless(terminatorState); + } + + this.semicolon(); + }; +} + +var ContinueStatement = exports.ContinueStatement = buildLabelStatement("continue"); +var ReturnStatement = exports.ReturnStatement = buildLabelStatement("return", "argument"); +var BreakStatement = exports.BreakStatement = buildLabelStatement("break"); +var ThrowStatement = exports.ThrowStatement = buildLabelStatement("throw", "argument"); + +function LabeledStatement(node) { + this.print(node.label, node); + this.token(":"); + this.space(); + this.print(node.body, node); +} + +function TryStatement(node) { + this.word("try"); + this.space(); + this.print(node.block, node); + this.space(); + + if (node.handlers) { + this.print(node.handlers[0], node); + } else { + this.print(node.handler, node); + } + + if (node.finalizer) { + this.space(); + this.word("finally"); + this.space(); + this.print(node.finalizer, node); + } +} + +function CatchClause(node) { + this.word("catch"); + this.space(); + this.token("("); + this.print(node.param, node); + this.token(")"); + this.space(); + this.print(node.body, node); +} + +function SwitchStatement(node) { + this.word("switch"); + this.space(); + this.token("("); + this.print(node.discriminant, node); + this.token(")"); + this.space(); + this.token("{"); + this.printSequence(node.cases, node, { + indent: true, + addNewlines: function addNewlines(leading, cas) { + if (!leading && node.cases[node.cases.length - 1] === cas) return -1; + } + }); + this.token("}"); +} + +function SwitchCase(node) { + if (node.test) { + this.word("case"); + this.space(); + this.print(node.test, node); + this.token(":"); + } else { + this.word("default"); + this.token(":"); + } + + if (node.consequent.length) { + this.newline(); + this.printSequence(node.consequent, node, { + indent: true + }); + } +} + +function DebuggerStatement() { + this.word("debugger"); + this.semicolon(); +} + +function variableDeclarationIdent() { + this.token(","); + this.newline(); + if (this.endsWith("\n")) for (var i = 0; i < 4; i++) { + this.space(true); + } +} + +function constDeclarationIdent() { + this.token(","); + this.newline(); + if (this.endsWith("\n")) for (var i = 0; i < 6; i++) { + this.space(true); + } +} + +function VariableDeclaration(node, parent) { + this.word(node.kind); + this.space(); + var hasInits = false; + + if (!t.isFor(parent)) { + for (var _iterator = node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var declar = _ref; + + if (declar.init) { + hasInits = true; + } + } + } + + var separator = void 0; + + if (hasInits) { + separator = node.kind === "const" ? constDeclarationIdent : variableDeclarationIdent; + } + + this.printList(node.declarations, node, { + separator: separator + }); + + if (t.isFor(parent)) { + if (parent.left === node || parent.init === node) return; + } + + this.semicolon(); +} + +function VariableDeclarator(node) { + this.print(node.id, node); + this.print(node.id.typeAnnotation, node); + + if (node.init) { + this.space(); + this.token("="); + this.space(); + this.print(node.init, node); + } +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/generators/template-literals.js": +/*!**************************************************************************!*\ + !*** ./node_modules/babel-generator/lib/generators/template-literals.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.TaggedTemplateExpression = TaggedTemplateExpression; +exports.TemplateElement = TemplateElement; +exports.TemplateLiteral = TemplateLiteral; + +function TaggedTemplateExpression(node) { + this.print(node.tag, node); + this.print(node.quasi, node); +} + +function TemplateElement(node, parent) { + var isFirst = parent.quasis[0] === node; + var isLast = parent.quasis[parent.quasis.length - 1] === node; + var value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${"); + this.token(value); +} + +function TemplateLiteral(node) { + var quasis = node.quasis; + + for (var i = 0; i < quasis.length; i++) { + this.print(quasis[i], node); + + if (i + 1 < quasis.length) { + this.print(node.expressions[i], node); + } + } +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/generators/types.js": +/*!**************************************************************!*\ + !*** ./node_modules/babel-generator/lib/generators/types.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.ArrayPattern = exports.ObjectPattern = exports.RestProperty = exports.SpreadProperty = exports.SpreadElement = undefined; +exports.Identifier = Identifier; +exports.RestElement = RestElement; +exports.ObjectExpression = ObjectExpression; +exports.ObjectMethod = ObjectMethod; +exports.ObjectProperty = ObjectProperty; +exports.ArrayExpression = ArrayExpression; +exports.RegExpLiteral = RegExpLiteral; +exports.BooleanLiteral = BooleanLiteral; +exports.NullLiteral = NullLiteral; +exports.NumericLiteral = NumericLiteral; +exports.StringLiteral = StringLiteral; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +var _jsesc = __webpack_require__(/*! jsesc */ "./node_modules/babel-generator/node_modules/jsesc/jsesc.js"); + +var _jsesc2 = _interopRequireDefault(_jsesc); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function Identifier(node) { + if (node.variance) { + if (node.variance === "plus") { + this.token("+"); + } else if (node.variance === "minus") { + this.token("-"); + } + } + + this.word(node.name); +} + +function RestElement(node) { + this.token("..."); + this.print(node.argument, node); +} + +exports.SpreadElement = RestElement; +exports.SpreadProperty = RestElement; +exports.RestProperty = RestElement; + +function ObjectExpression(node) { + var props = node.properties; + this.token("{"); + this.printInnerComments(node); + + if (props.length) { + this.space(); + this.printList(props, node, { + indent: true, + statement: true + }); + this.space(); + } + + this.token("}"); +} + +exports.ObjectPattern = ObjectExpression; + +function ObjectMethod(node) { + this.printJoin(node.decorators, node); + + this._method(node); +} + +function ObjectProperty(node) { + this.printJoin(node.decorators, node); + + if (node.computed) { + this.token("["); + this.print(node.key, node); + this.token("]"); + } else { + if (t.isAssignmentPattern(node.value) && t.isIdentifier(node.key) && node.key.name === node.value.left.name) { + this.print(node.value, node); + return; + } + + this.print(node.key, node); + + if (node.shorthand && t.isIdentifier(node.key) && t.isIdentifier(node.value) && node.key.name === node.value.name) { + return; + } + } + + this.token(":"); + this.space(); + this.print(node.value, node); +} + +function ArrayExpression(node) { + var elems = node.elements; + var len = elems.length; + this.token("["); + this.printInnerComments(node); + + for (var i = 0; i < elems.length; i++) { + var elem = elems[i]; + + if (elem) { + if (i > 0) this.space(); + this.print(elem, node); + if (i < len - 1) this.token(","); + } else { + this.token(","); + } + } + + this.token("]"); +} + +exports.ArrayPattern = ArrayExpression; + +function RegExpLiteral(node) { + this.word("/" + node.pattern + "/" + node.flags); +} + +function BooleanLiteral(node) { + this.word(node.value ? "true" : "false"); +} + +function NullLiteral() { + this.word("null"); +} + +function NumericLiteral(node) { + var raw = this.getPossibleRaw(node); + var value = node.value + ""; + + if (raw == null) { + this.number(value); + } else if (this.format.minified) { + this.number(raw.length < value.length ? raw : value); + } else { + this.number(raw); + } +} + +function StringLiteral(node, parent) { + var raw = this.getPossibleRaw(node); + + if (!this.format.minified && raw != null) { + this.token(raw); + return; + } + + var opts = { + quotes: t.isJSX(parent) ? "double" : this.format.quotes, + wrap: true + }; + + if (this.format.jsonCompatibleStrings) { + opts.json = true; + } + + var val = (0, _jsesc2.default)(node.value, opts); + return this.token(val); +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/index.js": +/*!***************************************************!*\ + !*** ./node_modules/babel-generator/lib/index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.CodeGenerator = undefined; + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _possibleConstructorReturn2 = __webpack_require__(/*! babel-runtime/helpers/possibleConstructorReturn */ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js"); + +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _inherits2 = __webpack_require__(/*! babel-runtime/helpers/inherits */ "./node_modules/babel-runtime/helpers/inherits.js"); + +var _inherits3 = _interopRequireDefault(_inherits2); + +exports.default = function (ast, opts, code) { + var gen = new Generator(ast, opts, code); + return gen.generate(); +}; + +var _detectIndent = __webpack_require__(/*! detect-indent */ "./node_modules/detect-indent/index.js"); + +var _detectIndent2 = _interopRequireDefault(_detectIndent); + +var _sourceMap = __webpack_require__(/*! ./source-map */ "./node_modules/babel-generator/lib/source-map.js"); + +var _sourceMap2 = _interopRequireDefault(_sourceMap); + +var _babelMessages = __webpack_require__(/*! babel-messages */ "./node_modules/babel-messages/lib/index.js"); + +var messages = _interopRequireWildcard(_babelMessages); + +var _printer = __webpack_require__(/*! ./printer */ "./node_modules/babel-generator/lib/printer.js"); + +var _printer2 = _interopRequireDefault(_printer); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var Generator = function (_Printer) { + (0, _inherits3.default)(Generator, _Printer); + + function Generator(ast) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var code = arguments[2]; + (0, _classCallCheck3.default)(this, Generator); + var tokens = ast.tokens || []; + var format = normalizeOptions(code, opts, tokens); + var map = opts.sourceMaps ? new _sourceMap2.default(opts, code) : null; + + var _this = (0, _possibleConstructorReturn3.default)(this, _Printer.call(this, format, map, tokens)); + + _this.ast = ast; + return _this; + } + + Generator.prototype.generate = function generate() { + return _Printer.prototype.generate.call(this, this.ast); + }; + + return Generator; +}(_printer2.default); + +function normalizeOptions(code, opts, tokens) { + var style = " "; + + if (code && typeof code === "string") { + var indent = (0, _detectIndent2.default)(code).indent; + if (indent && indent !== " ") style = indent; + } + + var format = { + auxiliaryCommentBefore: opts.auxiliaryCommentBefore, + auxiliaryCommentAfter: opts.auxiliaryCommentAfter, + shouldPrintComment: opts.shouldPrintComment, + retainLines: opts.retainLines, + retainFunctionParens: opts.retainFunctionParens, + comments: opts.comments == null || opts.comments, + compact: opts.compact, + minified: opts.minified, + concise: opts.concise, + quotes: opts.quotes || findCommonStringDelimiter(code, tokens), + jsonCompatibleStrings: opts.jsonCompatibleStrings, + indent: { + adjustMultilineComment: true, + style: style, + base: 0 + }, + flowCommaSeparator: opts.flowCommaSeparator + }; + + if (format.minified) { + format.compact = true; + + format.shouldPrintComment = format.shouldPrintComment || function () { + return format.comments; + }; + } else { + format.shouldPrintComment = format.shouldPrintComment || function (value) { + return format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0; + }; + } + + if (format.compact === "auto") { + format.compact = code.length > 500000; + + if (format.compact) { + console.error("[BABEL] " + messages.get("codeGeneratorDeopt", opts.filename, "500KB")); + } + } + + if (format.compact) { + format.indent.adjustMultilineComment = false; + } + + return format; +} + +function findCommonStringDelimiter(code, tokens) { + var DEFAULT_STRING_DELIMITER = "double"; + + if (!code) { + return DEFAULT_STRING_DELIMITER; + } + + var occurrences = { + single: 0, + double: 0 + }; + var checked = 0; + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (token.type.label !== "string") continue; + var raw = code.slice(token.start, token.end); + + if (raw[0] === "'") { + occurrences.single++; + } else { + occurrences.double++; + } + + checked++; + if (checked >= 3) break; + } + + if (occurrences.single > occurrences.double) { + return "single"; + } else { + return "double"; + } +} + +var CodeGenerator = exports.CodeGenerator = function () { + function CodeGenerator(ast, opts, code) { + (0, _classCallCheck3.default)(this, CodeGenerator); + this._generator = new Generator(ast, opts, code); + } + + CodeGenerator.prototype.generate = function generate() { + return this._generator.generate(); + }; + + return CodeGenerator; +}(); + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/node/index.js": +/*!********************************************************!*\ + !*** ./node_modules/babel-generator/lib/node/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); + +var _keys2 = _interopRequireDefault(_keys); + +exports.needsWhitespace = needsWhitespace; +exports.needsWhitespaceBefore = needsWhitespaceBefore; +exports.needsWhitespaceAfter = needsWhitespaceAfter; +exports.needsParens = needsParens; + +var _whitespace = __webpack_require__(/*! ./whitespace */ "./node_modules/babel-generator/lib/node/whitespace.js"); + +var _whitespace2 = _interopRequireDefault(_whitespace); + +var _parentheses = __webpack_require__(/*! ./parentheses */ "./node_modules/babel-generator/lib/node/parentheses.js"); + +var parens = _interopRequireWildcard(_parentheses); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function expandAliases(obj) { + var newObj = {}; + + function add(type, func) { + var fn = newObj[type]; + newObj[type] = fn ? function (node, parent, stack) { + var result = fn(node, parent, stack); + return result == null ? func(node, parent, stack) : result; + } : func; + } + + for (var _iterator = (0, _keys2.default)(obj), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var type = _ref; + var aliases = t.FLIPPED_ALIAS_KEYS[type]; + + if (aliases) { + for (var _iterator2 = aliases, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var alias = _ref2; + add(alias, obj[type]); + } + } else { + add(type, obj[type]); + } + } + + return newObj; +} + +var expandedParens = expandAliases(parens); +var expandedWhitespaceNodes = expandAliases(_whitespace2.default.nodes); +var expandedWhitespaceList = expandAliases(_whitespace2.default.list); + +function find(obj, node, parent, printStack) { + var fn = obj[node.type]; + return fn ? fn(node, parent, printStack) : null; +} + +function isOrHasCallExpression(node) { + if (t.isCallExpression(node)) { + return true; + } + + if (t.isMemberExpression(node)) { + return isOrHasCallExpression(node.object) || !node.computed && isOrHasCallExpression(node.property); + } else { + return false; + } +} + +function needsWhitespace(node, parent, type) { + if (!node) return 0; + + if (t.isExpressionStatement(node)) { + node = node.expression; + } + + var linesInfo = find(expandedWhitespaceNodes, node, parent); + + if (!linesInfo) { + var items = find(expandedWhitespaceList, node, parent); + + if (items) { + for (var i = 0; i < items.length; i++) { + linesInfo = needsWhitespace(items[i], node, type); + if (linesInfo) break; + } + } + } + + return linesInfo && linesInfo[type] || 0; +} + +function needsWhitespaceBefore(node, parent) { + return needsWhitespace(node, parent, "before"); +} + +function needsWhitespaceAfter(node, parent) { + return needsWhitespace(node, parent, "after"); +} + +function needsParens(node, parent, printStack) { + if (!parent) return false; + + if (t.isNewExpression(parent) && parent.callee === node) { + if (isOrHasCallExpression(node)) return true; + } + + return find(expandedParens, node, parent, printStack); +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/node/parentheses.js": +/*!**************************************************************!*\ + !*** ./node_modules/babel-generator/lib/node/parentheses.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.AwaitExpression = exports.FunctionTypeAnnotation = undefined; +exports.NullableTypeAnnotation = NullableTypeAnnotation; +exports.UpdateExpression = UpdateExpression; +exports.ObjectExpression = ObjectExpression; +exports.DoExpression = DoExpression; +exports.Binary = Binary; +exports.BinaryExpression = BinaryExpression; +exports.SequenceExpression = SequenceExpression; +exports.YieldExpression = YieldExpression; +exports.ClassExpression = ClassExpression; +exports.UnaryLike = UnaryLike; +exports.FunctionExpression = FunctionExpression; +exports.ArrowFunctionExpression = ArrowFunctionExpression; +exports.ConditionalExpression = ConditionalExpression; +exports.AssignmentExpression = AssignmentExpression; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +var PRECEDENCE = { + "||": 0, + "&&": 1, + "|": 2, + "^": 3, + "&": 4, + "==": 5, + "===": 5, + "!=": 5, + "!==": 5, + "<": 6, + ">": 6, + "<=": 6, + ">=": 6, + in: 6, + instanceof: 6, + ">>": 7, + "<<": 7, + ">>>": 7, + "+": 8, + "-": 8, + "*": 9, + "/": 9, + "%": 9, + "**": 10 +}; + +function NullableTypeAnnotation(node, parent) { + return t.isArrayTypeAnnotation(parent); +} + +exports.FunctionTypeAnnotation = NullableTypeAnnotation; + +function UpdateExpression(node, parent) { + return t.isMemberExpression(parent) && parent.object === node; +} + +function ObjectExpression(node, parent, printStack) { + return isFirstInStatement(printStack, { + considerArrow: true + }); +} + +function DoExpression(node, parent, printStack) { + return isFirstInStatement(printStack); +} + +function Binary(node, parent) { + if ((t.isCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node || t.isUnaryLike(parent) || t.isMemberExpression(parent) && parent.object === node || t.isAwaitExpression(parent)) { + return true; + } + + if (t.isBinary(parent)) { + var parentOp = parent.operator; + var parentPos = PRECEDENCE[parentOp]; + var nodeOp = node.operator; + var nodePos = PRECEDENCE[nodeOp]; + + if (parentPos === nodePos && parent.right === node && !t.isLogicalExpression(parent) || parentPos > nodePos) { + return true; + } + } + + return false; +} + +function BinaryExpression(node, parent) { + return node.operator === "in" && (t.isVariableDeclarator(parent) || t.isFor(parent)); +} + +function SequenceExpression(node, parent) { + if (t.isForStatement(parent) || t.isThrowStatement(parent) || t.isReturnStatement(parent) || t.isIfStatement(parent) && parent.test === node || t.isWhileStatement(parent) && parent.test === node || t.isForInStatement(parent) && parent.right === node || t.isSwitchStatement(parent) && parent.discriminant === node || t.isExpressionStatement(parent) && parent.expression === node) { + return false; + } + + return true; +} + +function YieldExpression(node, parent) { + return t.isBinary(parent) || t.isUnaryLike(parent) || t.isCallExpression(parent) || t.isMemberExpression(parent) || t.isNewExpression(parent) || t.isConditionalExpression(parent) && node === parent.test; +} + +exports.AwaitExpression = YieldExpression; + +function ClassExpression(node, parent, printStack) { + return isFirstInStatement(printStack, { + considerDefaultExports: true + }); +} + +function UnaryLike(node, parent) { + return t.isMemberExpression(parent, { + object: node + }) || t.isCallExpression(parent, { + callee: node + }) || t.isNewExpression(parent, { + callee: node + }); +} + +function FunctionExpression(node, parent, printStack) { + return isFirstInStatement(printStack, { + considerDefaultExports: true + }); +} + +function ArrowFunctionExpression(node, parent) { + if (t.isExportDeclaration(parent) || t.isBinaryExpression(parent) || t.isLogicalExpression(parent) || t.isUnaryExpression(parent) || t.isTaggedTemplateExpression(parent)) { + return true; + } + + return UnaryLike(node, parent); +} + +function ConditionalExpression(node, parent) { + if (t.isUnaryLike(parent) || t.isBinary(parent) || t.isConditionalExpression(parent, { + test: node + }) || t.isAwaitExpression(parent)) { + return true; + } + + return UnaryLike(node, parent); +} + +function AssignmentExpression(node) { + if (t.isObjectPattern(node.left)) { + return true; + } else { + return ConditionalExpression.apply(undefined, arguments); + } +} + +function isFirstInStatement(printStack) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$considerArrow = _ref.considerArrow, + considerArrow = _ref$considerArrow === undefined ? false : _ref$considerArrow, + _ref$considerDefaultE = _ref.considerDefaultExports, + considerDefaultExports = _ref$considerDefaultE === undefined ? false : _ref$considerDefaultE; + + var i = printStack.length - 1; + var node = printStack[i]; + i--; + var parent = printStack[i]; + + while (i > 0) { + if (t.isExpressionStatement(parent, { + expression: node + }) || t.isTaggedTemplateExpression(parent) || considerDefaultExports && t.isExportDefaultDeclaration(parent, { + declaration: node + }) || considerArrow && t.isArrowFunctionExpression(parent, { + body: node + })) { + return true; + } + + if (t.isCallExpression(parent, { + callee: node + }) || t.isSequenceExpression(parent) && parent.expressions[0] === node || t.isMemberExpression(parent, { + object: node + }) || t.isConditional(parent, { + test: node + }) || t.isBinary(parent, { + left: node + }) || t.isAssignmentExpression(parent, { + left: node + })) { + node = parent; + i--; + parent = printStack[i]; + } else { + return false; + } + } + + return false; +} + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/node/whitespace.js": +/*!*************************************************************!*\ + !*** ./node_modules/babel-generator/lib/node/whitespace.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js"); + +var _map2 = _interopRequireDefault(_map); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function crawl(node) { + var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (t.isMemberExpression(node)) { + crawl(node.object, state); + if (node.computed) crawl(node.property, state); + } else if (t.isBinary(node) || t.isAssignmentExpression(node)) { + crawl(node.left, state); + crawl(node.right, state); + } else if (t.isCallExpression(node)) { + state.hasCall = true; + crawl(node.callee, state); + } else if (t.isFunction(node)) { + state.hasFunction = true; + } else if (t.isIdentifier(node)) { + state.hasHelper = state.hasHelper || isHelper(node.callee); + } + + return state; +} + +function isHelper(node) { + if (t.isMemberExpression(node)) { + return isHelper(node.object) || isHelper(node.property); + } else if (t.isIdentifier(node)) { + return node.name === "require" || node.name[0] === "_"; + } else if (t.isCallExpression(node)) { + return isHelper(node.callee); + } else if (t.isBinary(node) || t.isAssignmentExpression(node)) { + return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right); + } else { + return false; + } +} + +function isType(node) { + return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node); +} + +exports.nodes = { + AssignmentExpression: function AssignmentExpression(node) { + var state = crawl(node.right); + + if (state.hasCall && state.hasHelper || state.hasFunction) { + return { + before: state.hasFunction, + after: true + }; + } + }, + SwitchCase: function SwitchCase(node, parent) { + return { + before: node.consequent.length || parent.cases[0] === node + }; + }, + LogicalExpression: function LogicalExpression(node) { + if (t.isFunction(node.left) || t.isFunction(node.right)) { + return { + after: true + }; + } + }, + Literal: function Literal(node) { + if (node.value === "use strict") { + return { + after: true + }; + } + }, + CallExpression: function CallExpression(node) { + if (t.isFunction(node.callee) || isHelper(node)) { + return { + before: true, + after: true + }; + } + }, + VariableDeclaration: function VariableDeclaration(node) { + for (var i = 0; i < node.declarations.length; i++) { + var declar = node.declarations[i]; + var enabled = isHelper(declar.id) && !isType(declar.init); + + if (!enabled) { + var state = crawl(declar.init); + enabled = isHelper(declar.init) && state.hasCall || state.hasFunction; + } + + if (enabled) { + return { + before: true, + after: true + }; + } + } + }, + IfStatement: function IfStatement(node) { + if (t.isBlockStatement(node.consequent)) { + return { + before: true, + after: true + }; + } + } +}; + +exports.nodes.ObjectProperty = exports.nodes.ObjectTypeProperty = exports.nodes.ObjectMethod = exports.nodes.SpreadProperty = function (node, parent) { + if (parent.properties[0] === node) { + return { + before: true + }; + } +}; + +exports.list = { + VariableDeclaration: function VariableDeclaration(node) { + return (0, _map2.default)(node.declarations, "init"); + }, + ArrayExpression: function ArrayExpression(node) { + return node.elements; + }, + ObjectExpression: function ObjectExpression(node) { + return node.properties; + } +}; +[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function (_ref) { + var type = _ref[0], + amounts = _ref[1]; + + if (typeof amounts === "boolean") { + amounts = { + after: amounts, + before: amounts + }; + } + + [type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) { + exports.nodes[type] = function () { + return amounts; + }; + }); +}); + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/printer.js": +/*!*****************************************************!*\ + !*** ./node_modules/babel-generator/lib/printer.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _assign = __webpack_require__(/*! babel-runtime/core-js/object/assign */ "./node_modules/babel-runtime/core-js/object/assign.js"); + +var _assign2 = _interopRequireDefault(_assign); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _stringify = __webpack_require__(/*! babel-runtime/core-js/json/stringify */ "./node_modules/babel-runtime/core-js/json/stringify.js"); + +var _stringify2 = _interopRequireDefault(_stringify); + +var _weakSet = __webpack_require__(/*! babel-runtime/core-js/weak-set */ "./node_modules/babel-runtime/core-js/weak-set.js"); + +var _weakSet2 = _interopRequireDefault(_weakSet); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _find = __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"); + +var _find2 = _interopRequireDefault(_find); + +var _findLast = __webpack_require__(/*! lodash/findLast */ "./node_modules/lodash/findLast.js"); + +var _findLast2 = _interopRequireDefault(_findLast); + +var _isInteger = __webpack_require__(/*! lodash/isInteger */ "./node_modules/lodash/isInteger.js"); + +var _isInteger2 = _interopRequireDefault(_isInteger); + +var _repeat = __webpack_require__(/*! lodash/repeat */ "./node_modules/lodash/repeat.js"); + +var _repeat2 = _interopRequireDefault(_repeat); + +var _buffer = __webpack_require__(/*! ./buffer */ "./node_modules/babel-generator/lib/buffer.js"); + +var _buffer2 = _interopRequireDefault(_buffer); + +var _node = __webpack_require__(/*! ./node */ "./node_modules/babel-generator/lib/node/index.js"); + +var n = _interopRequireWildcard(_node); + +var _whitespace = __webpack_require__(/*! ./whitespace */ "./node_modules/babel-generator/lib/whitespace.js"); + +var _whitespace2 = _interopRequireDefault(_whitespace); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var SCIENTIFIC_NOTATION = /e/i; +var ZERO_DECIMAL_INTEGER = /\.0+$/; +var NON_DECIMAL_LITERAL = /^0[box]/; + +var Printer = function () { + function Printer(format, map, tokens) { + (0, _classCallCheck3.default)(this, Printer); + this.inForStatementInitCounter = 0; + this._printStack = []; + this._indent = 0; + this._insideAux = false; + this._printedCommentStarts = {}; + this._parenPushNewlineState = null; + this._printAuxAfterOnNextUserNode = false; + this._printedComments = new _weakSet2.default(); + this._endsWithInteger = false; + this._endsWithWord = false; + this.format = format || {}; + this._buf = new _buffer2.default(map); + this._whitespace = tokens.length > 0 ? new _whitespace2.default(tokens) : null; + } + + Printer.prototype.generate = function generate(ast) { + this.print(ast); + + this._maybeAddAuxComment(); + + return this._buf.get(); + }; + + Printer.prototype.indent = function indent() { + if (this.format.compact || this.format.concise) return; + this._indent++; + }; + + Printer.prototype.dedent = function dedent() { + if (this.format.compact || this.format.concise) return; + this._indent--; + }; + + Printer.prototype.semicolon = function semicolon() { + var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + this._maybeAddAuxComment(); + + this._append(";", !force); + }; + + Printer.prototype.rightBrace = function rightBrace() { + if (this.format.minified) { + this._buf.removeLastSemicolon(); + } + + this.token("}"); + }; + + Printer.prototype.space = function space() { + var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + if (this.format.compact) return; + + if (this._buf.hasContent() && !this.endsWith(" ") && !this.endsWith("\n") || force) { + this._space(); + } + }; + + Printer.prototype.word = function word(str) { + if (this._endsWithWord) this._space(); + + this._maybeAddAuxComment(); + + this._append(str); + + this._endsWithWord = true; + }; + + Printer.prototype.number = function number(str) { + this.word(str); + this._endsWithInteger = (0, _isInteger2.default)(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== "."; + }; + + Printer.prototype.token = function token(str) { + if (str === "--" && this.endsWith("!") || str[0] === "+" && this.endsWith("+") || str[0] === "-" && this.endsWith("-") || str[0] === "." && this._endsWithInteger) { + this._space(); + } + + this._maybeAddAuxComment(); + + this._append(str); + }; + + Printer.prototype.newline = function newline(i) { + if (this.format.retainLines || this.format.compact) return; + + if (this.format.concise) { + this.space(); + return; + } + + if (this.endsWith("\n\n")) return; + if (typeof i !== "number") i = 1; + i = Math.min(2, i); + if (this.endsWith("{\n") || this.endsWith(":\n")) i--; + if (i <= 0) return; + + for (var j = 0; j < i; j++) { + this._newline(); + } + }; + + Printer.prototype.endsWith = function endsWith(str) { + return this._buf.endsWith(str); + }; + + Printer.prototype.removeTrailingNewline = function removeTrailingNewline() { + this._buf.removeTrailingNewline(); + }; + + Printer.prototype.source = function source(prop, loc) { + this._catchUp(prop, loc); + + this._buf.source(prop, loc); + }; + + Printer.prototype.withSource = function withSource(prop, loc, cb) { + this._catchUp(prop, loc); + + this._buf.withSource(prop, loc, cb); + }; + + Printer.prototype._space = function _space() { + this._append(" ", true); + }; + + Printer.prototype._newline = function _newline() { + this._append("\n", true); + }; + + Printer.prototype._append = function _append(str) { + var queue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + this._maybeAddParen(str); + + this._maybeIndent(str); + + if (queue) this._buf.queue(str);else this._buf.append(str); + this._endsWithWord = false; + this._endsWithInteger = false; + }; + + Printer.prototype._maybeIndent = function _maybeIndent(str) { + if (this._indent && this.endsWith("\n") && str[0] !== "\n") { + this._buf.queue(this._getIndent()); + } + }; + + Printer.prototype._maybeAddParen = function _maybeAddParen(str) { + var parenPushNewlineState = this._parenPushNewlineState; + if (!parenPushNewlineState) return; + this._parenPushNewlineState = null; + var i = void 0; + + for (i = 0; i < str.length && str[i] === " "; i++) { + continue; + } + + if (i === str.length) return; + var cha = str[i]; + + if (cha === "\n" || cha === "/") { + this.token("("); + this.indent(); + parenPushNewlineState.printed = true; + } + }; + + Printer.prototype._catchUp = function _catchUp(prop, loc) { + if (!this.format.retainLines) return; + var pos = loc ? loc[prop] : null; + + if (pos && pos.line !== null) { + var count = pos.line - this._buf.getCurrentLine(); + + for (var i = 0; i < count; i++) { + this._newline(); + } + } + }; + + Printer.prototype._getIndent = function _getIndent() { + return (0, _repeat2.default)(this.format.indent.style, this._indent); + }; + + Printer.prototype.startTerminatorless = function startTerminatorless() { + return this._parenPushNewlineState = { + printed: false + }; + }; + + Printer.prototype.endTerminatorless = function endTerminatorless(state) { + if (state.printed) { + this.dedent(); + this.newline(); + this.token(")"); + } + }; + + Printer.prototype.print = function print(node, parent) { + var _this = this; + + if (!node) return; + var oldConcise = this.format.concise; + + if (node._compact) { + this.format.concise = true; + } + + var printMethod = this[node.type]; + + if (!printMethod) { + throw new ReferenceError("unknown node of type " + (0, _stringify2.default)(node.type) + " with constructor " + (0, _stringify2.default)(node && node.constructor.name)); + } + + this._printStack.push(node); + + var oldInAux = this._insideAux; + this._insideAux = !node.loc; + + this._maybeAddAuxComment(this._insideAux && !oldInAux); + + var needsParens = n.needsParens(node, parent, this._printStack); + + if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) { + needsParens = true; + } + + if (needsParens) this.token("("); + + this._printLeadingComments(node, parent); + + var loc = t.isProgram(node) || t.isFile(node) ? null : node.loc; + this.withSource("start", loc, function () { + _this[node.type](node, parent); + }); + + this._printTrailingComments(node, parent); + + if (needsParens) this.token(")"); + + this._printStack.pop(); + + this.format.concise = oldConcise; + this._insideAux = oldInAux; + }; + + Printer.prototype._maybeAddAuxComment = function _maybeAddAuxComment(enteredPositionlessNode) { + if (enteredPositionlessNode) this._printAuxBeforeComment(); + if (!this._insideAux) this._printAuxAfterComment(); + }; + + Printer.prototype._printAuxBeforeComment = function _printAuxBeforeComment() { + if (this._printAuxAfterOnNextUserNode) return; + this._printAuxAfterOnNextUserNode = true; + var comment = this.format.auxiliaryCommentBefore; + + if (comment) { + this._printComment({ + type: "CommentBlock", + value: comment + }); + } + }; + + Printer.prototype._printAuxAfterComment = function _printAuxAfterComment() { + if (!this._printAuxAfterOnNextUserNode) return; + this._printAuxAfterOnNextUserNode = false; + var comment = this.format.auxiliaryCommentAfter; + + if (comment) { + this._printComment({ + type: "CommentBlock", + value: comment + }); + } + }; + + Printer.prototype.getPossibleRaw = function getPossibleRaw(node) { + var extra = node.extra; + + if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) { + return extra.raw; + } + }; + + Printer.prototype.printJoin = function printJoin(nodes, parent) { + var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (!nodes || !nodes.length) return; + if (opts.indent) this.indent(); + var newlineOpts = { + addNewlines: opts.addNewlines + }; + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + if (!node) continue; + if (opts.statement) this._printNewline(true, node, parent, newlineOpts); + this.print(node, parent); + + if (opts.iterator) { + opts.iterator(node, i); + } + + if (opts.separator && i < nodes.length - 1) { + opts.separator.call(this); + } + + if (opts.statement) this._printNewline(false, node, parent, newlineOpts); + } + + if (opts.indent) this.dedent(); + }; + + Printer.prototype.printAndIndentOnComments = function printAndIndentOnComments(node, parent) { + var indent = !!node.leadingComments; + if (indent) this.indent(); + this.print(node, parent); + if (indent) this.dedent(); + }; + + Printer.prototype.printBlock = function printBlock(parent) { + var node = parent.body; + + if (!t.isEmptyStatement(node)) { + this.space(); + } + + this.print(node, parent); + }; + + Printer.prototype._printTrailingComments = function _printTrailingComments(node, parent) { + this._printComments(this._getComments(false, node, parent)); + }; + + Printer.prototype._printLeadingComments = function _printLeadingComments(node, parent) { + this._printComments(this._getComments(true, node, parent)); + }; + + Printer.prototype.printInnerComments = function printInnerComments(node) { + var indent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + if (!node.innerComments) return; + if (indent) this.indent(); + + this._printComments(node.innerComments); + + if (indent) this.dedent(); + }; + + Printer.prototype.printSequence = function printSequence(nodes, parent) { + var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + opts.statement = true; + return this.printJoin(nodes, parent, opts); + }; + + Printer.prototype.printList = function printList(items, parent) { + var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + if (opts.separator == null) { + opts.separator = commaSeparator; + } + + return this.printJoin(items, parent, opts); + }; + + Printer.prototype._printNewline = function _printNewline(leading, node, parent, opts) { + var _this2 = this; + + if (this.format.retainLines || this.format.compact) return; + + if (this.format.concise) { + this.space(); + return; + } + + var lines = 0; + + if (node.start != null && !node._ignoreUserWhitespace && this._whitespace) { + if (leading) { + var _comments = node.leadingComments; + + var _comment = _comments && (0, _find2.default)(_comments, function (comment) { + return !!comment.loc && _this2.format.shouldPrintComment(comment.value); + }); + + lines = this._whitespace.getNewlinesBefore(_comment || node); + } else { + var _comments2 = node.trailingComments; + + var _comment2 = _comments2 && (0, _findLast2.default)(_comments2, function (comment) { + return !!comment.loc && _this2.format.shouldPrintComment(comment.value); + }); + + lines = this._whitespace.getNewlinesAfter(_comment2 || node); + } + } else { + if (!leading) lines++; + if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0; + var needs = n.needsWhitespaceAfter; + if (leading) needs = n.needsWhitespaceBefore; + if (needs(node, parent)) lines++; + if (!this._buf.hasContent()) lines = 0; + } + + this.newline(lines); + }; + + Printer.prototype._getComments = function _getComments(leading, node) { + return node && (leading ? node.leadingComments : node.trailingComments) || []; + }; + + Printer.prototype._printComment = function _printComment(comment) { + var _this3 = this; + + if (!this.format.shouldPrintComment(comment.value)) return; + if (comment.ignore) return; + if (this._printedComments.has(comment)) return; + + this._printedComments.add(comment); + + if (comment.start != null) { + if (this._printedCommentStarts[comment.start]) return; + this._printedCommentStarts[comment.start] = true; + } + + this.newline(this._whitespace ? this._whitespace.getNewlinesBefore(comment) : 0); + if (!this.endsWith("[") && !this.endsWith("{")) this.space(); + var val = comment.type === "CommentLine" ? "//" + comment.value + "\n" : "/*" + comment.value + "*/"; + + if (comment.type === "CommentBlock" && this.format.indent.adjustMultilineComment) { + var offset = comment.loc && comment.loc.start.column; + + if (offset) { + var newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g"); + val = val.replace(newlineRegex, "\n"); + } + + var indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn()); + val = val.replace(/\n(?!$)/g, "\n" + (0, _repeat2.default)(" ", indentSize)); + } + + this.withSource("start", comment.loc, function () { + _this3._append(val); + }); + this.newline((this._whitespace ? this._whitespace.getNewlinesAfter(comment) : 0) + (comment.type === "CommentLine" ? -1 : 0)); + }; + + Printer.prototype._printComments = function _printComments(comments) { + if (!comments || !comments.length) return; + + for (var _iterator = comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var _comment3 = _ref; + + this._printComment(_comment3); + } + }; + + return Printer; +}(); + +exports.default = Printer; + +function commaSeparator() { + this.token(","); + this.space(); +} + +var _arr = [__webpack_require__(/*! ./generators/template-literals */ "./node_modules/babel-generator/lib/generators/template-literals.js"), __webpack_require__(/*! ./generators/expressions */ "./node_modules/babel-generator/lib/generators/expressions.js"), __webpack_require__(/*! ./generators/statements */ "./node_modules/babel-generator/lib/generators/statements.js"), __webpack_require__(/*! ./generators/classes */ "./node_modules/babel-generator/lib/generators/classes.js"), __webpack_require__(/*! ./generators/methods */ "./node_modules/babel-generator/lib/generators/methods.js"), __webpack_require__(/*! ./generators/modules */ "./node_modules/babel-generator/lib/generators/modules.js"), __webpack_require__(/*! ./generators/types */ "./node_modules/babel-generator/lib/generators/types.js"), __webpack_require__(/*! ./generators/flow */ "./node_modules/babel-generator/lib/generators/flow.js"), __webpack_require__(/*! ./generators/base */ "./node_modules/babel-generator/lib/generators/base.js"), __webpack_require__(/*! ./generators/jsx */ "./node_modules/babel-generator/lib/generators/jsx.js")]; + +for (var _i2 = 0; _i2 < _arr.length; _i2++) { + var generator = _arr[_i2]; + (0, _assign2.default)(Printer.prototype, generator); +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/source-map.js": +/*!********************************************************!*\ + !*** ./node_modules/babel-generator/lib/source-map.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); + +var _keys2 = _interopRequireDefault(_keys); + +var _typeof2 = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _sourceMap = __webpack_require__(/*! source-map */ "./node_modules/source-map/source-map.js"); + +var _sourceMap2 = _interopRequireDefault(_sourceMap); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var SourceMap = function () { + function SourceMap(opts, code) { + (0, _classCallCheck3.default)(this, SourceMap); + this._cachedMap = null; + this._code = code; + this._opts = opts; + this._rawMappings = []; + } + + SourceMap.prototype.get = function get() { + if (!this._cachedMap) { + var map = this._cachedMap = new _sourceMap2.default.SourceMapGenerator({ + file: this._opts.sourceMapTarget, + sourceRoot: this._opts.sourceRoot + }); + var code = this._code; + + if (typeof code === "string") { + map.setSourceContent(this._opts.sourceFileName, code); + } else if ((typeof code === "undefined" ? "undefined" : (0, _typeof3.default)(code)) === "object") { + (0, _keys2.default)(code).forEach(function (sourceFileName) { + map.setSourceContent(sourceFileName, code[sourceFileName]); + }); + } + + this._rawMappings.forEach(map.addMapping, map); + } + + return this._cachedMap.toJSON(); + }; + + SourceMap.prototype.getRawMappings = function getRawMappings() { + return this._rawMappings.slice(); + }; + + SourceMap.prototype.mark = function mark(generatedLine, generatedColumn, line, column, identifierName, filename) { + if (this._lastGenLine !== generatedLine && line === null) return; + + if (this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) { + return; + } + + this._cachedMap = null; + this._lastGenLine = generatedLine; + this._lastSourceLine = line; + this._lastSourceColumn = column; + + this._rawMappings.push({ + name: identifierName || undefined, + generated: { + line: generatedLine, + column: generatedColumn + }, + source: line == null ? undefined : filename || this._opts.sourceFileName, + original: line == null ? undefined : { + line: line, + column: column + } + }); + }; + + return SourceMap; +}(); + +exports.default = SourceMap; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-generator/lib/whitespace.js": +/*!********************************************************!*\ + !*** ./node_modules/babel-generator/lib/whitespace.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var Whitespace = function () { + function Whitespace(tokens) { + (0, _classCallCheck3.default)(this, Whitespace); + this.tokens = tokens; + this.used = {}; + } + + Whitespace.prototype.getNewlinesBefore = function getNewlinesBefore(node) { + var startToken = void 0; + var endToken = void 0; + var tokens = this.tokens; + + var index = this._findToken(function (token) { + return token.start - node.start; + }, 0, tokens.length); + + if (index >= 0) { + while (index && node.start === tokens[index - 1].start) { + --index; + } + + startToken = tokens[index - 1]; + endToken = tokens[index]; + } + + return this._getNewlinesBetween(startToken, endToken); + }; + + Whitespace.prototype.getNewlinesAfter = function getNewlinesAfter(node) { + var startToken = void 0; + var endToken = void 0; + var tokens = this.tokens; + + var index = this._findToken(function (token) { + return token.end - node.end; + }, 0, tokens.length); + + if (index >= 0) { + while (index && node.end === tokens[index - 1].end) { + --index; + } + + startToken = tokens[index]; + endToken = tokens[index + 1]; + if (endToken && endToken.type.label === ",") endToken = tokens[index + 2]; + } + + if (endToken && endToken.type.label === "eof") { + return 1; + } else { + return this._getNewlinesBetween(startToken, endToken); + } + }; + + Whitespace.prototype._getNewlinesBetween = function _getNewlinesBetween(startToken, endToken) { + if (!endToken || !endToken.loc) return 0; + var start = startToken ? startToken.loc.end.line : 1; + var end = endToken.loc.start.line; + var lines = 0; + + for (var line = start; line < end; line++) { + if (typeof this.used[line] === "undefined") { + this.used[line] = true; + lines++; + } + } + + return lines; + }; + + Whitespace.prototype._findToken = function _findToken(test, start, end) { + if (start >= end) return -1; + var middle = start + end >>> 1; + var match = test(this.tokens[middle]); + + if (match < 0) { + return this._findToken(test, middle + 1, end); + } else if (match > 0) { + return this._findToken(test, start, middle); + } else if (match === 0) { + return middle; + } + + return -1; + }; + + return Whitespace; +}(); + +exports.default = Whitespace; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-generator/node_modules/jsesc/jsesc.js": +/*!******************************************************************!*\ + !*** ./node_modules/babel-generator/node_modules/jsesc/jsesc.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/jsesc v1.3.0 by @mathias */ +; + +(function (root) { + // Detect free variables `exports` + var freeExports = true && exports; // Detect free variable `module` + + var freeModule = true && module && module.exports == freeExports && module; // Detect free variable `global`, from Node.js or Browserified code, + // and use it as `root` + + var freeGlobal = typeof global == 'object' && global; + + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { + root = freeGlobal; + } + /*--------------------------------------------------------------------------*/ + + + var object = {}; + var hasOwnProperty = object.hasOwnProperty; + + var forOwn = function (object, callback) { + var key; + + for (key in object) { + if (hasOwnProperty.call(object, key)) { + callback(key, object[key]); + } + } + }; + + var extend = function (destination, source) { + if (!source) { + return destination; + } + + forOwn(source, function (key, value) { + destination[key] = value; + }); + return destination; + }; + + var forEach = function (array, callback) { + var length = array.length; + var index = -1; + + while (++index < length) { + callback(array[index]); + } + }; + + var toString = object.toString; + + var isArray = function (value) { + return toString.call(value) == '[object Array]'; + }; + + var isObject = function (value) { + // This is a very simple check, but it’s good enough for what we need. + return toString.call(value) == '[object Object]'; + }; + + var isString = function (value) { + return typeof value == 'string' || toString.call(value) == '[object String]'; + }; + + var isNumber = function (value) { + return typeof value == 'number' || toString.call(value) == '[object Number]'; + }; + + var isFunction = function (value) { + // In a perfect world, the `typeof` check would be sufficient. However, + // in Chrome 1–12, `typeof /x/ == 'object'`, and in IE 6–8 + // `typeof alert == 'object'` and similar for other host objects. + return typeof value == 'function' || toString.call(value) == '[object Function]'; + }; + + var isMap = function (value) { + return toString.call(value) == '[object Map]'; + }; + + var isSet = function (value) { + return toString.call(value) == '[object Set]'; + }; + /*--------------------------------------------------------------------------*/ + // https://mathiasbynens.be/notes/javascript-escapes#single + + + var singleEscapes = { + '"': '\\"', + '\'': '\\\'', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t' // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'. + // '\v': '\\x0B' + + }; + var regexSingleEscape = /["'\\\b\f\n\r\t]/; + var regexDigit = /[0-9]/; + var regexWhitelist = /[ !#-&\(-\[\]-~]/; + + var jsesc = function (argument, options) { + // Handle options + var defaults = { + 'escapeEverything': false, + 'escapeEtago': false, + 'quotes': 'single', + 'wrap': false, + 'es6': false, + 'json': false, + 'compact': true, + 'lowercaseHex': false, + 'numbers': 'decimal', + 'indent': '\t', + '__indent__': '', + '__inline1__': false, + '__inline2__': false + }; + var json = options && options.json; + + if (json) { + defaults.quotes = 'double'; + defaults.wrap = true; + } + + options = extend(defaults, options); + + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + + var quote = options.quotes == 'double' ? '"' : '\''; + var compact = options.compact; + var indent = options.indent; + var lowercaseHex = options.lowercaseHex; + var oldIndent = ''; + var inline1 = options.__inline1__; + var inline2 = options.__inline2__; + var newLine = compact ? '' : '\n'; + var result; + var isEmpty = true; + var useBinNumbers = options.numbers == 'binary'; + var useOctNumbers = options.numbers == 'octal'; + var useDecNumbers = options.numbers == 'decimal'; + var useHexNumbers = options.numbers == 'hexadecimal'; + + if (json && argument && isFunction(argument.toJSON)) { + argument = argument.toJSON(); + } + + if (!isString(argument)) { + if (isMap(argument)) { + if (argument.size == 0) { + return 'new Map()'; + } + + if (!compact) { + options.__inline1__ = true; + } + + return 'new Map(' + jsesc(Array.from(argument), options) + ')'; + } + + if (isSet(argument)) { + if (argument.size == 0) { + return 'new Set()'; + } + + return 'new Set(' + jsesc(Array.from(argument), options) + ')'; + } + + if (isArray(argument)) { + result = []; + options.wrap = true; + + if (inline1) { + options.__inline1__ = false; + options.__inline2__ = true; + } else { + oldIndent = options.__indent__; + indent += oldIndent; + options.__indent__ = indent; + } + + forEach(argument, function (value) { + isEmpty = false; + + if (inline2) { + options.__inline2__ = false; + } + + result.push((compact || inline2 ? '' : indent) + jsesc(value, options)); + }); + + if (isEmpty) { + return '[]'; + } + + if (inline2) { + return '[' + result.join(', ') + ']'; + } + + return '[' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + ']'; + } else if (isNumber(argument)) { + if (json) { + // Some number values (e.g. `Infinity`) cannot be represented in JSON. + return JSON.stringify(argument); + } + + if (useDecNumbers) { + return String(argument); + } + + if (useHexNumbers) { + var tmp = argument.toString(16); + + if (!lowercaseHex) { + tmp = tmp.toUpperCase(); + } + + return '0x' + tmp; + } + + if (useBinNumbers) { + return '0b' + argument.toString(2); + } + + if (useOctNumbers) { + return '0o' + argument.toString(8); + } + } else if (!isObject(argument)) { + if (json) { + // For some values (e.g. `undefined`, `function` objects), + // `JSON.stringify(value)` returns `undefined` (which isn’t valid + // JSON) instead of `'null'`. + return JSON.stringify(argument) || 'null'; + } + + return String(argument); + } else { + // it’s an object + result = []; + options.wrap = true; + oldIndent = options.__indent__; + indent += oldIndent; + options.__indent__ = indent; + forOwn(argument, function (key, value) { + isEmpty = false; + result.push((compact ? '' : indent) + jsesc(key, options) + ':' + (compact ? '' : ' ') + jsesc(value, options)); + }); + + if (isEmpty) { + return '{}'; + } + + return '{' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + '}'; + } + } + + var string = argument; // Loop over each code unit in the string and escape it + + var index = -1; + var length = string.length; + var first; + var second; + var codePoint; + result = ''; + + while (++index < length) { + var character = string.charAt(index); + + if (options.es6) { + first = string.charCodeAt(index); + + if ( // check if it’s the start of a surrogate pair + first >= 0xD800 && first <= 0xDBFF && // high surrogate + length > index + 1 // there is a next code unit + ) { + second = string.charCodeAt(index + 1); + + if (second >= 0xDC00 && second <= 0xDFFF) { + // low surrogate + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + var hexadecimal = codePoint.toString(16); + + if (!lowercaseHex) { + hexadecimal = hexadecimal.toUpperCase(); + } + + result += '\\u{' + hexadecimal + '}'; + index++; + continue; + } + } + } + + if (!options.escapeEverything) { + if (regexWhitelist.test(character)) { + // It’s a printable ASCII character that is not `"`, `'` or `\`, + // so don’t escape it. + result += character; + continue; + } + + if (character == '"') { + result += quote == character ? '\\"' : character; + continue; + } + + if (character == '\'') { + result += quote == character ? '\\\'' : character; + continue; + } + } + + if (character == '\0' && !json && !regexDigit.test(string.charAt(index + 1))) { + result += '\\0'; + continue; + } + + if (regexSingleEscape.test(character)) { + // no need for a `hasOwnProperty` check here + result += singleEscapes[character]; + continue; + } + + var charCode = character.charCodeAt(0); + var hexadecimal = charCode.toString(16); + + if (!lowercaseHex) { + hexadecimal = hexadecimal.toUpperCase(); + } + + var longhand = hexadecimal.length > 2 || json; + var escaped = '\\' + (longhand ? 'u' : 'x') + ('0000' + hexadecimal).slice(longhand ? -4 : -2); + result += escaped; + continue; + } + + if (options.wrap) { + result = quote + result + quote; + } + + if (options.escapeEtago) { + // https://mathiasbynens.be/notes/etago + return result.replace(/<\/(script|style)/gi, '<\\/$1'); + } + + return result; + }; + + jsesc.version = '1.3.0'; + /*--------------------------------------------------------------------------*/ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + + if (true) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return jsesc; + }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +})(this); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module), __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/babel-helpers/lib/helpers.js": +/*!***************************************************!*\ + !*** ./node_modules/babel-helpers/lib/helpers.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _babelTemplate = __webpack_require__(/*! babel-template */ "./node_modules/babel-template/lib/index.js"); + +var _babelTemplate2 = _interopRequireDefault(_babelTemplate); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var helpers = {}; +exports.default = helpers; +helpers.typeof = (0, _babelTemplate2.default)("\n (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\")\n ? function (obj) { return typeof obj; }\n : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? \"symbol\"\n : typeof obj;\n };\n"); +helpers.jsx = (0, _babelTemplate2.default)("\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === \"function\" && Symbol.for && Symbol.for(\"react.element\")) || 0xeac7;\n\n return function createRawReactElement (type, props, key, children) {\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we're going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {};\n }\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : '' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n"); +helpers.asyncIterator = (0, _babelTemplate2.default)("\n (function (iterable) {\n if (typeof Symbol === \"function\") {\n if (Symbol.asyncIterator) {\n var method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n return iterable[Symbol.iterator]();\n }\n }\n throw new TypeError(\"Object is not async iterable\");\n })\n"); +helpers.asyncGenerator = (0, _babelTemplate2.default)("\n (function () {\n function AwaitValue(value) {\n this.value = value;\n }\n\n function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n if (value instanceof AwaitValue) {\n Promise.resolve(value.value).then(\n function (arg) { resume(\"next\", arg); },\n function (arg) { resume(\"throw\", arg); });\n } else {\n settle(result.done ? \"return\" : \"normal\", result.value);\n }\n } catch (err) {\n settle(\"throw\", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case \"return\":\n front.resolve({ value: value, done: true });\n break;\n case \"throw\":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide \"return\" method if generator return is not supported\n if (typeof gen.return !== \"function\") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === \"function\" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke(\"next\", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke(\"throw\", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke(\"return\", arg); };\n\n return {\n wrap: function (fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n },\n await: function (value) {\n return new AwaitValue(value);\n }\n };\n\n })()\n"); +helpers.asyncGeneratorDelegate = (0, _babelTemplate2.default)("\n (function (inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === \"function\" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump(\"next\", value);\n };\n\n if (typeof inner.throw === \"function\") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump(\"throw\", value);\n };\n }\n\n if (typeof inner.return === \"function\") {\n iter.return = function (value) {\n return pump(\"return\", value);\n };\n }\n\n return iter;\n })\n"); +helpers.asyncToGenerator = (0, _babelTemplate2.default)("\n (function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new Promise(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return Promise.resolve(value).then(function (value) {\n step(\"next\", value);\n }, function (err) {\n step(\"throw\", err);\n });\n }\n }\n\n return step(\"next\");\n });\n };\n })\n"); +helpers.classCallCheck = (0, _babelTemplate2.default)("\n (function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n });\n"); +helpers.createClass = (0, _babelTemplate2.default)("\n (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n })()\n"); +helpers.defineEnumerableProperties = (0, _babelTemplate2.default)("\n (function (obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n return obj;\n })\n"); +helpers.defaults = (0, _babelTemplate2.default)("\n (function (obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n })\n"); +helpers.defineProperty = (0, _babelTemplate2.default)("\n (function (obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n });\n"); +helpers.extends = (0, _babelTemplate2.default)("\n Object.assign || (function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n })\n"); +helpers.get = (0, _babelTemplate2.default)("\n (function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n });\n"); +helpers.inherits = (0, _babelTemplate2.default)("\n (function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n })\n"); +helpers.instanceof = (0, _babelTemplate2.default)("\n (function (left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n });\n"); +helpers.interopRequireDefault = (0, _babelTemplate2.default)("\n (function (obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n })\n"); +helpers.interopRequireWildcard = (0, _babelTemplate2.default)("\n (function (obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n })\n"); +helpers.newArrowCheck = (0, _babelTemplate2.default)("\n (function (innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError(\"Cannot instantiate an arrow function\");\n }\n });\n"); +helpers.objectDestructuringEmpty = (0, _babelTemplate2.default)("\n (function (obj) {\n if (obj == null) throw new TypeError(\"Cannot destructure undefined\");\n });\n"); +helpers.objectWithoutProperties = (0, _babelTemplate2.default)("\n (function (obj, keys) {\n var target = {};\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n return target;\n })\n"); +helpers.possibleConstructorReturn = (0, _babelTemplate2.default)("\n (function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n });\n"); +helpers.selfGlobal = (0, _babelTemplate2.default)("\n typeof global === \"undefined\" ? self : global\n"); +helpers.set = (0, _babelTemplate2.default)("\n (function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if (\"value\" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n });\n"); +helpers.slicedToArray = (0, _babelTemplate2.default)("\n (function () {\n // Broken out into a separate function to avoid deoptimizations due to the try/catch for the\n // array iterator case.\n function sliceIterator(arr, i) {\n // this is an expanded form of `for...of` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliancy is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n })();\n"); +helpers.slicedToArrayLoose = (0, _babelTemplate2.default)("\n (function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n });\n"); +helpers.taggedTemplateLiteral = (0, _babelTemplate2.default)("\n (function (strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n });\n"); +helpers.taggedTemplateLiteralLoose = (0, _babelTemplate2.default)("\n (function (strings, raw) {\n strings.raw = raw;\n return strings;\n });\n"); +helpers.temporalRef = (0, _babelTemplate2.default)("\n (function (val, name, undef) {\n if (val === undef) {\n throw new ReferenceError(name + \" is not defined - temporal dead zone\");\n } else {\n return val;\n }\n })\n"); +helpers.temporalUndefined = (0, _babelTemplate2.default)("\n ({})\n"); +helpers.toArray = (0, _babelTemplate2.default)("\n (function (arr) {\n return Array.isArray(arr) ? arr : Array.from(arr);\n });\n"); +helpers.toConsumableArray = (0, _babelTemplate2.default)("\n (function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n return arr2;\n } else {\n return Array.from(arr);\n }\n });\n"); +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-helpers/lib/index.js": +/*!*************************************************!*\ + !*** ./node_modules/babel-helpers/lib/index.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.list = undefined; + +var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); + +var _keys2 = _interopRequireDefault(_keys); + +exports.get = get; + +var _helpers = __webpack_require__(/*! ./helpers */ "./node_modules/babel-helpers/lib/helpers.js"); + +var _helpers2 = _interopRequireDefault(_helpers); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function get(name) { + var fn = _helpers2.default[name]; + if (!fn) throw new ReferenceError("Unknown helper " + name); + return fn().expression; +} + +var list = exports.list = (0, _keys2.default)(_helpers2.default).map(function (name) { + return name.replace(/^_/, ""); +}).filter(function (name) { + return name !== "__esModule"; +}); +exports.default = get; + +/***/ }), + +/***/ "./node_modules/babel-messages/lib/index.js": +/*!**************************************************!*\ + !*** ./node_modules/babel-messages/lib/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.MESSAGES = undefined; + +var _stringify = __webpack_require__(/*! babel-runtime/core-js/json/stringify */ "./node_modules/babel-runtime/core-js/json/stringify.js"); + +var _stringify2 = _interopRequireDefault(_stringify); + +exports.get = get; +exports.parseArgs = parseArgs; + +var _util = __webpack_require__(/*! util */ "./node_modules/node-libs-browser/node_modules/util/util.js"); + +var util = _interopRequireWildcard(_util); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var MESSAGES = exports.MESSAGES = { + tailCallReassignmentDeopt: "Function reference has been reassigned, so it will probably be dereferenced, therefore we can't optimise this with confidence", + classesIllegalBareSuper: "Illegal use of bare super", + classesIllegalSuperCall: "Direct super call is illegal in non-constructor, use super.$1() instead", + scopeDuplicateDeclaration: "Duplicate declaration $1", + settersNoRest: "Setters aren't allowed to have a rest", + noAssignmentsInForHead: "No assignments allowed in for-in/of head", + expectedMemberExpressionOrIdentifier: "Expected type MemberExpression or Identifier", + invalidParentForThisNode: "We don't know how to handle this node within the current parent - please open an issue", + readOnly: "$1 is read-only", + unknownForHead: "Unknown node type $1 in ForStatement", + didYouMean: "Did you mean $1?", + codeGeneratorDeopt: "Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.", + missingTemplatesDirectory: "no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues", + unsupportedOutputType: "Unsupported output type $1", + illegalMethodName: "Illegal method name $1", + lostTrackNodePath: "We lost track of this node's position, likely because the AST was directly manipulated", + modulesIllegalExportName: "Illegal export $1", + modulesDuplicateDeclarations: "Duplicate module declarations with the same source but in different scopes", + undeclaredVariable: "Reference to undeclared variable $1", + undeclaredVariableType: "Referencing a type alias outside of a type annotation", + undeclaredVariableSuggestion: "Reference to undeclared variable $1 - did you mean $2?", + traverseNeedsParent: "You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a $1 node without passing scope and parentPath.", + traverseVerifyRootFunction: "You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?", + traverseVerifyVisitorProperty: "You passed `traverse()` a visitor object with the property $1 that has the invalid property $2", + traverseVerifyNodeType: "You gave us a visitor for the node type $1 but it's not a valid type", + pluginNotObject: "Plugin $2 specified in $1 was expected to return an object when invoked but returned $3", + pluginNotFunction: "Plugin $2 specified in $1 was expected to return a function but returned $3", + pluginUnknown: "Unknown plugin $1 specified in $2 at $3, attempted to resolve relative to $4", + pluginInvalidProperty: "Plugin $2 specified in $1 provided an invalid property of $3" +}; + +function get(key) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var msg = MESSAGES[key]; + if (!msg) throw new ReferenceError("Unknown message " + (0, _stringify2.default)(key)); + args = parseArgs(args); + return msg.replace(/\$(\d+)/g, function (str, i) { + return args[i - 1]; + }); +} + +function parseArgs(args) { + return args.map(function (val) { + if (val != null && val.inspect) { + return val.inspect(); + } else { + try { + return (0, _stringify2.default)(val) || val + ""; + } catch (e) { + return util.inspect(val); + } + } + }); +} + +/***/ }), + +/***/ "./node_modules/babel-plugin-transform-es2015-arrow-functions/lib/index.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/babel-plugin-transform-es2015-arrow-functions/lib/index.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function (_ref) { + var t = _ref.types; + return { + visitor: { + ArrowFunctionExpression: function ArrowFunctionExpression(path, state) { + if (state.opts.spec) { + var node = path.node; + if (node.shadow) return; + node.shadow = { + this: false + }; + node.type = "FunctionExpression"; + var boundThis = t.thisExpression(); + boundThis._forceShadow = path; + path.ensureBlock(); + path.get("body").unshiftContainer("body", t.expressionStatement(t.callExpression(state.addHelper("newArrowCheck"), [t.thisExpression(), boundThis]))); + path.replaceWith(t.callExpression(t.memberExpression(node, t.identifier("bind")), [t.thisExpression()])); + } else { + path.arrowFunctionToShadowed(); + } + } + } + }; +}; + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/array/from.js": +/*!**********************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/array/from.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/array/from */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/array/from.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/get-iterator.js": +/*!************************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/get-iterator.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/get-iterator */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/get-iterator.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/json/stringify.js": +/*!**************************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/json/stringify.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/json/stringify */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/json/stringify.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/map.js": +/*!***************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/map.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/map */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/map.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/number/max-safe-integer.js": +/*!***********************************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/number/max-safe-integer.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/number/max-safe-integer */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/number/max-safe-integer.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/object/assign.js": +/*!*************************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/object/assign.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/object/assign */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/object/assign.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/object/create.js": +/*!*************************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/object/create.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/object/create */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/object/create.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/object/get-own-property-symbols.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/object/get-own-property-symbols.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/object/get-own-property-symbols */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/object/get-own-property-symbols.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/object/keys.js": +/*!***********************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/object/keys.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/object/keys */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/object/keys.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/object/set-prototype-of.js": +/*!***********************************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/object/set-prototype-of.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/object/set-prototype-of */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/object/set-prototype-of.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/symbol.js": +/*!******************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/symbol.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/symbol */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/index.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/symbol/for.js": +/*!**********************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/symbol/for.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/symbol/for */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/for.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/symbol/iterator.js": +/*!***************************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/symbol/iterator.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/symbol/iterator */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/iterator.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/weak-map.js": +/*!********************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/weak-map.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/weak-map */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/weak-map.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/core-js/weak-set.js": +/*!********************************************************!*\ + !*** ./node_modules/babel-runtime/core-js/weak-set.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + "default": __webpack_require__(/*! core-js/library/fn/weak-set */ "./node_modules/babel-runtime/node_modules/core-js/library/fn/weak-set.js"), + __esModule: true +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/helpers/classCallCheck.js": +/*!**************************************************************!*\ + !*** ./node_modules/babel-runtime/helpers/classCallCheck.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/helpers/extends.js": +/*!*******************************************************!*\ + !*** ./node_modules/babel-runtime/helpers/extends.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _assign = __webpack_require__(/*! ../core-js/object/assign */ "./node_modules/babel-runtime/core-js/object/assign.js"); + +var _assign2 = _interopRequireDefault(_assign); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +exports.default = _assign2.default || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/helpers/inherits.js": +/*!********************************************************!*\ + !*** ./node_modules/babel-runtime/helpers/inherits.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _setPrototypeOf = __webpack_require__(/*! ../core-js/object/set-prototype-of */ "./node_modules/babel-runtime/core-js/object/set-prototype-of.js"); + +var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); + +var _create = __webpack_require__(/*! ../core-js/object/create */ "./node_modules/babel-runtime/core-js/object/create.js"); + +var _create2 = _interopRequireDefault(_create); + +var _typeof2 = __webpack_require__(/*! ../helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +exports.default = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); + } + + subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/helpers/objectWithoutProperties.js": +/*!***********************************************************************!*\ + !*** ./node_modules/babel-runtime/helpers/objectWithoutProperties.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function (obj, keys) { + var target = {}; + + for (var i in obj) { + if (keys.indexOf(i) >= 0) continue; + if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; + target[i] = obj[i]; + } + + return target; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js": +/*!*************************************************************************!*\ + !*** ./node_modules/babel-runtime/helpers/possibleConstructorReturn.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _typeof2 = __webpack_require__(/*! ../helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +exports.default = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/helpers/typeof.js": +/*!******************************************************!*\ + !*** ./node_modules/babel-runtime/helpers/typeof.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _iterator = __webpack_require__(/*! ../core-js/symbol/iterator */ "./node_modules/babel-runtime/core-js/symbol/iterator.js"); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _symbol = __webpack_require__(/*! ../core-js/symbol */ "./node_modules/babel-runtime/core-js/symbol.js"); + +var _symbol2 = _interopRequireDefault(_symbol); + +var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; +}; + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); +} : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/array/from.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/array/from.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.string.iterator */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.string.iterator.js"); + +__webpack_require__(/*! ../../modules/es6.array.from */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.array.from.js"); + +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").Array.from; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/get-iterator.js": +/*!************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/get-iterator.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../modules/web.dom.iterable */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/web.dom.iterable.js"); + +__webpack_require__(/*! ../modules/es6.string.iterator */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.string.iterator.js"); + +module.exports = __webpack_require__(/*! ../modules/core.get-iterator */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/core.get-iterator.js"); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/json/stringify.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/json/stringify.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(/*! ../../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js"); + +var $JSON = core.JSON || (core.JSON = { + stringify: JSON.stringify +}); + +module.exports = function stringify(it) { + // eslint-disable-line no-unused-vars + return $JSON.stringify.apply($JSON, arguments); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/map.js": +/*!***************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/map.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../modules/es6.object.to-string */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.to-string.js"); + +__webpack_require__(/*! ../modules/es6.string.iterator */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.string.iterator.js"); + +__webpack_require__(/*! ../modules/web.dom.iterable */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/web.dom.iterable.js"); + +__webpack_require__(/*! ../modules/es6.map */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.map.js"); + +__webpack_require__(/*! ../modules/es7.map.to-json */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.map.to-json.js"); + +__webpack_require__(/*! ../modules/es7.map.of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.map.of.js"); + +__webpack_require__(/*! ../modules/es7.map.from */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.map.from.js"); + +module.exports = __webpack_require__(/*! ../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").Map; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/number/max-safe-integer.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/number/max-safe-integer.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.number.max-safe-integer */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.number.max-safe-integer.js"); + +module.exports = 0x1fffffffffffff; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/object/assign.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/object/assign.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.object.assign */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.assign.js"); + +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").Object.assign; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/object/create.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/object/create.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.object.create */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.create.js"); + +var $Object = __webpack_require__(/*! ../../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").Object; + +module.exports = function create(P, D) { + return $Object.create(P, D); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/object/get-own-property-symbols.js": +/*!*******************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/object/get-own-property-symbols.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.symbol */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.symbol.js"); + +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").Object.getOwnPropertySymbols; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/object/keys.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/object/keys.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.object.keys */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.keys.js"); + +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").Object.keys; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/object/set-prototype-of.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/object/set-prototype-of.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.object.set-prototype-of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.set-prototype-of.js"); + +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").Object.setPrototypeOf; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/for.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/for.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.symbol */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.symbol.js"); + +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").Symbol['for']; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/index.js": +/*!************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/index.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.symbol */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.symbol.js"); + +__webpack_require__(/*! ../../modules/es6.object.to-string */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.to-string.js"); + +__webpack_require__(/*! ../../modules/es7.symbol.async-iterator */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.symbol.async-iterator.js"); + +__webpack_require__(/*! ../../modules/es7.symbol.observable */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.symbol.observable.js"); + +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").Symbol; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/iterator.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/symbol/iterator.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es6.string.iterator */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.string.iterator.js"); + +__webpack_require__(/*! ../../modules/web.dom.iterable */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/web.dom.iterable.js"); + +module.exports = __webpack_require__(/*! ../../modules/_wks-ext */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-ext.js").f('iterator'); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/weak-map.js": +/*!********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/weak-map.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../modules/es6.object.to-string */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.to-string.js"); + +__webpack_require__(/*! ../modules/web.dom.iterable */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/web.dom.iterable.js"); + +__webpack_require__(/*! ../modules/es6.weak-map */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.weak-map.js"); + +__webpack_require__(/*! ../modules/es7.weak-map.of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-map.of.js"); + +__webpack_require__(/*! ../modules/es7.weak-map.from */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-map.from.js"); + +module.exports = __webpack_require__(/*! ../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").WeakMap; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/fn/weak-set.js": +/*!********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/fn/weak-set.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../modules/es6.object.to-string */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.to-string.js"); + +__webpack_require__(/*! ../modules/web.dom.iterable */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/web.dom.iterable.js"); + +__webpack_require__(/*! ../modules/es6.weak-set */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.weak-set.js"); + +__webpack_require__(/*! ../modules/es7.weak-set.of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-set.of.js"); + +__webpack_require__(/*! ../modules/es7.weak-set.from */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-set.from.js"); + +module.exports = __webpack_require__(/*! ../modules/_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").WeakSet; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_a-function.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_a-function.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_add-to-unscopables.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_add-to-unscopables.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function () { + /* empty */ +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-instance.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-instance.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || forbiddenField !== undefined && forbiddenField in it) { + throw TypeError(name + ': incorrect invocation!'); + } + + return it; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); + +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-from-iterable.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-from-iterable.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_for-of.js"); + +module.exports = function (iter, ITERATOR) { + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-includes.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-includes.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-iobject.js"); + +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-length.js"); + +var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-absolute-index.js"); + +module.exports = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; // eslint-disable-next-line no-self-compare + + if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not + } else for (; length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } + return !IS_INCLUDES && -1; + }; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-methods.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-methods.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 0 -> Array#forEach +// 1 -> Array#map +// 2 -> Array#filter +// 3 -> Array#some +// 4 -> Array#every +// 5 -> Array#find +// 6 -> Array#findIndex +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js"); + +var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iobject.js"); + +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-object.js"); + +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-length.js"); + +var asc = __webpack_require__(/*! ./_array-species-create */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-species-create.js"); + +module.exports = function (TYPE, $create) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + var create = $create || asc; + return function ($this, callbackfn, that) { + var O = toObject($this); + var self = IObject(O); + var f = ctx(callbackfn, that, 3); + var length = toLength(self.length); + var index = 0; + var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var val, res; + + for (; length > index; index++) if (NO_HOLES || index in self) { + val = self[index]; + res = f(val, index, O); + + if (TYPE) { + if (IS_MAP) result[index] = res; // map + else if (res) switch (TYPE) { + case 3: + return true; + // some + + case 5: + return val; + // find + + case 6: + return index; + // findIndex + + case 2: + result.push(val); + // filter + } else if (IS_EVERY) return false; // every + } + } + + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-species-constructor.js": +/*!*******************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-species-constructor.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); + +var isArray = __webpack_require__(/*! ./_is-array */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-array.js"); + +var SPECIES = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js")('species'); + +module.exports = function (original) { + var C; + + if (isArray(original)) { + C = original.constructor; // cross-realm fallback + + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + + if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } + + return C === undefined ? Array : C; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-species-create.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-species-create.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = __webpack_require__(/*! ./_array-species-constructor */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-species-constructor.js"); + +module.exports = function (original, length) { + return new (speciesConstructor(original))(length); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_classof.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_classof.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_cof.js"); + +var TAG = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js")('toStringTag'); // ES3 wrong here + + +var ARG = cof(function () { + return arguments; +}()) == 'Arguments'; // fallback for IE11 Script Access Denied error + +var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { + /* empty */ + } +}; + +module.exports = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T // builtinTag case + : ARG ? cof(O) // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_cof.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_cof.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection-strong.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection-strong.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js").f; + +var create = __webpack_require__(/*! ./_object-create */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-create.js"); + +var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine-all.js"); + +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js"); + +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-instance.js"); + +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_for-of.js"); + +var $iterDefine = __webpack_require__(/*! ./_iter-define */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-define.js"); + +var step = __webpack_require__(/*! ./_iter-step */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-step.js"); + +var setSpecies = __webpack_require__(/*! ./_set-species */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-species.js"); + +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js"); + +var fastKey = __webpack_require__(/*! ./_meta */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_meta.js").fastKey; + +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_validate-collection.js"); + +var SIZE = DESCRIPTORS ? '_s' : 'size'; + +var getEntry = function (that, key) { + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return that._i[index]; // frozen object case + + for (entry = that._f; entry; entry = entry.n) { + if (entry.k == key) return entry; + } +}; + +module.exports = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + + that._i = create(null); // index + + that._f = undefined; // first entry + + that._l = undefined; // last entry + + that[SIZE] = 0; // size + + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { + entry.r = true; + if (entry.p) entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = validate(this, NAME); + var entry = getEntry(that, key); + + if (entry) { + var next = entry.n; + var prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if (prev) prev.n = next; + if (next) next.p = prev; + if (that._f == entry) that._f = next; + if (that._l == entry) that._l = prev; + that[SIZE]--; + } + + return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn + /* , that = undefined */ + ) { + validate(this, NAME); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + + while (entry = entry ? entry.n : this._f) { + f(entry.v, entry.k, this); // revert to the last existing entry + + while (entry && entry.r) entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(validate(this, NAME), key); + } + }); + if (DESCRIPTORS) dP(C.prototype, 'size', { + get: function () { + return validate(this, NAME)[SIZE]; + } + }); + return C; + }, + def: function (that, key, value) { + var entry = getEntry(that, key); + var prev, index; // change existing entry + + if (entry) { + entry.v = value; // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), + // <- index + k: key, + // <- key + v: value, + // <- value + p: prev = that._l, + // <- previous entry + n: undefined, + // <- next entry + r: false // <- removed + + }; + if (!that._f) that._f = entry; + if (prev) prev.n = entry; + that[SIZE]++; // add to index + + if (index !== 'F') that._i[index] = entry; + } + + return that; + }, + getEntry: getEntry, + setStrong: function (C, NAME, IS_MAP) { + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function (iterated, kind) { + this._t = validate(iterated, NAME); // target + + this._k = kind; // kind + + this._l = undefined; // previous + }, function () { + var that = this; + var kind = that._k; + var entry = that._l; // revert to the last existing entry + + while (entry && entry.r) entry = entry.p; // get next entry + + + if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { + // or finish the iteration + that._t = undefined; + return step(1); + } // return step by kind + + + if (kind == 'keys') return step(0, entry.k); + if (kind == 'values') return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // add [@@species], 23.1.2.2, 23.2.2.2 + + setSpecies(NAME); + } +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection-to-json.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection-to-json.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = __webpack_require__(/*! ./_classof */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_classof.js"); + +var from = __webpack_require__(/*! ./_array-from-iterable */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-from-iterable.js"); + +module.exports = function (NAME) { + return function toJSON() { + if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection-weak.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection-weak.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine-all.js"); + +var getWeak = __webpack_require__(/*! ./_meta */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_meta.js").getWeak; + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js"); + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); + +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-instance.js"); + +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_for-of.js"); + +var createArrayMethod = __webpack_require__(/*! ./_array-methods */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-methods.js"); + +var $has = __webpack_require__(/*! ./_has */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js"); + +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_validate-collection.js"); + +var arrayFind = createArrayMethod(5); +var arrayFindIndex = createArrayMethod(6); +var id = 0; // fallback for uncaught frozen keys + +var uncaughtFrozenStore = function (that) { + return that._l || (that._l = new UncaughtFrozenStore()); +}; + +var UncaughtFrozenStore = function () { + this.a = []; +}; + +var findUncaughtFrozen = function (store, key) { + return arrayFind(store.a, function (it) { + return it[0] === key; + }); +}; + +UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value;else this.a.push([key, value]); + }, + 'delete': function (key) { + var index = arrayFindIndex(this.a, function (it) { + return it[0] === key; + }); + if (~index) this.a.splice(index, 1); + return !!~index; + } +}; +module.exports = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + + that._i = id++; // collection id + + that._l = undefined; // leak store for uncaught frozen objects + + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function (key) { + if (!isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); + return data && $has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + if (!isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); + return data && $has(data, this._i); + } + }); + return C; + }, + def: function (that, key, value) { + var data = getWeak(anObject(key), true); + if (data === true) uncaughtFrozenStore(that).set(key, value);else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var global = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js"); + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +var meta = __webpack_require__(/*! ./_meta */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_meta.js"); + +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_fails.js"); + +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js"); + +var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine-all.js"); + +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_for-of.js"); + +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-instance.js"); + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); + +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-to-string-tag.js"); + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js").f; + +var each = __webpack_require__(/*! ./_array-methods */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-methods.js")(0); + +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js"); + +module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { + var Base = global[NAME]; + var C = Base; + var ADDER = IS_MAP ? 'set' : 'add'; + var proto = C && C.prototype; + var O = {}; + + if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { + new C().entries().next(); + }))) { + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + C = wrapper(function (target, iterable) { + anInstance(target, C, NAME, '_c'); + target._c = new Base(); + if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target); + }); + each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { + var IS_ADDER = KEY == 'add' || KEY == 'set'; + if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) { + anInstance(this, C, KEY); + if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false; + + var result = this._c[KEY](a === 0 ? 0 : a, b); + + return IS_ADDER ? this : result; + }); + }); + IS_WEAK || dP(C.prototype, 'size', { + get: function () { + return this._c.size; + } + }); + } + + setToStringTag(C, NAME); + O[NAME] = C; + $export($export.G + $export.W + $export.F, O); + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + return C; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var core = module.exports = { + version: '2.6.9' +}; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_create-property.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_create-property.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var $defineProperty = __webpack_require__(/*! ./_object-dp */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js"); + +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_property-desc.js"); + +module.exports = function (object, index, value) { + if (index in object) $defineProperty.f(object, index, createDesc(0, value));else object[index] = value; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_a-function.js"); + +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + + switch (length) { + case 1: + return function (a) { + return fn.call(that, a); + }; + + case 2: + return function (a, b) { + return fn.call(that, a, b); + }; + + case 3: + return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + + return function () + /* ...args */ + { + return fn.apply(that, arguments); + }; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_defined.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_defined.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(/*! ./_fails */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_fails.js")(function () { + return Object.defineProperty({}, 'a', { + get: function () { + return 7; + } + }).a != 7; +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_dom-create.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_dom-create.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); + +var document = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js").document; // typeof document.createElement is 'object' in old IE + + +var is = isObject(document) && isObject(document.createElement); + +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_enum-bug-keys.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_enum-bug-keys.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'.split(','); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_enum-keys.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_enum-keys.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys.js"); + +var gOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gops.js"); + +var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-pie.js"); + +module.exports = function (it) { + var result = getKeys(it); + var getSymbols = gOPS.f; + + if (getSymbols) { + var symbols = getSymbols(it); + var isEnum = pIE.f; + var i = 0; + var key; + + while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); + } + + return result; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js": +/*!************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js"); + +var core = __webpack_require__(/*! ./_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js"); + +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js"); + +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js"); + +var has = __webpack_require__(/*! ./_has */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js"); + +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && has(exports, key)) continue; // export native or passed + + out = own ? target[key] : source[key]; // prevent global pollution for namespaces + + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: + return new C(); + + case 1: + return new C(a); + + case 2: + return new C(a, b); + } + + return new C(a, b, c); + } + + return C.apply(this, arguments); + }; + + F[PROTOTYPE] = C[PROTOTYPE]; + return F; // make static versions for prototype methods + }(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + + if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); + } + } +}; // type bitmap + + +$export.F = 1; // forced + +$export.G = 2; // global + +$export.S = 4; // static + +$export.P = 8; // proto + +$export.B = 16; // bind + +$export.W = 32; // wrap + +$export.U = 64; // safe + +$export.R = 128; // real proto method for `library` + +module.exports = $export; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_fails.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_fails.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_for-of.js": +/*!************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_for-of.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js"); + +var call = __webpack_require__(/*! ./_iter-call */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-call.js"); + +var isArrayIter = __webpack_require__(/*! ./_is-array-iter */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-array-iter.js"); + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js"); + +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-length.js"); + +var getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/core.get-iterator-method.js"); + +var BREAK = {}; +var RETURN = {}; + +var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { + return iterable; + } : getIterFn(iterable); + var f = ctx(fn, that, entries ? 2 : 1); + var index = 0; + var length, step, iterator, result; + if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator + + if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if (result === BREAK || result === RETURN) return result; + } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { + result = call(iterator, f, step.value, entries); + if (result === BREAK || result === RETURN) return result; + } +}; + +exports.BREAK = BREAK; +exports.RETURN = RETURN; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js": +/*!************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func +: Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; + +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js"); + +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_property-desc.js"); + +module.exports = __webpack_require__(/*! ./_descriptors */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js") ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_html.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_html.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var document = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js").document; + +module.exports = document && document.documentElement; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ie8-dom-define.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_ie8-dom-define.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(/*! ./_descriptors */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js") && !__webpack_require__(/*! ./_fails */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_fails.js")(function () { + return Object.defineProperty(__webpack_require__(/*! ./_dom-create */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_dom-create.js")('div'), 'a', { + get: function () { + return 7; + } + }).a != 7; +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iobject.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_iobject.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_cof.js"); // eslint-disable-next-line no-prototype-builtins + + +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-array-iter.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-array-iter.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// check on default Array iterator +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iterators.js"); + +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js")('iterator'); + +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-array.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-array.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_cof.js"); + +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-call.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-call.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// call something on iterator step with safe closing on error +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js"); + +module.exports = function (iterator, fn, value, entries) { + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) + } catch (e) { + var ret = iterator['return']; + if (ret !== undefined) anObject(ret.call(iterator)); + throw e; + } +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-create.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-create.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var create = __webpack_require__(/*! ./_object-create */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-create.js"); + +var descriptor = __webpack_require__(/*! ./_property-desc */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_property-desc.js"); + +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-to-string-tag.js"); + +var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + +__webpack_require__(/*! ./_hide */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js")(IteratorPrototype, __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js")('iterator'), function () { + return this; +}); + +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { + next: descriptor(1, next) + }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-define.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-define.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_library.js"); + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine.js"); + +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js"); + +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iterators.js"); + +var $iterCreate = __webpack_require__(/*! ./_iter-create */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-create.js"); + +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-to-string-tag.js"); + +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gpo.js"); + +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js")('iterator'); + +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` + +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; + +var returnThis = function () { + return this; +}; + +module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + $iterCreate(Constructor, NAME, next); + + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + + switch (kind) { + case KEYS: + return function keys() { + return new Constructor(this, kind); + }; + + case VALUES: + return function values() { + return new Constructor(this, kind); + }; + } + + return function entries() { + return new Constructor(this, kind); + }; + }; + + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; // Fix native + + if ($anyNative) { + IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); + + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines + + if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); + } + } // fix Array#{values, @@iterator}.name in V8 / FF + + + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + + $default = function values() { + return $native.call(this); + }; + } // Define iterator + + + if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + hide(proto, ITERATOR, $default); + } // Plug for library + + + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + + return methods; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-detect.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-detect.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js")('iterator'); + +var SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + + riter['return'] = function () { + SAFE_CLOSING = true; + }; // eslint-disable-next-line no-throw-literal + + + Array.from(riter, function () { + throw 2; + }); +} catch (e) { + /* empty */ +} + +module.exports = function (exec, skipClosing) { + if (!skipClosing && !SAFE_CLOSING) return false; + var safe = false; + + try { + var arr = [7]; + var iter = arr[ITERATOR](); + + iter.next = function () { + return { + done: safe = true + }; + }; + + arr[ITERATOR] = function () { + return iter; + }; + + exec(arr); + } catch (e) { + /* empty */ + } + + return safe; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-step.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-step.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (done, value) { + return { + value: value, + done: !!done + }; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iterators.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_iterators.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = {}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_library.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_library.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = true; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_meta.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_meta.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var META = __webpack_require__(/*! ./_uid */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_uid.js")('meta'); + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); + +var has = __webpack_require__(/*! ./_has */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js"); + +var setDesc = __webpack_require__(/*! ./_object-dp */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js").f; + +var id = 0; + +var isExtensible = Object.isExtensible || function () { + return true; +}; + +var FREEZE = !__webpack_require__(/*! ./_fails */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_fails.js")(function () { + return isExtensible(Object.preventExtensions({})); +}); + +var setMeta = function (it) { + setDesc(it, META, { + value: { + i: 'O' + ++id, + // object ID + w: {} // weak collections IDs + + } + }); +}; + +var fastKey = function (it, create) { + // return primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; // not necessary to add metadata + + if (!create) return 'E'; // add missing metadata + + setMeta(it); // return object ID + } + + return it[META].i; +}; + +var getWeak = function (it, create) { + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; // not necessary to add metadata + + if (!create) return false; // add missing metadata + + setMeta(it); // return hash weak collections IDs + } + + return it[META].w; +}; // add metadata on freeze-family methods calling + + +var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); + return it; +}; + +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-assign.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-assign.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + // 19.1.2.1 Object.assign(target, source, ...) + +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js"); + +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys.js"); + +var gOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gops.js"); + +var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-pie.js"); + +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-object.js"); + +var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iobject.js"); + +var $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) + +module.exports = !$assign || __webpack_require__(/*! ./_fails */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_fails.js")(function () { + var A = {}; + var B = {}; // eslint-disable-next-line no-undef + + var S = Symbol(); + var K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function (k) { + B[k] = k; + }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source) { + // eslint-disable-line no-unused-vars + var T = toObject(target); + var aLen = arguments.length; + var index = 1; + var getSymbols = gOPS.f; + var isEnum = pIE.f; + + while (aLen > index) { + var S = IObject(arguments[index++]); + var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); + var length = keys.length; + var j = 0; + var key; + + while (length > j) { + key = keys[j++]; + if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key]; + } + } + + return T; +} : $assign; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-create.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-create.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js"); + +var dPs = __webpack_require__(/*! ./_object-dps */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dps.js"); + +var enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_enum-bug-keys.js"); + +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO'); + +var Empty = function () { + /* empty */ +}; + +var PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype + +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(/*! ./_dom-create */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_dom-create.js")('iframe'); + + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + + __webpack_require__(/*! ./_html */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_html.js").appendChild(iframe); + + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; + + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties) { + var result; + + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill + + result[IE_PROTO] = O; + } else result = createDict(); + + return Properties === undefined ? result : dPs(result, Properties); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js"); + +var IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ie8-dom-define.js"); + +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-primitive.js"); + +var dP = Object.defineProperty; +exports.f = __webpack_require__(/*! ./_descriptors */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js") ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { + /* empty */ + } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dps.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dps.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js"); + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js"); + +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys.js"); + +module.exports = __webpack_require__(/*! ./_descriptors */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js") ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = getKeys(Properties); + var length = keys.length; + var i = 0; + var P; + + while (length > i) dP.f(O, P = keys[i++], Properties[P]); + + return O; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopd.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopd.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-pie.js"); + +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_property-desc.js"); + +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-iobject.js"); + +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-primitive.js"); + +var has = __webpack_require__(/*! ./_has */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js"); + +var IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ie8-dom-define.js"); + +var gOPD = Object.getOwnPropertyDescriptor; +exports.f = __webpack_require__(/*! ./_descriptors */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js") ? gOPD : function getOwnPropertyDescriptor(O, P) { + O = toIObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return gOPD(O, P); + } catch (e) { + /* empty */ + } + if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopn-ext.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopn-ext.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-iobject.js"); + +var gOPN = __webpack_require__(/*! ./_object-gopn */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopn.js").f; + +var toString = {}.toString; +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function (it) { + try { + return gOPN(it); + } catch (e) { + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopn.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopn.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(/*! ./_object-keys-internal */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys-internal.js"); + +var hiddenKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_enum-bug-keys.js").concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gops.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gops.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gpo.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gpo.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __webpack_require__(/*! ./_has */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js"); + +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-object.js"); + +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO'); + +var ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } + + return O instanceof Object ? ObjectProto : null; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys-internal.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys-internal.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(/*! ./_has */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js"); + +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-iobject.js"); + +var arrayIndexOf = __webpack_require__(/*! ./_array-includes */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-includes.js")(false); + +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO'); + +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); // Don't enum bug & hidden keys + + + while (names.length > i) if (has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + + return result; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(/*! ./_object-keys-internal */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys-internal.js"); + +var enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_enum-bug-keys.js"); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-pie.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-pie.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-sap.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-sap.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +var core = __webpack_require__(/*! ./_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js"); + +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_fails.js"); + +module.exports = function (KEY, exec) { + var fn = (core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function () { + fn(1); + }), 'Object', exp); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_property-desc.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_property-desc.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine-all.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine-all.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js"); + +module.exports = function (target, src, safe) { + for (var key in src) { + if (safe && target[key]) target[key] = src[key];else hide(target, key, src[key]); + } + + return target; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./_hide */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js"); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-collection-from.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-collection-from.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + // https://tc39.github.io/proposal-setmap-offrom/ + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_a-function.js"); + +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js"); + +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_for-of.js"); + +module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { + from: function from(source + /* , mapFn, thisArg */ + ) { + var mapFn = arguments[1]; + var mapping, A, n, cb; + aFunction(this); + mapping = mapFn !== undefined; + if (mapping) aFunction(mapFn); + if (source == undefined) return new this(); + A = []; + + if (mapping) { + n = 0; + cb = ctx(mapFn, arguments[2], 2); + forOf(source, false, function (nextItem) { + A.push(cb(nextItem, n++)); + }); + } else { + forOf(source, false, A.push, A); + } + + return new this(A); + } + }); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-collection-of.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-collection-of.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + // https://tc39.github.io/proposal-setmap-offrom/ + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { + of: function of() { + var length = arguments.length; + var A = new Array(length); + + while (length--) A[length] = arguments[length]; + + return new this(A); + } + }); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-proto.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-proto.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// Works with __proto__ only. Old v8 can't work with null proto objects. + +/* eslint-disable no-proto */ +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js"); + +var check = function (O, proto) { + anObject(O); + if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); +}; + +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function (test, buggy, set) { + try { + set = __webpack_require__(/*! ./_ctx */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js")(Function.call, __webpack_require__(/*! ./_object-gopd */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopd.js").f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch (e) { + buggy = true; + } + + return function setPrototypeOf(O, proto) { + check(O, proto); + if (buggy) O.__proto__ = proto;else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-species.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-species.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var global = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js"); + +var core = __webpack_require__(/*! ./_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js"); + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js"); + +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js"); + +var SPECIES = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js")('species'); + +module.exports = function (KEY) { + var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; + if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { + configurable: true, + get: function () { + return this; + } + }); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-to-string-tag.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-to-string-tag.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(/*! ./_object-dp */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js").f; + +var has = __webpack_require__(/*! ./_has */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js"); + +var TAG = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js")('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { + configurable: true, + value: tag + }); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_shared-key.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_shared-key.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(/*! ./_shared */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_shared.js")('keys'); + +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_uid.js"); + +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_shared.js": +/*!************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_shared.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(/*! ./_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js"); + +var global = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js"); + +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: core.version, + mode: __webpack_require__(/*! ./_library */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_library.js") ? 'pure' : 'global', + copyright: '© 2019 Denis Pushkarev (zloirock.ru)' +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_string-at.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_string-at.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-integer.js"); + +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_defined.js"); // true -> String#at +// false -> String#codePointAt + + +module.exports = function (TO_STRING) { + return function (that, pos) { + var s = String(defined(that)); + var i = toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-absolute-index.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-absolute-index.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-integer.js"); + +var max = Math.max; +var min = Math.min; + +module.exports = function (index, length) { + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-integer.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-integer.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; + +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-iobject.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-iobject.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iobject.js"); + +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_defined.js"); + +module.exports = function (it) { + return IObject(defined(it)); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-length.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-length.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-integer.js"); + +var min = Math.min; + +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-object.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-object.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_defined.js"); + +module.exports = function (it) { + return Object(defined(it)); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-primitive.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-primitive.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); // instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string + + +module.exports = function (it, S) { + if (!isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_uid.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_uid.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); + +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_validate-collection.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_validate-collection.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); + +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-define.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-define.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js"); + +var core = __webpack_require__(/*! ./_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js"); + +var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_library.js"); + +var wksExt = __webpack_require__(/*! ./_wks-ext */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-ext.js"); + +var defineProperty = __webpack_require__(/*! ./_object-dp */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js").f; + +module.exports = function (name) { + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { + value: wksExt.f(name) + }); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-ext.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-ext.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js"); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(/*! ./_shared */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_shared.js")('wks'); + +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_uid.js"); + +var Symbol = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js").Symbol; + +var USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function (name) { + return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/core.get-iterator-method.js": +/*!*****************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/core.get-iterator-method.js ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(/*! ./_classof */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_classof.js"); + +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js")('iterator'); + +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iterators.js"); + +module.exports = __webpack_require__(/*! ./_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/core.get-iterator.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/core.get-iterator.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js"); + +var get = __webpack_require__(/*! ./core.get-iterator-method */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/core.get-iterator-method.js"); + +module.exports = __webpack_require__(/*! ./_core */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_core.js").getIterator = function (it) { + var iterFn = get(it); + if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); +}; + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.array.from.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.array.from.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js"); + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-object.js"); + +var call = __webpack_require__(/*! ./_iter-call */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-call.js"); + +var isArrayIter = __webpack_require__(/*! ./_is-array-iter */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-array-iter.js"); + +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-length.js"); + +var createProperty = __webpack_require__(/*! ./_create-property */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_create-property.js"); + +var getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/core.get-iterator-method.js"); + +$export($export.S + $export.F * !__webpack_require__(/*! ./_iter-detect */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-detect.js")(function (iter) { + Array.from(iter); +}), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike + /* , mapfn = undefined, thisArg = undefined */ + ) { + var O = toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var index = 0; + var iterFn = getIterFn(O); + var length, result, step, iterator; + if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); // if object isn't iterable or it's array with default iterator - use simple case + + if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + + for (result = new C(length); length > index; index++) { + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + + result.length = index; + return result; + } +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.array.iterator.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.array.iterator.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var addToUnscopables = __webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_add-to-unscopables.js"); + +var step = __webpack_require__(/*! ./_iter-step */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-step.js"); + +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iterators.js"); + +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-iobject.js"); // 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() + + +module.exports = __webpack_require__(/*! ./_iter-define */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-define.js")(Array, 'Array', function (iterated, kind) { + this._t = toIObject(iterated); // target + + this._i = 0; // next index + + this._k = kind; // kind + // 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + + if (!O || index >= O.length) { + this._t = undefined; + return step(1); + } + + if (kind == 'keys') return step(0, index); + if (kind == 'values') return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) + +Iterators.Arguments = Iterators.Array; +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.map.js": +/*!************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.map.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var strong = __webpack_require__(/*! ./_collection-strong */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection-strong.js"); + +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_validate-collection.js"); + +var MAP = 'Map'; // 23.1 Map Objects + +module.exports = __webpack_require__(/*! ./_collection */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection.js")(MAP, function (get) { + return function Map() { + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; +}, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key) { + var entry = strong.getEntry(validate(this, MAP), key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value) { + return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); + } +}, strong, true); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.number.max-safe-integer.js": +/*!********************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.number.max-safe-integer.js ***! + \********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +$export($export.S, 'Number', { + MAX_SAFE_INTEGER: 0x1fffffffffffff +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.assign.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.assign.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.1 Object.assign(target, source) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +$export($export.S + $export.F, 'Object', { + assign: __webpack_require__(/*! ./_object-assign */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-assign.js") +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.create.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.create.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + + +$export($export.S, 'Object', { + create: __webpack_require__(/*! ./_object-create */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-create.js") +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.keys.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.keys.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 Object.keys(O) +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-object.js"); + +var $keys = __webpack_require__(/*! ./_object-keys */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys.js"); + +__webpack_require__(/*! ./_object-sap */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-sap.js")('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.set-prototype-of.js": +/*!********************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.set-prototype-of.js ***! + \********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +$export($export.S, 'Object', { + setPrototypeOf: __webpack_require__(/*! ./_set-proto */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-proto.js").set +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.to-string.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.object.to-string.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + + + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.string.iterator.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.string.iterator.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var $at = __webpack_require__(/*! ./_string-at */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_string-at.js")(true); // 21.1.3.27 String.prototype[@@iterator]() + + +__webpack_require__(/*! ./_iter-define */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iter-define.js")(String, 'String', function (iterated) { + this._t = String(iterated); // target + + this._i = 0; // next index + // 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { + value: undefined, + done: true + }; + point = $at(O, index); + this._i += point.length; + return { + value: point, + done: false + }; +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.symbol.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.symbol.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + // ECMAScript 6 symbols shim + +var global = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js"); + +var has = __webpack_require__(/*! ./_has */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_has.js"); + +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_descriptors.js"); + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine.js"); + +var META = __webpack_require__(/*! ./_meta */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_meta.js").KEY; + +var $fails = __webpack_require__(/*! ./_fails */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_fails.js"); + +var shared = __webpack_require__(/*! ./_shared */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_shared.js"); + +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-to-string-tag.js"); + +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_uid.js"); + +var wks = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js"); + +var wksExt = __webpack_require__(/*! ./_wks-ext */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-ext.js"); + +var wksDefine = __webpack_require__(/*! ./_wks-define */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-define.js"); + +var enumKeys = __webpack_require__(/*! ./_enum-keys */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_enum-keys.js"); + +var isArray = __webpack_require__(/*! ./_is-array */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-array.js"); + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_an-object.js"); + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); + +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-object.js"); + +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-iobject.js"); + +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_to-primitive.js"); + +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_property-desc.js"); + +var _create = __webpack_require__(/*! ./_object-create */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-create.js"); + +var gOPNExt = __webpack_require__(/*! ./_object-gopn-ext */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopn-ext.js"); + +var $GOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopd.js"); + +var $GOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gops.js"); + +var $DP = __webpack_require__(/*! ./_object-dp */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-dp.js"); + +var $keys = __webpack_require__(/*! ./_object-keys */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-keys.js"); + +var gOPD = $GOPD.f; +var dP = $DP.f; +var gOPN = gOPNExt.f; +var $Symbol = global.Symbol; +var $JSON = global.JSON; + +var _stringify = $JSON && $JSON.stringify; + +var PROTOTYPE = 'prototype'; +var HIDDEN = wks('_hidden'); +var TO_PRIMITIVE = wks('toPrimitive'); +var isEnum = {}.propertyIsEnumerable; +var SymbolRegistry = shared('symbol-registry'); +var AllSymbols = shared('symbols'); +var OPSymbols = shared('op-symbols'); +var ObjectProto = Object[PROTOTYPE]; +var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f; +var QObject = global.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + +var setSymbolDesc = DESCRIPTORS && $fails(function () { + return _create(dP({}, 'a', { + get: function () { + return dP(this, 'a', { + value: 7 + }).a; + } + })).a != 7; +}) ? function (it, key, D) { + var protoDesc = gOPD(ObjectProto, key); + if (protoDesc) delete ObjectProto[key]; + dP(it, key, D); + if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function (tag) { + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D) { + if (it === ObjectProto) $defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + + if (has(AllSymbols, key)) { + if (!D.enumerable) { + if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; + D = _create(D, { + enumerable: createDesc(0, false) + }); + } + + return setSymbolDesc(it, key, D); + } + + return dP(it, key, D); +}; + +var $defineProperties = function defineProperties(it, P) { + anObject(it); + var keys = enumKeys(P = toIObject(P)); + var i = 0; + var l = keys.length; + var key; + + while (l > i) $defineProperty(it, key = keys[i++], P[key]); + + return it; +}; + +var $create = function create(it, P) { + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; + +var $propertyIsEnumerable = function propertyIsEnumerable(key) { + var E = isEnum.call(this, key = toPrimitive(key, true)); + if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; + +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { + it = toIObject(it); + key = toPrimitive(key, true); + if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; + var D = gOPD(it, key); + if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; + return D; +}; + +var $getOwnPropertyNames = function getOwnPropertyNames(it) { + var names = gOPN(toIObject(it)); + var result = []; + var i = 0; + var key; + + while (names.length > i) { + if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); + } + + return result; +}; + +var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { + var IS_OP = it === ObjectProto; + var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); + var result = []; + var i = 0; + var key; + + while (names.length > i) { + if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); + } + + return result; +}; // 19.4.1.1 Symbol([description]) + + +if (!USE_NATIVE) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + + var $set = function (value) { + if (this === ObjectProto) $set.call(OPSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + + if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { + configurable: true, + set: $set + }); + return wrap(tag); + }; + + redefine($Symbol[PROTOTYPE], 'toString', function toString() { + return this._k; + }); + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(/*! ./_object-gopn */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-gopn.js").f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(/*! ./_object-pie */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-pie.js").f = $propertyIsEnumerable; + $GOPS.f = $getOwnPropertySymbols; + + if (DESCRIPTORS && !__webpack_require__(/*! ./_library */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_library.js")) { + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function (name) { + return wrap(wks(name)); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { + Symbol: $Symbol +}); + +for (var es6Symbols = // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 +'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'.split(','), j = 0; es6Symbols.length > j;) wks(es6Symbols[j++]); + +for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function (key) { + return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); + + for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; + }, + useSetter: function () { + setter = true; + }, + useSimple: function () { + setter = false; + } +}); +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives +// https://bugs.chromium.org/p/v8/issues/detail?id=3443 + +var FAILS_ON_PRIMITIVES = $fails(function () { + $GOPS.f(1); +}); +$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', { + getOwnPropertySymbols: function getOwnPropertySymbols(it) { + return $GOPS.f(toObject(it)); + } +}); // 24.3.2 JSON.stringify(value [, replacer [, space]]) + +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { + var S = $Symbol(); // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + + return _stringify([S]) != '[null]' || _stringify({ + a: S + }) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it) { + var args = [it]; + var i = 1; + var replacer, $replacer; + + while (arguments.length > i) args.push(arguments[i++]); + + $replacer = replacer = args[1]; + if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + + if (!isArray(replacer)) replacer = function (key, value) { + if (typeof $replacer == 'function') value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) + +$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(/*! ./_hide */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js")($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); // 19.4.3.5 Symbol.prototype[@@toStringTag] + +setToStringTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] + +setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] + +setToStringTag(global.JSON, 'JSON', true); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.weak-map.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.weak-map.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var global = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js"); + +var each = __webpack_require__(/*! ./_array-methods */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_array-methods.js")(0); + +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_redefine.js"); + +var meta = __webpack_require__(/*! ./_meta */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_meta.js"); + +var assign = __webpack_require__(/*! ./_object-assign */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_object-assign.js"); + +var weak = __webpack_require__(/*! ./_collection-weak */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection-weak.js"); + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_is-object.js"); + +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_validate-collection.js"); + +var NATIVE_WEAK_MAP = __webpack_require__(/*! ./_validate-collection */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_validate-collection.js"); + +var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; +var WEAK_MAP = 'WeakMap'; +var getWeak = meta.getWeak; +var isExtensible = Object.isExtensible; +var uncaughtFrozenStore = weak.ufstore; +var InternalMap; + +var wrapper = function (get) { + return function WeakMap() { + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; +}; + +var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + if (isObject(key)) { + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return weak.def(validate(this, WEAK_MAP), key, value); + } +}; // 23.3 WeakMap Objects + +var $WeakMap = module.exports = __webpack_require__(/*! ./_collection */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection.js")(WEAK_MAP, wrapper, methods, weak, true, true); // IE11 WeakMap frozen keys fix + + +if (NATIVE_WEAK_MAP && IS_IE11) { + InternalMap = weak.getConstructor(wrapper, WEAK_MAP); + assign(InternalMap.prototype, methods); + meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function (key) { + var proto = $WeakMap.prototype; + var method = proto[key]; + redefine(proto, key, function (a, b) { + // store frozen objects on internal weakmap shim + if (isObject(a) && !isExtensible(a)) { + if (!this._f) this._f = new InternalMap(); + + var result = this._f[key](a, b); + + return key == 'set' ? this : result; // store all the rest on native weakmap + } + + return method.call(this, a, b); + }); + }); +} + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.weak-set.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.weak-set.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var weak = __webpack_require__(/*! ./_collection-weak */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection-weak.js"); + +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_validate-collection.js"); + +var WEAK_SET = 'WeakSet'; // 23.4 WeakSet Objects + +__webpack_require__(/*! ./_collection */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection.js")(WEAK_SET, function (get) { + return function WeakSet() { + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; +}, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value) { + return weak.def(validate(this, WEAK_SET), value, true); + } +}, weak, false, true); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.map.from.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.map.from.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from +__webpack_require__(/*! ./_set-collection-from */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-collection-from.js")('Map'); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.map.of.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.map.of.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of +__webpack_require__(/*! ./_set-collection-of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-collection-of.js")('Map'); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.map.to-json.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.map.to-json.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(/*! ./_export */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js"); + +$export($export.P + $export.R, 'Map', { + toJSON: __webpack_require__(/*! ./_collection-to-json */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_collection-to-json.js")('Map') +}); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.symbol.async-iterator.js": +/*!******************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.symbol.async-iterator.js ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_wks-define */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-define.js")('asyncIterator'); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.symbol.observable.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.symbol.observable.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_wks-define */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks-define.js")('observable'); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-map.from.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-map.from.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from +__webpack_require__(/*! ./_set-collection-from */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-collection-from.js")('WeakMap'); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-map.of.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-map.of.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of +__webpack_require__(/*! ./_set-collection-of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-collection-of.js")('WeakMap'); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-set.from.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-set.from.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from +__webpack_require__(/*! ./_set-collection-from */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-collection-from.js")('WeakSet'); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-set.of.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/es7.weak-set.of.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of +__webpack_require__(/*! ./_set-collection-of */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_set-collection-of.js")('WeakSet'); + +/***/ }), + +/***/ "./node_modules/babel-runtime/node_modules/core-js/library/modules/web.dom.iterable.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/babel-runtime/node_modules/core-js/library/modules/web.dom.iterable.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./es6.array.iterator */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/es6.array.iterator.js"); + +var global = __webpack_require__(/*! ./_global */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_global.js"); + +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_hide.js"); + +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_iterators.js"); + +var TO_STRING_TAG = __webpack_require__(/*! ./_wks */ "./node_modules/babel-runtime/node_modules/core-js/library/modules/_wks.js")('toStringTag'); + +var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + 'TextTrackList,TouchList').split(','); + +for (var i = 0; i < DOMIterables.length; i++) { + var NAME = DOMIterables[i]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = Iterators.Array; +} + +/***/ }), + +/***/ "./node_modules/babel-template/lib/index.js": +/*!**************************************************!*\ + !*** ./node_modules/babel-template/lib/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _symbol = __webpack_require__(/*! babel-runtime/core-js/symbol */ "./node_modules/babel-runtime/core-js/symbol.js"); + +var _symbol2 = _interopRequireDefault(_symbol); + +exports.default = function (code, opts) { + var stack = void 0; + + try { + throw new Error(); + } catch (error) { + if (error.stack) { + stack = error.stack.split("\n").slice(1).join("\n"); + } + } + + opts = (0, _assign2.default)({ + allowReturnOutsideFunction: true, + allowSuperOutsideMethod: true, + preserveComments: false + }, opts); + + var _getAst = function getAst() { + var ast = void 0; + + try { + ast = babylon.parse(code, opts); + ast = _babelTraverse2.default.removeProperties(ast, { + preserveComments: opts.preserveComments + }); + + _babelTraverse2.default.cheap(ast, function (node) { + node[FROM_TEMPLATE] = true; + }); + } catch (err) { + err.stack = err.stack + "from\n" + stack; + throw err; + } + + _getAst = function getAst() { + return ast; + }; + + return ast; + }; + + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return useTemplate(_getAst(), args); + }; +}; + +var _cloneDeep = __webpack_require__(/*! lodash/cloneDeep */ "./node_modules/lodash/cloneDeep.js"); + +var _cloneDeep2 = _interopRequireDefault(_cloneDeep); + +var _assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); + +var _assign2 = _interopRequireDefault(_assign); + +var _has = __webpack_require__(/*! lodash/has */ "./node_modules/lodash/has.js"); + +var _has2 = _interopRequireDefault(_has); + +var _babelTraverse = __webpack_require__(/*! babel-traverse */ "./node_modules/babel-traverse/lib/index.js"); + +var _babelTraverse2 = _interopRequireDefault(_babelTraverse); + +var _babylon = __webpack_require__(/*! babylon */ "./node_modules/babylon/lib/index.js"); + +var babylon = _interopRequireWildcard(_babylon); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var FROM_TEMPLATE = "_fromTemplate"; +var TEMPLATE_SKIP = (0, _symbol2.default)(); + +function useTemplate(ast, nodes) { + ast = (0, _cloneDeep2.default)(ast); + var _ast = ast, + program = _ast.program; + + if (nodes.length) { + (0, _babelTraverse2.default)(ast, templateVisitor, null, nodes); + } + + if (program.body.length > 1) { + return program.body; + } else { + return program.body[0]; + } +} + +var templateVisitor = { + noScope: true, + enter: function enter(path, args) { + var node = path.node; + if (node[TEMPLATE_SKIP]) return path.skip(); + + if (t.isExpressionStatement(node)) { + node = node.expression; + } + + var replacement = void 0; + + if (t.isIdentifier(node) && node[FROM_TEMPLATE]) { + if ((0, _has2.default)(args[0], node.name)) { + replacement = args[0][node.name]; + } else if (node.name[0] === "$") { + var i = +node.name.slice(1); + if (args[i]) replacement = args[i]; + } + } + + if (replacement === null) { + path.remove(); + } + + if (replacement) { + replacement[TEMPLATE_SKIP] = true; + path.replaceInline(replacement); + } + }, + exit: function exit(_ref) { + var node = _ref.node; + if (!node.loc) _babelTraverse2.default.clearNode(node); + } +}; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/cache.js": +/*!**************************************************!*\ + !*** ./node_modules/babel-traverse/lib/cache.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.scope = exports.path = undefined; + +var _weakMap = __webpack_require__(/*! babel-runtime/core-js/weak-map */ "./node_modules/babel-runtime/core-js/weak-map.js"); + +var _weakMap2 = _interopRequireDefault(_weakMap); + +exports.clear = clear; +exports.clearPath = clearPath; +exports.clearScope = clearScope; + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var path = exports.path = new _weakMap2.default(); +var scope = exports.scope = new _weakMap2.default(); + +function clear() { + clearPath(); + clearScope(); +} + +function clearPath() { + exports.path = path = new _weakMap2.default(); +} + +function clearScope() { + exports.scope = scope = new _weakMap2.default(); +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/context.js": +/*!****************************************************!*\ + !*** ./node_modules/babel-traverse/lib/context.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _path2 = __webpack_require__(/*! ./path */ "./node_modules/babel-traverse/lib/path/index.js"); + +var _path3 = _interopRequireDefault(_path2); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var testing = "development" === "test"; + +var TraversalContext = function () { + function TraversalContext(scope, opts, state, parentPath) { + (0, _classCallCheck3.default)(this, TraversalContext); + this.queue = null; + this.parentPath = parentPath; + this.scope = scope; + this.state = state; + this.opts = opts; + } + + TraversalContext.prototype.shouldVisit = function shouldVisit(node) { + var opts = this.opts; + if (opts.enter || opts.exit) return true; + if (opts[node.type]) return true; + var keys = t.VISITOR_KEYS[node.type]; + if (!keys || !keys.length) return false; + + for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var key = _ref; + if (node[key]) return true; + } + + return false; + }; + + TraversalContext.prototype.create = function create(node, obj, key, listKey) { + return _path3.default.get({ + parentPath: this.parentPath, + parent: node, + container: obj, + key: key, + listKey: listKey + }); + }; + + TraversalContext.prototype.maybeQueue = function maybeQueue(path, notPriority) { + if (this.trap) { + throw new Error("Infinite cycle detected"); + } + + if (this.queue) { + if (notPriority) { + this.queue.push(path); + } else { + this.priorityQueue.push(path); + } + } + }; + + TraversalContext.prototype.visitMultiple = function visitMultiple(container, parent, listKey) { + if (container.length === 0) return false; + var queue = []; + + for (var key = 0; key < container.length; key++) { + var node = container[key]; + + if (node && this.shouldVisit(node)) { + queue.push(this.create(parent, container, key, listKey)); + } + } + + return this.visitQueue(queue); + }; + + TraversalContext.prototype.visitSingle = function visitSingle(node, key) { + if (this.shouldVisit(node[key])) { + return this.visitQueue([this.create(node, node, key)]); + } else { + return false; + } + }; + + TraversalContext.prototype.visitQueue = function visitQueue(queue) { + this.queue = queue; + this.priorityQueue = []; + var visited = []; + var stop = false; + + for (var _iterator2 = queue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var path = _ref2; + path.resync(); + + if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) { + path.pushContext(this); + } + + if (path.key === null) continue; + + if (testing && queue.length >= 10000) { + this.trap = true; + } + + if (visited.indexOf(path.node) >= 0) continue; + visited.push(path.node); + + if (path.visit()) { + stop = true; + break; + } + + if (this.priorityQueue.length) { + stop = this.visitQueue(this.priorityQueue); + this.priorityQueue = []; + this.queue = queue; + if (stop) break; + } + } + + for (var _iterator3 = queue, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var _path = _ref3; + + _path.popContext(); + } + + this.queue = null; + return stop; + }; + + TraversalContext.prototype.visit = function visit(node, key) { + var nodes = node[key]; + if (!nodes) return false; + + if (Array.isArray(nodes)) { + return this.visitMultiple(nodes, node, key); + } else { + return this.visitSingle(node, key); + } + }; + + return TraversalContext; +}(); + +exports.default = TraversalContext; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/hub.js": +/*!************************************************!*\ + !*** ./node_modules/babel-traverse/lib/hub.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var Hub = function Hub(file, options) { + (0, _classCallCheck3.default)(this, Hub); + this.file = file; + this.options = options; +}; + +exports.default = Hub; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/index.js": +/*!**************************************************!*\ + !*** ./node_modules/babel-traverse/lib/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.visitors = exports.Hub = exports.Scope = exports.NodePath = undefined; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _path = __webpack_require__(/*! ./path */ "./node_modules/babel-traverse/lib/path/index.js"); + +Object.defineProperty(exports, "NodePath", { + enumerable: true, + get: function get() { + return _interopRequireDefault(_path).default; + } +}); + +var _scope = __webpack_require__(/*! ./scope */ "./node_modules/babel-traverse/lib/scope/index.js"); + +Object.defineProperty(exports, "Scope", { + enumerable: true, + get: function get() { + return _interopRequireDefault(_scope).default; + } +}); + +var _hub = __webpack_require__(/*! ./hub */ "./node_modules/babel-traverse/lib/hub.js"); + +Object.defineProperty(exports, "Hub", { + enumerable: true, + get: function get() { + return _interopRequireDefault(_hub).default; + } +}); +exports.default = traverse; + +var _context = __webpack_require__(/*! ./context */ "./node_modules/babel-traverse/lib/context.js"); + +var _context2 = _interopRequireDefault(_context); + +var _visitors = __webpack_require__(/*! ./visitors */ "./node_modules/babel-traverse/lib/visitors.js"); + +var visitors = _interopRequireWildcard(_visitors); + +var _babelMessages = __webpack_require__(/*! babel-messages */ "./node_modules/babel-messages/lib/index.js"); + +var messages = _interopRequireWildcard(_babelMessages); + +var _includes = __webpack_require__(/*! lodash/includes */ "./node_modules/lodash/includes.js"); + +var _includes2 = _interopRequireDefault(_includes); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +var _cache = __webpack_require__(/*! ./cache */ "./node_modules/babel-traverse/lib/cache.js"); + +var cache = _interopRequireWildcard(_cache); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +exports.visitors = visitors; + +function traverse(parent, opts, scope, state, parentPath) { + if (!parent) return; + if (!opts) opts = {}; + + if (!opts.noScope && !scope) { + if (parent.type !== "Program" && parent.type !== "File") { + throw new Error(messages.get("traverseNeedsParent", parent.type)); + } + } + + visitors.explode(opts); + traverse.node(parent, opts, scope, state, parentPath); +} + +traverse.visitors = visitors; +traverse.verify = visitors.verify; +traverse.explode = visitors.explode; +traverse.NodePath = __webpack_require__(/*! ./path */ "./node_modules/babel-traverse/lib/path/index.js"); +traverse.Scope = __webpack_require__(/*! ./scope */ "./node_modules/babel-traverse/lib/scope/index.js"); +traverse.Hub = __webpack_require__(/*! ./hub */ "./node_modules/babel-traverse/lib/hub.js"); + +traverse.cheap = function (node, enter) { + return t.traverseFast(node, enter); +}; + +traverse.node = function (node, opts, scope, state, parentPath, skipKeys) { + var keys = t.VISITOR_KEYS[node.type]; + if (!keys) return; + var context = new _context2.default(scope, opts, state, parentPath); + + for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var key = _ref; + if (skipKeys && skipKeys[key]) continue; + if (context.visit(node, key)) return; + } +}; + +traverse.clearNode = function (node, opts) { + t.removeProperties(node, opts); + cache.path.delete(node); +}; + +traverse.removeProperties = function (tree, opts) { + t.traverseFast(tree, traverse.clearNode, opts); + return tree; +}; + +function hasBlacklistedType(path, state) { + if (path.node.type === state.type) { + state.has = true; + path.stop(); + } +} + +traverse.hasType = function (tree, scope, type, blacklistTypes) { + if ((0, _includes2.default)(blacklistTypes, tree.type)) return false; + if (tree.type === type) return true; + var state = { + has: false, + type: type + }; + traverse(tree, { + blacklist: blacklistTypes, + enter: hasBlacklistedType + }, scope, state); + return state.has; +}; + +traverse.clearCache = function () { + cache.clear(); +}; + +traverse.clearCache.clearPath = cache.clearPath; +traverse.clearCache.clearScope = cache.clearScope; + +traverse.copyCache = function (source, destination) { + if (cache.path.has(source)) { + cache.path.set(destination, cache.path.get(source)); + } +}; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/ancestry.js": +/*!**********************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/ancestry.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.findParent = findParent; +exports.find = find; +exports.getFunctionParent = getFunctionParent; +exports.getStatementParent = getStatementParent; +exports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom; +exports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom; +exports.getAncestry = getAncestry; +exports.isAncestor = isAncestor; +exports.isDescendant = isDescendant; +exports.inType = inType; +exports.inShadow = inShadow; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-traverse/lib/path/index.js"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function findParent(callback) { + var path = this; + + while (path = path.parentPath) { + if (callback(path)) return path; + } + + return null; +} + +function find(callback) { + var path = this; + + do { + if (callback(path)) return path; + } while (path = path.parentPath); + + return null; +} + +function getFunctionParent() { + return this.findParent(function (path) { + return path.isFunction() || path.isProgram(); + }); +} + +function getStatementParent() { + var path = this; + + do { + if (Array.isArray(path.container)) { + return path; + } + } while (path = path.parentPath); +} + +function getEarliestCommonAncestorFrom(paths) { + return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) { + var earliest = void 0; + var keys = t.VISITOR_KEYS[deepest.type]; + + for (var _iterator = ancestries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var ancestry = _ref; + var path = ancestry[i + 1]; + + if (!earliest) { + earliest = path; + continue; + } + + if (path.listKey && earliest.listKey === path.listKey) { + if (path.key < earliest.key) { + earliest = path; + continue; + } + } + + var earliestKeyIndex = keys.indexOf(earliest.parentKey); + var currentKeyIndex = keys.indexOf(path.parentKey); + + if (earliestKeyIndex > currentKeyIndex) { + earliest = path; + } + } + + return earliest; + }); +} + +function getDeepestCommonAncestorFrom(paths, filter) { + var _this = this; + + if (!paths.length) { + return this; + } + + if (paths.length === 1) { + return paths[0]; + } + + var minDepth = Infinity; + var lastCommonIndex = void 0, + lastCommon = void 0; + var ancestries = paths.map(function (path) { + var ancestry = []; + + do { + ancestry.unshift(path); + } while ((path = path.parentPath) && path !== _this); + + if (ancestry.length < minDepth) { + minDepth = ancestry.length; + } + + return ancestry; + }); + var first = ancestries[0]; + + depthLoop: for (var i = 0; i < minDepth; i++) { + var shouldMatch = first[i]; + + for (var _iterator2 = ancestries, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var ancestry = _ref2; + + if (ancestry[i] !== shouldMatch) { + break depthLoop; + } + } + + lastCommonIndex = i; + lastCommon = shouldMatch; + } + + if (lastCommon) { + if (filter) { + return filter(lastCommon, lastCommonIndex, ancestries); + } else { + return lastCommon; + } + } else { + throw new Error("Couldn't find intersection"); + } +} + +function getAncestry() { + var path = this; + var paths = []; + + do { + paths.push(path); + } while (path = path.parentPath); + + return paths; +} + +function isAncestor(maybeDescendant) { + return maybeDescendant.isDescendant(this); +} + +function isDescendant(maybeAncestor) { + return !!this.findParent(function (parent) { + return parent === maybeAncestor; + }); +} + +function inType() { + var path = this; + + while (path) { + for (var _iterator3 = arguments, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var type = _ref3; + if (path.node.type === type) return true; + } + + path = path.parentPath; + } + + return false; +} + +function inShadow(key) { + var parentFn = this.isFunction() ? this : this.findParent(function (p) { + return p.isFunction(); + }); + if (!parentFn) return; + + if (parentFn.isFunctionExpression() || parentFn.isFunctionDeclaration()) { + var shadow = parentFn.node.shadow; + + if (shadow && (!key || shadow[key] !== false)) { + return parentFn; + } + } else if (parentFn.isArrowFunctionExpression()) { + return parentFn; + } + + return null; +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/comments.js": +/*!**********************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/comments.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.shareCommentsWithSiblings = shareCommentsWithSiblings; +exports.addComment = addComment; +exports.addComments = addComments; + +function shareCommentsWithSiblings() { + if (typeof this.key === "string") return; + var node = this.node; + if (!node) return; + var trailing = node.trailingComments; + var leading = node.leadingComments; + if (!trailing && !leading) return; + var prev = this.getSibling(this.key - 1); + var next = this.getSibling(this.key + 1); + if (!prev.node) prev = next; + if (!next.node) next = prev; + prev.addComments("trailing", leading); + next.addComments("leading", trailing); +} + +function addComment(type, content, line) { + this.addComments(type, [{ + type: line ? "CommentLine" : "CommentBlock", + value: content + }]); +} + +function addComments(type, comments) { + if (!comments) return; + var node = this.node; + if (!node) return; + var key = type + "Comments"; + + if (node[key]) { + node[key] = node[key].concat(comments); + } else { + node[key] = comments; + } +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/context.js": +/*!*********************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/context.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.call = call; +exports._call = _call; +exports.isBlacklisted = isBlacklisted; +exports.visit = visit; +exports.skip = skip; +exports.skipKey = skipKey; +exports.stop = stop; +exports.setScope = setScope; +exports.setContext = setContext; +exports.resync = resync; +exports._resyncParent = _resyncParent; +exports._resyncKey = _resyncKey; +exports._resyncList = _resyncList; +exports._resyncRemoved = _resyncRemoved; +exports.popContext = popContext; +exports.pushContext = pushContext; +exports.setup = setup; +exports.setKey = setKey; +exports.requeue = requeue; +exports._getQueueContexts = _getQueueContexts; + +var _index = __webpack_require__(/*! ../index */ "./node_modules/babel-traverse/lib/index.js"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function call(key) { + var opts = this.opts; + this.debug(function () { + return key; + }); + + if (this.node) { + if (this._call(opts[key])) return true; + } + + if (this.node) { + return this._call(opts[this.node.type] && opts[this.node.type][key]); + } + + return false; +} + +function _call(fns) { + if (!fns) return false; + + for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var fn = _ref; + if (!fn) continue; + var node = this.node; + if (!node) return true; + var ret = fn.call(this.state, this, this.state); + if (ret) throw new Error("Unexpected return value from visitor method " + fn); + if (this.node !== node) return true; + if (this.shouldStop || this.shouldSkip || this.removed) return true; + } + + return false; +} + +function isBlacklisted() { + var blacklist = this.opts.blacklist; + return blacklist && blacklist.indexOf(this.node.type) > -1; +} + +function visit() { + if (!this.node) { + return false; + } + + if (this.isBlacklisted()) { + return false; + } + + if (this.opts.shouldSkip && this.opts.shouldSkip(this)) { + return false; + } + + if (this.call("enter") || this.shouldSkip) { + this.debug(function () { + return "Skip..."; + }); + return this.shouldStop; + } + + this.debug(function () { + return "Recursing into..."; + }); + + _index2.default.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys); + + this.call("exit"); + return this.shouldStop; +} + +function skip() { + this.shouldSkip = true; +} + +function skipKey(key) { + this.skipKeys[key] = true; +} + +function stop() { + this.shouldStop = true; + this.shouldSkip = true; +} + +function setScope() { + if (this.opts && this.opts.noScope) return; + var target = this.context && this.context.scope; + + if (!target) { + var path = this.parentPath; + + while (path && !target) { + if (path.opts && path.opts.noScope) return; + target = path.scope; + path = path.parentPath; + } + } + + this.scope = this.getScope(target); + if (this.scope) this.scope.init(); +} + +function setContext(context) { + this.shouldSkip = false; + this.shouldStop = false; + this.removed = false; + this.skipKeys = {}; + + if (context) { + this.context = context; + this.state = context.state; + this.opts = context.opts; + } + + this.setScope(); + return this; +} + +function resync() { + if (this.removed) return; + + this._resyncParent(); + + this._resyncList(); + + this._resyncKey(); +} + +function _resyncParent() { + if (this.parentPath) { + this.parent = this.parentPath.node; + } +} + +function _resyncKey() { + if (!this.container) return; + if (this.node === this.container[this.key]) return; + + if (Array.isArray(this.container)) { + for (var i = 0; i < this.container.length; i++) { + if (this.container[i] === this.node) { + return this.setKey(i); + } + } + } else { + for (var key in this.container) { + if (this.container[key] === this.node) { + return this.setKey(key); + } + } + } + + this.key = null; +} + +function _resyncList() { + if (!this.parent || !this.inList) return; + var newContainer = this.parent[this.listKey]; + if (this.container === newContainer) return; + this.container = newContainer || null; +} + +function _resyncRemoved() { + if (this.key == null || !this.container || this.container[this.key] !== this.node) { + this._markRemoved(); + } +} + +function popContext() { + this.contexts.pop(); + this.setContext(this.contexts[this.contexts.length - 1]); +} + +function pushContext(context) { + this.contexts.push(context); + this.setContext(context); +} + +function setup(parentPath, container, listKey, key) { + this.inList = !!listKey; + this.listKey = listKey; + this.parentKey = listKey || key; + this.container = container; + this.parentPath = parentPath || this.parentPath; + this.setKey(key); +} + +function setKey(key) { + this.key = key; + this.node = this.container[this.key]; + this.type = this.node && this.node.type; +} + +function requeue() { + var pathToQueue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this; + if (pathToQueue.removed) return; + var contexts = this.contexts; + + for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var context = _ref2; + context.maybeQueue(pathToQueue); + } +} + +function _getQueueContexts() { + var path = this; + var contexts = this.contexts; + + while (!contexts.length) { + path = path.parentPath; + contexts = path.contexts; + } + + return contexts; +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/conversion.js": +/*!************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/conversion.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.toComputedKey = toComputedKey; +exports.ensureBlock = ensureBlock; +exports.arrowFunctionToShadowed = arrowFunctionToShadowed; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function toComputedKey() { + var node = this.node; + var key = void 0; + + if (this.isMemberExpression()) { + key = node.property; + } else if (this.isProperty() || this.isMethod()) { + key = node.key; + } else { + throw new ReferenceError("todo"); + } + + if (!node.computed) { + if (t.isIdentifier(key)) key = t.stringLiteral(key.name); + } + + return key; +} + +function ensureBlock() { + return t.ensureBlock(this.node); +} + +function arrowFunctionToShadowed() { + if (!this.isArrowFunctionExpression()) return; + this.ensureBlock(); + var node = this.node; + node.expression = false; + node.type = "FunctionExpression"; + node.shadow = node.shadow || true; +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/evaluation.js": +/*!************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/evaluation.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +exports.__esModule = true; + +var _typeof2 = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _map = __webpack_require__(/*! babel-runtime/core-js/map */ "./node_modules/babel-runtime/core-js/map.js"); + +var _map2 = _interopRequireDefault(_map); + +exports.evaluateTruthy = evaluateTruthy; +exports.evaluate = evaluate; + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var VALID_CALLEES = ["String", "Number", "Math"]; +var INVALID_METHODS = ["random"]; + +function evaluateTruthy() { + var res = this.evaluate(); + if (res.confident) return !!res.value; +} + +function evaluate() { + var confident = true; + var deoptPath = void 0; + var seen = new _map2.default(); + + function deopt(path) { + if (!confident) return; + deoptPath = path; + confident = false; + } + + var value = evaluate(this); + if (!confident) value = undefined; + return { + confident: confident, + deopt: deoptPath, + value: value + }; + + function evaluate(path) { + var node = path.node; + + if (seen.has(node)) { + var existing = seen.get(node); + + if (existing.resolved) { + return existing.value; + } else { + deopt(path); + return; + } + } else { + var item = { + resolved: false + }; + seen.set(node, item); + + var val = _evaluate(path); + + if (confident) { + item.resolved = true; + item.value = val; + } + + return val; + } + } + + function _evaluate(path) { + if (!confident) return; + var node = path.node; + + if (path.isSequenceExpression()) { + var exprs = path.get("expressions"); + return evaluate(exprs[exprs.length - 1]); + } + + if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) { + return node.value; + } + + if (path.isNullLiteral()) { + return null; + } + + if (path.isTemplateLiteral()) { + var str = ""; + var i = 0; + + var _exprs = path.get("expressions"); + + for (var _iterator = node.quasis, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var elem = _ref; + if (!confident) break; + str += elem.value.cooked; + var expr = _exprs[i++]; + if (expr) str += String(evaluate(expr)); + } + + if (!confident) return; + return str; + } + + if (path.isConditionalExpression()) { + var testResult = evaluate(path.get("test")); + if (!confident) return; + + if (testResult) { + return evaluate(path.get("consequent")); + } else { + return evaluate(path.get("alternate")); + } + } + + if (path.isExpressionWrapper()) { + return evaluate(path.get("expression")); + } + + if (path.isMemberExpression() && !path.parentPath.isCallExpression({ + callee: node + })) { + var property = path.get("property"); + var object = path.get("object"); + + if (object.isLiteral() && property.isIdentifier()) { + var _value = object.node.value; + var type = typeof _value === "undefined" ? "undefined" : (0, _typeof3.default)(_value); + + if (type === "number" || type === "string") { + return _value[property.node.name]; + } + } + } + + if (path.isReferencedIdentifier()) { + var binding = path.scope.getBinding(node.name); + + if (binding && binding.constantViolations.length > 0) { + return deopt(binding.path); + } + + if (binding && path.node.start < binding.path.node.end) { + return deopt(binding.path); + } + + if (binding && binding.hasValue) { + return binding.value; + } else { + if (node.name === "undefined") { + return binding ? deopt(binding.path) : undefined; + } else if (node.name === "Infinity") { + return binding ? deopt(binding.path) : Infinity; + } else if (node.name === "NaN") { + return binding ? deopt(binding.path) : NaN; + } + + var resolved = path.resolve(); + + if (resolved === path) { + return deopt(path); + } else { + return evaluate(resolved); + } + } + } + + if (path.isUnaryExpression({ + prefix: true + })) { + if (node.operator === "void") { + return undefined; + } + + var argument = path.get("argument"); + + if (node.operator === "typeof" && (argument.isFunction() || argument.isClass())) { + return "function"; + } + + var arg = evaluate(argument); + if (!confident) return; + + switch (node.operator) { + case "!": + return !arg; + + case "+": + return +arg; + + case "-": + return -arg; + + case "~": + return ~arg; + + case "typeof": + return typeof arg === "undefined" ? "undefined" : (0, _typeof3.default)(arg); + } + } + + if (path.isArrayExpression()) { + var arr = []; + var elems = path.get("elements"); + + for (var _iterator2 = elems, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var _elem = _ref2; + _elem = _elem.evaluate(); + + if (_elem.confident) { + arr.push(_elem.value); + } else { + return deopt(_elem); + } + } + + return arr; + } + + if (path.isObjectExpression()) { + var obj = {}; + var props = path.get("properties"); + + for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var prop = _ref3; + + if (prop.isObjectMethod() || prop.isSpreadProperty()) { + return deopt(prop); + } + + var keyPath = prop.get("key"); + var key = keyPath; + + if (prop.node.computed) { + key = key.evaluate(); + + if (!key.confident) { + return deopt(keyPath); + } + + key = key.value; + } else if (key.isIdentifier()) { + key = key.node.name; + } else { + key = key.node.value; + } + + var valuePath = prop.get("value"); + + var _value2 = valuePath.evaluate(); + + if (!_value2.confident) { + return deopt(valuePath); + } + + _value2 = _value2.value; + obj[key] = _value2; + } + + return obj; + } + + if (path.isLogicalExpression()) { + var wasConfident = confident; + var left = evaluate(path.get("left")); + var leftConfident = confident; + confident = wasConfident; + var right = evaluate(path.get("right")); + var rightConfident = confident; + confident = leftConfident && rightConfident; + + switch (node.operator) { + case "||": + if (left && leftConfident) { + confident = true; + return left; + } + + if (!confident) return; + return left || right; + + case "&&": + if (!left && leftConfident || !right && rightConfident) { + confident = true; + } + + if (!confident) return; + return left && right; + } + } + + if (path.isBinaryExpression()) { + var _left = evaluate(path.get("left")); + + if (!confident) return; + + var _right = evaluate(path.get("right")); + + if (!confident) return; + + switch (node.operator) { + case "-": + return _left - _right; + + case "+": + return _left + _right; + + case "/": + return _left / _right; + + case "*": + return _left * _right; + + case "%": + return _left % _right; + + case "**": + return Math.pow(_left, _right); + + case "<": + return _left < _right; + + case ">": + return _left > _right; + + case "<=": + return _left <= _right; + + case ">=": + return _left >= _right; + + case "==": + return _left == _right; + + case "!=": + return _left != _right; + + case "===": + return _left === _right; + + case "!==": + return _left !== _right; + + case "|": + return _left | _right; + + case "&": + return _left & _right; + + case "^": + return _left ^ _right; + + case "<<": + return _left << _right; + + case ">>": + return _left >> _right; + + case ">>>": + return _left >>> _right; + } + } + + if (path.isCallExpression()) { + var callee = path.get("callee"); + var context = void 0; + var func = void 0; + + if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name, true) && VALID_CALLEES.indexOf(callee.node.name) >= 0) { + func = global[node.callee.name]; + } + + if (callee.isMemberExpression()) { + var _object = callee.get("object"); + + var _property = callee.get("property"); + + if (_object.isIdentifier() && _property.isIdentifier() && VALID_CALLEES.indexOf(_object.node.name) >= 0 && INVALID_METHODS.indexOf(_property.node.name) < 0) { + context = global[_object.node.name]; + func = context[_property.node.name]; + } + + if (_object.isLiteral() && _property.isIdentifier()) { + var _type = (0, _typeof3.default)(_object.node.value); + + if (_type === "string" || _type === "number") { + context = _object.node.value; + func = context[_property.node.name]; + } + } + } + + if (func) { + var args = path.get("arguments").map(evaluate); + if (!confident) return; + return func.apply(context, args); + } + } + + deopt(path); + } +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/family.js": +/*!********************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/family.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _create = __webpack_require__(/*! babel-runtime/core-js/object/create */ "./node_modules/babel-runtime/core-js/object/create.js"); + +var _create2 = _interopRequireDefault(_create); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.getStatementParent = getStatementParent; +exports.getOpposite = getOpposite; +exports.getCompletionRecords = getCompletionRecords; +exports.getSibling = getSibling; +exports.getPrevSibling = getPrevSibling; +exports.getNextSibling = getNextSibling; +exports.getAllNextSiblings = getAllNextSiblings; +exports.getAllPrevSiblings = getAllPrevSiblings; +exports.get = get; +exports._getKey = _getKey; +exports._getPattern = _getPattern; +exports.getBindingIdentifiers = getBindingIdentifiers; +exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers; +exports.getBindingIdentifierPaths = getBindingIdentifierPaths; +exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths; + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-traverse/lib/path/index.js"); + +var _index2 = _interopRequireDefault(_index); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function getStatementParent() { + var path = this; + + do { + if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) { + break; + } else { + path = path.parentPath; + } + } while (path); + + if (path && (path.isProgram() || path.isFile())) { + throw new Error("File/Program node, we can't possibly find a statement parent to this"); + } + + return path; +} + +function getOpposite() { + if (this.key === "left") { + return this.getSibling("right"); + } else if (this.key === "right") { + return this.getSibling("left"); + } +} + +function getCompletionRecords() { + var paths = []; + + var add = function add(path) { + if (path) paths = paths.concat(path.getCompletionRecords()); + }; + + if (this.isIfStatement()) { + add(this.get("consequent")); + add(this.get("alternate")); + } else if (this.isDoExpression() || this.isFor() || this.isWhile()) { + add(this.get("body")); + } else if (this.isProgram() || this.isBlockStatement()) { + add(this.get("body").pop()); + } else if (this.isFunction()) { + return this.get("body").getCompletionRecords(); + } else if (this.isTryStatement()) { + add(this.get("block")); + add(this.get("handler")); + add(this.get("finalizer")); + } else { + paths.push(this); + } + + return paths; +} + +function getSibling(key) { + return _index2.default.get({ + parentPath: this.parentPath, + parent: this.parent, + container: this.container, + listKey: this.listKey, + key: key + }); +} + +function getPrevSibling() { + return this.getSibling(this.key - 1); +} + +function getNextSibling() { + return this.getSibling(this.key + 1); +} + +function getAllNextSiblings() { + var _key = this.key; + var sibling = this.getSibling(++_key); + var siblings = []; + + while (sibling.node) { + siblings.push(sibling); + sibling = this.getSibling(++_key); + } + + return siblings; +} + +function getAllPrevSiblings() { + var _key = this.key; + var sibling = this.getSibling(--_key); + var siblings = []; + + while (sibling.node) { + siblings.push(sibling); + sibling = this.getSibling(--_key); + } + + return siblings; +} + +function get(key, context) { + if (context === true) context = this.context; + var parts = key.split("."); + + if (parts.length === 1) { + return this._getKey(key, context); + } else { + return this._getPattern(parts, context); + } +} + +function _getKey(key, context) { + var _this = this; + + var node = this.node; + var container = node[key]; + + if (Array.isArray(container)) { + return container.map(function (_, i) { + return _index2.default.get({ + listKey: key, + parentPath: _this, + parent: node, + container: container, + key: i + }).setContext(context); + }); + } else { + return _index2.default.get({ + parentPath: this, + parent: node, + container: node, + key: key + }).setContext(context); + } +} + +function _getPattern(parts, context) { + var path = this; + + for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var part = _ref; + + if (part === ".") { + path = path.parentPath; + } else { + if (Array.isArray(path)) { + path = path[part]; + } else { + path = path.get(part, context); + } + } + } + + return path; +} + +function getBindingIdentifiers(duplicates) { + return t.getBindingIdentifiers(this.node, duplicates); +} + +function getOuterBindingIdentifiers(duplicates) { + return t.getOuterBindingIdentifiers(this.node, duplicates); +} + +function getBindingIdentifierPaths() { + var duplicates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var outerOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var path = this; + var search = [].concat(path); + var ids = (0, _create2.default)(null); + + while (search.length) { + var id = search.shift(); + if (!id) continue; + if (!id.node) continue; + var keys = t.getBindingIdentifiers.keys[id.node.type]; + + if (id.isIdentifier()) { + if (duplicates) { + var _ids = ids[id.node.name] = ids[id.node.name] || []; + + _ids.push(id); + } else { + ids[id.node.name] = id; + } + + continue; + } + + if (id.isExportDeclaration()) { + var declaration = id.get("declaration"); + + if (declaration.isDeclaration()) { + search.push(declaration); + } + + continue; + } + + if (outerOnly) { + if (id.isFunctionDeclaration()) { + search.push(id.get("id")); + continue; + } + + if (id.isFunctionExpression()) { + continue; + } + } + + if (keys) { + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var child = id.get(key); + + if (Array.isArray(child) || child.node) { + search = search.concat(child); + } + } + } + } + + return ids; +} + +function getOuterBindingIdentifierPaths(duplicates) { + return this.getBindingIdentifierPaths(duplicates, true); +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/index.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _virtualTypes = __webpack_require__(/*! ./lib/virtual-types */ "./node_modules/babel-traverse/lib/path/lib/virtual-types.js"); + +var virtualTypes = _interopRequireWildcard(_virtualTypes); + +var _debug2 = __webpack_require__(/*! debug */ "./node_modules/babel-traverse/node_modules/debug/src/browser.js"); + +var _debug3 = _interopRequireDefault(_debug2); + +var _invariant = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js"); + +var _invariant2 = _interopRequireDefault(_invariant); + +var _index = __webpack_require__(/*! ../index */ "./node_modules/babel-traverse/lib/index.js"); + +var _index2 = _interopRequireDefault(_index); + +var _assign = __webpack_require__(/*! lodash/assign */ "./node_modules/lodash/assign.js"); + +var _assign2 = _interopRequireDefault(_assign); + +var _scope = __webpack_require__(/*! ../scope */ "./node_modules/babel-traverse/lib/scope/index.js"); + +var _scope2 = _interopRequireDefault(_scope); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +var _cache = __webpack_require__(/*! ../cache */ "./node_modules/babel-traverse/lib/cache.js"); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var _debug = (0, _debug3.default)("babel"); + +var NodePath = function () { + function NodePath(hub, parent) { + (0, _classCallCheck3.default)(this, NodePath); + this.parent = parent; + this.hub = hub; + this.contexts = []; + this.data = {}; + this.shouldSkip = false; + this.shouldStop = false; + this.removed = false; + this.state = null; + this.opts = null; + this.skipKeys = null; + this.parentPath = null; + this.context = null; + this.container = null; + this.listKey = null; + this.inList = false; + this.parentKey = null; + this.key = null; + this.node = null; + this.scope = null; + this.type = null; + this.typeAnnotation = null; + } + + NodePath.get = function get(_ref) { + var hub = _ref.hub, + parentPath = _ref.parentPath, + parent = _ref.parent, + container = _ref.container, + listKey = _ref.listKey, + key = _ref.key; + + if (!hub && parentPath) { + hub = parentPath.hub; + } + + (0, _invariant2.default)(parent, "To get a node path the parent needs to exist"); + var targetNode = container[key]; + var paths = _cache.path.get(parent) || []; + + if (!_cache.path.has(parent)) { + _cache.path.set(parent, paths); + } + + var path = void 0; + + for (var i = 0; i < paths.length; i++) { + var pathCheck = paths[i]; + + if (pathCheck.node === targetNode) { + path = pathCheck; + break; + } + } + + if (!path) { + path = new NodePath(hub, parent); + paths.push(path); + } + + path.setup(parentPath, container, listKey, key); + return path; + }; + + NodePath.prototype.getScope = function getScope(scope) { + var ourScope = scope; + + if (this.isScope()) { + ourScope = new _scope2.default(this, scope); + } + + return ourScope; + }; + + NodePath.prototype.setData = function setData(key, val) { + return this.data[key] = val; + }; + + NodePath.prototype.getData = function getData(key, def) { + var val = this.data[key]; + if (!val && def) val = this.data[key] = def; + return val; + }; + + NodePath.prototype.buildCodeFrameError = function buildCodeFrameError(msg) { + var Error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SyntaxError; + return this.hub.file.buildCodeFrameError(this.node, msg, Error); + }; + + NodePath.prototype.traverse = function traverse(visitor, state) { + (0, _index2.default)(this.node, visitor, this.scope, state, this); + }; + + NodePath.prototype.mark = function mark(type, message) { + this.hub.file.metadata.marked.push({ + type: type, + message: message, + loc: this.node.loc + }); + }; + + NodePath.prototype.set = function set(key, node) { + t.validate(this.node, key, node); + this.node[key] = node; + }; + + NodePath.prototype.getPathLocation = function getPathLocation() { + var parts = []; + var path = this; + + do { + var key = path.key; + if (path.inList) key = path.listKey + "[" + key + "]"; + parts.unshift(key); + } while (path = path.parentPath); + + return parts.join("."); + }; + + NodePath.prototype.debug = function debug(buildMessage) { + if (!_debug.enabled) return; + + _debug(this.getPathLocation() + " " + this.type + ": " + buildMessage()); + }; + + return NodePath; +}(); + +exports.default = NodePath; +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./ancestry */ "./node_modules/babel-traverse/lib/path/ancestry.js")); +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./inference */ "./node_modules/babel-traverse/lib/path/inference/index.js")); +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./replacement */ "./node_modules/babel-traverse/lib/path/replacement.js")); +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./evaluation */ "./node_modules/babel-traverse/lib/path/evaluation.js")); +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./conversion */ "./node_modules/babel-traverse/lib/path/conversion.js")); +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./introspection */ "./node_modules/babel-traverse/lib/path/introspection.js")); +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./context */ "./node_modules/babel-traverse/lib/path/context.js")); +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./removal */ "./node_modules/babel-traverse/lib/path/removal.js")); +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./modification */ "./node_modules/babel-traverse/lib/path/modification.js")); +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./family */ "./node_modules/babel-traverse/lib/path/family.js")); +(0, _assign2.default)(NodePath.prototype, __webpack_require__(/*! ./comments */ "./node_modules/babel-traverse/lib/path/comments.js")); + +var _loop2 = function _loop2() { + if (_isArray) { + if (_i >= _iterator.length) return "break"; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) return "break"; + _ref2 = _i.value; + } + + var type = _ref2; + var typeKey = "is" + type; + + NodePath.prototype[typeKey] = function (opts) { + return t[typeKey](this.node, opts); + }; + + NodePath.prototype["assert" + type] = function (opts) { + if (!this[typeKey](opts)) { + throw new TypeError("Expected node path of type " + type); + } + }; +}; + +for (var _iterator = t.TYPES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref2; + + var _ret2 = _loop2(); + + if (_ret2 === "break") break; +} + +var _loop = function _loop(type) { + if (type[0] === "_") return "continue"; + if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type); + var virtualType = virtualTypes[type]; + + NodePath.prototype["is" + type] = function (opts) { + return virtualType.checkPath(this, opts); + }; +}; + +for (var type in virtualTypes) { + var _ret = _loop(type); + + if (_ret === "continue") continue; +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/inference/index.js": +/*!*****************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/inference/index.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.getTypeAnnotation = getTypeAnnotation; +exports._getTypeAnnotation = _getTypeAnnotation; +exports.isBaseType = isBaseType; +exports.couldBeBaseType = couldBeBaseType; +exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches; +exports.isGenericType = isGenericType; + +var _inferers = __webpack_require__(/*! ./inferers */ "./node_modules/babel-traverse/lib/path/inference/inferers.js"); + +var inferers = _interopRequireWildcard(_inferers); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function getTypeAnnotation() { + if (this.typeAnnotation) return this.typeAnnotation; + var type = this._getTypeAnnotation() || t.anyTypeAnnotation(); + if (t.isTypeAnnotation(type)) type = type.typeAnnotation; + return this.typeAnnotation = type; +} + +function _getTypeAnnotation() { + var node = this.node; + + if (!node) { + if (this.key === "init" && this.parentPath.isVariableDeclarator()) { + var declar = this.parentPath.parentPath; + var declarParent = declar.parentPath; + + if (declar.key === "left" && declarParent.isForInStatement()) { + return t.stringTypeAnnotation(); + } + + if (declar.key === "left" && declarParent.isForOfStatement()) { + return t.anyTypeAnnotation(); + } + + return t.voidTypeAnnotation(); + } else { + return; + } + } + + if (node.typeAnnotation) { + return node.typeAnnotation; + } + + var inferer = inferers[node.type]; + + if (inferer) { + return inferer.call(this, node); + } + + inferer = inferers[this.parentPath.type]; + + if (inferer && inferer.validParent) { + return this.parentPath.getTypeAnnotation(); + } +} + +function isBaseType(baseName, soft) { + return _isBaseType(baseName, this.getTypeAnnotation(), soft); +} + +function _isBaseType(baseName, type, soft) { + if (baseName === "string") { + return t.isStringTypeAnnotation(type); + } else if (baseName === "number") { + return t.isNumberTypeAnnotation(type); + } else if (baseName === "boolean") { + return t.isBooleanTypeAnnotation(type); + } else if (baseName === "any") { + return t.isAnyTypeAnnotation(type); + } else if (baseName === "mixed") { + return t.isMixedTypeAnnotation(type); + } else if (baseName === "empty") { + return t.isEmptyTypeAnnotation(type); + } else if (baseName === "void") { + return t.isVoidTypeAnnotation(type); + } else { + if (soft) { + return false; + } else { + throw new Error("Unknown base type " + baseName); + } + } +} + +function couldBeBaseType(name) { + var type = this.getTypeAnnotation(); + if (t.isAnyTypeAnnotation(type)) return true; + + if (t.isUnionTypeAnnotation(type)) { + for (var _iterator = type.types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var type2 = _ref; + + if (t.isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) { + return true; + } + } + + return false; + } else { + return _isBaseType(name, type, true); + } +} + +function baseTypeStrictlyMatches(right) { + var left = this.getTypeAnnotation(); + right = right.getTypeAnnotation(); + + if (!t.isAnyTypeAnnotation(left) && t.isFlowBaseAnnotation(left)) { + return right.type === left.type; + } +} + +function isGenericType(genericName) { + var type = this.getTypeAnnotation(); + return t.isGenericTypeAnnotation(type) && t.isIdentifier(type.id, { + name: genericName + }); +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/inference/inferer-reference.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/inference/inferer-reference.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.default = function (node) { + if (!this.isReferenced()) return; + var binding = this.scope.getBinding(node.name); + + if (binding) { + if (binding.identifier.typeAnnotation) { + return binding.identifier.typeAnnotation; + } else { + return getTypeAnnotationBindingConstantViolations(this, node.name); + } + } + + if (node.name === "undefined") { + return t.voidTypeAnnotation(); + } else if (node.name === "NaN" || node.name === "Infinity") { + return t.numberTypeAnnotation(); + } else if (node.name === "arguments") {} +}; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function getTypeAnnotationBindingConstantViolations(path, name) { + var binding = path.scope.getBinding(name); + var types = []; + path.typeAnnotation = t.unionTypeAnnotation(types); + var functionConstantViolations = []; + var constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations); + var testType = getConditionalAnnotation(path, name); + + if (testType) { + var testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement); + constantViolations = constantViolations.filter(function (path) { + return testConstantViolations.indexOf(path) < 0; + }); + types.push(testType.typeAnnotation); + } + + if (constantViolations.length) { + constantViolations = constantViolations.concat(functionConstantViolations); + + for (var _iterator = constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var violation = _ref; + types.push(violation.getTypeAnnotation()); + } + } + + if (types.length) { + return t.createUnionTypeAnnotation(types); + } +} + +function getConstantViolationsBefore(binding, path, functions) { + var violations = binding.constantViolations.slice(); + violations.unshift(binding.path); + return violations.filter(function (violation) { + violation = violation.resolve(); + + var status = violation._guessExecutionStatusRelativeTo(path); + + if (functions && status === "function") functions.push(violation); + return status === "before"; + }); +} + +function inferAnnotationFromBinaryExpression(name, path) { + var operator = path.node.operator; + var right = path.get("right").resolve(); + var left = path.get("left").resolve(); + var target = void 0; + + if (left.isIdentifier({ + name: name + })) { + target = right; + } else if (right.isIdentifier({ + name: name + })) { + target = left; + } + + if (target) { + if (operator === "===") { + return target.getTypeAnnotation(); + } else if (t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { + return t.numberTypeAnnotation(); + } else { + return; + } + } else { + if (operator !== "===") return; + } + + var typeofPath = void 0; + var typePath = void 0; + + if (left.isUnaryExpression({ + operator: "typeof" + })) { + typeofPath = left; + typePath = right; + } else if (right.isUnaryExpression({ + operator: "typeof" + })) { + typeofPath = right; + typePath = left; + } + + if (!typePath && !typeofPath) return; + typePath = typePath.resolve(); + if (!typePath.isLiteral()) return; + var typeValue = typePath.node.value; + if (typeof typeValue !== "string") return; + if (!typeofPath.get("argument").isIdentifier({ + name: name + })) return; + return t.createTypeAnnotationBasedOnTypeof(typePath.node.value); +} + +function getParentConditionalPath(path) { + var parentPath = void 0; + + while (parentPath = path.parentPath) { + if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) { + if (path.key === "test") { + return; + } else { + return parentPath; + } + } else { + path = parentPath; + } + } +} + +function getConditionalAnnotation(path, name) { + var ifStatement = getParentConditionalPath(path); + if (!ifStatement) return; + var test = ifStatement.get("test"); + var paths = [test]; + var types = []; + + do { + var _path = paths.shift().resolve(); + + if (_path.isLogicalExpression()) { + paths.push(_path.get("left")); + paths.push(_path.get("right")); + } + + if (_path.isBinaryExpression()) { + var type = inferAnnotationFromBinaryExpression(name, _path); + if (type) types.push(type); + } + } while (paths.length); + + if (types.length) { + return { + typeAnnotation: t.createUnionTypeAnnotation(types), + ifStatement: ifStatement + }; + } else { + return getConditionalAnnotation(ifStatement, name); + } +} + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/inference/inferers.js": +/*!********************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/inference/inferers.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = exports.Identifier = undefined; + +var _infererReference = __webpack_require__(/*! ./inferer-reference */ "./node_modules/babel-traverse/lib/path/inference/inferer-reference.js"); + +Object.defineProperty(exports, "Identifier", { + enumerable: true, + get: function get() { + return _interopRequireDefault(_infererReference).default; + } +}); +exports.VariableDeclarator = VariableDeclarator; +exports.TypeCastExpression = TypeCastExpression; +exports.NewExpression = NewExpression; +exports.TemplateLiteral = TemplateLiteral; +exports.UnaryExpression = UnaryExpression; +exports.BinaryExpression = BinaryExpression; +exports.LogicalExpression = LogicalExpression; +exports.ConditionalExpression = ConditionalExpression; +exports.SequenceExpression = SequenceExpression; +exports.AssignmentExpression = AssignmentExpression; +exports.UpdateExpression = UpdateExpression; +exports.StringLiteral = StringLiteral; +exports.NumericLiteral = NumericLiteral; +exports.BooleanLiteral = BooleanLiteral; +exports.NullLiteral = NullLiteral; +exports.RegExpLiteral = RegExpLiteral; +exports.ObjectExpression = ObjectExpression; +exports.ArrayExpression = ArrayExpression; +exports.RestElement = RestElement; +exports.CallExpression = CallExpression; +exports.TaggedTemplateExpression = TaggedTemplateExpression; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function VariableDeclarator() { + var id = this.get("id"); + + if (id.isIdentifier()) { + return this.get("init").getTypeAnnotation(); + } else { + return; + } +} + +function TypeCastExpression(node) { + return node.typeAnnotation; +} + +TypeCastExpression.validParent = true; + +function NewExpression(node) { + if (this.get("callee").isIdentifier()) { + return t.genericTypeAnnotation(node.callee); + } +} + +function TemplateLiteral() { + return t.stringTypeAnnotation(); +} + +function UnaryExpression(node) { + var operator = node.operator; + + if (operator === "void") { + return t.voidTypeAnnotation(); + } else if (t.NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) { + return t.numberTypeAnnotation(); + } else if (t.STRING_UNARY_OPERATORS.indexOf(operator) >= 0) { + return t.stringTypeAnnotation(); + } else if (t.BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) { + return t.booleanTypeAnnotation(); + } +} + +function BinaryExpression(node) { + var operator = node.operator; + + if (t.NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { + return t.numberTypeAnnotation(); + } else if (t.BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) { + return t.booleanTypeAnnotation(); + } else if (operator === "+") { + var right = this.get("right"); + var left = this.get("left"); + + if (left.isBaseType("number") && right.isBaseType("number")) { + return t.numberTypeAnnotation(); + } else if (left.isBaseType("string") || right.isBaseType("string")) { + return t.stringTypeAnnotation(); + } + + return t.unionTypeAnnotation([t.stringTypeAnnotation(), t.numberTypeAnnotation()]); + } +} + +function LogicalExpression() { + return t.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]); +} + +function ConditionalExpression() { + return t.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]); +} + +function SequenceExpression() { + return this.get("expressions").pop().getTypeAnnotation(); +} + +function AssignmentExpression() { + return this.get("right").getTypeAnnotation(); +} + +function UpdateExpression(node) { + var operator = node.operator; + + if (operator === "++" || operator === "--") { + return t.numberTypeAnnotation(); + } +} + +function StringLiteral() { + return t.stringTypeAnnotation(); +} + +function NumericLiteral() { + return t.numberTypeAnnotation(); +} + +function BooleanLiteral() { + return t.booleanTypeAnnotation(); +} + +function NullLiteral() { + return t.nullLiteralTypeAnnotation(); +} + +function RegExpLiteral() { + return t.genericTypeAnnotation(t.identifier("RegExp")); +} + +function ObjectExpression() { + return t.genericTypeAnnotation(t.identifier("Object")); +} + +function ArrayExpression() { + return t.genericTypeAnnotation(t.identifier("Array")); +} + +function RestElement() { + return ArrayExpression(); +} + +RestElement.validParent = true; + +function Func() { + return t.genericTypeAnnotation(t.identifier("Function")); +} + +exports.FunctionExpression = Func; +exports.ArrowFunctionExpression = Func; +exports.FunctionDeclaration = Func; +exports.ClassExpression = Func; +exports.ClassDeclaration = Func; + +function CallExpression() { + return resolveCall(this.get("callee")); +} + +function TaggedTemplateExpression() { + return resolveCall(this.get("tag")); +} + +function resolveCall(callee) { + callee = callee.resolve(); + + if (callee.isFunction()) { + if (callee.is("async")) { + if (callee.is("generator")) { + return t.genericTypeAnnotation(t.identifier("AsyncIterator")); + } else { + return t.genericTypeAnnotation(t.identifier("Promise")); + } + } else { + if (callee.node.returnType) { + return callee.node.returnType; + } else {} + } + } +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/introspection.js": +/*!***************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/introspection.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.is = undefined; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.matchesPattern = matchesPattern; +exports.has = has; +exports.isStatic = isStatic; +exports.isnt = isnt; +exports.equals = equals; +exports.isNodeType = isNodeType; +exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression; +exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement; +exports.isCompletionRecord = isCompletionRecord; +exports.isStatementOrBlock = isStatementOrBlock; +exports.referencesImport = referencesImport; +exports.getSource = getSource; +exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore; +exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo; +exports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions; +exports.resolve = resolve; +exports._resolve = _resolve; + +var _includes = __webpack_require__(/*! lodash/includes */ "./node_modules/lodash/includes.js"); + +var _includes2 = _interopRequireDefault(_includes); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function matchesPattern(pattern, allowPartial) { + if (!this.isMemberExpression()) return false; + var parts = pattern.split("."); + var search = [this.node]; + var i = 0; + + function matches(name) { + var part = parts[i]; + return part === "*" || name === part; + } + + while (search.length) { + var node = search.shift(); + + if (allowPartial && i === parts.length) { + return true; + } + + if (t.isIdentifier(node)) { + if (!matches(node.name)) return false; + } else if (t.isLiteral(node)) { + if (!matches(node.value)) return false; + } else if (t.isMemberExpression(node)) { + if (node.computed && !t.isLiteral(node.property)) { + return false; + } else { + search.unshift(node.property); + search.unshift(node.object); + continue; + } + } else if (t.isThisExpression(node)) { + if (!matches("this")) return false; + } else { + return false; + } + + if (++i > parts.length) { + return false; + } + } + + return i === parts.length; +} + +function has(key) { + var val = this.node && this.node[key]; + + if (val && Array.isArray(val)) { + return !!val.length; + } else { + return !!val; + } +} + +function isStatic() { + return this.scope.isStatic(this.node); +} + +var is = exports.is = has; + +function isnt(key) { + return !this.has(key); +} + +function equals(key, value) { + return this.node[key] === value; +} + +function isNodeType(type) { + return t.isType(this.type, type); +} + +function canHaveVariableDeclarationOrExpression() { + return (this.key === "init" || this.key === "left") && this.parentPath.isFor(); +} + +function canSwapBetweenExpressionAndStatement(replacement) { + if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) { + return false; + } + + if (this.isExpression()) { + return t.isBlockStatement(replacement); + } else if (this.isBlockStatement()) { + return t.isExpression(replacement); + } + + return false; +} + +function isCompletionRecord(allowInsideFunction) { + var path = this; + var first = true; + + do { + var container = path.container; + + if (path.isFunction() && !first) { + return !!allowInsideFunction; + } + + first = false; + + if (Array.isArray(container) && path.key !== container.length - 1) { + return false; + } + } while ((path = path.parentPath) && !path.isProgram()); + + return true; +} + +function isStatementOrBlock() { + if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) { + return false; + } else { + return (0, _includes2.default)(t.STATEMENT_OR_BLOCK_KEYS, this.key); + } +} + +function referencesImport(moduleSource, importName) { + if (!this.isReferencedIdentifier()) return false; + var binding = this.scope.getBinding(this.node.name); + if (!binding || binding.kind !== "module") return false; + var path = binding.path; + var parent = path.parentPath; + if (!parent.isImportDeclaration()) return false; + + if (parent.node.source.value === moduleSource) { + if (!importName) return true; + } else { + return false; + } + + if (path.isImportDefaultSpecifier() && importName === "default") { + return true; + } + + if (path.isImportNamespaceSpecifier() && importName === "*") { + return true; + } + + if (path.isImportSpecifier() && path.node.imported.name === importName) { + return true; + } + + return false; +} + +function getSource() { + var node = this.node; + + if (node.end) { + return this.hub.file.code.slice(node.start, node.end); + } else { + return ""; + } +} + +function willIMaybeExecuteBefore(target) { + return this._guessExecutionStatusRelativeTo(target) !== "after"; +} + +function _guessExecutionStatusRelativeTo(target) { + var targetFuncParent = target.scope.getFunctionParent(); + var selfFuncParent = this.scope.getFunctionParent(); + + if (targetFuncParent.node !== selfFuncParent.node) { + var status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent); + + if (status) { + return status; + } else { + target = targetFuncParent.path; + } + } + + var targetPaths = target.getAncestry(); + if (targetPaths.indexOf(this) >= 0) return "after"; + var selfPaths = this.getAncestry(); + var commonPath = void 0; + var targetIndex = void 0; + var selfIndex = void 0; + + for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) { + var selfPath = selfPaths[selfIndex]; + targetIndex = targetPaths.indexOf(selfPath); + + if (targetIndex >= 0) { + commonPath = selfPath; + break; + } + } + + if (!commonPath) { + return "before"; + } + + var targetRelationship = targetPaths[targetIndex - 1]; + var selfRelationship = selfPaths[selfIndex - 1]; + + if (!targetRelationship || !selfRelationship) { + return "before"; + } + + if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) { + return targetRelationship.key > selfRelationship.key ? "before" : "after"; + } + + var targetKeyPosition = t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key); + var selfKeyPosition = t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key); + return targetKeyPosition > selfKeyPosition ? "before" : "after"; +} + +function _guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent) { + var targetFuncPath = targetFuncParent.path; + if (!targetFuncPath.isFunctionDeclaration()) return; + var binding = targetFuncPath.scope.getBinding(targetFuncPath.node.id.name); + if (!binding.references) return "before"; + var referencePaths = binding.referencePaths; + + for (var _iterator = referencePaths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var path = _ref; + + if (path.key !== "callee" || !path.parentPath.isCallExpression()) { + return; + } + } + + var allStatus = void 0; + + for (var _iterator2 = referencePaths, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var _path = _ref2; + var childOfFunction = !!_path.find(function (path) { + return path.node === targetFuncPath.node; + }); + if (childOfFunction) continue; + + var status = this._guessExecutionStatusRelativeTo(_path); + + if (allStatus) { + if (allStatus !== status) return; + } else { + allStatus = status; + } + } + + return allStatus; +} + +function resolve(dangerous, resolved) { + return this._resolve(dangerous, resolved) || this; +} + +function _resolve(dangerous, resolved) { + if (resolved && resolved.indexOf(this) >= 0) return; + resolved = resolved || []; + resolved.push(this); + + if (this.isVariableDeclarator()) { + if (this.get("id").isIdentifier()) { + return this.get("init").resolve(dangerous, resolved); + } else {} + } else if (this.isReferencedIdentifier()) { + var binding = this.scope.getBinding(this.node.name); + if (!binding) return; + if (!binding.constant) return; + if (binding.kind === "module") return; + + if (binding.path !== this) { + var ret = binding.path.resolve(dangerous, resolved); + if (this.find(function (parent) { + return parent.node === ret.node; + })) return; + return ret; + } + } else if (this.isTypeCastExpression()) { + return this.get("expression").resolve(dangerous, resolved); + } else if (dangerous && this.isMemberExpression()) { + var targetKey = this.toComputedKey(); + if (!t.isLiteral(targetKey)) return; + var targetName = targetKey.value; + var target = this.get("object").resolve(dangerous, resolved); + + if (target.isObjectExpression()) { + var props = target.get("properties"); + + for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var prop = _ref3; + if (!prop.isProperty()) continue; + var key = prop.get("key"); + var match = prop.isnt("computed") && key.isIdentifier({ + name: targetName + }); + match = match || key.isLiteral({ + value: targetName + }); + if (match) return prop.get("value").resolve(dangerous, resolved); + } + } else if (target.isArrayExpression() && !isNaN(+targetName)) { + var elems = target.get("elements"); + var elem = elems[targetName]; + if (elem) return elem.resolve(dangerous, resolved); + } + } +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/lib/hoister.js": +/*!*************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/lib/hoister.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var referenceVisitor = { + ReferencedIdentifier: function ReferencedIdentifier(path, state) { + if (path.isJSXIdentifier() && _babelTypes.react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) { + return; + } + + if (path.node.name === "this") { + var scope = path.scope; + + do { + if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) break; + } while (scope = scope.parent); + + if (scope) state.breakOnScopePaths.push(scope.path); + } + + var binding = path.scope.getBinding(path.node.name); + if (!binding) return; + if (binding !== state.scope.getBinding(path.node.name)) return; + state.bindings[path.node.name] = binding; + } +}; + +var PathHoister = function () { + function PathHoister(path, scope) { + (0, _classCallCheck3.default)(this, PathHoister); + this.breakOnScopePaths = []; + this.bindings = {}; + this.scopes = []; + this.scope = scope; + this.path = path; + this.attachAfter = false; + } + + PathHoister.prototype.isCompatibleScope = function isCompatibleScope(scope) { + for (var key in this.bindings) { + var binding = this.bindings[key]; + + if (!scope.bindingIdentifierEquals(key, binding.identifier)) { + return false; + } + } + + return true; + }; + + PathHoister.prototype.getCompatibleScopes = function getCompatibleScopes() { + var scope = this.path.scope; + + do { + if (this.isCompatibleScope(scope)) { + this.scopes.push(scope); + } else { + break; + } + + if (this.breakOnScopePaths.indexOf(scope.path) >= 0) { + break; + } + } while (scope = scope.parent); + }; + + PathHoister.prototype.getAttachmentPath = function getAttachmentPath() { + var path = this._getAttachmentPath(); + + if (!path) return; + var targetScope = path.scope; + + if (targetScope.path === path) { + targetScope = path.scope.parent; + } + + if (targetScope.path.isProgram() || targetScope.path.isFunction()) { + for (var name in this.bindings) { + if (!targetScope.hasOwnBinding(name)) continue; + var binding = this.bindings[name]; + if (binding.kind === "param") continue; + + if (this.getAttachmentParentForPath(binding.path).key > path.key) { + this.attachAfter = true; + path = binding.path; + + for (var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var violationPath = _ref; + + if (this.getAttachmentParentForPath(violationPath).key > path.key) { + path = violationPath; + } + } + } + } + } + + if (path.parentPath.isExportDeclaration()) { + path = path.parentPath; + } + + return path; + }; + + PathHoister.prototype._getAttachmentPath = function _getAttachmentPath() { + var scopes = this.scopes; + var scope = scopes.pop(); + if (!scope) return; + + if (scope.path.isFunction()) { + if (this.hasOwnParamBindings(scope)) { + if (this.scope === scope) return; + return scope.path.get("body").get("body")[0]; + } else { + return this.getNextScopeAttachmentParent(); + } + } else if (scope.path.isProgram()) { + return this.getNextScopeAttachmentParent(); + } + }; + + PathHoister.prototype.getNextScopeAttachmentParent = function getNextScopeAttachmentParent() { + var scope = this.scopes.pop(); + if (scope) return this.getAttachmentParentForPath(scope.path); + }; + + PathHoister.prototype.getAttachmentParentForPath = function getAttachmentParentForPath(path) { + do { + if (!path.parentPath || Array.isArray(path.container) && path.isStatement() || path.isVariableDeclarator() && path.parentPath.node !== null && path.parentPath.node.declarations.length > 1) return path; + } while (path = path.parentPath); + }; + + PathHoister.prototype.hasOwnParamBindings = function hasOwnParamBindings(scope) { + for (var name in this.bindings) { + if (!scope.hasOwnBinding(name)) continue; + var binding = this.bindings[name]; + if (binding.kind === "param" && binding.constant) return true; + } + + return false; + }; + + PathHoister.prototype.run = function run() { + var node = this.path.node; + if (node._hoisted) return; + node._hoisted = true; + this.path.traverse(referenceVisitor, this); + this.getCompatibleScopes(); + var attachTo = this.getAttachmentPath(); + if (!attachTo) return; + if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return; + var uid = attachTo.scope.generateUidIdentifier("ref"); + var declarator = t.variableDeclarator(uid, this.path.node); + var insertFn = this.attachAfter ? "insertAfter" : "insertBefore"; + attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t.variableDeclaration("var", [declarator])]); + var parent = this.path.parentPath; + + if (parent.isJSXElement() && this.path.container === parent.node.children) { + uid = t.JSXExpressionContainer(uid); + } + + this.path.replaceWith(uid); + }; + + return PathHoister; +}(); + +exports.default = PathHoister; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/lib/removal-hooks.js": +/*!*******************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/lib/removal-hooks.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +var hooks = exports.hooks = [function (self, parent) { + var removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement(); + + if (removeParent) { + parent.remove(); + return true; + } +}, function (self, parent) { + if (parent.isSequenceExpression() && parent.node.expressions.length === 1) { + parent.replaceWith(parent.node.expressions[0]); + return true; + } +}, function (self, parent) { + if (parent.isBinary()) { + if (self.key === "left") { + parent.replaceWith(parent.node.right); + } else { + parent.replaceWith(parent.node.left); + } + + return true; + } +}, function (self, parent) { + if (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate") || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) { + self.replaceWith({ + type: "BlockStatement", + body: [] + }); + return true; + } +}]; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/lib/virtual-types.js": +/*!*******************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/lib/virtual-types.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = undefined; + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +var ReferencedIdentifier = exports.ReferencedIdentifier = { + types: ["Identifier", "JSXIdentifier"], + checkPath: function checkPath(_ref, opts) { + var node = _ref.node, + parent = _ref.parent; + + if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) { + if (t.isJSXIdentifier(node, opts)) { + if (_babelTypes.react.isCompatTag(node.name)) return false; + } else { + return false; + } + } + + return t.isReferenced(node, parent); + } +}; +var ReferencedMemberExpression = exports.ReferencedMemberExpression = { + types: ["MemberExpression"], + checkPath: function checkPath(_ref2) { + var node = _ref2.node, + parent = _ref2.parent; + return t.isMemberExpression(node) && t.isReferenced(node, parent); + } +}; +var BindingIdentifier = exports.BindingIdentifier = { + types: ["Identifier"], + checkPath: function checkPath(_ref3) { + var node = _ref3.node, + parent = _ref3.parent; + return t.isIdentifier(node) && t.isBinding(node, parent); + } +}; +var Statement = exports.Statement = { + types: ["Statement"], + checkPath: function checkPath(_ref4) { + var node = _ref4.node, + parent = _ref4.parent; + + if (t.isStatement(node)) { + if (t.isVariableDeclaration(node)) { + if (t.isForXStatement(parent, { + left: node + })) return false; + if (t.isForStatement(parent, { + init: node + })) return false; + } + + return true; + } else { + return false; + } + } +}; +var Expression = exports.Expression = { + types: ["Expression"], + checkPath: function checkPath(path) { + if (path.isIdentifier()) { + return path.isReferencedIdentifier(); + } else { + return t.isExpression(path.node); + } + } +}; +var Scope = exports.Scope = { + types: ["Scopable"], + checkPath: function checkPath(path) { + return t.isScope(path.node, path.parent); + } +}; +var Referenced = exports.Referenced = { + checkPath: function checkPath(path) { + return t.isReferenced(path.node, path.parent); + } +}; +var BlockScoped = exports.BlockScoped = { + checkPath: function checkPath(path) { + return t.isBlockScoped(path.node); + } +}; +var Var = exports.Var = { + types: ["VariableDeclaration"], + checkPath: function checkPath(path) { + return t.isVar(path.node); + } +}; +var User = exports.User = { + checkPath: function checkPath(path) { + return path.node && !!path.node.loc; + } +}; +var Generated = exports.Generated = { + checkPath: function checkPath(path) { + return !path.isUser(); + } +}; +var Pure = exports.Pure = { + checkPath: function checkPath(path, opts) { + return path.scope.isPure(path.node, opts); + } +}; +var Flow = exports.Flow = { + types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"], + checkPath: function checkPath(_ref5) { + var node = _ref5.node; + + if (t.isFlow(node)) { + return true; + } else if (t.isImportDeclaration(node)) { + return node.importKind === "type" || node.importKind === "typeof"; + } else if (t.isExportDeclaration(node)) { + return node.exportKind === "type"; + } else if (t.isImportSpecifier(node)) { + return node.importKind === "type" || node.importKind === "typeof"; + } else { + return false; + } + } +}; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/modification.js": +/*!**************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/modification.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _typeof2 = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.insertBefore = insertBefore; +exports._containerInsert = _containerInsert; +exports._containerInsertBefore = _containerInsertBefore; +exports._containerInsertAfter = _containerInsertAfter; +exports._maybePopFromStatements = _maybePopFromStatements; +exports.insertAfter = insertAfter; +exports.updateSiblingKeys = updateSiblingKeys; +exports._verifyNodeList = _verifyNodeList; +exports.unshiftContainer = unshiftContainer; +exports.pushContainer = pushContainer; +exports.hoist = hoist; + +var _cache = __webpack_require__(/*! ../cache */ "./node_modules/babel-traverse/lib/cache.js"); + +var _hoister = __webpack_require__(/*! ./lib/hoister */ "./node_modules/babel-traverse/lib/path/lib/hoister.js"); + +var _hoister2 = _interopRequireDefault(_hoister); + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-traverse/lib/path/index.js"); + +var _index2 = _interopRequireDefault(_index); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function insertBefore(nodes) { + this._assertUnremoved(); + + nodes = this._verifyNodeList(nodes); + + if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) { + return this.parentPath.insertBefore(nodes); + } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") { + if (this.node) nodes.push(this.node); + this.replaceExpressionWithStatements(nodes); + } else { + this._maybePopFromStatements(nodes); + + if (Array.isArray(this.container)) { + return this._containerInsertBefore(nodes); + } else if (this.isStatementOrBlock()) { + if (this.node) nodes.push(this.node); + + this._replaceWith(t.blockStatement(nodes)); + } else { + throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); + } + } + + return [this]; +} + +function _containerInsert(from, nodes) { + this.updateSiblingKeys(from, nodes.length); + var paths = []; + + for (var i = 0; i < nodes.length; i++) { + var to = from + i; + var node = nodes[i]; + this.container.splice(to, 0, node); + + if (this.context) { + var path = this.context.create(this.parent, this.container, to, this.listKey); + if (this.context.queue) path.pushContext(this.context); + paths.push(path); + } else { + paths.push(_index2.default.get({ + parentPath: this.parentPath, + parent: this.parent, + container: this.container, + listKey: this.listKey, + key: to + })); + } + } + + var contexts = this._getQueueContexts(); + + for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var _path = _ref; + + _path.setScope(); + + _path.debug(function () { + return "Inserted."; + }); + + for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var context = _ref2; + context.maybeQueue(_path, true); + } + } + + return paths; +} + +function _containerInsertBefore(nodes) { + return this._containerInsert(this.key, nodes); +} + +function _containerInsertAfter(nodes) { + return this._containerInsert(this.key + 1, nodes); +} + +function _maybePopFromStatements(nodes) { + var last = nodes[nodes.length - 1]; + var isIdentifier = t.isIdentifier(last) || t.isExpressionStatement(last) && t.isIdentifier(last.expression); + + if (isIdentifier && !this.isCompletionRecord()) { + nodes.pop(); + } +} + +function insertAfter(nodes) { + this._assertUnremoved(); + + nodes = this._verifyNodeList(nodes); + + if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) { + return this.parentPath.insertAfter(nodes); + } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") { + if (this.node) { + var temp = this.scope.generateDeclaredUidIdentifier(); + nodes.unshift(t.expressionStatement(t.assignmentExpression("=", temp, this.node))); + nodes.push(t.expressionStatement(temp)); + } + + this.replaceExpressionWithStatements(nodes); + } else { + this._maybePopFromStatements(nodes); + + if (Array.isArray(this.container)) { + return this._containerInsertAfter(nodes); + } else if (this.isStatementOrBlock()) { + if (this.node) nodes.unshift(this.node); + + this._replaceWith(t.blockStatement(nodes)); + } else { + throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); + } + } + + return [this]; +} + +function updateSiblingKeys(fromIndex, incrementBy) { + if (!this.parent) return; + + var paths = _cache.path.get(this.parent); + + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + + if (path.key >= fromIndex) { + path.key += incrementBy; + } + } +} + +function _verifyNodeList(nodes) { + if (!nodes) { + return []; + } + + if (nodes.constructor !== Array) { + nodes = [nodes]; + } + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var msg = void 0; + + if (!node) { + msg = "has falsy node"; + } else if ((typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node)) !== "object") { + msg = "contains a non-object node"; + } else if (!node.type) { + msg = "without a type"; + } else if (node instanceof _index2.default) { + msg = "has a NodePath when it expected a raw object"; + } + + if (msg) { + var type = Array.isArray(node) ? "array" : typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node); + throw new Error("Node list " + msg + " with the index of " + i + " and type of " + type); + } + } + + return nodes; +} + +function unshiftContainer(listKey, nodes) { + this._assertUnremoved(); + + nodes = this._verifyNodeList(nodes); + + var path = _index2.default.get({ + parentPath: this, + parent: this.node, + container: this.node[listKey], + listKey: listKey, + key: 0 + }); + + return path.insertBefore(nodes); +} + +function pushContainer(listKey, nodes) { + this._assertUnremoved(); + + nodes = this._verifyNodeList(nodes); + var container = this.node[listKey]; + + var path = _index2.default.get({ + parentPath: this, + parent: this.node, + container: container, + listKey: listKey, + key: container.length + }); + + return path.replaceWithMultiple(nodes); +} + +function hoist() { + var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.scope; + var hoister = new _hoister2.default(this, scope); + return hoister.run(); +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/removal.js": +/*!*********************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/removal.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.remove = remove; +exports._callRemovalHooks = _callRemovalHooks; +exports._remove = _remove; +exports._markRemoved = _markRemoved; +exports._assertUnremoved = _assertUnremoved; + +var _removalHooks = __webpack_require__(/*! ./lib/removal-hooks */ "./node_modules/babel-traverse/lib/path/lib/removal-hooks.js"); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function remove() { + this._assertUnremoved(); + + this.resync(); + + if (this._callRemovalHooks()) { + this._markRemoved(); + + return; + } + + this.shareCommentsWithSiblings(); + + this._remove(); + + this._markRemoved(); +} + +function _callRemovalHooks() { + for (var _iterator = _removalHooks.hooks, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var fn = _ref; + if (fn(this, this.parentPath)) return true; + } +} + +function _remove() { + if (Array.isArray(this.container)) { + this.container.splice(this.key, 1); + this.updateSiblingKeys(this.key, -1); + } else { + this._replaceWith(null); + } +} + +function _markRemoved() { + this.shouldSkip = true; + this.removed = true; + this.node = null; +} + +function _assertUnremoved() { + if (this.removed) { + throw this.buildCodeFrameError("NodePath has been removed so is read-only."); + } +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/path/replacement.js": +/*!*************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/path/replacement.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.replaceWithMultiple = replaceWithMultiple; +exports.replaceWithSourceString = replaceWithSourceString; +exports.replaceWith = replaceWith; +exports._replaceWith = _replaceWith; +exports.replaceExpressionWithStatements = replaceExpressionWithStatements; +exports.replaceInline = replaceInline; + +var _babelCodeFrame = __webpack_require__(/*! babel-code-frame */ "./node_modules/babel-code-frame/lib/index.js"); + +var _babelCodeFrame2 = _interopRequireDefault(_babelCodeFrame); + +var _index = __webpack_require__(/*! ../index */ "./node_modules/babel-traverse/lib/index.js"); + +var _index2 = _interopRequireDefault(_index); + +var _index3 = __webpack_require__(/*! ./index */ "./node_modules/babel-traverse/lib/path/index.js"); + +var _index4 = _interopRequireDefault(_index3); + +var _babylon = __webpack_require__(/*! babylon */ "./node_modules/babylon/lib/index.js"); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var hoistVariablesVisitor = { + Function: function Function(path) { + path.skip(); + }, + VariableDeclaration: function VariableDeclaration(path) { + if (path.node.kind !== "var") return; + var bindings = path.getBindingIdentifiers(); + + for (var key in bindings) { + path.scope.push({ + id: bindings[key] + }); + } + + var exprs = []; + + for (var _iterator = path.node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var declar = _ref; + + if (declar.init) { + exprs.push(t.expressionStatement(t.assignmentExpression("=", declar.id, declar.init))); + } + } + + path.replaceWithMultiple(exprs); + } +}; + +function replaceWithMultiple(nodes) { + this.resync(); + nodes = this._verifyNodeList(nodes); + t.inheritLeadingComments(nodes[0], this.node); + t.inheritTrailingComments(nodes[nodes.length - 1], this.node); + this.node = this.container[this.key] = null; + this.insertAfter(nodes); + + if (this.node) { + this.requeue(); + } else { + this.remove(); + } +} + +function replaceWithSourceString(replacement) { + this.resync(); + + try { + replacement = "(" + replacement + ")"; + replacement = (0, _babylon.parse)(replacement); + } catch (err) { + var loc = err.loc; + + if (loc) { + err.message += " - make sure this is an expression."; + err.message += "\n" + (0, _babelCodeFrame2.default)(replacement, loc.line, loc.column + 1); + } + + throw err; + } + + replacement = replacement.program.body[0].expression; + + _index2.default.removeProperties(replacement); + + return this.replaceWith(replacement); +} + +function replaceWith(replacement) { + this.resync(); + + if (this.removed) { + throw new Error("You can't replace this node, we've already removed it"); + } + + if (replacement instanceof _index4.default) { + replacement = replacement.node; + } + + if (!replacement) { + throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead"); + } + + if (this.node === replacement) { + return; + } + + if (this.isProgram() && !t.isProgram(replacement)) { + throw new Error("You can only replace a Program root node with another Program node"); + } + + if (Array.isArray(replacement)) { + throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`"); + } + + if (typeof replacement === "string") { + throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`"); + } + + if (this.isNodeType("Statement") && t.isExpression(replacement)) { + if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) { + replacement = t.expressionStatement(replacement); + } + } + + if (this.isNodeType("Expression") && t.isStatement(replacement)) { + if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) { + return this.replaceExpressionWithStatements([replacement]); + } + } + + var oldNode = this.node; + + if (oldNode) { + t.inheritsComments(replacement, oldNode); + t.removeComments(oldNode); + } + + this._replaceWith(replacement); + + this.type = replacement.type; + this.setScope(); + this.requeue(); +} + +function _replaceWith(node) { + if (!this.container) { + throw new ReferenceError("Container is falsy"); + } + + if (this.inList) { + t.validate(this.parent, this.key, [node]); + } else { + t.validate(this.parent, this.key, node); + } + + this.debug(function () { + return "Replace with " + (node && node.type); + }); + this.node = this.container[this.key] = node; +} + +function replaceExpressionWithStatements(nodes) { + this.resync(); + var toSequenceExpression = t.toSequenceExpression(nodes, this.scope); + + if (t.isSequenceExpression(toSequenceExpression)) { + var exprs = toSequenceExpression.expressions; + + if (exprs.length >= 2 && this.parentPath.isExpressionStatement()) { + this._maybePopFromStatements(exprs); + } + + if (exprs.length === 1) { + this.replaceWith(exprs[0]); + } else { + this.replaceWith(toSequenceExpression); + } + } else if (toSequenceExpression) { + this.replaceWith(toSequenceExpression); + } else { + var container = t.functionExpression(null, [], t.blockStatement(nodes)); + container.shadow = true; + this.replaceWith(t.callExpression(container, [])); + this.traverse(hoistVariablesVisitor); + var completionRecords = this.get("callee").getCompletionRecords(); + + for (var _iterator2 = completionRecords, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var path = _ref2; + if (!path.isExpressionStatement()) continue; + var loop = path.findParent(function (path) { + return path.isLoop(); + }); + + if (loop) { + var uid = loop.getData("expressionReplacementReturnUid"); + + if (!uid) { + var callee = this.get("callee"); + uid = callee.scope.generateDeclaredUidIdentifier("ret"); + callee.get("body").pushContainer("body", t.returnStatement(uid)); + loop.setData("expressionReplacementReturnUid", uid); + } else { + uid = t.identifier(uid.name); + } + + path.get("expression").replaceWith(t.assignmentExpression("=", uid, path.node.expression)); + } else { + path.replaceWith(t.returnStatement(path.node.expression)); + } + } + + return this.node; + } +} + +function replaceInline(nodes) { + this.resync(); + + if (Array.isArray(nodes)) { + if (Array.isArray(this.container)) { + nodes = this._verifyNodeList(nodes); + + this._containerInsertAfter(nodes); + + return this.remove(); + } else { + return this.replaceWithMultiple(nodes); + } + } else { + return this.replaceWith(nodes); + } +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/scope/binding.js": +/*!**********************************************************!*\ + !*** ./node_modules/babel-traverse/lib/scope/binding.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var Binding = function () { + function Binding(_ref) { + var existing = _ref.existing, + identifier = _ref.identifier, + scope = _ref.scope, + path = _ref.path, + kind = _ref.kind; + (0, _classCallCheck3.default)(this, Binding); + this.identifier = identifier; + this.scope = scope; + this.path = path; + this.kind = kind; + this.constantViolations = []; + this.constant = true; + this.referencePaths = []; + this.referenced = false; + this.references = 0; + this.clearValue(); + + if (existing) { + this.constantViolations = [].concat(existing.path, existing.constantViolations, this.constantViolations); + } + } + + Binding.prototype.deoptValue = function deoptValue() { + this.clearValue(); + this.hasDeoptedValue = true; + }; + + Binding.prototype.setValue = function setValue(value) { + if (this.hasDeoptedValue) return; + this.hasValue = true; + this.value = value; + }; + + Binding.prototype.clearValue = function clearValue() { + this.hasDeoptedValue = false; + this.hasValue = false; + this.value = null; + }; + + Binding.prototype.reassign = function reassign(path) { + this.constant = false; + + if (this.constantViolations.indexOf(path) !== -1) { + return; + } + + this.constantViolations.push(path); + }; + + Binding.prototype.reference = function reference(path) { + if (this.referencePaths.indexOf(path) !== -1) { + return; + } + + this.referenced = true; + this.references++; + this.referencePaths.push(path); + }; + + Binding.prototype.dereference = function dereference() { + this.references--; + this.referenced = !!this.references; + }; + + return Binding; +}(); + +exports.default = Binding; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/scope/index.js": +/*!********************************************************!*\ + !*** ./node_modules/babel-traverse/lib/scope/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); + +var _keys2 = _interopRequireDefault(_keys); + +var _create = __webpack_require__(/*! babel-runtime/core-js/object/create */ "./node_modules/babel-runtime/core-js/object/create.js"); + +var _create2 = _interopRequireDefault(_create); + +var _map = __webpack_require__(/*! babel-runtime/core-js/map */ "./node_modules/babel-runtime/core-js/map.js"); + +var _map2 = _interopRequireDefault(_map); + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _includes = __webpack_require__(/*! lodash/includes */ "./node_modules/lodash/includes.js"); + +var _includes2 = _interopRequireDefault(_includes); + +var _repeat = __webpack_require__(/*! lodash/repeat */ "./node_modules/lodash/repeat.js"); + +var _repeat2 = _interopRequireDefault(_repeat); + +var _renamer = __webpack_require__(/*! ./lib/renamer */ "./node_modules/babel-traverse/lib/scope/lib/renamer.js"); + +var _renamer2 = _interopRequireDefault(_renamer); + +var _index = __webpack_require__(/*! ../index */ "./node_modules/babel-traverse/lib/index.js"); + +var _index2 = _interopRequireDefault(_index); + +var _defaults = __webpack_require__(/*! lodash/defaults */ "./node_modules/lodash/defaults.js"); + +var _defaults2 = _interopRequireDefault(_defaults); + +var _babelMessages = __webpack_require__(/*! babel-messages */ "./node_modules/babel-messages/lib/index.js"); + +var messages = _interopRequireWildcard(_babelMessages); + +var _binding2 = __webpack_require__(/*! ./binding */ "./node_modules/babel-traverse/lib/scope/binding.js"); + +var _binding3 = _interopRequireDefault(_binding2); + +var _globals = __webpack_require__(/*! globals */ "./node_modules/babel-traverse/node_modules/globals/index.js"); + +var _globals2 = _interopRequireDefault(_globals); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +var _cache = __webpack_require__(/*! ../cache */ "./node_modules/babel-traverse/lib/cache.js"); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var _crawlCallsCount = 0; + +function getCache(path, parentScope, self) { + var scopes = _cache.scope.get(path.node) || []; + + for (var _iterator = scopes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var scope = _ref; + if (scope.parent === parentScope && scope.path === path) return scope; + } + + scopes.push(self); + + if (!_cache.scope.has(path.node)) { + _cache.scope.set(path.node, scopes); + } +} + +function gatherNodeParts(node, parts) { + if (t.isModuleDeclaration(node)) { + if (node.source) { + gatherNodeParts(node.source, parts); + } else if (node.specifiers && node.specifiers.length) { + for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var specifier = _ref2; + gatherNodeParts(specifier, parts); + } + } else if (node.declaration) { + gatherNodeParts(node.declaration, parts); + } + } else if (t.isModuleSpecifier(node)) { + gatherNodeParts(node.local, parts); + } else if (t.isMemberExpression(node)) { + gatherNodeParts(node.object, parts); + gatherNodeParts(node.property, parts); + } else if (t.isIdentifier(node)) { + parts.push(node.name); + } else if (t.isLiteral(node)) { + parts.push(node.value); + } else if (t.isCallExpression(node)) { + gatherNodeParts(node.callee, parts); + } else if (t.isObjectExpression(node) || t.isObjectPattern(node)) { + for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var prop = _ref3; + gatherNodeParts(prop.key || prop.argument, parts); + } + } +} + +var collectorVisitor = { + For: function For(path) { + for (var _iterator4 = t.FOR_INIT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var key = _ref4; + var declar = path.get(key); + if (declar.isVar()) path.scope.getFunctionParent().registerBinding("var", declar); + } + }, + Declaration: function Declaration(path) { + if (path.isBlockScoped()) return; + if (path.isExportDeclaration() && path.get("declaration").isDeclaration()) return; + path.scope.getFunctionParent().registerDeclaration(path); + }, + ReferencedIdentifier: function ReferencedIdentifier(path, state) { + state.references.push(path); + }, + ForXStatement: function ForXStatement(path, state) { + var left = path.get("left"); + + if (left.isPattern() || left.isIdentifier()) { + state.constantViolations.push(left); + } + }, + ExportDeclaration: { + exit: function exit(path) { + var node = path.node, + scope = path.scope; + var declar = node.declaration; + + if (t.isClassDeclaration(declar) || t.isFunctionDeclaration(declar)) { + var _id = declar.id; + if (!_id) return; + var binding = scope.getBinding(_id.name); + if (binding) binding.reference(path); + } else if (t.isVariableDeclaration(declar)) { + for (var _iterator5 = declar.declarations, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { + var _ref5; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref5 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref5 = _i5.value; + } + + var decl = _ref5; + var ids = t.getBindingIdentifiers(decl); + + for (var name in ids) { + var _binding = scope.getBinding(name); + + if (_binding) _binding.reference(path); + } + } + } + } + }, + LabeledStatement: function LabeledStatement(path) { + path.scope.getProgramParent().addGlobal(path.node); + path.scope.getBlockParent().registerDeclaration(path); + }, + AssignmentExpression: function AssignmentExpression(path, state) { + state.assignments.push(path); + }, + UpdateExpression: function UpdateExpression(path, state) { + state.constantViolations.push(path.get("argument")); + }, + UnaryExpression: function UnaryExpression(path, state) { + if (path.node.operator === "delete") { + state.constantViolations.push(path.get("argument")); + } + }, + BlockScoped: function BlockScoped(path) { + var scope = path.scope; + if (scope.path === path) scope = scope.parent; + scope.getBlockParent().registerDeclaration(path); + }, + ClassDeclaration: function ClassDeclaration(path) { + var id = path.node.id; + if (!id) return; + var name = id.name; + path.scope.bindings[name] = path.scope.getBinding(name); + }, + Block: function Block(path) { + var paths = path.get("body"); + + for (var _iterator6 = paths, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { + var _ref6; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref6 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref6 = _i6.value; + } + + var bodyPath = _ref6; + + if (bodyPath.isFunctionDeclaration()) { + path.scope.getBlockParent().registerDeclaration(bodyPath); + } + } + } +}; +var uid = 0; + +var Scope = function () { + function Scope(path, parentScope) { + (0, _classCallCheck3.default)(this, Scope); + + if (parentScope && parentScope.block === path.node) { + return parentScope; + } + + var cached = getCache(path, parentScope, this); + if (cached) return cached; + this.uid = uid++; + this.parent = parentScope; + this.hub = path.hub; + this.parentBlock = path.parent; + this.block = path.node; + this.path = path; + this.labels = new _map2.default(); + } + + Scope.prototype.traverse = function traverse(node, opts, state) { + (0, _index2.default)(node, opts, this, state, this.path); + }; + + Scope.prototype.generateDeclaredUidIdentifier = function generateDeclaredUidIdentifier() { + var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; + var id = this.generateUidIdentifier(name); + this.push({ + id: id + }); + return id; + }; + + Scope.prototype.generateUidIdentifier = function generateUidIdentifier() { + var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; + return t.identifier(this.generateUid(name)); + }; + + Scope.prototype.generateUid = function generateUid() { + var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; + name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, ""); + var uid = void 0; + var i = 0; + + do { + uid = this._generateUid(name, i); + i++; + } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid)); + + var program = this.getProgramParent(); + program.references[uid] = true; + program.uids[uid] = true; + return uid; + }; + + Scope.prototype._generateUid = function _generateUid(name, i) { + var id = name; + if (i > 1) id += i; + return "_" + id; + }; + + Scope.prototype.generateUidIdentifierBasedOnNode = function generateUidIdentifierBasedOnNode(parent, defaultName) { + var node = parent; + + if (t.isAssignmentExpression(parent)) { + node = parent.left; + } else if (t.isVariableDeclarator(parent)) { + node = parent.id; + } else if (t.isObjectProperty(node) || t.isObjectMethod(node)) { + node = node.key; + } + + var parts = []; + gatherNodeParts(node, parts); + var id = parts.join("$"); + id = id.replace(/^_/, "") || defaultName || "ref"; + return this.generateUidIdentifier(id.slice(0, 20)); + }; + + Scope.prototype.isStatic = function isStatic(node) { + if (t.isThisExpression(node) || t.isSuper(node)) { + return true; + } + + if (t.isIdentifier(node)) { + var binding = this.getBinding(node.name); + + if (binding) { + return binding.constant; + } else { + return this.hasBinding(node.name); + } + } + + return false; + }; + + Scope.prototype.maybeGenerateMemoised = function maybeGenerateMemoised(node, dontPush) { + if (this.isStatic(node)) { + return null; + } else { + var _id2 = this.generateUidIdentifierBasedOnNode(node); + + if (!dontPush) this.push({ + id: _id2 + }); + return _id2; + } + }; + + Scope.prototype.checkBlockScopedCollisions = function checkBlockScopedCollisions(local, kind, name, id) { + if (kind === "param") return; + if (kind === "hoisted" && local.kind === "let") return; + var duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && (kind === "let" || kind === "const"); + + if (duplicate) { + throw this.hub.file.buildCodeFrameError(id, messages.get("scopeDuplicateDeclaration", name), TypeError); + } + }; + + Scope.prototype.rename = function rename(oldName, newName, block) { + var binding = this.getBinding(oldName); + + if (binding) { + newName = newName || this.generateUidIdentifier(oldName).name; + return new _renamer2.default(binding, oldName, newName).rename(block); + } + }; + + Scope.prototype._renameFromMap = function _renameFromMap(map, oldName, newName, value) { + if (map[oldName]) { + map[newName] = value; + map[oldName] = null; + } + }; + + Scope.prototype.dump = function dump() { + var sep = (0, _repeat2.default)("-", 60); + console.log(sep); + var scope = this; + + do { + console.log("#", scope.block.type); + + for (var name in scope.bindings) { + var binding = scope.bindings[name]; + console.log(" -", name, { + constant: binding.constant, + references: binding.references, + violations: binding.constantViolations.length, + kind: binding.kind + }); + } + } while (scope = scope.parent); + + console.log(sep); + }; + + Scope.prototype.toArray = function toArray(node, i) { + var file = this.hub.file; + + if (t.isIdentifier(node)) { + var binding = this.getBinding(node.name); + if (binding && binding.constant && binding.path.isGenericType("Array")) return node; + } + + if (t.isArrayExpression(node)) { + return node; + } + + if (t.isIdentifier(node, { + name: "arguments" + })) { + return t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Array"), t.identifier("prototype")), t.identifier("slice")), t.identifier("call")), [node]); + } + + var helperName = "toArray"; + var args = [node]; + + if (i === true) { + helperName = "toConsumableArray"; + } else if (i) { + args.push(t.numericLiteral(i)); + helperName = "slicedToArray"; + } + + return t.callExpression(file.addHelper(helperName), args); + }; + + Scope.prototype.hasLabel = function hasLabel(name) { + return !!this.getLabel(name); + }; + + Scope.prototype.getLabel = function getLabel(name) { + return this.labels.get(name); + }; + + Scope.prototype.registerLabel = function registerLabel(path) { + this.labels.set(path.node.label.name, path); + }; + + Scope.prototype.registerDeclaration = function registerDeclaration(path) { + if (path.isLabeledStatement()) { + this.registerLabel(path); + } else if (path.isFunctionDeclaration()) { + this.registerBinding("hoisted", path.get("id"), path); + } else if (path.isVariableDeclaration()) { + var declarations = path.get("declarations"); + + for (var _iterator7 = declarations, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { + var _ref7; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref7 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref7 = _i7.value; + } + + var declar = _ref7; + this.registerBinding(path.node.kind, declar); + } + } else if (path.isClassDeclaration()) { + this.registerBinding("let", path); + } else if (path.isImportDeclaration()) { + var specifiers = path.get("specifiers"); + + for (var _iterator8 = specifiers, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) { + var _ref8; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref8 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref8 = _i8.value; + } + + var specifier = _ref8; + this.registerBinding("module", specifier); + } + } else if (path.isExportDeclaration()) { + var _declar = path.get("declaration"); + + if (_declar.isClassDeclaration() || _declar.isFunctionDeclaration() || _declar.isVariableDeclaration()) { + this.registerDeclaration(_declar); + } + } else { + this.registerBinding("unknown", path); + } + }; + + Scope.prototype.buildUndefinedNode = function buildUndefinedNode() { + if (this.hasBinding("undefined")) { + return t.unaryExpression("void", t.numericLiteral(0), true); + } else { + return t.identifier("undefined"); + } + }; + + Scope.prototype.registerConstantViolation = function registerConstantViolation(path) { + var ids = path.getBindingIdentifiers(); + + for (var name in ids) { + var binding = this.getBinding(name); + if (binding) binding.reassign(path); + } + }; + + Scope.prototype.registerBinding = function registerBinding(kind, path) { + var bindingPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : path; + if (!kind) throw new ReferenceError("no `kind`"); + + if (path.isVariableDeclaration()) { + var declarators = path.get("declarations"); + + for (var _iterator9 = declarators, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) { + var _ref9; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref9 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref9 = _i9.value; + } + + var declar = _ref9; + this.registerBinding(kind, declar); + } + + return; + } + + var parent = this.getProgramParent(); + var ids = path.getBindingIdentifiers(true); + + for (var name in ids) { + for (var _iterator10 = ids[name], _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) { + var _ref10; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref10 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref10 = _i10.value; + } + + var _id3 = _ref10; + var local = this.getOwnBinding(name); + + if (local) { + if (local.identifier === _id3) continue; + this.checkBlockScopedCollisions(local, kind, name, _id3); + } + + if (local && local.path.isFlow()) local = null; + parent.references[name] = true; + this.bindings[name] = new _binding3.default({ + identifier: _id3, + existing: local, + scope: this, + path: bindingPath, + kind: kind + }); + } + } + }; + + Scope.prototype.addGlobal = function addGlobal(node) { + this.globals[node.name] = node; + }; + + Scope.prototype.hasUid = function hasUid(name) { + var scope = this; + + do { + if (scope.uids[name]) return true; + } while (scope = scope.parent); + + return false; + }; + + Scope.prototype.hasGlobal = function hasGlobal(name) { + var scope = this; + + do { + if (scope.globals[name]) return true; + } while (scope = scope.parent); + + return false; + }; + + Scope.prototype.hasReference = function hasReference(name) { + var scope = this; + + do { + if (scope.references[name]) return true; + } while (scope = scope.parent); + + return false; + }; + + Scope.prototype.isPure = function isPure(node, constantsOnly) { + if (t.isIdentifier(node)) { + var binding = this.getBinding(node.name); + if (!binding) return false; + if (constantsOnly) return binding.constant; + return true; + } else if (t.isClass(node)) { + if (node.superClass && !this.isPure(node.superClass, constantsOnly)) return false; + return this.isPure(node.body, constantsOnly); + } else if (t.isClassBody(node)) { + for (var _iterator11 = node.body, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, _getIterator3.default)(_iterator11);;) { + var _ref11; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref11 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref11 = _i11.value; + } + + var method = _ref11; + if (!this.isPure(method, constantsOnly)) return false; + } + + return true; + } else if (t.isBinary(node)) { + return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly); + } else if (t.isArrayExpression(node)) { + for (var _iterator12 = node.elements, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, _getIterator3.default)(_iterator12);;) { + var _ref12; + + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref12 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref12 = _i12.value; + } + + var elem = _ref12; + if (!this.isPure(elem, constantsOnly)) return false; + } + + return true; + } else if (t.isObjectExpression(node)) { + for (var _iterator13 = node.properties, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, _getIterator3.default)(_iterator13);;) { + var _ref13; + + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref13 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref13 = _i13.value; + } + + var prop = _ref13; + if (!this.isPure(prop, constantsOnly)) return false; + } + + return true; + } else if (t.isClassMethod(node)) { + if (node.computed && !this.isPure(node.key, constantsOnly)) return false; + if (node.kind === "get" || node.kind === "set") return false; + return true; + } else if (t.isClassProperty(node) || t.isObjectProperty(node)) { + if (node.computed && !this.isPure(node.key, constantsOnly)) return false; + return this.isPure(node.value, constantsOnly); + } else if (t.isUnaryExpression(node)) { + return this.isPure(node.argument, constantsOnly); + } else { + return t.isPureish(node); + } + }; + + Scope.prototype.setData = function setData(key, val) { + return this.data[key] = val; + }; + + Scope.prototype.getData = function getData(key) { + var scope = this; + + do { + var data = scope.data[key]; + if (data != null) return data; + } while (scope = scope.parent); + }; + + Scope.prototype.removeData = function removeData(key) { + var scope = this; + + do { + var data = scope.data[key]; + if (data != null) scope.data[key] = null; + } while (scope = scope.parent); + }; + + Scope.prototype.init = function init() { + if (!this.references) this.crawl(); + }; + + Scope.prototype.crawl = function crawl() { + _crawlCallsCount++; + + this._crawl(); + + _crawlCallsCount--; + }; + + Scope.prototype._crawl = function _crawl() { + var path = this.path; + this.references = (0, _create2.default)(null); + this.bindings = (0, _create2.default)(null); + this.globals = (0, _create2.default)(null); + this.uids = (0, _create2.default)(null); + this.data = (0, _create2.default)(null); + + if (path.isLoop()) { + for (var _iterator14 = t.FOR_INIT_KEYS, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, _getIterator3.default)(_iterator14);;) { + var _ref14; + + if (_isArray14) { + if (_i14 >= _iterator14.length) break; + _ref14 = _iterator14[_i14++]; + } else { + _i14 = _iterator14.next(); + if (_i14.done) break; + _ref14 = _i14.value; + } + + var key = _ref14; + var node = path.get(key); + if (node.isBlockScoped()) this.registerBinding(node.node.kind, node); + } + } + + if (path.isFunctionExpression() && path.has("id")) { + if (!path.get("id").node[t.NOT_LOCAL_BINDING]) { + this.registerBinding("local", path.get("id"), path); + } + } + + if (path.isClassExpression() && path.has("id")) { + if (!path.get("id").node[t.NOT_LOCAL_BINDING]) { + this.registerBinding("local", path); + } + } + + if (path.isFunction()) { + var params = path.get("params"); + + for (var _iterator15 = params, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, _getIterator3.default)(_iterator15);;) { + var _ref15; + + if (_isArray15) { + if (_i15 >= _iterator15.length) break; + _ref15 = _iterator15[_i15++]; + } else { + _i15 = _iterator15.next(); + if (_i15.done) break; + _ref15 = _i15.value; + } + + var param = _ref15; + this.registerBinding("param", param); + } + } + + if (path.isCatchClause()) { + this.registerBinding("let", path); + } + + var parent = this.getProgramParent(); + if (parent.crawling) return; + var state = { + references: [], + constantViolations: [], + assignments: [] + }; + this.crawling = true; + path.traverse(collectorVisitor, state); + this.crawling = false; + + for (var _iterator16 = state.assignments, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, _getIterator3.default)(_iterator16);;) { + var _ref16; + + if (_isArray16) { + if (_i16 >= _iterator16.length) break; + _ref16 = _iterator16[_i16++]; + } else { + _i16 = _iterator16.next(); + if (_i16.done) break; + _ref16 = _i16.value; + } + + var _path = _ref16; + + var ids = _path.getBindingIdentifiers(); + + var programParent = void 0; + + for (var name in ids) { + if (_path.scope.getBinding(name)) continue; + programParent = programParent || _path.scope.getProgramParent(); + programParent.addGlobal(ids[name]); + } + + _path.scope.registerConstantViolation(_path); + } + + for (var _iterator17 = state.references, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, _getIterator3.default)(_iterator17);;) { + var _ref17; + + if (_isArray17) { + if (_i17 >= _iterator17.length) break; + _ref17 = _iterator17[_i17++]; + } else { + _i17 = _iterator17.next(); + if (_i17.done) break; + _ref17 = _i17.value; + } + + var ref = _ref17; + var binding = ref.scope.getBinding(ref.node.name); + + if (binding) { + binding.reference(ref); + } else { + ref.scope.getProgramParent().addGlobal(ref.node); + } + } + + for (var _iterator18 = state.constantViolations, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, _getIterator3.default)(_iterator18);;) { + var _ref18; + + if (_isArray18) { + if (_i18 >= _iterator18.length) break; + _ref18 = _iterator18[_i18++]; + } else { + _i18 = _iterator18.next(); + if (_i18.done) break; + _ref18 = _i18.value; + } + + var _path2 = _ref18; + + _path2.scope.registerConstantViolation(_path2); + } + }; + + Scope.prototype.push = function push(opts) { + var path = this.path; + + if (!path.isBlockStatement() && !path.isProgram()) { + path = this.getBlockParent().path; + } + + if (path.isSwitchStatement()) { + path = this.getFunctionParent().path; + } + + if (path.isLoop() || path.isCatchClause() || path.isFunction()) { + t.ensureBlock(path.node); + path = path.get("body"); + } + + var unique = opts.unique; + var kind = opts.kind || "var"; + var blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist; + var dataKey = "declaration:" + kind + ":" + blockHoist; + var declarPath = !unique && path.getData(dataKey); + + if (!declarPath) { + var declar = t.variableDeclaration(kind, []); + declar._generated = true; + declar._blockHoist = blockHoist; + + var _path$unshiftContaine = path.unshiftContainer("body", [declar]); + + declarPath = _path$unshiftContaine[0]; + if (!unique) path.setData(dataKey, declarPath); + } + + var declarator = t.variableDeclarator(opts.id, opts.init); + declarPath.node.declarations.push(declarator); + this.registerBinding(kind, declarPath.get("declarations").pop()); + }; + + Scope.prototype.getProgramParent = function getProgramParent() { + var scope = this; + + do { + if (scope.path.isProgram()) { + return scope; + } + } while (scope = scope.parent); + + throw new Error("We couldn't find a Function or Program..."); + }; + + Scope.prototype.getFunctionParent = function getFunctionParent() { + var scope = this; + + do { + if (scope.path.isFunctionParent()) { + return scope; + } + } while (scope = scope.parent); + + throw new Error("We couldn't find a Function or Program..."); + }; + + Scope.prototype.getBlockParent = function getBlockParent() { + var scope = this; + + do { + if (scope.path.isBlockParent()) { + return scope; + } + } while (scope = scope.parent); + + throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program..."); + }; + + Scope.prototype.getAllBindings = function getAllBindings() { + var ids = (0, _create2.default)(null); + var scope = this; + + do { + (0, _defaults2.default)(ids, scope.bindings); + scope = scope.parent; + } while (scope); + + return ids; + }; + + Scope.prototype.getAllBindingsOfKind = function getAllBindingsOfKind() { + var ids = (0, _create2.default)(null); + + for (var _iterator19 = arguments, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : (0, _getIterator3.default)(_iterator19);;) { + var _ref19; + + if (_isArray19) { + if (_i19 >= _iterator19.length) break; + _ref19 = _iterator19[_i19++]; + } else { + _i19 = _iterator19.next(); + if (_i19.done) break; + _ref19 = _i19.value; + } + + var kind = _ref19; + var scope = this; + + do { + for (var name in scope.bindings) { + var binding = scope.bindings[name]; + if (binding.kind === kind) ids[name] = binding; + } + + scope = scope.parent; + } while (scope); + } + + return ids; + }; + + Scope.prototype.bindingIdentifierEquals = function bindingIdentifierEquals(name, node) { + return this.getBindingIdentifier(name) === node; + }; + + Scope.prototype.warnOnFlowBinding = function warnOnFlowBinding(binding) { + if (_crawlCallsCount === 0 && binding && binding.path.isFlow()) { + console.warn("\n You or one of the Babel plugins you are using are using Flow declarations as bindings.\n Support for this will be removed in version 7. To find out the caller, grep for this\n message and change it to a `console.trace()`.\n "); + } + + return binding; + }; + + Scope.prototype.getBinding = function getBinding(name) { + var scope = this; + + do { + var binding = scope.getOwnBinding(name); + if (binding) return this.warnOnFlowBinding(binding); + } while (scope = scope.parent); + }; + + Scope.prototype.getOwnBinding = function getOwnBinding(name) { + return this.warnOnFlowBinding(this.bindings[name]); + }; + + Scope.prototype.getBindingIdentifier = function getBindingIdentifier(name) { + var info = this.getBinding(name); + return info && info.identifier; + }; + + Scope.prototype.getOwnBindingIdentifier = function getOwnBindingIdentifier(name) { + var binding = this.bindings[name]; + return binding && binding.identifier; + }; + + Scope.prototype.hasOwnBinding = function hasOwnBinding(name) { + return !!this.getOwnBinding(name); + }; + + Scope.prototype.hasBinding = function hasBinding(name, noGlobals) { + if (!name) return false; + if (this.hasOwnBinding(name)) return true; + if (this.parentHasBinding(name, noGlobals)) return true; + if (this.hasUid(name)) return true; + if (!noGlobals && (0, _includes2.default)(Scope.globals, name)) return true; + if (!noGlobals && (0, _includes2.default)(Scope.contextVariables, name)) return true; + return false; + }; + + Scope.prototype.parentHasBinding = function parentHasBinding(name, noGlobals) { + return this.parent && this.parent.hasBinding(name, noGlobals); + }; + + Scope.prototype.moveBindingTo = function moveBindingTo(name, scope) { + var info = this.getBinding(name); + + if (info) { + info.scope.removeOwnBinding(name); + info.scope = scope; + scope.bindings[name] = info; + } + }; + + Scope.prototype.removeOwnBinding = function removeOwnBinding(name) { + delete this.bindings[name]; + }; + + Scope.prototype.removeBinding = function removeBinding(name) { + var info = this.getBinding(name); + + if (info) { + info.scope.removeOwnBinding(name); + } + + var scope = this; + + do { + if (scope.uids[name]) { + scope.uids[name] = false; + } + } while (scope = scope.parent); + }; + + return Scope; +}(); + +Scope.globals = (0, _keys2.default)(_globals2.default.builtin); +Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"]; +exports.default = Scope; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/scope/lib/renamer.js": +/*!**************************************************************!*\ + !*** ./node_modules/babel-traverse/lib/scope/lib/renamer.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _classCallCheck2 = __webpack_require__(/*! babel-runtime/helpers/classCallCheck */ "./node_modules/babel-runtime/helpers/classCallCheck.js"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _binding = __webpack_require__(/*! ../binding */ "./node_modules/babel-traverse/lib/scope/binding.js"); + +var _binding2 = _interopRequireDefault(_binding); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var renameVisitor = { + ReferencedIdentifier: function ReferencedIdentifier(_ref, state) { + var node = _ref.node; + + if (node.name === state.oldName) { + node.name = state.newName; + } + }, + Scope: function Scope(path, state) { + if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) { + path.skip(); + } + }, + "AssignmentExpression|Declaration": function AssignmentExpressionDeclaration(path, state) { + var ids = path.getOuterBindingIdentifiers(); + + for (var name in ids) { + if (name === state.oldName) ids[name].name = state.newName; + } + } +}; + +var Renamer = function () { + function Renamer(binding, oldName, newName) { + (0, _classCallCheck3.default)(this, Renamer); + this.newName = newName; + this.oldName = oldName; + this.binding = binding; + } + + Renamer.prototype.maybeConvertFromExportDeclaration = function maybeConvertFromExportDeclaration(parentDeclar) { + var exportDeclar = parentDeclar.parentPath.isExportDeclaration() && parentDeclar.parentPath; + if (!exportDeclar) return; + var isDefault = exportDeclar.isExportDefaultDeclaration(); + + if (isDefault && (parentDeclar.isFunctionDeclaration() || parentDeclar.isClassDeclaration()) && !parentDeclar.node.id) { + parentDeclar.node.id = parentDeclar.scope.generateUidIdentifier("default"); + } + + var bindingIdentifiers = parentDeclar.getOuterBindingIdentifiers(); + var specifiers = []; + + for (var name in bindingIdentifiers) { + var localName = name === this.oldName ? this.newName : name; + var exportedName = isDefault ? "default" : name; + specifiers.push(t.exportSpecifier(t.identifier(localName), t.identifier(exportedName))); + } + + if (specifiers.length) { + var aliasDeclar = t.exportNamedDeclaration(null, specifiers); + + if (parentDeclar.isFunctionDeclaration()) { + aliasDeclar._blockHoist = 3; + } + + exportDeclar.insertAfter(aliasDeclar); + exportDeclar.replaceWith(parentDeclar.node); + } + }; + + Renamer.prototype.rename = function rename(block) { + var binding = this.binding, + oldName = this.oldName, + newName = this.newName; + var scope = binding.scope, + path = binding.path; + var parentDeclar = path.find(function (path) { + return path.isDeclaration() || path.isFunctionExpression(); + }); + + if (parentDeclar) { + this.maybeConvertFromExportDeclaration(parentDeclar); + } + + scope.traverse(block || scope.block, renameVisitor, this); + + if (!block) { + scope.removeOwnBinding(oldName); + scope.bindings[newName] = binding; + this.binding.identifier.name = newName; + } + + if (binding.type === "hoisted") {} + }; + + return Renamer; +}(); + +exports.default = Renamer; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/babel-traverse/lib/visitors.js": +/*!*****************************************************!*\ + !*** ./node_modules/babel-traverse/lib/visitors.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _typeof2 = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); + +var _keys2 = _interopRequireDefault(_keys); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.explode = explode; +exports.verify = verify; +exports.merge = merge; + +var _virtualTypes = __webpack_require__(/*! ./path/lib/virtual-types */ "./node_modules/babel-traverse/lib/path/lib/virtual-types.js"); + +var virtualTypes = _interopRequireWildcard(_virtualTypes); + +var _babelMessages = __webpack_require__(/*! babel-messages */ "./node_modules/babel-messages/lib/index.js"); + +var messages = _interopRequireWildcard(_babelMessages); + +var _babelTypes = __webpack_require__(/*! babel-types */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_babelTypes); + +var _clone = __webpack_require__(/*! lodash/clone */ "./node_modules/lodash/clone.js"); + +var _clone2 = _interopRequireDefault(_clone); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function explode(visitor) { + if (visitor._exploded) return visitor; + visitor._exploded = true; + + for (var nodeType in visitor) { + if (shouldIgnoreKey(nodeType)) continue; + var parts = nodeType.split("|"); + if (parts.length === 1) continue; + var fns = visitor[nodeType]; + delete visitor[nodeType]; + + for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var part = _ref; + visitor[part] = fns; + } + } + + verify(visitor); + delete visitor.__esModule; + ensureEntranceObjects(visitor); + ensureCallbackArrays(visitor); + + for (var _iterator2 = (0, _keys2.default)(visitor), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var _nodeType3 = _ref2; + if (shouldIgnoreKey(_nodeType3)) continue; + var wrapper = virtualTypes[_nodeType3]; + if (!wrapper) continue; + var _fns2 = visitor[_nodeType3]; + + for (var type in _fns2) { + _fns2[type] = wrapCheck(wrapper, _fns2[type]); + } + + delete visitor[_nodeType3]; + + if (wrapper.types) { + for (var _iterator4 = wrapper.types, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var _type = _ref4; + + if (visitor[_type]) { + mergePair(visitor[_type], _fns2); + } else { + visitor[_type] = _fns2; + } + } + } else { + mergePair(visitor, _fns2); + } + } + + for (var _nodeType in visitor) { + if (shouldIgnoreKey(_nodeType)) continue; + var _fns = visitor[_nodeType]; + var aliases = t.FLIPPED_ALIAS_KEYS[_nodeType]; + var deprecratedKey = t.DEPRECATED_KEYS[_nodeType]; + + if (deprecratedKey) { + console.trace("Visitor defined for " + _nodeType + " but it has been renamed to " + deprecratedKey); + aliases = [deprecratedKey]; + } + + if (!aliases) continue; + delete visitor[_nodeType]; + + for (var _iterator3 = aliases, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var alias = _ref3; + var existing = visitor[alias]; + + if (existing) { + mergePair(existing, _fns); + } else { + visitor[alias] = (0, _clone2.default)(_fns); + } + } + } + + for (var _nodeType2 in visitor) { + if (shouldIgnoreKey(_nodeType2)) continue; + ensureCallbackArrays(visitor[_nodeType2]); + } + + return visitor; +} + +function verify(visitor) { + if (visitor._verified) return; + + if (typeof visitor === "function") { + throw new Error(messages.get("traverseVerifyRootFunction")); + } + + for (var nodeType in visitor) { + if (nodeType === "enter" || nodeType === "exit") { + validateVisitorMethods(nodeType, visitor[nodeType]); + } + + if (shouldIgnoreKey(nodeType)) continue; + + if (t.TYPES.indexOf(nodeType) < 0) { + throw new Error(messages.get("traverseVerifyNodeType", nodeType)); + } + + var visitors = visitor[nodeType]; + + if ((typeof visitors === "undefined" ? "undefined" : (0, _typeof3.default)(visitors)) === "object") { + for (var visitorKey in visitors) { + if (visitorKey === "enter" || visitorKey === "exit") { + validateVisitorMethods(nodeType + "." + visitorKey, visitors[visitorKey]); + } else { + throw new Error(messages.get("traverseVerifyVisitorProperty", nodeType, visitorKey)); + } + } + } + } + + visitor._verified = true; +} + +function validateVisitorMethods(path, val) { + var fns = [].concat(val); + + for (var _iterator5 = fns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { + var _ref5; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref5 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref5 = _i5.value; + } + + var fn = _ref5; + + if (typeof fn !== "function") { + throw new TypeError("Non-function found defined in " + path + " with type " + (typeof fn === "undefined" ? "undefined" : (0, _typeof3.default)(fn))); + } + } +} + +function merge(visitors) { + var states = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var wrapper = arguments[2]; + var rootVisitor = {}; + + for (var i = 0; i < visitors.length; i++) { + var visitor = visitors[i]; + var state = states[i]; + explode(visitor); + + for (var type in visitor) { + var visitorType = visitor[type]; + + if (state || wrapper) { + visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper); + } + + var nodeVisitor = rootVisitor[type] = rootVisitor[type] || {}; + mergePair(nodeVisitor, visitorType); + } + } + + return rootVisitor; +} + +function wrapWithStateOrWrapper(oldVisitor, state, wrapper) { + var newVisitor = {}; + + var _loop = function _loop(key) { + var fns = oldVisitor[key]; + if (!Array.isArray(fns)) return "continue"; + fns = fns.map(function (fn) { + var newFn = fn; + + if (state) { + newFn = function newFn(path) { + return fn.call(state, path, state); + }; + } + + if (wrapper) { + newFn = wrapper(state.key, key, newFn); + } + + return newFn; + }); + newVisitor[key] = fns; + }; + + for (var key in oldVisitor) { + var _ret = _loop(key); + + if (_ret === "continue") continue; + } + + return newVisitor; +} + +function ensureEntranceObjects(obj) { + for (var key in obj) { + if (shouldIgnoreKey(key)) continue; + var fns = obj[key]; + + if (typeof fns === "function") { + obj[key] = { + enter: fns + }; + } + } +} + +function ensureCallbackArrays(obj) { + if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter]; + if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit]; +} + +function wrapCheck(wrapper, fn) { + var newFn = function newFn(path) { + if (wrapper.checkPath(path)) { + return fn.apply(this, arguments); + } + }; + + newFn.toString = function () { + return fn.toString(); + }; + + return newFn; +} + +function shouldIgnoreKey(key) { + if (key[0] === "_") return true; + if (key === "enter" || key === "exit" || key === "shouldSkip") return true; + if (key === "blacklist" || key === "noScope" || key === "skipKeys") return true; + return false; +} + +function mergePair(dest, src) { + for (var key in src) { + dest[key] = [].concat(dest[key] || [], src[key]); + } +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/node_modules/debug/src/browser.js": +/*!***********************************************************************!*\ + !*** ./node_modules/babel-traverse/node_modules/debug/src/browser.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ +exports = module.exports = __webpack_require__(/*! ./debug */ "./node_modules/babel-traverse/node_modules/debug/src/debug.js"); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage(); +/** + * Colors. + */ + +exports.colors = ['lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson']; +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + + + return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker + typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); +} +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + + +exports.formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; +/** + * Colorize log arguments if enabled. + * + * @api public + */ + + +function formatArgs(args) { + var useColors = this.useColors; + args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); + if (!useColors) return; + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function (match) { + if ('%%' === match) return; + index++; + + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + args.splice(lastC, 0, c); +} +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); +} +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch (e) {} +} +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + +function load() { + var r; + + try { + r = exports.storage.debug; + } catch (e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + + + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = Object({"NODE_ENV":"development","PUBLIC_URL":""}).DEBUG; + } + + return r; +} +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + + +exports.enable(load()); +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/babel-traverse/node_modules/debug/src/debug.js": +/*!*********************************************************************!*\ + !*** ./node_modules/babel-traverse/node_modules/debug/src/debug.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = __webpack_require__(/*! ms */ "./node_modules/babel-traverse/node_modules/ms/index.js"); +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; +/** + * Previous log timestamp. + */ + +var prevTime; +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, + i; + + for (i in namespace) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + + +function createDebug(namespace) { + function debug() { + // disabled? + if (!debug.enabled) return; + var self = debug; // set `diff` timestamp + + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; // turn the `arguments` into a proper Array + + var args = new Array(arguments.length); + + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } // apply any `formatters` transformations + + + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format` + + args.splice(index, 1); + index--; + } + + return match; + }); // apply env-specific formatting (colors, etc.) + + exports.formatArgs.call(self, args); + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); // env-specific initialization logic for debug instances + + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + +function enable(namespaces) { + exports.save(namespaces); + exports.names = []; + exports.skips = []; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} +/** + * Disable debug output. + * + * @api public + */ + + +function disable() { + exports.enable(''); +} +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + +function enabled(name) { + var i, len; + + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + + return false; +} +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} + +/***/ }), + +/***/ "./node_modules/babel-traverse/node_modules/globals/globals.json": +/*!***********************************************************************!*\ + !*** ./node_modules/babel-traverse/node_modules/globals/globals.json ***! + \***********************************************************************/ +/*! exports provided: builtin, es5, es6, browser, worker, node, commonjs, amd, mocha, jasmine, jest, qunit, phantomjs, couch, rhino, nashorn, wsh, jquery, yui, shelljs, prototypejs, meteor, mongo, applescript, serviceworker, atomtest, embertest, protractor, shared-node-browser, webextensions, greasemonkey, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"builtin\":{\"Array\":false,\"ArrayBuffer\":false,\"Boolean\":false,\"constructor\":false,\"DataView\":false,\"Date\":false,\"decodeURI\":false,\"decodeURIComponent\":false,\"encodeURI\":false,\"encodeURIComponent\":false,\"Error\":false,\"escape\":false,\"eval\":false,\"EvalError\":false,\"Float32Array\":false,\"Float64Array\":false,\"Function\":false,\"hasOwnProperty\":false,\"Infinity\":false,\"Int16Array\":false,\"Int32Array\":false,\"Int8Array\":false,\"isFinite\":false,\"isNaN\":false,\"isPrototypeOf\":false,\"JSON\":false,\"Map\":false,\"Math\":false,\"NaN\":false,\"Number\":false,\"Object\":false,\"parseFloat\":false,\"parseInt\":false,\"Promise\":false,\"propertyIsEnumerable\":false,\"Proxy\":false,\"RangeError\":false,\"ReferenceError\":false,\"Reflect\":false,\"RegExp\":false,\"Set\":false,\"String\":false,\"Symbol\":false,\"SyntaxError\":false,\"System\":false,\"toLocaleString\":false,\"toString\":false,\"TypeError\":false,\"Uint16Array\":false,\"Uint32Array\":false,\"Uint8Array\":false,\"Uint8ClampedArray\":false,\"undefined\":false,\"unescape\":false,\"URIError\":false,\"valueOf\":false,\"WeakMap\":false,\"WeakSet\":false},\"es5\":{\"Array\":false,\"Boolean\":false,\"constructor\":false,\"Date\":false,\"decodeURI\":false,\"decodeURIComponent\":false,\"encodeURI\":false,\"encodeURIComponent\":false,\"Error\":false,\"escape\":false,\"eval\":false,\"EvalError\":false,\"Function\":false,\"hasOwnProperty\":false,\"Infinity\":false,\"isFinite\":false,\"isNaN\":false,\"isPrototypeOf\":false,\"JSON\":false,\"Math\":false,\"NaN\":false,\"Number\":false,\"Object\":false,\"parseFloat\":false,\"parseInt\":false,\"propertyIsEnumerable\":false,\"RangeError\":false,\"ReferenceError\":false,\"RegExp\":false,\"String\":false,\"SyntaxError\":false,\"toLocaleString\":false,\"toString\":false,\"TypeError\":false,\"undefined\":false,\"unescape\":false,\"URIError\":false,\"valueOf\":false},\"es6\":{\"Array\":false,\"ArrayBuffer\":false,\"Boolean\":false,\"constructor\":false,\"DataView\":false,\"Date\":false,\"decodeURI\":false,\"decodeURIComponent\":false,\"encodeURI\":false,\"encodeURIComponent\":false,\"Error\":false,\"escape\":false,\"eval\":false,\"EvalError\":false,\"Float32Array\":false,\"Float64Array\":false,\"Function\":false,\"hasOwnProperty\":false,\"Infinity\":false,\"Int16Array\":false,\"Int32Array\":false,\"Int8Array\":false,\"isFinite\":false,\"isNaN\":false,\"isPrototypeOf\":false,\"JSON\":false,\"Map\":false,\"Math\":false,\"NaN\":false,\"Number\":false,\"Object\":false,\"parseFloat\":false,\"parseInt\":false,\"Promise\":false,\"propertyIsEnumerable\":false,\"Proxy\":false,\"RangeError\":false,\"ReferenceError\":false,\"Reflect\":false,\"RegExp\":false,\"Set\":false,\"String\":false,\"Symbol\":false,\"SyntaxError\":false,\"System\":false,\"toLocaleString\":false,\"toString\":false,\"TypeError\":false,\"Uint16Array\":false,\"Uint32Array\":false,\"Uint8Array\":false,\"Uint8ClampedArray\":false,\"undefined\":false,\"unescape\":false,\"URIError\":false,\"valueOf\":false,\"WeakMap\":false,\"WeakSet\":false},\"browser\":{\"addEventListener\":false,\"alert\":false,\"AnalyserNode\":false,\"Animation\":false,\"AnimationEffectReadOnly\":false,\"AnimationEffectTiming\":false,\"AnimationEffectTimingReadOnly\":false,\"AnimationEvent\":false,\"AnimationPlaybackEvent\":false,\"AnimationTimeline\":false,\"applicationCache\":false,\"ApplicationCache\":false,\"ApplicationCacheErrorEvent\":false,\"atob\":false,\"Attr\":false,\"Audio\":false,\"AudioBuffer\":false,\"AudioBufferSourceNode\":false,\"AudioContext\":false,\"AudioDestinationNode\":false,\"AudioListener\":false,\"AudioNode\":false,\"AudioParam\":false,\"AudioProcessingEvent\":false,\"AutocompleteErrorEvent\":false,\"BarProp\":false,\"BatteryManager\":false,\"BeforeUnloadEvent\":false,\"BiquadFilterNode\":false,\"Blob\":false,\"blur\":false,\"btoa\":false,\"Cache\":false,\"caches\":false,\"CacheStorage\":false,\"cancelAnimationFrame\":false,\"cancelIdleCallback\":false,\"CanvasGradient\":false,\"CanvasPattern\":false,\"CanvasRenderingContext2D\":false,\"CDATASection\":false,\"ChannelMergerNode\":false,\"ChannelSplitterNode\":false,\"CharacterData\":false,\"clearInterval\":false,\"clearTimeout\":false,\"clientInformation\":false,\"ClientRect\":false,\"ClientRectList\":false,\"ClipboardEvent\":false,\"close\":false,\"closed\":false,\"CloseEvent\":false,\"Comment\":false,\"CompositionEvent\":false,\"confirm\":false,\"console\":false,\"ConvolverNode\":false,\"createImageBitmap\":false,\"Credential\":false,\"CredentialsContainer\":false,\"crypto\":false,\"Crypto\":false,\"CryptoKey\":false,\"CSS\":false,\"CSSAnimation\":false,\"CSSFontFaceRule\":false,\"CSSImportRule\":false,\"CSSKeyframeRule\":false,\"CSSKeyframesRule\":false,\"CSSMediaRule\":false,\"CSSPageRule\":false,\"CSSRule\":false,\"CSSRuleList\":false,\"CSSStyleDeclaration\":false,\"CSSStyleRule\":false,\"CSSStyleSheet\":false,\"CSSSupportsRule\":false,\"CSSTransition\":false,\"CSSUnknownRule\":false,\"CSSViewportRule\":false,\"customElements\":false,\"CustomEvent\":false,\"DataTransfer\":false,\"DataTransferItem\":false,\"DataTransferItemList\":false,\"Debug\":false,\"defaultStatus\":false,\"defaultstatus\":false,\"DelayNode\":false,\"DeviceMotionEvent\":false,\"DeviceOrientationEvent\":false,\"devicePixelRatio\":false,\"dispatchEvent\":false,\"document\":false,\"Document\":false,\"DocumentFragment\":false,\"DocumentTimeline\":false,\"DocumentType\":false,\"DOMError\":false,\"DOMException\":false,\"DOMImplementation\":false,\"DOMParser\":false,\"DOMSettableTokenList\":false,\"DOMStringList\":false,\"DOMStringMap\":false,\"DOMTokenList\":false,\"DragEvent\":false,\"DynamicsCompressorNode\":false,\"Element\":false,\"ElementTimeControl\":false,\"ErrorEvent\":false,\"event\":false,\"Event\":false,\"EventSource\":false,\"EventTarget\":false,\"external\":false,\"FederatedCredential\":false,\"fetch\":false,\"File\":false,\"FileError\":false,\"FileList\":false,\"FileReader\":false,\"find\":false,\"focus\":false,\"FocusEvent\":false,\"FontFace\":false,\"FormData\":false,\"frameElement\":false,\"frames\":false,\"GainNode\":false,\"Gamepad\":false,\"GamepadButton\":false,\"GamepadEvent\":false,\"getComputedStyle\":false,\"getSelection\":false,\"HashChangeEvent\":false,\"Headers\":false,\"history\":false,\"History\":false,\"HTMLAllCollection\":false,\"HTMLAnchorElement\":false,\"HTMLAppletElement\":false,\"HTMLAreaElement\":false,\"HTMLAudioElement\":false,\"HTMLBaseElement\":false,\"HTMLBlockquoteElement\":false,\"HTMLBodyElement\":false,\"HTMLBRElement\":false,\"HTMLButtonElement\":false,\"HTMLCanvasElement\":false,\"HTMLCollection\":false,\"HTMLContentElement\":false,\"HTMLDataListElement\":false,\"HTMLDetailsElement\":false,\"HTMLDialogElement\":false,\"HTMLDirectoryElement\":false,\"HTMLDivElement\":false,\"HTMLDListElement\":false,\"HTMLDocument\":false,\"HTMLElement\":false,\"HTMLEmbedElement\":false,\"HTMLFieldSetElement\":false,\"HTMLFontElement\":false,\"HTMLFormControlsCollection\":false,\"HTMLFormElement\":false,\"HTMLFrameElement\":false,\"HTMLFrameSetElement\":false,\"HTMLHeadElement\":false,\"HTMLHeadingElement\":false,\"HTMLHRElement\":false,\"HTMLHtmlElement\":false,\"HTMLIFrameElement\":false,\"HTMLImageElement\":false,\"HTMLInputElement\":false,\"HTMLIsIndexElement\":false,\"HTMLKeygenElement\":false,\"HTMLLabelElement\":false,\"HTMLLayerElement\":false,\"HTMLLegendElement\":false,\"HTMLLIElement\":false,\"HTMLLinkElement\":false,\"HTMLMapElement\":false,\"HTMLMarqueeElement\":false,\"HTMLMediaElement\":false,\"HTMLMenuElement\":false,\"HTMLMetaElement\":false,\"HTMLMeterElement\":false,\"HTMLModElement\":false,\"HTMLObjectElement\":false,\"HTMLOListElement\":false,\"HTMLOptGroupElement\":false,\"HTMLOptionElement\":false,\"HTMLOptionsCollection\":false,\"HTMLOutputElement\":false,\"HTMLParagraphElement\":false,\"HTMLParamElement\":false,\"HTMLPictureElement\":false,\"HTMLPreElement\":false,\"HTMLProgressElement\":false,\"HTMLQuoteElement\":false,\"HTMLScriptElement\":false,\"HTMLSelectElement\":false,\"HTMLShadowElement\":false,\"HTMLSourceElement\":false,\"HTMLSpanElement\":false,\"HTMLStyleElement\":false,\"HTMLTableCaptionElement\":false,\"HTMLTableCellElement\":false,\"HTMLTableColElement\":false,\"HTMLTableElement\":false,\"HTMLTableRowElement\":false,\"HTMLTableSectionElement\":false,\"HTMLTemplateElement\":false,\"HTMLTextAreaElement\":false,\"HTMLTitleElement\":false,\"HTMLTrackElement\":false,\"HTMLUListElement\":false,\"HTMLUnknownElement\":false,\"HTMLVideoElement\":false,\"IDBCursor\":false,\"IDBCursorWithValue\":false,\"IDBDatabase\":false,\"IDBEnvironment\":false,\"IDBFactory\":false,\"IDBIndex\":false,\"IDBKeyRange\":false,\"IDBObjectStore\":false,\"IDBOpenDBRequest\":false,\"IDBRequest\":false,\"IDBTransaction\":false,\"IDBVersionChangeEvent\":false,\"Image\":false,\"ImageBitmap\":false,\"ImageData\":false,\"indexedDB\":false,\"innerHeight\":false,\"innerWidth\":false,\"InputEvent\":false,\"InputMethodContext\":false,\"IntersectionObserver\":false,\"IntersectionObserverEntry\":false,\"Intl\":false,\"KeyboardEvent\":false,\"KeyframeEffect\":false,\"KeyframeEffectReadOnly\":false,\"length\":false,\"localStorage\":false,\"location\":false,\"Location\":false,\"locationbar\":false,\"matchMedia\":false,\"MediaElementAudioSourceNode\":false,\"MediaEncryptedEvent\":false,\"MediaError\":false,\"MediaKeyError\":false,\"MediaKeyEvent\":false,\"MediaKeyMessageEvent\":false,\"MediaKeys\":false,\"MediaKeySession\":false,\"MediaKeyStatusMap\":false,\"MediaKeySystemAccess\":false,\"MediaList\":false,\"MediaQueryList\":false,\"MediaQueryListEvent\":false,\"MediaSource\":false,\"MediaRecorder\":false,\"MediaStream\":false,\"MediaStreamAudioDestinationNode\":false,\"MediaStreamAudioSourceNode\":false,\"MediaStreamEvent\":false,\"MediaStreamTrack\":false,\"menubar\":false,\"MessageChannel\":false,\"MessageEvent\":false,\"MessagePort\":false,\"MIDIAccess\":false,\"MIDIConnectionEvent\":false,\"MIDIInput\":false,\"MIDIInputMap\":false,\"MIDIMessageEvent\":false,\"MIDIOutput\":false,\"MIDIOutputMap\":false,\"MIDIPort\":false,\"MimeType\":false,\"MimeTypeArray\":false,\"MouseEvent\":false,\"moveBy\":false,\"moveTo\":false,\"MutationEvent\":false,\"MutationObserver\":false,\"MutationRecord\":false,\"name\":false,\"NamedNodeMap\":false,\"navigator\":false,\"Navigator\":false,\"Node\":false,\"NodeFilter\":false,\"NodeIterator\":false,\"NodeList\":false,\"Notification\":false,\"OfflineAudioCompletionEvent\":false,\"OfflineAudioContext\":false,\"offscreenBuffering\":false,\"onbeforeunload\":true,\"onblur\":true,\"onerror\":true,\"onfocus\":true,\"onload\":true,\"onresize\":true,\"onunload\":true,\"open\":false,\"openDatabase\":false,\"opener\":false,\"opera\":false,\"Option\":false,\"OscillatorNode\":false,\"outerHeight\":false,\"outerWidth\":false,\"PageTransitionEvent\":false,\"pageXOffset\":false,\"pageYOffset\":false,\"parent\":false,\"PasswordCredential\":false,\"Path2D\":false,\"performance\":false,\"Performance\":false,\"PerformanceEntry\":false,\"PerformanceMark\":false,\"PerformanceMeasure\":false,\"PerformanceNavigation\":false,\"PerformanceResourceTiming\":false,\"PerformanceTiming\":false,\"PeriodicWave\":false,\"Permissions\":false,\"PermissionStatus\":false,\"personalbar\":false,\"Plugin\":false,\"PluginArray\":false,\"PopStateEvent\":false,\"postMessage\":false,\"print\":false,\"ProcessingInstruction\":false,\"ProgressEvent\":false,\"PromiseRejectionEvent\":false,\"prompt\":false,\"PushManager\":false,\"PushSubscription\":false,\"RadioNodeList\":false,\"Range\":false,\"ReadableByteStream\":false,\"ReadableStream\":false,\"removeEventListener\":false,\"Request\":false,\"requestAnimationFrame\":false,\"requestIdleCallback\":false,\"resizeBy\":false,\"resizeTo\":false,\"Response\":false,\"RTCIceCandidate\":false,\"RTCSessionDescription\":false,\"RTCPeerConnection\":false,\"screen\":false,\"Screen\":false,\"screenLeft\":false,\"ScreenOrientation\":false,\"screenTop\":false,\"screenX\":false,\"screenY\":false,\"ScriptProcessorNode\":false,\"scroll\":false,\"scrollbars\":false,\"scrollBy\":false,\"scrollTo\":false,\"scrollX\":false,\"scrollY\":false,\"SecurityPolicyViolationEvent\":false,\"Selection\":false,\"self\":false,\"ServiceWorker\":false,\"ServiceWorkerContainer\":false,\"ServiceWorkerRegistration\":false,\"sessionStorage\":false,\"setInterval\":false,\"setTimeout\":false,\"ShadowRoot\":false,\"SharedKeyframeList\":false,\"SharedWorker\":false,\"showModalDialog\":false,\"SiteBoundCredential\":false,\"speechSynthesis\":false,\"SpeechSynthesisEvent\":false,\"SpeechSynthesisUtterance\":false,\"status\":false,\"statusbar\":false,\"stop\":false,\"Storage\":false,\"StorageEvent\":false,\"styleMedia\":false,\"StyleSheet\":false,\"StyleSheetList\":false,\"SubtleCrypto\":false,\"SVGAElement\":false,\"SVGAltGlyphDefElement\":false,\"SVGAltGlyphElement\":false,\"SVGAltGlyphItemElement\":false,\"SVGAngle\":false,\"SVGAnimateColorElement\":false,\"SVGAnimatedAngle\":false,\"SVGAnimatedBoolean\":false,\"SVGAnimatedEnumeration\":false,\"SVGAnimatedInteger\":false,\"SVGAnimatedLength\":false,\"SVGAnimatedLengthList\":false,\"SVGAnimatedNumber\":false,\"SVGAnimatedNumberList\":false,\"SVGAnimatedPathData\":false,\"SVGAnimatedPoints\":false,\"SVGAnimatedPreserveAspectRatio\":false,\"SVGAnimatedRect\":false,\"SVGAnimatedString\":false,\"SVGAnimatedTransformList\":false,\"SVGAnimateElement\":false,\"SVGAnimateMotionElement\":false,\"SVGAnimateTransformElement\":false,\"SVGAnimationElement\":false,\"SVGCircleElement\":false,\"SVGClipPathElement\":false,\"SVGColor\":false,\"SVGColorProfileElement\":false,\"SVGColorProfileRule\":false,\"SVGComponentTransferFunctionElement\":false,\"SVGCSSRule\":false,\"SVGCursorElement\":false,\"SVGDefsElement\":false,\"SVGDescElement\":false,\"SVGDiscardElement\":false,\"SVGDocument\":false,\"SVGElement\":false,\"SVGElementInstance\":false,\"SVGElementInstanceList\":false,\"SVGEllipseElement\":false,\"SVGEvent\":false,\"SVGExternalResourcesRequired\":false,\"SVGFEBlendElement\":false,\"SVGFEColorMatrixElement\":false,\"SVGFEComponentTransferElement\":false,\"SVGFECompositeElement\":false,\"SVGFEConvolveMatrixElement\":false,\"SVGFEDiffuseLightingElement\":false,\"SVGFEDisplacementMapElement\":false,\"SVGFEDistantLightElement\":false,\"SVGFEDropShadowElement\":false,\"SVGFEFloodElement\":false,\"SVGFEFuncAElement\":false,\"SVGFEFuncBElement\":false,\"SVGFEFuncGElement\":false,\"SVGFEFuncRElement\":false,\"SVGFEGaussianBlurElement\":false,\"SVGFEImageElement\":false,\"SVGFEMergeElement\":false,\"SVGFEMergeNodeElement\":false,\"SVGFEMorphologyElement\":false,\"SVGFEOffsetElement\":false,\"SVGFEPointLightElement\":false,\"SVGFESpecularLightingElement\":false,\"SVGFESpotLightElement\":false,\"SVGFETileElement\":false,\"SVGFETurbulenceElement\":false,\"SVGFilterElement\":false,\"SVGFilterPrimitiveStandardAttributes\":false,\"SVGFitToViewBox\":false,\"SVGFontElement\":false,\"SVGFontFaceElement\":false,\"SVGFontFaceFormatElement\":false,\"SVGFontFaceNameElement\":false,\"SVGFontFaceSrcElement\":false,\"SVGFontFaceUriElement\":false,\"SVGForeignObjectElement\":false,\"SVGGElement\":false,\"SVGGeometryElement\":false,\"SVGGlyphElement\":false,\"SVGGlyphRefElement\":false,\"SVGGradientElement\":false,\"SVGGraphicsElement\":false,\"SVGHKernElement\":false,\"SVGICCColor\":false,\"SVGImageElement\":false,\"SVGLangSpace\":false,\"SVGLength\":false,\"SVGLengthList\":false,\"SVGLinearGradientElement\":false,\"SVGLineElement\":false,\"SVGLocatable\":false,\"SVGMarkerElement\":false,\"SVGMaskElement\":false,\"SVGMatrix\":false,\"SVGMetadataElement\":false,\"SVGMissingGlyphElement\":false,\"SVGMPathElement\":false,\"SVGNumber\":false,\"SVGNumberList\":false,\"SVGPaint\":false,\"SVGPathElement\":false,\"SVGPathSeg\":false,\"SVGPathSegArcAbs\":false,\"SVGPathSegArcRel\":false,\"SVGPathSegClosePath\":false,\"SVGPathSegCurvetoCubicAbs\":false,\"SVGPathSegCurvetoCubicRel\":false,\"SVGPathSegCurvetoCubicSmoothAbs\":false,\"SVGPathSegCurvetoCubicSmoothRel\":false,\"SVGPathSegCurvetoQuadraticAbs\":false,\"SVGPathSegCurvetoQuadraticRel\":false,\"SVGPathSegCurvetoQuadraticSmoothAbs\":false,\"SVGPathSegCurvetoQuadraticSmoothRel\":false,\"SVGPathSegLinetoAbs\":false,\"SVGPathSegLinetoHorizontalAbs\":false,\"SVGPathSegLinetoHorizontalRel\":false,\"SVGPathSegLinetoRel\":false,\"SVGPathSegLinetoVerticalAbs\":false,\"SVGPathSegLinetoVerticalRel\":false,\"SVGPathSegList\":false,\"SVGPathSegMovetoAbs\":false,\"SVGPathSegMovetoRel\":false,\"SVGPatternElement\":false,\"SVGPoint\":false,\"SVGPointList\":false,\"SVGPolygonElement\":false,\"SVGPolylineElement\":false,\"SVGPreserveAspectRatio\":false,\"SVGRadialGradientElement\":false,\"SVGRect\":false,\"SVGRectElement\":false,\"SVGRenderingIntent\":false,\"SVGScriptElement\":false,\"SVGSetElement\":false,\"SVGStopElement\":false,\"SVGStringList\":false,\"SVGStylable\":false,\"SVGStyleElement\":false,\"SVGSVGElement\":false,\"SVGSwitchElement\":false,\"SVGSymbolElement\":false,\"SVGTests\":false,\"SVGTextContentElement\":false,\"SVGTextElement\":false,\"SVGTextPathElement\":false,\"SVGTextPositioningElement\":false,\"SVGTitleElement\":false,\"SVGTransform\":false,\"SVGTransformable\":false,\"SVGTransformList\":false,\"SVGTRefElement\":false,\"SVGTSpanElement\":false,\"SVGUnitTypes\":false,\"SVGURIReference\":false,\"SVGUseElement\":false,\"SVGViewElement\":false,\"SVGViewSpec\":false,\"SVGVKernElement\":false,\"SVGZoomAndPan\":false,\"SVGZoomEvent\":false,\"Text\":false,\"TextDecoder\":false,\"TextEncoder\":false,\"TextEvent\":false,\"TextMetrics\":false,\"TextTrack\":false,\"TextTrackCue\":false,\"TextTrackCueList\":false,\"TextTrackList\":false,\"TimeEvent\":false,\"TimeRanges\":false,\"toolbar\":false,\"top\":false,\"Touch\":false,\"TouchEvent\":false,\"TouchList\":false,\"TrackEvent\":false,\"TransitionEvent\":false,\"TreeWalker\":false,\"UIEvent\":false,\"URL\":false,\"URLSearchParams\":false,\"ValidityState\":false,\"VTTCue\":false,\"WaveShaperNode\":false,\"WebGLActiveInfo\":false,\"WebGLBuffer\":false,\"WebGLContextEvent\":false,\"WebGLFramebuffer\":false,\"WebGLProgram\":false,\"WebGLRenderbuffer\":false,\"WebGLRenderingContext\":false,\"WebGLShader\":false,\"WebGLShaderPrecisionFormat\":false,\"WebGLTexture\":false,\"WebGLUniformLocation\":false,\"WebSocket\":false,\"WheelEvent\":false,\"window\":false,\"Window\":false,\"Worker\":false,\"XDomainRequest\":false,\"XMLDocument\":false,\"XMLHttpRequest\":false,\"XMLHttpRequestEventTarget\":false,\"XMLHttpRequestProgressEvent\":false,\"XMLHttpRequestUpload\":false,\"XMLSerializer\":false,\"XPathEvaluator\":false,\"XPathException\":false,\"XPathExpression\":false,\"XPathNamespace\":false,\"XPathNSResolver\":false,\"XPathResult\":false,\"XSLTProcessor\":false},\"worker\":{\"applicationCache\":false,\"atob\":false,\"Blob\":false,\"BroadcastChannel\":false,\"btoa\":false,\"Cache\":false,\"caches\":false,\"clearInterval\":false,\"clearTimeout\":false,\"close\":true,\"console\":false,\"fetch\":false,\"FileReaderSync\":false,\"FormData\":false,\"Headers\":false,\"IDBCursor\":false,\"IDBCursorWithValue\":false,\"IDBDatabase\":false,\"IDBFactory\":false,\"IDBIndex\":false,\"IDBKeyRange\":false,\"IDBObjectStore\":false,\"IDBOpenDBRequest\":false,\"IDBRequest\":false,\"IDBTransaction\":false,\"IDBVersionChangeEvent\":false,\"ImageData\":false,\"importScripts\":true,\"indexedDB\":false,\"location\":false,\"MessageChannel\":false,\"MessagePort\":false,\"name\":false,\"navigator\":false,\"Notification\":false,\"onclose\":true,\"onconnect\":true,\"onerror\":true,\"onlanguagechange\":true,\"onmessage\":true,\"onoffline\":true,\"ononline\":true,\"onrejectionhandled\":true,\"onunhandledrejection\":true,\"performance\":false,\"Performance\":false,\"PerformanceEntry\":false,\"PerformanceMark\":false,\"PerformanceMeasure\":false,\"PerformanceNavigation\":false,\"PerformanceResourceTiming\":false,\"PerformanceTiming\":false,\"postMessage\":true,\"Promise\":false,\"Request\":false,\"Response\":false,\"self\":true,\"ServiceWorkerRegistration\":false,\"setInterval\":false,\"setTimeout\":false,\"TextDecoder\":false,\"TextEncoder\":false,\"URL\":false,\"URLSearchParams\":false,\"WebSocket\":false,\"Worker\":false,\"XMLHttpRequest\":false},\"node\":{\"__dirname\":false,\"__filename\":false,\"arguments\":false,\"Buffer\":false,\"clearImmediate\":false,\"clearInterval\":false,\"clearTimeout\":false,\"console\":false,\"exports\":true,\"GLOBAL\":false,\"global\":false,\"Intl\":false,\"module\":false,\"process\":false,\"require\":false,\"root\":false,\"setImmediate\":false,\"setInterval\":false,\"setTimeout\":false},\"commonjs\":{\"exports\":true,\"module\":false,\"require\":false,\"global\":false},\"amd\":{\"define\":false,\"require\":false},\"mocha\":{\"after\":false,\"afterEach\":false,\"before\":false,\"beforeEach\":false,\"context\":false,\"describe\":false,\"it\":false,\"mocha\":false,\"run\":false,\"setup\":false,\"specify\":false,\"suite\":false,\"suiteSetup\":false,\"suiteTeardown\":false,\"teardown\":false,\"test\":false,\"xcontext\":false,\"xdescribe\":false,\"xit\":false,\"xspecify\":false},\"jasmine\":{\"afterAll\":false,\"afterEach\":false,\"beforeAll\":false,\"beforeEach\":false,\"describe\":false,\"expect\":false,\"fail\":false,\"fdescribe\":false,\"fit\":false,\"it\":false,\"jasmine\":false,\"pending\":false,\"runs\":false,\"spyOn\":false,\"spyOnProperty\":false,\"waits\":false,\"waitsFor\":false,\"xdescribe\":false,\"xit\":false},\"jest\":{\"afterAll\":false,\"afterEach\":false,\"beforeAll\":false,\"beforeEach\":false,\"check\":false,\"describe\":false,\"expect\":false,\"gen\":false,\"it\":false,\"fdescribe\":false,\"fit\":false,\"jest\":false,\"pit\":false,\"require\":false,\"test\":false,\"xdescribe\":false,\"xit\":false,\"xtest\":false},\"qunit\":{\"asyncTest\":false,\"deepEqual\":false,\"equal\":false,\"expect\":false,\"module\":false,\"notDeepEqual\":false,\"notEqual\":false,\"notOk\":false,\"notPropEqual\":false,\"notStrictEqual\":false,\"ok\":false,\"propEqual\":false,\"QUnit\":false,\"raises\":false,\"start\":false,\"stop\":false,\"strictEqual\":false,\"test\":false,\"throws\":false},\"phantomjs\":{\"console\":true,\"exports\":true,\"phantom\":true,\"require\":true,\"WebPage\":true},\"couch\":{\"emit\":false,\"exports\":false,\"getRow\":false,\"log\":false,\"module\":false,\"provides\":false,\"require\":false,\"respond\":false,\"send\":false,\"start\":false,\"sum\":false},\"rhino\":{\"defineClass\":false,\"deserialize\":false,\"gc\":false,\"help\":false,\"importClass\":false,\"importPackage\":false,\"java\":false,\"load\":false,\"loadClass\":false,\"Packages\":false,\"print\":false,\"quit\":false,\"readFile\":false,\"readUrl\":false,\"runCommand\":false,\"seal\":false,\"serialize\":false,\"spawn\":false,\"sync\":false,\"toint32\":false,\"version\":false},\"nashorn\":{\"__DIR__\":false,\"__FILE__\":false,\"__LINE__\":false,\"com\":false,\"edu\":false,\"exit\":false,\"Java\":false,\"java\":false,\"javafx\":false,\"JavaImporter\":false,\"javax\":false,\"JSAdapter\":false,\"load\":false,\"loadWithNewGlobal\":false,\"org\":false,\"Packages\":false,\"print\":false,\"quit\":false},\"wsh\":{\"ActiveXObject\":true,\"Enumerator\":true,\"GetObject\":true,\"ScriptEngine\":true,\"ScriptEngineBuildVersion\":true,\"ScriptEngineMajorVersion\":true,\"ScriptEngineMinorVersion\":true,\"VBArray\":true,\"WScript\":true,\"WSH\":true,\"XDomainRequest\":true},\"jquery\":{\"$\":false,\"jQuery\":false},\"yui\":{\"Y\":false,\"YUI\":false,\"YUI_config\":false},\"shelljs\":{\"cat\":false,\"cd\":false,\"chmod\":false,\"config\":false,\"cp\":false,\"dirs\":false,\"echo\":false,\"env\":false,\"error\":false,\"exec\":false,\"exit\":false,\"find\":false,\"grep\":false,\"ls\":false,\"ln\":false,\"mkdir\":false,\"mv\":false,\"popd\":false,\"pushd\":false,\"pwd\":false,\"rm\":false,\"sed\":false,\"set\":false,\"target\":false,\"tempdir\":false,\"test\":false,\"touch\":false,\"which\":false},\"prototypejs\":{\"$\":false,\"$$\":false,\"$A\":false,\"$break\":false,\"$continue\":false,\"$F\":false,\"$H\":false,\"$R\":false,\"$w\":false,\"Abstract\":false,\"Ajax\":false,\"Autocompleter\":false,\"Builder\":false,\"Class\":false,\"Control\":false,\"Draggable\":false,\"Draggables\":false,\"Droppables\":false,\"Effect\":false,\"Element\":false,\"Enumerable\":false,\"Event\":false,\"Field\":false,\"Form\":false,\"Hash\":false,\"Insertion\":false,\"ObjectRange\":false,\"PeriodicalExecuter\":false,\"Position\":false,\"Prototype\":false,\"Scriptaculous\":false,\"Selector\":false,\"Sortable\":false,\"SortableObserver\":false,\"Sound\":false,\"Template\":false,\"Toggle\":false,\"Try\":false},\"meteor\":{\"$\":false,\"_\":false,\"Accounts\":false,\"AccountsClient\":false,\"AccountsServer\":false,\"AccountsCommon\":false,\"App\":false,\"Assets\":false,\"Blaze\":false,\"check\":false,\"Cordova\":false,\"DDP\":false,\"DDPServer\":false,\"DDPRateLimiter\":false,\"Deps\":false,\"EJSON\":false,\"Email\":false,\"HTTP\":false,\"Log\":false,\"Match\":false,\"Meteor\":false,\"Mongo\":false,\"MongoInternals\":false,\"Npm\":false,\"Package\":false,\"Plugin\":false,\"process\":false,\"Random\":false,\"ReactiveDict\":false,\"ReactiveVar\":false,\"Router\":false,\"ServiceConfiguration\":false,\"Session\":false,\"share\":false,\"Spacebars\":false,\"Template\":false,\"Tinytest\":false,\"Tracker\":false,\"UI\":false,\"Utils\":false,\"WebApp\":false,\"WebAppInternals\":false},\"mongo\":{\"_isWindows\":false,\"_rand\":false,\"BulkWriteResult\":false,\"cat\":false,\"cd\":false,\"connect\":false,\"db\":false,\"getHostName\":false,\"getMemInfo\":false,\"hostname\":false,\"ISODate\":false,\"listFiles\":false,\"load\":false,\"ls\":false,\"md5sumFile\":false,\"mkdir\":false,\"Mongo\":false,\"NumberInt\":false,\"NumberLong\":false,\"ObjectId\":false,\"PlanCache\":false,\"print\":false,\"printjson\":false,\"pwd\":false,\"quit\":false,\"removeFile\":false,\"rs\":false,\"sh\":false,\"UUID\":false,\"version\":false,\"WriteResult\":false},\"applescript\":{\"$\":false,\"Application\":false,\"Automation\":false,\"console\":false,\"delay\":false,\"Library\":false,\"ObjC\":false,\"ObjectSpecifier\":false,\"Path\":false,\"Progress\":false,\"Ref\":false},\"serviceworker\":{\"caches\":false,\"Cache\":false,\"CacheStorage\":false,\"Client\":false,\"clients\":false,\"Clients\":false,\"ExtendableEvent\":false,\"ExtendableMessageEvent\":false,\"FetchEvent\":false,\"importScripts\":false,\"registration\":false,\"self\":false,\"ServiceWorker\":false,\"ServiceWorkerContainer\":false,\"ServiceWorkerGlobalScope\":false,\"ServiceWorkerMessageEvent\":false,\"ServiceWorkerRegistration\":false,\"skipWaiting\":false,\"WindowClient\":false},\"atomtest\":{\"advanceClock\":false,\"fakeClearInterval\":false,\"fakeClearTimeout\":false,\"fakeSetInterval\":false,\"fakeSetTimeout\":false,\"resetTimeouts\":false,\"waitsForPromise\":false},\"embertest\":{\"andThen\":false,\"click\":false,\"currentPath\":false,\"currentRouteName\":false,\"currentURL\":false,\"fillIn\":false,\"find\":false,\"findWithAssert\":false,\"keyEvent\":false,\"pauseTest\":false,\"resumeTest\":false,\"triggerEvent\":false,\"visit\":false},\"protractor\":{\"$\":false,\"$$\":false,\"browser\":false,\"By\":false,\"by\":false,\"DartObject\":false,\"element\":false,\"protractor\":false},\"shared-node-browser\":{\"clearInterval\":false,\"clearTimeout\":false,\"console\":false,\"setInterval\":false,\"setTimeout\":false},\"webextensions\":{\"browser\":false,\"chrome\":false,\"opr\":false},\"greasemonkey\":{\"GM_addStyle\":false,\"GM_deleteValue\":false,\"GM_getResourceText\":false,\"GM_getResourceURL\":false,\"GM_getValue\":false,\"GM_info\":false,\"GM_listValues\":false,\"GM_log\":false,\"GM_openInTab\":false,\"GM_registerMenuCommand\":false,\"GM_setClipboard\":false,\"GM_setValue\":false,\"GM_xmlhttpRequest\":false,\"unsafeWindow\":false}}"); + +/***/ }), + +/***/ "./node_modules/babel-traverse/node_modules/globals/index.js": +/*!*******************************************************************!*\ + !*** ./node_modules/babel-traverse/node_modules/globals/index.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./globals.json */ "./node_modules/babel-traverse/node_modules/globals/globals.json"); + +/***/ }), + +/***/ "./node_modules/babel-traverse/node_modules/ms/index.js": +/*!**************************************************************!*\ + !*** ./node_modules/babel-traverse/node_modules/ms/index.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Helpers. + */ +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + + throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); +}; +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + +function parse(str) { + str = String(str); + + if (str.length > 100) { + return; + } + + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); + + if (!match) { + return; + } + + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + + case 'days': + case 'day': + case 'd': + return n * d; + + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + + default: + return undefined; + } +} +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; + } + + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + + return ms + 'ms'; +} +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtLong(ms) { + return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; +} +/** + * Pluralization helper. + */ + + +function plural(ms, n, name) { + if (ms < n) { + return; + } + + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + + return Math.ceil(ms / n) + ' ' + name + 's'; +} + +/***/ }), + +/***/ "./node_modules/babel-types/lib/constants.js": +/*!***************************************************!*\ + !*** ./node_modules/babel-types/lib/constants.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = undefined; + +var _for = __webpack_require__(/*! babel-runtime/core-js/symbol/for */ "./node_modules/babel-runtime/core-js/symbol/for.js"); + +var _for2 = _interopRequireDefault(_for); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var STATEMENT_OR_BLOCK_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; +var FLATTENABLE_KEYS = exports.FLATTENABLE_KEYS = ["body", "expressions"]; +var FOR_INIT_KEYS = exports.FOR_INIT_KEYS = ["left", "init"]; +var COMMENT_KEYS = exports.COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"]; +var LOGICAL_OPERATORS = exports.LOGICAL_OPERATORS = ["||", "&&"]; +var UPDATE_OPERATORS = exports.UPDATE_OPERATORS = ["++", "--"]; +var BOOLEAN_NUMBER_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="]; +var EQUALITY_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="]; +var COMPARISON_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = [].concat(EQUALITY_BINARY_OPERATORS, ["in", "instanceof"]); +var BOOLEAN_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = [].concat(COMPARISON_BINARY_OPERATORS, BOOLEAN_NUMBER_BINARY_OPERATORS); +var NUMBER_BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"]; +var BINARY_OPERATORS = exports.BINARY_OPERATORS = ["+"].concat(NUMBER_BINARY_OPERATORS, BOOLEAN_BINARY_OPERATORS); +var BOOLEAN_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; +var NUMBER_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = ["+", "-", "++", "--", "~"]; +var STRING_UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = ["typeof"]; +var UNARY_OPERATORS = exports.UNARY_OPERATORS = ["void"].concat(BOOLEAN_UNARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS); +var INHERIT_KEYS = exports.INHERIT_KEYS = { + optional: ["typeAnnotation", "typeParameters", "returnType"], + force: ["start", "loc", "end"] +}; +var BLOCK_SCOPED_SYMBOL = exports.BLOCK_SCOPED_SYMBOL = (0, _for2.default)("var used to be block scoped"); +var NOT_LOCAL_BINDING = exports.NOT_LOCAL_BINDING = (0, _for2.default)("should not be considered a local binding"); + +/***/ }), + +/***/ "./node_modules/babel-types/lib/converters.js": +/*!****************************************************!*\ + !*** ./node_modules/babel-types/lib/converters.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _maxSafeInteger = __webpack_require__(/*! babel-runtime/core-js/number/max-safe-integer */ "./node_modules/babel-runtime/core-js/number/max-safe-integer.js"); + +var _maxSafeInteger2 = _interopRequireDefault(_maxSafeInteger); + +var _stringify = __webpack_require__(/*! babel-runtime/core-js/json/stringify */ "./node_modules/babel-runtime/core-js/json/stringify.js"); + +var _stringify2 = _interopRequireDefault(_stringify); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.toComputedKey = toComputedKey; +exports.toSequenceExpression = toSequenceExpression; +exports.toKeyAlias = toKeyAlias; +exports.toIdentifier = toIdentifier; +exports.toBindingIdentifierName = toBindingIdentifierName; +exports.toStatement = toStatement; +exports.toExpression = toExpression; +exports.toBlock = toBlock; +exports.valueToNode = valueToNode; + +var _isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ "./node_modules/lodash/isPlainObject.js"); + +var _isPlainObject2 = _interopRequireDefault(_isPlainObject); + +var _isRegExp = __webpack_require__(/*! lodash/isRegExp */ "./node_modules/lodash/isRegExp.js"); + +var _isRegExp2 = _interopRequireDefault(_isRegExp); + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_index); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function toComputedKey(node) { + var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key || node.property; + + if (!node.computed) { + if (t.isIdentifier(key)) key = t.stringLiteral(key.name); + } + + return key; +} + +function gatherSequenceExpressions(nodes, scope, declars) { + var exprs = []; + var ensureLastUndefined = true; + + for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var node = _ref; + ensureLastUndefined = false; + + if (t.isExpression(node)) { + exprs.push(node); + } else if (t.isExpressionStatement(node)) { + exprs.push(node.expression); + } else if (t.isVariableDeclaration(node)) { + if (node.kind !== "var") return; + + for (var _iterator2 = node.declarations, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var declar = _ref2; + var bindings = t.getBindingIdentifiers(declar); + + for (var key in bindings) { + declars.push({ + kind: node.kind, + id: bindings[key] + }); + } + + if (declar.init) { + exprs.push(t.assignmentExpression("=", declar.id, declar.init)); + } + } + + ensureLastUndefined = true; + } else if (t.isIfStatement(node)) { + var consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode(); + var alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode(); + if (!consequent || !alternate) return; + exprs.push(t.conditionalExpression(node.test, consequent, alternate)); + } else if (t.isBlockStatement(node)) { + var body = gatherSequenceExpressions(node.body, scope, declars); + if (!body) return; + exprs.push(body); + } else if (t.isEmptyStatement(node)) { + ensureLastUndefined = true; + } else { + return; + } + } + + if (ensureLastUndefined) { + exprs.push(scope.buildUndefinedNode()); + } + + if (exprs.length === 1) { + return exprs[0]; + } else { + return t.sequenceExpression(exprs); + } +} + +function toSequenceExpression(nodes, scope) { + if (!nodes || !nodes.length) return; + var declars = []; + var result = gatherSequenceExpressions(nodes, scope, declars); + if (!result) return; + + for (var _iterator3 = declars, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var declar = _ref3; + scope.push(declar); + } + + return result; +} + +function toKeyAlias(node) { + var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key; + var alias = void 0; + + if (node.kind === "method") { + return toKeyAlias.increment() + ""; + } else if (t.isIdentifier(key)) { + alias = key.name; + } else if (t.isStringLiteral(key)) { + alias = (0, _stringify2.default)(key.value); + } else { + alias = (0, _stringify2.default)(t.removePropertiesDeep(t.cloneDeep(key))); + } + + if (node.computed) { + alias = "[" + alias + "]"; + } + + if (node.static) { + alias = "static:" + alias; + } + + return alias; +} + +toKeyAlias.uid = 0; + +toKeyAlias.increment = function () { + if (toKeyAlias.uid >= _maxSafeInteger2.default) { + return toKeyAlias.uid = 0; + } else { + return toKeyAlias.uid++; + } +}; + +function toIdentifier(name) { + name = name + ""; + name = name.replace(/[^a-zA-Z0-9$_]/g, "-"); + name = name.replace(/^[-0-9]+/, ""); + name = name.replace(/[-\s]+(.)?/g, function (match, c) { + return c ? c.toUpperCase() : ""; + }); + + if (!t.isValidIdentifier(name)) { + name = "_" + name; + } + + return name || "_"; +} + +function toBindingIdentifierName(name) { + name = toIdentifier(name); + if (name === "eval" || name === "arguments") name = "_" + name; + return name; +} + +function toStatement(node, ignore) { + if (t.isStatement(node)) { + return node; + } + + var mustHaveId = false; + var newType = void 0; + + if (t.isClass(node)) { + mustHaveId = true; + newType = "ClassDeclaration"; + } else if (t.isFunction(node)) { + mustHaveId = true; + newType = "FunctionDeclaration"; + } else if (t.isAssignmentExpression(node)) { + return t.expressionStatement(node); + } + + if (mustHaveId && !node.id) { + newType = false; + } + + if (!newType) { + if (ignore) { + return false; + } else { + throw new Error("cannot turn " + node.type + " to a statement"); + } + } + + node.type = newType; + return node; +} + +function toExpression(node) { + if (t.isExpressionStatement(node)) { + node = node.expression; + } + + if (t.isExpression(node)) { + return node; + } + + if (t.isClass(node)) { + node.type = "ClassExpression"; + } else if (t.isFunction(node)) { + node.type = "FunctionExpression"; + } + + if (!t.isExpression(node)) { + throw new Error("cannot turn " + node.type + " to an expression"); + } + + return node; +} + +function toBlock(node, parent) { + if (t.isBlockStatement(node)) { + return node; + } + + if (t.isEmptyStatement(node)) { + node = []; + } + + if (!Array.isArray(node)) { + if (!t.isStatement(node)) { + if (t.isFunction(parent)) { + node = t.returnStatement(node); + } else { + node = t.expressionStatement(node); + } + } + + node = [node]; + } + + return t.blockStatement(node); +} + +function valueToNode(value) { + if (value === undefined) { + return t.identifier("undefined"); + } + + if (value === true || value === false) { + return t.booleanLiteral(value); + } + + if (value === null) { + return t.nullLiteral(); + } + + if (typeof value === "string") { + return t.stringLiteral(value); + } + + if (typeof value === "number") { + return t.numericLiteral(value); + } + + if ((0, _isRegExp2.default)(value)) { + var pattern = value.source; + var flags = value.toString().match(/\/([a-z]+|)$/)[1]; + return t.regExpLiteral(pattern, flags); + } + + if (Array.isArray(value)) { + return t.arrayExpression(value.map(t.valueToNode)); + } + + if ((0, _isPlainObject2.default)(value)) { + var props = []; + + for (var key in value) { + var nodeKey = void 0; + + if (t.isValidIdentifier(key)) { + nodeKey = t.identifier(key); + } else { + nodeKey = t.stringLiteral(key); + } + + props.push(t.objectProperty(nodeKey, t.valueToNode(value[key]))); + } + + return t.objectExpression(props); + } + + throw new Error("don't know how to turn this value into a node"); +} + +/***/ }), + +/***/ "./node_modules/babel-types/lib/definitions/core.js": +/*!**********************************************************!*\ + !*** ./node_modules/babel-types/lib/definitions/core.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _index = __webpack_require__(/*! ../index */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_index); + +var _constants = __webpack_require__(/*! ../constants */ "./node_modules/babel-types/lib/constants.js"); + +var _index2 = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/definitions/index.js"); + +var _index3 = _interopRequireDefault(_index2); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +(0, _index3.default)("ArrayExpression", { + fields: { + elements: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeOrValueType)("null", "Expression", "SpreadElement"))), + default: [] + } + }, + visitor: ["elements"], + aliases: ["Expression"] +}); +(0, _index3.default)("AssignmentExpression", { + fields: { + operator: { + validate: (0, _index2.assertValueType)("string") + }, + left: { + validate: (0, _index2.assertNodeType)("LVal") + }, + right: { + validate: (0, _index2.assertNodeType)("Expression") + } + }, + builder: ["operator", "left", "right"], + visitor: ["left", "right"], + aliases: ["Expression"] +}); +(0, _index3.default)("BinaryExpression", { + builder: ["operator", "left", "right"], + fields: { + operator: { + validate: _index2.assertOneOf.apply(undefined, _constants.BINARY_OPERATORS) + }, + left: { + validate: (0, _index2.assertNodeType)("Expression") + }, + right: { + validate: (0, _index2.assertNodeType)("Expression") + } + }, + visitor: ["left", "right"], + aliases: ["Binary", "Expression"] +}); +(0, _index3.default)("Directive", { + visitor: ["value"], + fields: { + value: { + validate: (0, _index2.assertNodeType)("DirectiveLiteral") + } + } +}); +(0, _index3.default)("DirectiveLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _index2.assertValueType)("string") + } + } +}); +(0, _index3.default)("BlockStatement", { + builder: ["body", "directives"], + visitor: ["directives", "body"], + fields: { + directives: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))), + default: [] + }, + body: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement"))) + } + }, + aliases: ["Scopable", "BlockParent", "Block", "Statement"] +}); +(0, _index3.default)("BreakStatement", { + visitor: ["label"], + fields: { + label: { + validate: (0, _index2.assertNodeType)("Identifier"), + optional: true + } + }, + aliases: ["Statement", "Terminatorless", "CompletionStatement"] +}); +(0, _index3.default)("CallExpression", { + visitor: ["callee", "arguments"], + fields: { + callee: { + validate: (0, _index2.assertNodeType)("Expression") + }, + arguments: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement"))) + } + }, + aliases: ["Expression"] +}); +(0, _index3.default)("CatchClause", { + visitor: ["param", "body"], + fields: { + param: { + validate: (0, _index2.assertNodeType)("Identifier") + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement") + } + }, + aliases: ["Scopable"] +}); +(0, _index3.default)("ConditionalExpression", { + visitor: ["test", "consequent", "alternate"], + fields: { + test: { + validate: (0, _index2.assertNodeType)("Expression") + }, + consequent: { + validate: (0, _index2.assertNodeType)("Expression") + }, + alternate: { + validate: (0, _index2.assertNodeType)("Expression") + } + }, + aliases: ["Expression", "Conditional"] +}); +(0, _index3.default)("ContinueStatement", { + visitor: ["label"], + fields: { + label: { + validate: (0, _index2.assertNodeType)("Identifier"), + optional: true + } + }, + aliases: ["Statement", "Terminatorless", "CompletionStatement"] +}); +(0, _index3.default)("DebuggerStatement", { + aliases: ["Statement"] +}); +(0, _index3.default)("DoWhileStatement", { + visitor: ["test", "body"], + fields: { + test: { + validate: (0, _index2.assertNodeType)("Expression") + }, + body: { + validate: (0, _index2.assertNodeType)("Statement") + } + }, + aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"] +}); +(0, _index3.default)("EmptyStatement", { + aliases: ["Statement"] +}); +(0, _index3.default)("ExpressionStatement", { + visitor: ["expression"], + fields: { + expression: { + validate: (0, _index2.assertNodeType)("Expression") + } + }, + aliases: ["Statement", "ExpressionWrapper"] +}); +(0, _index3.default)("File", { + builder: ["program", "comments", "tokens"], + visitor: ["program"], + fields: { + program: { + validate: (0, _index2.assertNodeType)("Program") + } + } +}); +(0, _index3.default)("ForInStatement", { + visitor: ["left", "right", "body"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], + fields: { + left: { + validate: (0, _index2.assertNodeType)("VariableDeclaration", "LVal") + }, + right: { + validate: (0, _index2.assertNodeType)("Expression") + }, + body: { + validate: (0, _index2.assertNodeType)("Statement") + } + } +}); +(0, _index3.default)("ForStatement", { + visitor: ["init", "test", "update", "body"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"], + fields: { + init: { + validate: (0, _index2.assertNodeType)("VariableDeclaration", "Expression"), + optional: true + }, + test: { + validate: (0, _index2.assertNodeType)("Expression"), + optional: true + }, + update: { + validate: (0, _index2.assertNodeType)("Expression"), + optional: true + }, + body: { + validate: (0, _index2.assertNodeType)("Statement") + } + } +}); +(0, _index3.default)("FunctionDeclaration", { + builder: ["id", "params", "body", "generator", "async"], + visitor: ["id", "params", "body", "returnType", "typeParameters"], + fields: { + id: { + validate: (0, _index2.assertNodeType)("Identifier") + }, + params: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal"))) + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement") + }, + generator: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + }, + async: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + } + }, + aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"] +}); +(0, _index3.default)("FunctionExpression", { + inherits: "FunctionDeclaration", + aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], + fields: { + id: { + validate: (0, _index2.assertNodeType)("Identifier"), + optional: true + }, + params: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal"))) + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement") + }, + generator: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + }, + async: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + } + } +}); +(0, _index3.default)("Identifier", { + builder: ["name"], + visitor: ["typeAnnotation"], + aliases: ["Expression", "LVal"], + fields: { + name: { + validate: function validate(node, key, val) { + if (!t.isValidIdentifier(val)) {} + } + }, + decorators: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))) + } + } +}); +(0, _index3.default)("IfStatement", { + visitor: ["test", "consequent", "alternate"], + aliases: ["Statement", "Conditional"], + fields: { + test: { + validate: (0, _index2.assertNodeType)("Expression") + }, + consequent: { + validate: (0, _index2.assertNodeType)("Statement") + }, + alternate: { + optional: true, + validate: (0, _index2.assertNodeType)("Statement") + } + } +}); +(0, _index3.default)("LabeledStatement", { + visitor: ["label", "body"], + aliases: ["Statement"], + fields: { + label: { + validate: (0, _index2.assertNodeType)("Identifier") + }, + body: { + validate: (0, _index2.assertNodeType)("Statement") + } + } +}); +(0, _index3.default)("StringLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _index2.assertValueType)("string") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); +(0, _index3.default)("NumericLiteral", { + builder: ["value"], + deprecatedAlias: "NumberLiteral", + fields: { + value: { + validate: (0, _index2.assertValueType)("number") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); +(0, _index3.default)("NullLiteral", { + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); +(0, _index3.default)("BooleanLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _index2.assertValueType)("boolean") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); +(0, _index3.default)("RegExpLiteral", { + builder: ["pattern", "flags"], + deprecatedAlias: "RegexLiteral", + aliases: ["Expression", "Literal"], + fields: { + pattern: { + validate: (0, _index2.assertValueType)("string") + }, + flags: { + validate: (0, _index2.assertValueType)("string"), + default: "" + } + } +}); +(0, _index3.default)("LogicalExpression", { + builder: ["operator", "left", "right"], + visitor: ["left", "right"], + aliases: ["Binary", "Expression"], + fields: { + operator: { + validate: _index2.assertOneOf.apply(undefined, _constants.LOGICAL_OPERATORS) + }, + left: { + validate: (0, _index2.assertNodeType)("Expression") + }, + right: { + validate: (0, _index2.assertNodeType)("Expression") + } + } +}); +(0, _index3.default)("MemberExpression", { + builder: ["object", "property", "computed"], + visitor: ["object", "property"], + aliases: ["Expression", "LVal"], + fields: { + object: { + validate: (0, _index2.assertNodeType)("Expression") + }, + property: { + validate: function validate(node, key, val) { + var expectedType = node.computed ? "Expression" : "Identifier"; + (0, _index2.assertNodeType)(expectedType)(node, key, val); + } + }, + computed: { + default: false + } + } +}); +(0, _index3.default)("NewExpression", { + visitor: ["callee", "arguments"], + aliases: ["Expression"], + fields: { + callee: { + validate: (0, _index2.assertNodeType)("Expression") + }, + arguments: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement"))) + } + } +}); +(0, _index3.default)("Program", { + visitor: ["directives", "body"], + builder: ["body", "directives"], + fields: { + directives: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))), + default: [] + }, + body: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement"))) + } + }, + aliases: ["Scopable", "BlockParent", "Block", "FunctionParent"] +}); +(0, _index3.default)("ObjectExpression", { + visitor: ["properties"], + aliases: ["Expression"], + fields: { + properties: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadProperty"))) + } + } +}); +(0, _index3.default)("ObjectMethod", { + builder: ["kind", "key", "params", "body", "computed"], + fields: { + kind: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("method", "get", "set")), + default: "method" + }, + computed: { + validate: (0, _index2.assertValueType)("boolean"), + default: false + }, + key: { + validate: function validate(node, key, val) { + var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"]; + + _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val); + } + }, + decorators: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))) + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement") + }, + generator: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + }, + async: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + } + }, + visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], + aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"] +}); +(0, _index3.default)("ObjectProperty", { + builder: ["key", "value", "computed", "shorthand", "decorators"], + fields: { + computed: { + validate: (0, _index2.assertValueType)("boolean"), + default: false + }, + key: { + validate: function validate(node, key, val) { + var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"]; + + _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val); + } + }, + value: { + validate: (0, _index2.assertNodeType)("Expression", "Pattern", "RestElement") + }, + shorthand: { + validate: (0, _index2.assertValueType)("boolean"), + default: false + }, + decorators: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))), + optional: true + } + }, + visitor: ["key", "value", "decorators"], + aliases: ["UserWhitespacable", "Property", "ObjectMember"] +}); +(0, _index3.default)("RestElement", { + visitor: ["argument", "typeAnnotation"], + aliases: ["LVal"], + fields: { + argument: { + validate: (0, _index2.assertNodeType)("LVal") + }, + decorators: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))) + } + } +}); +(0, _index3.default)("ReturnStatement", { + visitor: ["argument"], + aliases: ["Statement", "Terminatorless", "CompletionStatement"], + fields: { + argument: { + validate: (0, _index2.assertNodeType)("Expression"), + optional: true + } + } +}); +(0, _index3.default)("SequenceExpression", { + visitor: ["expressions"], + fields: { + expressions: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression"))) + } + }, + aliases: ["Expression"] +}); +(0, _index3.default)("SwitchCase", { + visitor: ["test", "consequent"], + fields: { + test: { + validate: (0, _index2.assertNodeType)("Expression"), + optional: true + }, + consequent: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement"))) + } + } +}); +(0, _index3.default)("SwitchStatement", { + visitor: ["discriminant", "cases"], + aliases: ["Statement", "BlockParent", "Scopable"], + fields: { + discriminant: { + validate: (0, _index2.assertNodeType)("Expression") + }, + cases: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("SwitchCase"))) + } + } +}); +(0, _index3.default)("ThisExpression", { + aliases: ["Expression"] +}); +(0, _index3.default)("ThrowStatement", { + visitor: ["argument"], + aliases: ["Statement", "Terminatorless", "CompletionStatement"], + fields: { + argument: { + validate: (0, _index2.assertNodeType)("Expression") + } + } +}); +(0, _index3.default)("TryStatement", { + visitor: ["block", "handler", "finalizer"], + aliases: ["Statement"], + fields: { + body: { + validate: (0, _index2.assertNodeType)("BlockStatement") + }, + handler: { + optional: true, + handler: (0, _index2.assertNodeType)("BlockStatement") + }, + finalizer: { + optional: true, + validate: (0, _index2.assertNodeType)("BlockStatement") + } + } +}); +(0, _index3.default)("UnaryExpression", { + builder: ["operator", "argument", "prefix"], + fields: { + prefix: { + default: true + }, + argument: { + validate: (0, _index2.assertNodeType)("Expression") + }, + operator: { + validate: _index2.assertOneOf.apply(undefined, _constants.UNARY_OPERATORS) + } + }, + visitor: ["argument"], + aliases: ["UnaryLike", "Expression"] +}); +(0, _index3.default)("UpdateExpression", { + builder: ["operator", "argument", "prefix"], + fields: { + prefix: { + default: false + }, + argument: { + validate: (0, _index2.assertNodeType)("Expression") + }, + operator: { + validate: _index2.assertOneOf.apply(undefined, _constants.UPDATE_OPERATORS) + } + }, + visitor: ["argument"], + aliases: ["Expression"] +}); +(0, _index3.default)("VariableDeclaration", { + builder: ["kind", "declarations"], + visitor: ["declarations"], + aliases: ["Statement", "Declaration"], + fields: { + kind: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("var", "let", "const")) + }, + declarations: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("VariableDeclarator"))) + } + } +}); +(0, _index3.default)("VariableDeclarator", { + visitor: ["id", "init"], + fields: { + id: { + validate: (0, _index2.assertNodeType)("LVal") + }, + init: { + optional: true, + validate: (0, _index2.assertNodeType)("Expression") + } + } +}); +(0, _index3.default)("WhileStatement", { + visitor: ["test", "body"], + aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"], + fields: { + test: { + validate: (0, _index2.assertNodeType)("Expression") + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement", "Statement") + } + } +}); +(0, _index3.default)("WithStatement", { + visitor: ["object", "body"], + aliases: ["Statement"], + fields: { + object: { + object: (0, _index2.assertNodeType)("Expression") + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement", "Statement") + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-types/lib/definitions/es2015.js": +/*!************************************************************!*\ + !*** ./node_modules/babel-types/lib/definitions/es2015.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/definitions/index.js"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +(0, _index2.default)("AssignmentPattern", { + visitor: ["left", "right"], + aliases: ["Pattern", "LVal"], + fields: { + left: { + validate: (0, _index.assertNodeType)("Identifier") + }, + right: { + validate: (0, _index.assertNodeType)("Expression") + }, + decorators: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) + } + } +}); +(0, _index2.default)("ArrayPattern", { + visitor: ["elements", "typeAnnotation"], + aliases: ["Pattern", "LVal"], + fields: { + elements: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Identifier", "Pattern", "RestElement"))) + }, + decorators: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) + } + } +}); +(0, _index2.default)("ArrowFunctionExpression", { + builder: ["params", "body", "async"], + visitor: ["params", "body", "returnType", "typeParameters"], + aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], + fields: { + params: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal"))) + }, + body: { + validate: (0, _index.assertNodeType)("BlockStatement", "Expression") + }, + async: { + validate: (0, _index.assertValueType)("boolean"), + default: false + } + } +}); +(0, _index2.default)("ClassBody", { + visitor: ["body"], + fields: { + body: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ClassMethod", "ClassProperty"))) + } + } +}); +(0, _index2.default)("ClassDeclaration", { + builder: ["id", "superClass", "body", "decorators"], + visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"], + aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"], + fields: { + id: { + validate: (0, _index.assertNodeType)("Identifier") + }, + body: { + validate: (0, _index.assertNodeType)("ClassBody") + }, + superClass: { + optional: true, + validate: (0, _index.assertNodeType)("Expression") + }, + decorators: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) + } + } +}); +(0, _index2.default)("ClassExpression", { + inherits: "ClassDeclaration", + aliases: ["Scopable", "Class", "Expression", "Pureish"], + fields: { + id: { + optional: true, + validate: (0, _index.assertNodeType)("Identifier") + }, + body: { + validate: (0, _index.assertNodeType)("ClassBody") + }, + superClass: { + optional: true, + validate: (0, _index.assertNodeType)("Expression") + }, + decorators: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) + } + } +}); +(0, _index2.default)("ExportAllDeclaration", { + visitor: ["source"], + aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], + fields: { + source: { + validate: (0, _index.assertNodeType)("StringLiteral") + } + } +}); +(0, _index2.default)("ExportDefaultDeclaration", { + visitor: ["declaration"], + aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], + fields: { + declaration: { + validate: (0, _index.assertNodeType)("FunctionDeclaration", "ClassDeclaration", "Expression") + } + } +}); +(0, _index2.default)("ExportNamedDeclaration", { + visitor: ["declaration", "specifiers", "source"], + aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], + fields: { + declaration: { + validate: (0, _index.assertNodeType)("Declaration"), + optional: true + }, + specifiers: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ExportSpecifier"))) + }, + source: { + validate: (0, _index.assertNodeType)("StringLiteral"), + optional: true + } + } +}); +(0, _index2.default)("ExportSpecifier", { + visitor: ["local", "exported"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _index.assertNodeType)("Identifier") + }, + exported: { + validate: (0, _index.assertNodeType)("Identifier") + } + } +}); +(0, _index2.default)("ForOfStatement", { + visitor: ["left", "right", "body"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], + fields: { + left: { + validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal") + }, + right: { + validate: (0, _index.assertNodeType)("Expression") + }, + body: { + validate: (0, _index.assertNodeType)("Statement") + } + } +}); +(0, _index2.default)("ImportDeclaration", { + visitor: ["specifiers", "source"], + aliases: ["Statement", "Declaration", "ModuleDeclaration"], + fields: { + specifiers: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"))) + }, + source: { + validate: (0, _index.assertNodeType)("StringLiteral") + } + } +}); +(0, _index2.default)("ImportDefaultSpecifier", { + visitor: ["local"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _index.assertNodeType)("Identifier") + } + } +}); +(0, _index2.default)("ImportNamespaceSpecifier", { + visitor: ["local"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _index.assertNodeType)("Identifier") + } + } +}); +(0, _index2.default)("ImportSpecifier", { + visitor: ["local", "imported"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _index.assertNodeType)("Identifier") + }, + imported: { + validate: (0, _index.assertNodeType)("Identifier") + }, + importKind: { + validate: (0, _index.assertOneOf)(null, "type", "typeof") + } + } +}); +(0, _index2.default)("MetaProperty", { + visitor: ["meta", "property"], + aliases: ["Expression"], + fields: { + meta: { + validate: (0, _index.assertValueType)("string") + }, + property: { + validate: (0, _index.assertValueType)("string") + } + } +}); +(0, _index2.default)("ClassMethod", { + aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"], + builder: ["kind", "key", "params", "body", "computed", "static"], + visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], + fields: { + kind: { + validate: (0, _index.chain)((0, _index.assertValueType)("string"), (0, _index.assertOneOf)("get", "set", "method", "constructor")), + default: "method" + }, + computed: { + default: false, + validate: (0, _index.assertValueType)("boolean") + }, + static: { + default: false, + validate: (0, _index.assertValueType)("boolean") + }, + key: { + validate: function validate(node, key, val) { + var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"]; + + _index.assertNodeType.apply(undefined, expectedTypes)(node, key, val); + } + }, + params: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal"))) + }, + body: { + validate: (0, _index.assertNodeType)("BlockStatement") + }, + generator: { + default: false, + validate: (0, _index.assertValueType)("boolean") + }, + async: { + default: false, + validate: (0, _index.assertValueType)("boolean") + } + } +}); +(0, _index2.default)("ObjectPattern", { + visitor: ["properties", "typeAnnotation"], + aliases: ["Pattern", "LVal"], + fields: { + properties: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("RestProperty", "Property"))) + }, + decorators: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) + } + } +}); +(0, _index2.default)("SpreadElement", { + visitor: ["argument"], + aliases: ["UnaryLike"], + fields: { + argument: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); +(0, _index2.default)("Super", { + aliases: ["Expression"] +}); +(0, _index2.default)("TaggedTemplateExpression", { + visitor: ["tag", "quasi"], + aliases: ["Expression"], + fields: { + tag: { + validate: (0, _index.assertNodeType)("Expression") + }, + quasi: { + validate: (0, _index.assertNodeType)("TemplateLiteral") + } + } +}); +(0, _index2.default)("TemplateElement", { + builder: ["value", "tail"], + fields: { + value: {}, + tail: { + validate: (0, _index.assertValueType)("boolean"), + default: false + } + } +}); +(0, _index2.default)("TemplateLiteral", { + visitor: ["quasis", "expressions"], + aliases: ["Expression", "Literal"], + fields: { + quasis: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("TemplateElement"))) + }, + expressions: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression"))) + } + } +}); +(0, _index2.default)("YieldExpression", { + builder: ["argument", "delegate"], + visitor: ["argument"], + aliases: ["Expression", "Terminatorless"], + fields: { + delegate: { + validate: (0, _index.assertValueType)("boolean"), + default: false + }, + argument: { + optional: true, + validate: (0, _index.assertNodeType)("Expression") + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-types/lib/definitions/experimental.js": +/*!******************************************************************!*\ + !*** ./node_modules/babel-types/lib/definitions/experimental.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/definitions/index.js"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +(0, _index2.default)("AwaitExpression", { + builder: ["argument"], + visitor: ["argument"], + aliases: ["Expression", "Terminatorless"], + fields: { + argument: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); +(0, _index2.default)("ForAwaitStatement", { + visitor: ["left", "right", "body"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], + fields: { + left: { + validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal") + }, + right: { + validate: (0, _index.assertNodeType)("Expression") + }, + body: { + validate: (0, _index.assertNodeType)("Statement") + } + } +}); +(0, _index2.default)("BindExpression", { + visitor: ["object", "callee"], + aliases: ["Expression"], + fields: {} +}); +(0, _index2.default)("Import", { + aliases: ["Expression"] +}); +(0, _index2.default)("Decorator", { + visitor: ["expression"], + fields: { + expression: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); +(0, _index2.default)("DoExpression", { + visitor: ["body"], + aliases: ["Expression"], + fields: { + body: { + validate: (0, _index.assertNodeType)("BlockStatement") + } + } +}); +(0, _index2.default)("ExportDefaultSpecifier", { + visitor: ["exported"], + aliases: ["ModuleSpecifier"], + fields: { + exported: { + validate: (0, _index.assertNodeType)("Identifier") + } + } +}); +(0, _index2.default)("ExportNamespaceSpecifier", { + visitor: ["exported"], + aliases: ["ModuleSpecifier"], + fields: { + exported: { + validate: (0, _index.assertNodeType)("Identifier") + } + } +}); +(0, _index2.default)("RestProperty", { + visitor: ["argument"], + aliases: ["UnaryLike"], + fields: { + argument: { + validate: (0, _index.assertNodeType)("LVal") + } + } +}); +(0, _index2.default)("SpreadProperty", { + visitor: ["argument"], + aliases: ["UnaryLike"], + fields: { + argument: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-types/lib/definitions/flow.js": +/*!**********************************************************!*\ + !*** ./node_modules/babel-types/lib/definitions/flow.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/definitions/index.js"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +(0, _index2.default)("AnyTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); +(0, _index2.default)("ArrayTypeAnnotation", { + visitor: ["elementType"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("BooleanTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); +(0, _index2.default)("BooleanLiteralTypeAnnotation", { + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("NullLiteralTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); +(0, _index2.default)("ClassImplements", { + visitor: ["id", "typeParameters"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("ClassProperty", { + visitor: ["key", "value", "typeAnnotation", "decorators"], + builder: ["key", "value", "typeAnnotation", "decorators", "computed"], + aliases: ["Property"], + fields: { + computed: { + validate: (0, _index.assertValueType)("boolean"), + default: false + } + } +}); +(0, _index2.default)("DeclareClass", { + visitor: ["id", "typeParameters", "extends", "body"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("DeclareFunction", { + visitor: ["id"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("DeclareInterface", { + visitor: ["id", "typeParameters", "extends", "body"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("DeclareModule", { + visitor: ["id", "body"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("DeclareModuleExports", { + visitor: ["typeAnnotation"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("DeclareTypeAlias", { + visitor: ["id", "typeParameters", "right"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("DeclareOpaqueType", { + visitor: ["id", "typeParameters", "supertype"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("DeclareVariable", { + visitor: ["id"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("DeclareExportDeclaration", { + visitor: ["declaration", "specifiers", "source"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("ExistentialTypeParam", { + aliases: ["Flow"] +}); +(0, _index2.default)("FunctionTypeAnnotation", { + visitor: ["typeParameters", "params", "rest", "returnType"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("FunctionTypeParam", { + visitor: ["name", "typeAnnotation"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("GenericTypeAnnotation", { + visitor: ["id", "typeParameters"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("InterfaceExtends", { + visitor: ["id", "typeParameters"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("InterfaceDeclaration", { + visitor: ["id", "typeParameters", "extends", "body"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("IntersectionTypeAnnotation", { + visitor: ["types"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("MixedTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"] +}); +(0, _index2.default)("EmptyTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"] +}); +(0, _index2.default)("NullableTypeAnnotation", { + visitor: ["typeAnnotation"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("NumericLiteralTypeAnnotation", { + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("NumberTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); +(0, _index2.default)("StringLiteralTypeAnnotation", { + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("StringTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); +(0, _index2.default)("ThisTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); +(0, _index2.default)("TupleTypeAnnotation", { + visitor: ["types"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("TypeofTypeAnnotation", { + visitor: ["argument"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("TypeAlias", { + visitor: ["id", "typeParameters", "right"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("OpaqueType", { + visitor: ["id", "typeParameters", "impltype", "supertype"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); +(0, _index2.default)("TypeAnnotation", { + visitor: ["typeAnnotation"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("TypeCastExpression", { + visitor: ["expression", "typeAnnotation"], + aliases: ["Flow", "ExpressionWrapper", "Expression"], + fields: {} +}); +(0, _index2.default)("TypeParameter", { + visitor: ["bound"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("TypeParameterDeclaration", { + visitor: ["params"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("TypeParameterInstantiation", { + visitor: ["params"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("ObjectTypeAnnotation", { + visitor: ["properties", "indexers", "callProperties"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("ObjectTypeCallProperty", { + visitor: ["value"], + aliases: ["Flow", "UserWhitespacable"], + fields: {} +}); +(0, _index2.default)("ObjectTypeIndexer", { + visitor: ["id", "key", "value"], + aliases: ["Flow", "UserWhitespacable"], + fields: {} +}); +(0, _index2.default)("ObjectTypeProperty", { + visitor: ["key", "value"], + aliases: ["Flow", "UserWhitespacable"], + fields: {} +}); +(0, _index2.default)("ObjectTypeSpreadProperty", { + visitor: ["argument"], + aliases: ["Flow", "UserWhitespacable"], + fields: {} +}); +(0, _index2.default)("QualifiedTypeIdentifier", { + visitor: ["id", "qualification"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("UnionTypeAnnotation", { + visitor: ["types"], + aliases: ["Flow"], + fields: {} +}); +(0, _index2.default)("VoidTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); + +/***/ }), + +/***/ "./node_modules/babel-types/lib/definitions/index.js": +/*!***********************************************************!*\ + !*** ./node_modules/babel-types/lib/definitions/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = undefined; + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _stringify = __webpack_require__(/*! babel-runtime/core-js/json/stringify */ "./node_modules/babel-runtime/core-js/json/stringify.js"); + +var _stringify2 = _interopRequireDefault(_stringify); + +var _typeof2 = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +exports.assertEach = assertEach; +exports.assertOneOf = assertOneOf; +exports.assertNodeType = assertNodeType; +exports.assertNodeOrValueType = assertNodeOrValueType; +exports.assertValueType = assertValueType; +exports.chain = chain; +exports.default = defineType; + +var _index = __webpack_require__(/*! ../index */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_index); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var VISITOR_KEYS = exports.VISITOR_KEYS = {}; +var ALIAS_KEYS = exports.ALIAS_KEYS = {}; +var NODE_FIELDS = exports.NODE_FIELDS = {}; +var BUILDER_KEYS = exports.BUILDER_KEYS = {}; +var DEPRECATED_KEYS = exports.DEPRECATED_KEYS = {}; + +function getType(val) { + if (Array.isArray(val)) { + return "array"; + } else if (val === null) { + return "null"; + } else if (val === undefined) { + return "undefined"; + } else { + return typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val); + } +} + +function assertEach(callback) { + function validator(node, key, val) { + if (!Array.isArray(val)) return; + + for (var i = 0; i < val.length; i++) { + callback(node, key + "[" + i + "]", val[i]); + } + } + + validator.each = callback; + return validator; +} + +function assertOneOf() { + for (var _len = arguments.length, vals = Array(_len), _key = 0; _key < _len; _key++) { + vals[_key] = arguments[_key]; + } + + function validate(node, key, val) { + if (vals.indexOf(val) < 0) { + throw new TypeError("Property " + key + " expected value to be one of " + (0, _stringify2.default)(vals) + " but got " + (0, _stringify2.default)(val)); + } + } + + validate.oneOf = vals; + return validate; +} + +function assertNodeType() { + for (var _len2 = arguments.length, types = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + types[_key2] = arguments[_key2]; + } + + function validate(node, key, val) { + var valid = false; + + for (var _iterator = types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var type = _ref; + + if (t.is(type, val)) { + valid = true; + break; + } + } + + if (!valid) { + throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type))); + } + } + + validate.oneOfNodeTypes = types; + return validate; +} + +function assertNodeOrValueType() { + for (var _len3 = arguments.length, types = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + types[_key3] = arguments[_key3]; + } + + function validate(node, key, val) { + var valid = false; + + for (var _iterator2 = types, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var type = _ref2; + + if (getType(val) === type || t.is(type, val)) { + valid = true; + break; + } + } + + if (!valid) { + throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type))); + } + } + + validate.oneOfNodeOrValueTypes = types; + return validate; +} + +function assertValueType(type) { + function validate(node, key, val) { + var valid = getType(val) === type; + + if (!valid) { + throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val)); + } + } + + validate.type = type; + return validate; +} + +function chain() { + for (var _len4 = arguments.length, fns = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + fns[_key4] = arguments[_key4]; + } + + function validate() { + for (var _iterator3 = fns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var fn = _ref3; + fn.apply(undefined, arguments); + } + } + + validate.chainOf = fns; + return validate; +} + +function defineType(type) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var inherits = opts.inherits && store[opts.inherits] || {}; + opts.fields = opts.fields || inherits.fields || {}; + opts.visitor = opts.visitor || inherits.visitor || []; + opts.aliases = opts.aliases || inherits.aliases || []; + opts.builder = opts.builder || inherits.builder || opts.visitor || []; + + if (opts.deprecatedAlias) { + DEPRECATED_KEYS[opts.deprecatedAlias] = type; + } + + for (var _iterator4 = opts.visitor.concat(opts.builder), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var _key5 = _ref4; + opts.fields[_key5] = opts.fields[_key5] || {}; + } + + for (var key in opts.fields) { + var field = opts.fields[key]; + + if (opts.builder.indexOf(key) === -1) { + field.optional = true; + } + + if (field.default === undefined) { + field.default = null; + } else if (!field.validate) { + field.validate = assertValueType(getType(field.default)); + } + } + + VISITOR_KEYS[type] = opts.visitor; + BUILDER_KEYS[type] = opts.builder; + NODE_FIELDS[type] = opts.fields; + ALIAS_KEYS[type] = opts.aliases; + store[type] = opts; +} + +var store = {}; + +/***/ }), + +/***/ "./node_modules/babel-types/lib/definitions/init.js": +/*!**********************************************************!*\ + !*** ./node_modules/babel-types/lib/definitions/init.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/definitions/index.js"); + +__webpack_require__(/*! ./core */ "./node_modules/babel-types/lib/definitions/core.js"); + +__webpack_require__(/*! ./es2015 */ "./node_modules/babel-types/lib/definitions/es2015.js"); + +__webpack_require__(/*! ./flow */ "./node_modules/babel-types/lib/definitions/flow.js"); + +__webpack_require__(/*! ./jsx */ "./node_modules/babel-types/lib/definitions/jsx.js"); + +__webpack_require__(/*! ./misc */ "./node_modules/babel-types/lib/definitions/misc.js"); + +__webpack_require__(/*! ./experimental */ "./node_modules/babel-types/lib/definitions/experimental.js"); + +/***/ }), + +/***/ "./node_modules/babel-types/lib/definitions/jsx.js": +/*!*********************************************************!*\ + !*** ./node_modules/babel-types/lib/definitions/jsx.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/definitions/index.js"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +(0, _index2.default)("JSXAttribute", { + visitor: ["name", "value"], + aliases: ["JSX", "Immutable"], + fields: { + name: { + validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXNamespacedName") + }, + value: { + optional: true, + validate: (0, _index.assertNodeType)("JSXElement", "StringLiteral", "JSXExpressionContainer") + } + } +}); +(0, _index2.default)("JSXClosingElement", { + visitor: ["name"], + aliases: ["JSX", "Immutable"], + fields: { + name: { + validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXMemberExpression") + } + } +}); +(0, _index2.default)("JSXElement", { + builder: ["openingElement", "closingElement", "children", "selfClosing"], + visitor: ["openingElement", "children", "closingElement"], + aliases: ["JSX", "Immutable", "Expression"], + fields: { + openingElement: { + validate: (0, _index.assertNodeType)("JSXOpeningElement") + }, + closingElement: { + optional: true, + validate: (0, _index.assertNodeType)("JSXClosingElement") + }, + children: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement"))) + } + } +}); +(0, _index2.default)("JSXEmptyExpression", { + aliases: ["JSX", "Expression"] +}); +(0, _index2.default)("JSXExpressionContainer", { + visitor: ["expression"], + aliases: ["JSX", "Immutable"], + fields: { + expression: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); +(0, _index2.default)("JSXSpreadChild", { + visitor: ["expression"], + aliases: ["JSX", "Immutable"], + fields: { + expression: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); +(0, _index2.default)("JSXIdentifier", { + builder: ["name"], + aliases: ["JSX", "Expression"], + fields: { + name: { + validate: (0, _index.assertValueType)("string") + } + } +}); +(0, _index2.default)("JSXMemberExpression", { + visitor: ["object", "property"], + aliases: ["JSX", "Expression"], + fields: { + object: { + validate: (0, _index.assertNodeType)("JSXMemberExpression", "JSXIdentifier") + }, + property: { + validate: (0, _index.assertNodeType)("JSXIdentifier") + } + } +}); +(0, _index2.default)("JSXNamespacedName", { + visitor: ["namespace", "name"], + aliases: ["JSX"], + fields: { + namespace: { + validate: (0, _index.assertNodeType)("JSXIdentifier") + }, + name: { + validate: (0, _index.assertNodeType)("JSXIdentifier") + } + } +}); +(0, _index2.default)("JSXOpeningElement", { + builder: ["name", "attributes", "selfClosing"], + visitor: ["name", "attributes"], + aliases: ["JSX", "Immutable"], + fields: { + name: { + validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXMemberExpression") + }, + selfClosing: { + default: false, + validate: (0, _index.assertValueType)("boolean") + }, + attributes: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("JSXAttribute", "JSXSpreadAttribute"))) + } + } +}); +(0, _index2.default)("JSXSpreadAttribute", { + visitor: ["argument"], + aliases: ["JSX"], + fields: { + argument: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); +(0, _index2.default)("JSXText", { + aliases: ["JSX", "Immutable"], + builder: ["value"], + fields: { + value: { + validate: (0, _index.assertValueType)("string") + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-types/lib/definitions/misc.js": +/*!**********************************************************!*\ + !*** ./node_modules/babel-types/lib/definitions/misc.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/definitions/index.js"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +(0, _index2.default)("Noop", { + visitor: [] +}); +(0, _index2.default)("ParenthesizedExpression", { + visitor: ["expression"], + aliases: ["Expression", "ExpressionWrapper"], + fields: { + expression: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-types/lib/flow.js": +/*!**********************************************!*\ + !*** ./node_modules/babel-types/lib/flow.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.createUnionTypeAnnotation = createUnionTypeAnnotation; +exports.removeTypeDuplicates = removeTypeDuplicates; +exports.createTypeAnnotationBasedOnTypeof = createTypeAnnotationBasedOnTypeof; + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_index); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function createUnionTypeAnnotation(types) { + var flattened = removeTypeDuplicates(types); + + if (flattened.length === 1) { + return flattened[0]; + } else { + return t.unionTypeAnnotation(flattened); + } +} + +function removeTypeDuplicates(nodes) { + var generics = {}; + var bases = {}; + var typeGroups = []; + var types = []; + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + if (!node) continue; + + if (types.indexOf(node) >= 0) { + continue; + } + + if (t.isAnyTypeAnnotation(node)) { + return [node]; + } + + if (t.isFlowBaseAnnotation(node)) { + bases[node.type] = node; + continue; + } + + if (t.isUnionTypeAnnotation(node)) { + if (typeGroups.indexOf(node.types) < 0) { + nodes = nodes.concat(node.types); + typeGroups.push(node.types); + } + + continue; + } + + if (t.isGenericTypeAnnotation(node)) { + var name = node.id.name; + + if (generics[name]) { + var existing = generics[name]; + + if (existing.typeParameters) { + if (node.typeParameters) { + existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params)); + } + } else { + existing = node.typeParameters; + } + } else { + generics[name] = node; + } + + continue; + } + + types.push(node); + } + + for (var type in bases) { + types.push(bases[type]); + } + + for (var _name in generics) { + types.push(generics[_name]); + } + + return types; +} + +function createTypeAnnotationBasedOnTypeof(type) { + if (type === "string") { + return t.stringTypeAnnotation(); + } else if (type === "number") { + return t.numberTypeAnnotation(); + } else if (type === "undefined") { + return t.voidTypeAnnotation(); + } else if (type === "boolean") { + return t.booleanTypeAnnotation(); + } else if (type === "function") { + return t.genericTypeAnnotation(t.identifier("Function")); + } else if (type === "object") { + return t.genericTypeAnnotation(t.identifier("Object")); + } else if (type === "symbol") { + return t.genericTypeAnnotation(t.identifier("Symbol")); + } else { + throw new Error("Invalid typeof value"); + } +} + +/***/ }), + +/***/ "./node_modules/babel-types/lib/index.js": +/*!***********************************************!*\ + !*** ./node_modules/babel-types/lib/index.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.createTypeAnnotationBasedOnTypeof = exports.removeTypeDuplicates = exports.createUnionTypeAnnotation = exports.valueToNode = exports.toBlock = exports.toExpression = exports.toStatement = exports.toBindingIdentifierName = exports.toIdentifier = exports.toKeyAlias = exports.toSequenceExpression = exports.toComputedKey = exports.isNodesEquivalent = exports.isImmutable = exports.isScope = exports.isSpecifierDefault = exports.isVar = exports.isBlockScoped = exports.isLet = exports.isValidIdentifier = exports.isReferenced = exports.isBinding = exports.getOuterBindingIdentifiers = exports.getBindingIdentifiers = exports.TYPES = exports.react = exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = undefined; + +var _getOwnPropertySymbols = __webpack_require__(/*! babel-runtime/core-js/object/get-own-property-symbols */ "./node_modules/babel-runtime/core-js/object/get-own-property-symbols.js"); + +var _getOwnPropertySymbols2 = _interopRequireDefault(_getOwnPropertySymbols); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); + +var _keys2 = _interopRequireDefault(_keys); + +var _stringify = __webpack_require__(/*! babel-runtime/core-js/json/stringify */ "./node_modules/babel-runtime/core-js/json/stringify.js"); + +var _stringify2 = _interopRequireDefault(_stringify); + +var _constants = __webpack_require__(/*! ./constants */ "./node_modules/babel-types/lib/constants.js"); + +Object.defineProperty(exports, "STATEMENT_OR_BLOCK_KEYS", { + enumerable: true, + get: function get() { + return _constants.STATEMENT_OR_BLOCK_KEYS; + } +}); +Object.defineProperty(exports, "FLATTENABLE_KEYS", { + enumerable: true, + get: function get() { + return _constants.FLATTENABLE_KEYS; + } +}); +Object.defineProperty(exports, "FOR_INIT_KEYS", { + enumerable: true, + get: function get() { + return _constants.FOR_INIT_KEYS; + } +}); +Object.defineProperty(exports, "COMMENT_KEYS", { + enumerable: true, + get: function get() { + return _constants.COMMENT_KEYS; + } +}); +Object.defineProperty(exports, "LOGICAL_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.LOGICAL_OPERATORS; + } +}); +Object.defineProperty(exports, "UPDATE_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.UPDATE_OPERATORS; + } +}); +Object.defineProperty(exports, "BOOLEAN_NUMBER_BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.BOOLEAN_NUMBER_BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "EQUALITY_BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.EQUALITY_BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "COMPARISON_BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.COMPARISON_BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "BOOLEAN_BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.BOOLEAN_BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "NUMBER_BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.NUMBER_BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "BOOLEAN_UNARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.BOOLEAN_UNARY_OPERATORS; + } +}); +Object.defineProperty(exports, "NUMBER_UNARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.NUMBER_UNARY_OPERATORS; + } +}); +Object.defineProperty(exports, "STRING_UNARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.STRING_UNARY_OPERATORS; + } +}); +Object.defineProperty(exports, "UNARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.UNARY_OPERATORS; + } +}); +Object.defineProperty(exports, "INHERIT_KEYS", { + enumerable: true, + get: function get() { + return _constants.INHERIT_KEYS; + } +}); +Object.defineProperty(exports, "BLOCK_SCOPED_SYMBOL", { + enumerable: true, + get: function get() { + return _constants.BLOCK_SCOPED_SYMBOL; + } +}); +Object.defineProperty(exports, "NOT_LOCAL_BINDING", { + enumerable: true, + get: function get() { + return _constants.NOT_LOCAL_BINDING; + } +}); +exports.is = is; +exports.isType = isType; +exports.validate = validate; +exports.shallowEqual = shallowEqual; +exports.appendToMemberExpression = appendToMemberExpression; +exports.prependToMemberExpression = prependToMemberExpression; +exports.ensureBlock = ensureBlock; +exports.clone = clone; +exports.cloneWithoutLoc = cloneWithoutLoc; +exports.cloneDeep = cloneDeep; +exports.buildMatchMemberExpression = buildMatchMemberExpression; +exports.removeComments = removeComments; +exports.inheritsComments = inheritsComments; +exports.inheritTrailingComments = inheritTrailingComments; +exports.inheritLeadingComments = inheritLeadingComments; +exports.inheritInnerComments = inheritInnerComments; +exports.inherits = inherits; +exports.assertNode = assertNode; +exports.isNode = isNode; +exports.traverseFast = traverseFast; +exports.removeProperties = removeProperties; +exports.removePropertiesDeep = removePropertiesDeep; + +var _retrievers = __webpack_require__(/*! ./retrievers */ "./node_modules/babel-types/lib/retrievers.js"); + +Object.defineProperty(exports, "getBindingIdentifiers", { + enumerable: true, + get: function get() { + return _retrievers.getBindingIdentifiers; + } +}); +Object.defineProperty(exports, "getOuterBindingIdentifiers", { + enumerable: true, + get: function get() { + return _retrievers.getOuterBindingIdentifiers; + } +}); + +var _validators = __webpack_require__(/*! ./validators */ "./node_modules/babel-types/lib/validators.js"); + +Object.defineProperty(exports, "isBinding", { + enumerable: true, + get: function get() { + return _validators.isBinding; + } +}); +Object.defineProperty(exports, "isReferenced", { + enumerable: true, + get: function get() { + return _validators.isReferenced; + } +}); +Object.defineProperty(exports, "isValidIdentifier", { + enumerable: true, + get: function get() { + return _validators.isValidIdentifier; + } +}); +Object.defineProperty(exports, "isLet", { + enumerable: true, + get: function get() { + return _validators.isLet; + } +}); +Object.defineProperty(exports, "isBlockScoped", { + enumerable: true, + get: function get() { + return _validators.isBlockScoped; + } +}); +Object.defineProperty(exports, "isVar", { + enumerable: true, + get: function get() { + return _validators.isVar; + } +}); +Object.defineProperty(exports, "isSpecifierDefault", { + enumerable: true, + get: function get() { + return _validators.isSpecifierDefault; + } +}); +Object.defineProperty(exports, "isScope", { + enumerable: true, + get: function get() { + return _validators.isScope; + } +}); +Object.defineProperty(exports, "isImmutable", { + enumerable: true, + get: function get() { + return _validators.isImmutable; + } +}); +Object.defineProperty(exports, "isNodesEquivalent", { + enumerable: true, + get: function get() { + return _validators.isNodesEquivalent; + } +}); + +var _converters = __webpack_require__(/*! ./converters */ "./node_modules/babel-types/lib/converters.js"); + +Object.defineProperty(exports, "toComputedKey", { + enumerable: true, + get: function get() { + return _converters.toComputedKey; + } +}); +Object.defineProperty(exports, "toSequenceExpression", { + enumerable: true, + get: function get() { + return _converters.toSequenceExpression; + } +}); +Object.defineProperty(exports, "toKeyAlias", { + enumerable: true, + get: function get() { + return _converters.toKeyAlias; + } +}); +Object.defineProperty(exports, "toIdentifier", { + enumerable: true, + get: function get() { + return _converters.toIdentifier; + } +}); +Object.defineProperty(exports, "toBindingIdentifierName", { + enumerable: true, + get: function get() { + return _converters.toBindingIdentifierName; + } +}); +Object.defineProperty(exports, "toStatement", { + enumerable: true, + get: function get() { + return _converters.toStatement; + } +}); +Object.defineProperty(exports, "toExpression", { + enumerable: true, + get: function get() { + return _converters.toExpression; + } +}); +Object.defineProperty(exports, "toBlock", { + enumerable: true, + get: function get() { + return _converters.toBlock; + } +}); +Object.defineProperty(exports, "valueToNode", { + enumerable: true, + get: function get() { + return _converters.valueToNode; + } +}); + +var _flow = __webpack_require__(/*! ./flow */ "./node_modules/babel-types/lib/flow.js"); + +Object.defineProperty(exports, "createUnionTypeAnnotation", { + enumerable: true, + get: function get() { + return _flow.createUnionTypeAnnotation; + } +}); +Object.defineProperty(exports, "removeTypeDuplicates", { + enumerable: true, + get: function get() { + return _flow.removeTypeDuplicates; + } +}); +Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", { + enumerable: true, + get: function get() { + return _flow.createTypeAnnotationBasedOnTypeof; + } +}); + +var _toFastProperties = __webpack_require__(/*! to-fast-properties */ "./node_modules/babel-types/node_modules/to-fast-properties/index.js"); + +var _toFastProperties2 = _interopRequireDefault(_toFastProperties); + +var _clone = __webpack_require__(/*! lodash/clone */ "./node_modules/lodash/clone.js"); + +var _clone2 = _interopRequireDefault(_clone); + +var _uniq = __webpack_require__(/*! lodash/uniq */ "./node_modules/lodash/uniq.js"); + +var _uniq2 = _interopRequireDefault(_uniq); + +__webpack_require__(/*! ./definitions/init */ "./node_modules/babel-types/lib/definitions/init.js"); + +var _definitions = __webpack_require__(/*! ./definitions */ "./node_modules/babel-types/lib/definitions/index.js"); + +var _react2 = __webpack_require__(/*! ./react */ "./node_modules/babel-types/lib/react.js"); + +var _react = _interopRequireWildcard(_react2); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +var t = exports; + +function registerType(type) { + var is = t["is" + type]; + + if (!is) { + is = t["is" + type] = function (node, opts) { + return t.is(type, node, opts); + }; + } + + t["assert" + type] = function (node, opts) { + opts = opts || {}; + + if (!is(node, opts)) { + throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); + } + }; +} + +exports.VISITOR_KEYS = _definitions.VISITOR_KEYS; +exports.ALIAS_KEYS = _definitions.ALIAS_KEYS; +exports.NODE_FIELDS = _definitions.NODE_FIELDS; +exports.BUILDER_KEYS = _definitions.BUILDER_KEYS; +exports.DEPRECATED_KEYS = _definitions.DEPRECATED_KEYS; +exports.react = _react; + +for (var type in t.VISITOR_KEYS) { + registerType(type); +} + +t.FLIPPED_ALIAS_KEYS = {}; +(0, _keys2.default)(t.ALIAS_KEYS).forEach(function (type) { + t.ALIAS_KEYS[type].forEach(function (alias) { + var types = t.FLIPPED_ALIAS_KEYS[alias] = t.FLIPPED_ALIAS_KEYS[alias] || []; + types.push(type); + }); +}); +(0, _keys2.default)(t.FLIPPED_ALIAS_KEYS).forEach(function (type) { + t[type.toUpperCase() + "_TYPES"] = t.FLIPPED_ALIAS_KEYS[type]; + registerType(type); +}); +var TYPES = exports.TYPES = (0, _keys2.default)(t.VISITOR_KEYS).concat((0, _keys2.default)(t.FLIPPED_ALIAS_KEYS)).concat((0, _keys2.default)(t.DEPRECATED_KEYS)); + +function is(type, node, opts) { + if (!node) return false; + var matches = isType(node.type, type); + if (!matches) return false; + + if (typeof opts === "undefined") { + return true; + } else { + return t.shallowEqual(node, opts); + } +} + +function isType(nodeType, targetType) { + if (nodeType === targetType) return true; + if (t.ALIAS_KEYS[targetType]) return false; + var aliases = t.FLIPPED_ALIAS_KEYS[targetType]; + + if (aliases) { + if (aliases[0] === nodeType) return true; + + for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var alias = _ref; + if (nodeType === alias) return true; + } + } + + return false; +} + +(0, _keys2.default)(t.BUILDER_KEYS).forEach(function (type) { + var keys = t.BUILDER_KEYS[type]; + + function builder() { + if (arguments.length > keys.length) { + throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); + } + + var node = {}; + node.type = type; + var i = 0; + + for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var _key = _ref2; + var field = t.NODE_FIELDS[type][_key]; + var arg = arguments[i++]; + if (arg === undefined) arg = (0, _clone2.default)(field.default); + node[_key] = arg; + } + + for (var key in node) { + validate(node, key, node[key]); + } + + return node; + } + + t[type] = builder; + t[type[0].toLowerCase() + type.slice(1)] = builder; +}); + +var _loop = function _loop(_type) { + var newType = t.DEPRECATED_KEYS[_type]; + + function proxy(fn) { + return function () { + console.trace("The node type " + _type + " has been renamed to " + newType); + return fn.apply(this, arguments); + }; + } + + t[_type] = t[_type[0].toLowerCase() + _type.slice(1)] = proxy(t[newType]); + t["is" + _type] = proxy(t["is" + newType]); + t["assert" + _type] = proxy(t["assert" + newType]); +}; + +for (var _type in t.DEPRECATED_KEYS) { + _loop(_type); +} + +function validate(node, key, val) { + if (!node) return; + var fields = t.NODE_FIELDS[node.type]; + if (!fields) return; + var field = fields[key]; + if (!field || !field.validate) return; + if (field.optional && val == null) return; + field.validate(node, key, val); +} + +function shallowEqual(actual, expected) { + var keys = (0, _keys2.default)(expected); + + for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var key = _ref3; + + if (actual[key] !== expected[key]) { + return false; + } + } + + return true; +} + +function appendToMemberExpression(member, append, computed) { + member.object = t.memberExpression(member.object, member.property, member.computed); + member.property = append; + member.computed = !!computed; + return member; +} + +function prependToMemberExpression(member, prepend) { + member.object = t.memberExpression(prepend, member.object); + return member; +} + +function ensureBlock(node) { + var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "body"; + return node[key] = t.toBlock(node[key], node); +} + +function clone(node) { + if (!node) return node; + var newNode = {}; + + for (var key in node) { + if (key[0] === "_") continue; + newNode[key] = node[key]; + } + + return newNode; +} + +function cloneWithoutLoc(node) { + var newNode = clone(node); + delete newNode.loc; + return newNode; +} + +function cloneDeep(node) { + if (!node) return node; + var newNode = {}; + + for (var key in node) { + if (key[0] === "_") continue; + var val = node[key]; + + if (val) { + if (val.type) { + val = t.cloneDeep(val); + } else if (Array.isArray(val)) { + val = val.map(t.cloneDeep); + } + } + + newNode[key] = val; + } + + return newNode; +} + +function buildMatchMemberExpression(match, allowPartial) { + var parts = match.split("."); + return function (member) { + if (!t.isMemberExpression(member)) return false; + var search = [member]; + var i = 0; + + while (search.length) { + var node = search.shift(); + + if (allowPartial && i === parts.length) { + return true; + } + + if (t.isIdentifier(node)) { + if (parts[i] !== node.name) return false; + } else if (t.isStringLiteral(node)) { + if (parts[i] !== node.value) return false; + } else if (t.isMemberExpression(node)) { + if (node.computed && !t.isStringLiteral(node.property)) { + return false; + } else { + search.push(node.object); + search.push(node.property); + continue; + } + } else { + return false; + } + + if (++i > parts.length) { + return false; + } + } + + return true; + }; +} + +function removeComments(node) { + for (var _iterator4 = t.COMMENT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var key = _ref4; + delete node[key]; + } + + return node; +} + +function inheritsComments(child, parent) { + inheritTrailingComments(child, parent); + inheritLeadingComments(child, parent); + inheritInnerComments(child, parent); + return child; +} + +function inheritTrailingComments(child, parent) { + _inheritComments("trailingComments", child, parent); +} + +function inheritLeadingComments(child, parent) { + _inheritComments("leadingComments", child, parent); +} + +function inheritInnerComments(child, parent) { + _inheritComments("innerComments", child, parent); +} + +function _inheritComments(key, child, parent) { + if (child && parent) { + child[key] = (0, _uniq2.default)([].concat(child[key], parent[key]).filter(Boolean)); + } +} + +function inherits(child, parent) { + if (!child || !parent) return child; + + for (var _iterator5 = t.INHERIT_KEYS.optional, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { + var _ref5; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref5 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref5 = _i5.value; + } + + var _key2 = _ref5; + + if (child[_key2] == null) { + child[_key2] = parent[_key2]; + } + } + + for (var key in parent) { + if (key[0] === "_") child[key] = parent[key]; + } + + for (var _iterator6 = t.INHERIT_KEYS.force, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { + var _ref6; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref6 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref6 = _i6.value; + } + + var _key3 = _ref6; + child[_key3] = parent[_key3]; + } + + t.inheritsComments(child, parent); + return child; +} + +function assertNode(node) { + if (!isNode(node)) { + throw new TypeError("Not a valid node " + (node && node.type)); + } +} + +function isNode(node) { + return !!(node && _definitions.VISITOR_KEYS[node.type]); +} + +(0, _toFastProperties2.default)(t); +(0, _toFastProperties2.default)(t.VISITOR_KEYS); + +function traverseFast(node, enter, opts) { + if (!node) return; + var keys = t.VISITOR_KEYS[node.type]; + if (!keys) return; + opts = opts || {}; + enter(node, opts); + + for (var _iterator7 = keys, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { + var _ref7; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref7 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref7 = _i7.value; + } + + var key = _ref7; + var subNode = node[key]; + + if (Array.isArray(subNode)) { + for (var _iterator8 = subNode, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) { + var _ref8; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref8 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref8 = _i8.value; + } + + var _node = _ref8; + traverseFast(_node, enter, opts); + } + } else { + traverseFast(subNode, enter, opts); + } + } +} + +var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; +var CLEAR_KEYS_PLUS_COMMENTS = t.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS); + +function removeProperties(node, opts) { + opts = opts || {}; + var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; + + for (var _iterator9 = map, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) { + var _ref9; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref9 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref9 = _i9.value; + } + + var _key4 = _ref9; + if (node[_key4] != null) node[_key4] = undefined; + } + + for (var key in node) { + if (key[0] === "_" && node[key] != null) node[key] = undefined; + } + + var syms = (0, _getOwnPropertySymbols2.default)(node); + + for (var _iterator10 = syms, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) { + var _ref10; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref10 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref10 = _i10.value; + } + + var sym = _ref10; + node[sym] = null; + } +} + +function removePropertiesDeep(tree, opts) { + traverseFast(tree, removeProperties, opts); + return tree; +} + +/***/ }), + +/***/ "./node_modules/babel-types/lib/react.js": +/*!***********************************************!*\ + !*** ./node_modules/babel-types/lib/react.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.isReactComponent = undefined; +exports.isCompatTag = isCompatTag; +exports.buildChildren = buildChildren; + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_index); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +var isReactComponent = exports.isReactComponent = t.buildMatchMemberExpression("React.Component"); + +function isCompatTag(tagName) { + return !!tagName && /^[a-z]|\-/.test(tagName); +} + +function cleanJSXElementLiteralChild(child, args) { + var lines = child.value.split(/\r\n|\n|\r/); + var lastNonEmptyLine = 0; + + for (var i = 0; i < lines.length; i++) { + if (lines[i].match(/[^ \t]/)) { + lastNonEmptyLine = i; + } + } + + var str = ""; + + for (var _i = 0; _i < lines.length; _i++) { + var line = lines[_i]; + var isFirstLine = _i === 0; + var isLastLine = _i === lines.length - 1; + var isLastNonEmptyLine = _i === lastNonEmptyLine; + var trimmedLine = line.replace(/\t/g, " "); + + if (!isFirstLine) { + trimmedLine = trimmedLine.replace(/^[ ]+/, ""); + } + + if (!isLastLine) { + trimmedLine = trimmedLine.replace(/[ ]+$/, ""); + } + + if (trimmedLine) { + if (!isLastNonEmptyLine) { + trimmedLine += " "; + } + + str += trimmedLine; + } + } + + if (str) args.push(t.stringLiteral(str)); +} + +function buildChildren(node) { + var elems = []; + + for (var i = 0; i < node.children.length; i++) { + var child = node.children[i]; + + if (t.isJSXText(child)) { + cleanJSXElementLiteralChild(child, elems); + continue; + } + + if (t.isJSXExpressionContainer(child)) child = child.expression; + if (t.isJSXEmptyExpression(child)) continue; + elems.push(child); + } + + return elems; +} + +/***/ }), + +/***/ "./node_modules/babel-types/lib/retrievers.js": +/*!****************************************************!*\ + !*** ./node_modules/babel-types/lib/retrievers.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _create = __webpack_require__(/*! babel-runtime/core-js/object/create */ "./node_modules/babel-runtime/core-js/object/create.js"); + +var _create2 = _interopRequireDefault(_create); + +exports.getBindingIdentifiers = getBindingIdentifiers; +exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers; + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_index); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function getBindingIdentifiers(node, duplicates, outerOnly) { + var search = [].concat(node); + var ids = (0, _create2.default)(null); + + while (search.length) { + var id = search.shift(); + if (!id) continue; + var keys = t.getBindingIdentifiers.keys[id.type]; + + if (t.isIdentifier(id)) { + if (duplicates) { + var _ids = ids[id.name] = ids[id.name] || []; + + _ids.push(id); + } else { + ids[id.name] = id; + } + + continue; + } + + if (t.isExportDeclaration(id)) { + if (t.isDeclaration(id.declaration)) { + search.push(id.declaration); + } + + continue; + } + + if (outerOnly) { + if (t.isFunctionDeclaration(id)) { + search.push(id.id); + continue; + } + + if (t.isFunctionExpression(id)) { + continue; + } + } + + if (keys) { + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (id[key]) { + search = search.concat(id[key]); + } + } + } + } + + return ids; +} + +getBindingIdentifiers.keys = { + DeclareClass: ["id"], + DeclareFunction: ["id"], + DeclareModule: ["id"], + DeclareVariable: ["id"], + InterfaceDeclaration: ["id"], + TypeAlias: ["id"], + OpaqueType: ["id"], + CatchClause: ["param"], + LabeledStatement: ["label"], + UnaryExpression: ["argument"], + AssignmentExpression: ["left"], + ImportSpecifier: ["local"], + ImportNamespaceSpecifier: ["local"], + ImportDefaultSpecifier: ["local"], + ImportDeclaration: ["specifiers"], + ExportSpecifier: ["exported"], + ExportNamespaceSpecifier: ["exported"], + ExportDefaultSpecifier: ["exported"], + FunctionDeclaration: ["id", "params"], + FunctionExpression: ["id", "params"], + ClassDeclaration: ["id"], + ClassExpression: ["id"], + RestElement: ["argument"], + UpdateExpression: ["argument"], + RestProperty: ["argument"], + ObjectProperty: ["value"], + AssignmentPattern: ["left"], + ArrayPattern: ["elements"], + ObjectPattern: ["properties"], + VariableDeclaration: ["declarations"], + VariableDeclarator: ["id"] +}; + +function getOuterBindingIdentifiers(node, duplicates) { + return getBindingIdentifiers(node, duplicates, true); +} + +/***/ }), + +/***/ "./node_modules/babel-types/lib/validators.js": +/*!****************************************************!*\ + !*** ./node_modules/babel-types/lib/validators.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _keys = __webpack_require__(/*! babel-runtime/core-js/object/keys */ "./node_modules/babel-runtime/core-js/object/keys.js"); + +var _keys2 = _interopRequireDefault(_keys); + +var _typeof2 = __webpack_require__(/*! babel-runtime/helpers/typeof */ "./node_modules/babel-runtime/helpers/typeof.js"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +var _getIterator2 = __webpack_require__(/*! babel-runtime/core-js/get-iterator */ "./node_modules/babel-runtime/core-js/get-iterator.js"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.isBinding = isBinding; +exports.isReferenced = isReferenced; +exports.isValidIdentifier = isValidIdentifier; +exports.isLet = isLet; +exports.isBlockScoped = isBlockScoped; +exports.isVar = isVar; +exports.isSpecifierDefault = isSpecifierDefault; +exports.isScope = isScope; +exports.isImmutable = isImmutable; +exports.isNodesEquivalent = isNodesEquivalent; + +var _retrievers = __webpack_require__(/*! ./retrievers */ "./node_modules/babel-types/lib/retrievers.js"); + +var _esutils = __webpack_require__(/*! esutils */ "./node_modules/esutils/lib/utils.js"); + +var _esutils2 = _interopRequireDefault(_esutils); + +var _index = __webpack_require__(/*! ./index */ "./node_modules/babel-types/lib/index.js"); + +var t = _interopRequireWildcard(_index); + +var _constants = __webpack_require__(/*! ./constants */ "./node_modules/babel-types/lib/constants.js"); + +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function isBinding(node, parent) { + var keys = _retrievers.getBindingIdentifiers.keys[parent.type]; + + if (keys) { + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var val = parent[key]; + + if (Array.isArray(val)) { + if (val.indexOf(node) >= 0) return true; + } else { + if (val === node) return true; + } + } + } + + return false; +} + +function isReferenced(node, parent) { + switch (parent.type) { + case "BindExpression": + return parent.object === node || parent.callee === node; + + case "MemberExpression": + case "JSXMemberExpression": + if (parent.property === node && parent.computed) { + return true; + } else if (parent.object === node) { + return true; + } else { + return false; + } + + case "MetaProperty": + return false; + + case "ObjectProperty": + if (parent.key === node) { + return parent.computed; + } + + case "VariableDeclarator": + return parent.id !== node; + + case "ArrowFunctionExpression": + case "FunctionDeclaration": + case "FunctionExpression": + for (var _iterator = parent.params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var param = _ref; + if (param === node) return false; + } + + return parent.id !== node; + + case "ExportSpecifier": + if (parent.source) { + return false; + } else { + return parent.local === node; + } + + case "ExportNamespaceSpecifier": + case "ExportDefaultSpecifier": + return false; + + case "JSXAttribute": + return parent.name !== node; + + case "ClassProperty": + if (parent.key === node) { + return parent.computed; + } else { + return parent.value === node; + } + + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "ImportSpecifier": + return false; + + case "ClassDeclaration": + case "ClassExpression": + return parent.id !== node; + + case "ClassMethod": + case "ObjectMethod": + return parent.key === node && parent.computed; + + case "LabeledStatement": + return false; + + case "CatchClause": + return parent.param !== node; + + case "RestElement": + return false; + + case "AssignmentExpression": + return parent.right === node; + + case "AssignmentPattern": + return parent.right === node; + + case "ObjectPattern": + case "ArrayPattern": + return false; + } + + return true; +} + +function isValidIdentifier(name) { + if (typeof name !== "string" || _esutils2.default.keyword.isReservedWordES6(name, true)) { + return false; + } else if (name === "await") { + return false; + } else { + return _esutils2.default.keyword.isIdentifierNameES6(name); + } +} + +function isLet(node) { + return t.isVariableDeclaration(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]); +} + +function isBlockScoped(node) { + return t.isFunctionDeclaration(node) || t.isClassDeclaration(node) || t.isLet(node); +} + +function isVar(node) { + return t.isVariableDeclaration(node, { + kind: "var" + }) && !node[_constants.BLOCK_SCOPED_SYMBOL]; +} + +function isSpecifierDefault(specifier) { + return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported || specifier.exported, { + name: "default" + }); +} + +function isScope(node, parent) { + if (t.isBlockStatement(node) && t.isFunction(parent, { + body: node + })) { + return false; + } + + return t.isScopable(node); +} + +function isImmutable(node) { + if (t.isType(node.type, "Immutable")) return true; + + if (t.isIdentifier(node)) { + if (node.name === "undefined") { + return true; + } else { + return false; + } + } + + return false; +} + +function isNodesEquivalent(a, b) { + if ((typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || (typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || a == null || b == null) { + return a === b; + } + + if (a.type !== b.type) { + return false; + } + + var fields = (0, _keys2.default)(t.NODE_FIELDS[a.type] || a.type); + + for (var _iterator2 = fields, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var field = _ref2; + + if ((0, _typeof3.default)(a[field]) !== (0, _typeof3.default)(b[field])) { + return false; + } + + if (Array.isArray(a[field])) { + if (!Array.isArray(b[field])) { + return false; + } + + if (a[field].length !== b[field].length) { + return false; + } + + for (var i = 0; i < a[field].length; i++) { + if (!isNodesEquivalent(a[field][i], b[field][i])) { + return false; + } + } + + continue; + } + + if (!isNodesEquivalent(a[field], b[field])) { + return false; + } + } + + return true; +} + +/***/ }), + +/***/ "./node_modules/babel-types/node_modules/to-fast-properties/index.js": +/*!***************************************************************************!*\ + !*** ./node_modules/babel-types/node_modules/to-fast-properties/index.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function toFastproperties(o) { + function Sub() {} + + Sub.prototype = o; + var receiver = new Sub(); // create an instance + + function ic() { + return typeof receiver.foo; + } // perform access + + + ic(); + ic(); + return o; + eval("o" + o); // ensure no dead code elimination +}; + +/***/ }), + +/***/ "./node_modules/babylon/lib/index.js": +/*!*******************************************!*\ + !*** ./node_modules/babylon/lib/index.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, '__esModule', { + value: true +}); +/* eslint max-len: 0 */ +// This is a trick taken from Esprima. It turns out that, on +// non-Chrome browsers, to check whether a string is in a set, a +// predicate containing a big ugly `switch` statement is faster than +// a regular expression, and on Chrome the two are about on par. +// This function uses `eval` (non-lexical) to produce such a +// predicate from a space-separated string of words. +// +// It starts by sorting the words by length. + +function makePredicate(words) { + words = words.split(" "); + return function (str) { + return words.indexOf(str) >= 0; + }; +} // Reserved word lists for various dialects of the language + + +var reservedWords = { + 6: makePredicate("enum await"), + strict: makePredicate("implements interface let package private protected public static yield"), + strictBind: makePredicate("eval arguments") +}; // And the keywords + +var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super"); // ## Character categories +// Big ugly regular expressions that match characters in the +// whitespace, identifier, and identifier-start categories. These +// are only applied when a character is found to actually have a +// code point above 128. +// Generated by `bin/generate-identifier-regex.js`. + +var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\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\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\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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"; +var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\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\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\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-\u0C03\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\u0D01-\u0D03\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-\u0EB9\u0EBB\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\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\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\uA900-\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"; +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; // These are a run-length and offset encoded representation of the +// >0xffff code points that are a valid part of identifiers. The +// offset starts at 0x10000, and each pair of numbers represents an +// offset to the next range, and then a size of the range. They were +// generated by `bin/generate-identifier-regex.js`. +// eslint-disable-next-line comma-spacing + +var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 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, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 785, 52, 76, 44, 33, 24, 27, 35, 42, 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, 54, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 86, 25, 391, 63, 32, 0, 449, 56, 264, 8, 2, 36, 18, 0, 50, 29, 881, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 65, 0, 32, 6124, 20, 754, 9486, 1, 3071, 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, 4149, 196, 60, 67, 1213, 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, 42710, 42, 4148, 12, 221, 3, 5761, 10591, 541]; // eslint-disable-next-line comma-spacing + +var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 10, 2, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 87, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 423, 9, 838, 7, 2, 7, 17, 9, 57, 21, 2, 13, 19882, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 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, 2214, 6, 110, 6, 6, 9, 792487, 239]; // This has a complexity linear to the value of the code. The +// assumption is that looking up astral identifier characters is +// rare. + +function isInAstralSet(code, set) { + var pos = 0x10000; + + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } +} // Test whether a given character code starts an identifier. + + +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123) return true; + if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + return isInAstralSet(code, astralIdentifierStartCodes); +} // Test whether a given character is part of an identifier. + + +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123) return true; + if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} // A second optional argument can be given to further configure + + +var defaultOptions = { + // Source type ("script" or "module") for different semantics + sourceType: "script", + // Source filename. + sourceFilename: undefined, + // Line from which to start counting source. Useful for + // integration with other tools. + startLine: 1, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // TODO + allowSuperOutsideMethod: false, + // An array of plugins to enable + plugins: [], + // TODO + strictMode: null +}; // Interpret and default an options object + +function getOptions(opts) { + var options = {}; + + for (var key in defaultOptions) { + options[key] = opts && key in opts ? opts[key] : defaultOptions[key]; + } + + return options; +} + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; + +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +}; + +var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; // ## Token types +// The assignment of fine-grained, information-carrying type objects +// allows the tokenizer to store the information it has about a +// token in a way that is very cheap for the parser to look up. +// All token type variables start with an underscore, to make them +// easy to recognize. +// The `beforeExpr` property is used to disambiguate between regular +// expressions and divisions. It is set on all token types that can +// be followed by an expression (thus, a slash after them would be a +// regular expression). +// +// `isLoop` marks a keyword as starting a loop, which is important +// to know when parsing a label, in order to allow or disallow +// continue jumps to that label. + + +var beforeExpr = true; +var startsExpr = true; +var isLoop = true; +var isAssign = true; +var prefix = true; +var postfix = true; + +var TokenType = function TokenType(label) { + var conf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + classCallCheck(this, TokenType); + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.rightAssociative = !!conf.rightAssociative; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; +}; + +var KeywordTokenType = function (_TokenType) { + inherits(KeywordTokenType, _TokenType); + + function KeywordTokenType(name) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + classCallCheck(this, KeywordTokenType); + options.keyword = name; + return possibleConstructorReturn(this, _TokenType.call(this, name, options)); + } + + return KeywordTokenType; +}(TokenType); + +var BinopTokenType = function (_TokenType2) { + inherits(BinopTokenType, _TokenType2); + + function BinopTokenType(name, prec) { + classCallCheck(this, BinopTokenType); + return possibleConstructorReturn(this, _TokenType2.call(this, name, { + beforeExpr: beforeExpr, + binop: prec + })); + } + + return BinopTokenType; +}(TokenType); + +var types = { + num: new TokenType("num", { + startsExpr: startsExpr + }), + regexp: new TokenType("regexp", { + startsExpr: startsExpr + }), + string: new TokenType("string", { + startsExpr: startsExpr + }), + name: new TokenType("name", { + startsExpr: startsExpr + }), + eof: new TokenType("eof"), + // Punctuation token types. + bracketL: new TokenType("[", { + beforeExpr: beforeExpr, + startsExpr: startsExpr + }), + bracketR: new TokenType("]"), + braceL: new TokenType("{", { + beforeExpr: beforeExpr, + startsExpr: startsExpr + }), + braceBarL: new TokenType("{|", { + beforeExpr: beforeExpr, + startsExpr: startsExpr + }), + braceR: new TokenType("}"), + braceBarR: new TokenType("|}"), + parenL: new TokenType("(", { + beforeExpr: beforeExpr, + startsExpr: startsExpr + }), + parenR: new TokenType(")"), + comma: new TokenType(",", { + beforeExpr: beforeExpr + }), + semi: new TokenType(";", { + beforeExpr: beforeExpr + }), + colon: new TokenType(":", { + beforeExpr: beforeExpr + }), + doubleColon: new TokenType("::", { + beforeExpr: beforeExpr + }), + dot: new TokenType("."), + question: new TokenType("?", { + beforeExpr: beforeExpr + }), + arrow: new TokenType("=>", { + beforeExpr: beforeExpr + }), + template: new TokenType("template"), + ellipsis: new TokenType("...", { + beforeExpr: beforeExpr + }), + backQuote: new TokenType("`", { + startsExpr: startsExpr + }), + dollarBraceL: new TokenType("${", { + beforeExpr: beforeExpr, + startsExpr: startsExpr + }), + at: new TokenType("@"), + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + eq: new TokenType("=", { + beforeExpr: beforeExpr, + isAssign: isAssign + }), + assign: new TokenType("_=", { + beforeExpr: beforeExpr, + isAssign: isAssign + }), + incDec: new TokenType("++/--", { + prefix: prefix, + postfix: postfix, + startsExpr: startsExpr + }), + prefix: new TokenType("prefix", { + beforeExpr: beforeExpr, + prefix: prefix, + startsExpr: startsExpr + }), + logicalOR: new BinopTokenType("||", 1), + logicalAND: new BinopTokenType("&&", 2), + bitwiseOR: new BinopTokenType("|", 3), + bitwiseXOR: new BinopTokenType("^", 4), + bitwiseAND: new BinopTokenType("&", 5), + equality: new BinopTokenType("==/!=", 6), + relational: new BinopTokenType("", 7), + bitShift: new BinopTokenType("<>", 8), + plusMin: new TokenType("+/-", { + beforeExpr: beforeExpr, + binop: 9, + prefix: prefix, + startsExpr: startsExpr + }), + modulo: new BinopTokenType("%", 10), + star: new BinopTokenType("*", 10), + slash: new BinopTokenType("/", 10), + exponent: new TokenType("**", { + beforeExpr: beforeExpr, + binop: 11, + rightAssociative: true + }) +}; +var keywords = { + "break": new KeywordTokenType("break"), + "case": new KeywordTokenType("case", { + beforeExpr: beforeExpr + }), + "catch": new KeywordTokenType("catch"), + "continue": new KeywordTokenType("continue"), + "debugger": new KeywordTokenType("debugger"), + "default": new KeywordTokenType("default", { + beforeExpr: beforeExpr + }), + "do": new KeywordTokenType("do", { + isLoop: isLoop, + beforeExpr: beforeExpr + }), + "else": new KeywordTokenType("else", { + beforeExpr: beforeExpr + }), + "finally": new KeywordTokenType("finally"), + "for": new KeywordTokenType("for", { + isLoop: isLoop + }), + "function": new KeywordTokenType("function", { + startsExpr: startsExpr + }), + "if": new KeywordTokenType("if"), + "return": new KeywordTokenType("return", { + beforeExpr: beforeExpr + }), + "switch": new KeywordTokenType("switch"), + "throw": new KeywordTokenType("throw", { + beforeExpr: beforeExpr + }), + "try": new KeywordTokenType("try"), + "var": new KeywordTokenType("var"), + "let": new KeywordTokenType("let"), + "const": new KeywordTokenType("const"), + "while": new KeywordTokenType("while", { + isLoop: isLoop + }), + "with": new KeywordTokenType("with"), + "new": new KeywordTokenType("new", { + beforeExpr: beforeExpr, + startsExpr: startsExpr + }), + "this": new KeywordTokenType("this", { + startsExpr: startsExpr + }), + "super": new KeywordTokenType("super", { + startsExpr: startsExpr + }), + "class": new KeywordTokenType("class"), + "extends": new KeywordTokenType("extends", { + beforeExpr: beforeExpr + }), + "export": new KeywordTokenType("export"), + "import": new KeywordTokenType("import", { + startsExpr: startsExpr + }), + "yield": new KeywordTokenType("yield", { + beforeExpr: beforeExpr, + startsExpr: startsExpr + }), + "null": new KeywordTokenType("null", { + startsExpr: startsExpr + }), + "true": new KeywordTokenType("true", { + startsExpr: startsExpr + }), + "false": new KeywordTokenType("false", { + startsExpr: startsExpr + }), + "in": new KeywordTokenType("in", { + beforeExpr: beforeExpr, + binop: 7 + }), + "instanceof": new KeywordTokenType("instanceof", { + beforeExpr: beforeExpr, + binop: 7 + }), + "typeof": new KeywordTokenType("typeof", { + beforeExpr: beforeExpr, + prefix: prefix, + startsExpr: startsExpr + }), + "void": new KeywordTokenType("void", { + beforeExpr: beforeExpr, + prefix: prefix, + startsExpr: startsExpr + }), + "delete": new KeywordTokenType("delete", { + beforeExpr: beforeExpr, + prefix: prefix, + startsExpr: startsExpr + }) +}; // Map keyword names to token types. + +Object.keys(keywords).forEach(function (name) { + types["_" + name] = keywords[name]; +}); // Matches a whole line break (where CRLF is considered a single +// line break). Used to count lines. + +var lineBreak = /\r\n?|\n|\u2028|\u2029/; +var lineBreakG = new RegExp(lineBreak.source, "g"); + +function isNewLine(code) { + return code === 10 || code === 13 || code === 0x2028 || code === 0x2029; +} + +var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; // The algorithm used to determine whether a regexp can appear at a +// given point in the program is loosely based on sweet.js' approach. +// See https://github.com/mozilla/sweet.js/wiki/design + +var TokContext = function TokContext(token, isExpr, preserveSpace, override) { + classCallCheck(this, TokContext); + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; +}; + +var types$1 = { + braceStatement: new TokContext("{", false), + braceExpression: new TokContext("{", true), + templateQuasi: new TokContext("${", true), + parenStatement: new TokContext("(", false), + parenExpression: new TokContext("(", true), + template: new TokContext("`", true, true, function (p) { + return p.readTmplToken(); + }), + functionExpression: new TokContext("function", true) +}; // Token-specific context update code + +types.parenR.updateContext = types.braceR.updateContext = function () { + if (this.state.context.length === 1) { + this.state.exprAllowed = true; + return; + } + + var out = this.state.context.pop(); + + if (out === types$1.braceStatement && this.curContext() === types$1.functionExpression) { + this.state.context.pop(); + this.state.exprAllowed = false; + } else if (out === types$1.templateQuasi) { + this.state.exprAllowed = true; + } else { + this.state.exprAllowed = !out.isExpr; + } +}; + +types.name.updateContext = function (prevType) { + this.state.exprAllowed = false; + + if (prevType === types._let || prevType === types._const || prevType === types._var) { + if (lineBreak.test(this.input.slice(this.state.end))) { + this.state.exprAllowed = true; + } + } +}; + +types.braceL.updateContext = function (prevType) { + this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression); + this.state.exprAllowed = true; +}; + +types.dollarBraceL.updateContext = function () { + this.state.context.push(types$1.templateQuasi); + this.state.exprAllowed = true; +}; + +types.parenL.updateContext = function (prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression); + this.state.exprAllowed = true; +}; + +types.incDec.updateContext = function () {// tokExprAllowed stays unchanged +}; + +types._function.updateContext = function () { + if (this.curContext() !== types$1.braceStatement) { + this.state.context.push(types$1.functionExpression); + } + + this.state.exprAllowed = false; +}; + +types.backQuote.updateContext = function () { + if (this.curContext() === types$1.template) { + this.state.context.pop(); + } else { + this.state.context.push(types$1.template); + } + + this.state.exprAllowed = false; +}; // These are used when `options.locations` is on, for the +// `startLoc` and `endLoc` properties. + + +var Position = function Position(line, col) { + classCallCheck(this, Position); + this.line = line; + this.column = col; +}; + +var SourceLocation = function SourceLocation(start, end) { + classCallCheck(this, SourceLocation); + this.start = start; + this.end = end; +}; // The `getLineInfo` function is mostly useful when the +// `locations` option is off (for performance reasons) and you +// want to find the line/column position for a given character +// offset. `input` should be the code string that the offset refers +// into. + + +function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); + + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur); + } + } +} + +var State = function () { + function State() { + classCallCheck(this, State); + } + + State.prototype.init = function init(options, input) { + this.strict = options.strictMode === false ? false : options.sourceType === "module"; + this.input = input; + this.potentialArrowAt = -1; + this.inMethod = this.inFunction = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.inClassProperty = this.noAnonFunctionType = false; + this.labels = []; + this.decorators = []; + this.tokens = []; + this.comments = []; + this.trailingComments = []; + this.leadingComments = []; + this.commentStack = []; + this.pos = this.lineStart = 0; + this.curLine = options.startLine; + this.type = types.eof; + this.value = null; + this.start = this.end = this.pos; + this.startLoc = this.endLoc = this.curPosition(); + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + this.context = [types$1.braceStatement]; + this.exprAllowed = true; + this.containsEsc = this.containsOctal = false; + this.octalPosition = null; + this.invalidTemplateEscapePosition = null; + this.exportedIdentifiers = []; + return this; + }; // TODO + // TODO + // Used to signify the start of a potential arrow function + // Flags to track whether we are in a function, a generator. + // Labels in scope. + // Leading decorators. + // Token store. + // Comment store. + // Comment attachment store + // The current position of the tokenizer in the input. + // Properties of the current token: + // Its type + // For tokens that include more information than their type, the value + // Its start and end offset + // And, if locations are used, the {line, column} object + // corresponding to those offsets + // Position information for the previous token + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + // TODO + // Names of exports store. `default` is stored as a name for both + // `export default foo;` and `export { foo as default };`. + + + State.prototype.curPosition = function curPosition() { + return new Position(this.curLine, this.pos - this.lineStart); + }; + + State.prototype.clone = function clone(skipArrays) { + var state = new State(); + + for (var key in this) { + var val = this[key]; + + if ((!skipArrays || key === "context") && Array.isArray(val)) { + val = val.slice(); + } + + state[key] = val; + } + + return state; + }; + + return State; +}(); // Object type used to represent tokens. Note that normally, tokens +// simply exist as properties on the parser object. This is only +// used for the onToken callback and the external tokenizer. + + +var Token = function Token(state) { + classCallCheck(this, Token); + this.type = state.type; + this.value = state.value; + this.start = state.start; + this.end = state.end; + this.loc = new SourceLocation(state.startLoc, state.endLoc); +}; // ## Tokenizer + + +function codePointToString(code) { + // UTF-16 Decoding + if (code <= 0xFFFF) { + return String.fromCharCode(code); + } else { + return String.fromCharCode((code - 0x10000 >> 10) + 0xD800, (code - 0x10000 & 1023) + 0xDC00); + } +} + +var Tokenizer = function () { + function Tokenizer(options, input) { + classCallCheck(this, Tokenizer); + this.state = new State(); + this.state.init(options, input); + } // Move to the next token + + + Tokenizer.prototype.next = function next() { + if (!this.isLookahead) { + this.state.tokens.push(new Token(this.state)); + } + + this.state.lastTokEnd = this.state.end; + this.state.lastTokStart = this.state.start; + this.state.lastTokEndLoc = this.state.endLoc; + this.state.lastTokStartLoc = this.state.startLoc; + this.nextToken(); + }; // TODO + + + Tokenizer.prototype.eat = function eat(type) { + if (this.match(type)) { + this.next(); + return true; + } else { + return false; + } + }; // TODO + + + Tokenizer.prototype.match = function match(type) { + return this.state.type === type; + }; // TODO + + + Tokenizer.prototype.isKeyword = function isKeyword$$1(word) { + return isKeyword(word); + }; // TODO + + + Tokenizer.prototype.lookahead = function lookahead() { + var old = this.state; + this.state = old.clone(true); + this.isLookahead = true; + this.next(); + this.isLookahead = false; + var curr = this.state.clone(true); + this.state = old; + return curr; + }; // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). + + + Tokenizer.prototype.setStrict = function setStrict(strict) { + this.state.strict = strict; + if (!this.match(types.num) && !this.match(types.string)) return; + this.state.pos = this.state.start; + + while (this.state.pos < this.state.lineStart) { + this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1; + --this.state.curLine; + } + + this.nextToken(); + }; + + Tokenizer.prototype.curContext = function curContext() { + return this.state.context[this.state.context.length - 1]; + }; // Read a single token, updating the parser object's token-related + // properties. + + + Tokenizer.prototype.nextToken = function nextToken() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) this.skipSpace(); + this.state.containsOctal = false; + this.state.octalPosition = null; + this.state.start = this.state.pos; + this.state.startLoc = this.state.curPosition(); + if (this.state.pos >= this.input.length) return this.finishToken(types.eof); + + if (curContext.override) { + return curContext.override(this); + } else { + return this.readToken(this.fullCharCodeAtPos()); + } + }; + + Tokenizer.prototype.readToken = function readToken(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code) || code === 92 + /* '\' */ + ) { + return this.readWord(); + } else { + return this.getTokenFromCode(code); + } + }; + + Tokenizer.prototype.fullCharCodeAtPos = function fullCharCodeAtPos() { + var code = this.input.charCodeAt(this.state.pos); + if (code <= 0xd7ff || code >= 0xe000) return code; + var next = this.input.charCodeAt(this.state.pos + 1); + return (code << 10) + next - 0x35fdc00; + }; + + Tokenizer.prototype.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "CommentBlock" : "CommentLine", + value: text, + start: start, + end: end, + loc: new SourceLocation(startLoc, endLoc) + }; + + if (!this.isLookahead) { + this.state.tokens.push(comment); + this.state.comments.push(comment); + this.addComment(comment); + } + }; + + Tokenizer.prototype.skipBlockComment = function skipBlockComment() { + var startLoc = this.state.curPosition(); + var start = this.state.pos; + var end = this.input.indexOf("*/", this.state.pos += 2); + if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); + this.state.pos = end + 2; + lineBreakG.lastIndex = start; + var match = void 0; + + while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) { + ++this.state.curLine; + this.state.lineStart = match.index + match[0].length; + } + + this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); + }; + + Tokenizer.prototype.skipLineComment = function skipLineComment(startSkip) { + var start = this.state.pos; + var startLoc = this.state.curPosition(); + var ch = this.input.charCodeAt(this.state.pos += startSkip); + + while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { + ++this.state.pos; + ch = this.input.charCodeAt(this.state.pos); + } + + this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition()); + }; // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. + + + Tokenizer.prototype.skipSpace = function skipSpace() { + loop: while (this.state.pos < this.input.length) { + var ch = this.input.charCodeAt(this.state.pos); + + switch (ch) { + case 32: + case 160: + // ' ' + ++this.state.pos; + break; + + case 13: + if (this.input.charCodeAt(this.state.pos + 1) === 10) { + ++this.state.pos; + } + + case 10: + case 8232: + case 8233: + ++this.state.pos; + ++this.state.curLine; + this.state.lineStart = this.state.pos; + break; + + case 47: + // '/' + switch (this.input.charCodeAt(this.state.pos + 1)) { + case 42: + // '*' + this.skipBlockComment(); + break; + + case 47: + this.skipLineComment(2); + break; + + default: + break loop; + } + + break; + + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.state.pos; + } else { + break loop; + } + + } + } + }; // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. + + + Tokenizer.prototype.finishToken = function finishToken(type, val) { + this.state.end = this.state.pos; + this.state.endLoc = this.state.curPosition(); + var prevType = this.state.type; + this.state.type = type; + this.state.value = val; + this.updateContext(prevType); + }; // ### Token reading + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + + + Tokenizer.prototype.readToken_dot = function readToken_dot() { + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next >= 48 && next <= 57) { + return this.readNumber(true); + } + + var next2 = this.input.charCodeAt(this.state.pos + 2); + + if (next === 46 && next2 === 46) { + // 46 = dot '.' + this.state.pos += 3; + return this.finishToken(types.ellipsis); + } else { + ++this.state.pos; + return this.finishToken(types.dot); + } + }; + + Tokenizer.prototype.readToken_slash = function readToken_slash() { + // '/' + if (this.state.exprAllowed) { + ++this.state.pos; + return this.readRegexp(); + } + + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 61) { + return this.finishOp(types.assign, 2); + } else { + return this.finishOp(types.slash, 1); + } + }; + + Tokenizer.prototype.readToken_mult_modulo = function readToken_mult_modulo(code) { + // '%*' + var type = code === 42 ? types.star : types.modulo; + var width = 1; + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 42) { + // '*' + width++; + next = this.input.charCodeAt(this.state.pos + 2); + type = types.exponent; + } + + if (next === 61) { + width++; + type = types.assign; + } + + return this.finishOp(type, width); + }; + + Tokenizer.prototype.readToken_pipe_amp = function readToken_pipe_amp(code) { + // '|&' + var next = this.input.charCodeAt(this.state.pos + 1); + if (next === code) return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2); + if (next === 61) return this.finishOp(types.assign, 2); + if (code === 124 && next === 125 && this.hasPlugin("flow")) return this.finishOp(types.braceBarR, 2); + return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1); + }; + + Tokenizer.prototype.readToken_caret = function readToken_caret() { + // '^' + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 61) { + return this.finishOp(types.assign, 2); + } else { + return this.finishOp(types.bitwiseXOR, 1); + } + }; + + Tokenizer.prototype.readToken_plus_min = function readToken_plus_min(code) { + // '+-' + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === code) { + if (next === 45 && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + + return this.finishOp(types.incDec, 2); + } + + if (next === 61) { + return this.finishOp(types.assign, 2); + } else { + return this.finishOp(types.plusMin, 1); + } + }; + + Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) { + // '<>' + var next = this.input.charCodeAt(this.state.pos + 1); + var size = 1; + + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(types.assign, size + 1); + return this.finishOp(types.bitShift, size); + } + + if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { + if (this.inModule) this.unexpected(); // ` regexps + + set = set.map(function (s, si, set) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set); // filter out everything that didn't compile properly. + + set = set.filter(function (s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set); + this.set = set; +} + +Minimatch.prototype.parseNegate = parseNegate; + +function parseNegate() { + var pattern = this.pattern; + var negate = false; + var options = this.options; + var negateOffset = 0; + if (options.nonegate) return; + + for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === '!'; i++) { + negate = !negate; + negateOffset++; + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; +} // Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c + + +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options); +}; + +Minimatch.prototype.braceExpand = braceExpand; + +function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + + pattern = typeof pattern === 'undefined' ? this.pattern : pattern; + + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern'); + } + + if (options.nobrace || !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern]; + } + + return expand(pattern); +} // parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. + + +Minimatch.prototype.parse = parse; +var SUBPARSE = {}; + +function parse(pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long'); + } + + var options = this.options; // shortcuts + + if (!options.noglobstar && pattern === '**') return GLOBSTAR; + if (pattern === '') return ''; + var re = ''; + var hasMagic = !!options.nocase; + var escaping = false; // ? => one single character + + var patternListStack = []; + var negativeLists = []; + var stateChar; + var inClass = false; + var reClassStart = -1; + var classStart = -1; // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)'; + var self = this; + + function clearStateChar() { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star; + hasMagic = true; + break; + + case '?': + re += qmark; + hasMagic = true; + break; + + default: + re += '\\' + stateChar; + break; + } + + self.debug('clearStateChar %j %j', stateChar, re); + stateChar = false; + } + } + + for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c); // skip over any that are escaped. + + if (escaping && reSpecials[c]) { + re += '\\' + c; + escaping = false; + continue; + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false; + + case '\\': + clearStateChar(); + escaping = true; + continue; + // the various stateChar values + // for the "extglob" stuff. + + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c); // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + + if (inClass) { + this.debug(' in class'); + if (c === '!' && i === classStart + 1) c = '^'; + re += c; + continue; + } // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + + + self.debug('call clearStateChar %j', stateChar); + clearStateChar(); + stateChar = c; // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + + if (options.noext) clearStateChar(); + continue; + + case '(': + if (inClass) { + re += '('; + continue; + } + + if (!stateChar) { + re += '\\('; + continue; + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }); // negation is (?:(?!js)[^/]*) + + re += stateChar === '!' ? '(?:(?!(?:' : '(?:'; + this.debug('plType %j %j', stateChar, re); + stateChar = false; + continue; + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)'; + continue; + } + + clearStateChar(); + hasMagic = true; + var pl = patternListStack.pop(); // negation is (?:(?!js)[^/]*) + // The others are (?:) + + re += pl.close; + + if (pl.type === '!') { + negativeLists.push(pl); + } + + pl.reEnd = re.length; + continue; + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|'; + escaping = false; + continue; + } + + clearStateChar(); + re += '|'; + continue; + // these are mostly the same in regexp and glob + + case '[': + // swallow any state-tracking char before the [ + clearStateChar(); + + if (inClass) { + re += '\\' + c; + continue; + } + + inClass = true; + classStart = i; + reClassStart = re.length; + re += c; + continue; + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c; + escaping = false; + continue; + } // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + + + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i); + + try { + RegExp('[' + cs + ']'); + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'; + hasMagic = hasMagic || sp[1]; + inClass = false; + continue; + } + } // finish up the class. + + + hasMagic = true; + inClass = false; + re += c; + continue; + + default: + // swallow any state char that wasn't consumed + clearStateChar(); + + if (escaping) { + // no need + escaping = false; + } else if (reSpecials[c] && !(c === '^' && inClass)) { + re += '\\'; + } + + re += c; + } // switch + + } // for + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + + + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + '\\[' + sp[0]; + hasMagic = hasMagic || sp[1]; + } // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + + + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length); + this.debug('setting tail', re, pl); // maybe some even number of \, then maybe 1 \, followed by a | + + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\'; + } // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + + + return $1 + $1 + $2 + '|'; + }); + this.debug('tail=%j\n %s', tail, tail, pl, re); + var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + '\\(' + tail; + } // handle trailing things that only matter at the very end. + + + clearStateChar(); + + if (escaping) { + // trailing \\ + re += '\\\\'; + } // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + + + var addPatternStart = false; + + switch (re.charAt(0)) { + case '.': + case '[': + case '(': + addPatternStart = true; + } // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + + + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n]; + var nlBefore = re.slice(0, nl.reStart); + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); + var nlAfter = re.slice(nl.reEnd); + nlLast += nlAfter; // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + + var openParensBefore = nlBefore.split('(').length - 1; + var cleanAfter = nlAfter; + + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, ''); + } + + nlAfter = cleanAfter; + var dollar = ''; + + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$'; + } + + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; + re = newRe; + } // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + + + if (re !== '' && hasMagic) { + re = '(?=.)' + re; + } + + if (addPatternStart) { + re = patternStart + re; + } // parsing just a piece of a larger pattern. + + + if (isSub === SUBPARSE) { + return [re, hasMagic]; + } // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + + + if (!hasMagic) { + return globUnescape(pattern); + } + + var flags = options.nocase ? 'i' : ''; + + try { + var regExp = new RegExp('^' + re + '$', flags); + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.'); + } + + regExp._glob = pattern; + regExp._src = re; + return regExp; +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); +}; + +Minimatch.prototype.makeRe = makeRe; + +function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + + var set = this.set; + + if (!set.length) { + this.regexp = false; + return this.regexp; + } + + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? 'i' : ''; + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return p === GLOBSTAR ? twoStar : typeof p === 'string' ? regExpEscape(p) : p._src; + }).join('\\\/'); + }).join('|'); // must match entire pattern + // ending in a * or ** will make it less strict. + + re = '^(?:' + re + ')$'; // can match anything, as long as it's not this. + + if (this.negate) re = '^(?!' + re + ').*$'; + + try { + this.regexp = new RegExp(re, flags); + } catch (ex) { + this.regexp = false; + } + + return this.regexp; +} + +minimatch.match = function (list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function (f) { + return mm.match(f); + }); + + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + + return list; +}; + +Minimatch.prototype.match = match; + +function match(f, partial) { + this.debug('match', f, this.pattern); // short-circuit in the case of busted things. + // comments, etc. + + if (this.comment) return false; + if (this.empty) return f === ''; + if (f === '/' && partial) return true; + var options = this.options; // windows: need to use /, not \ + + if (path.sep !== '/') { + f = f.split(path.sep).join('/'); + } // treat the test path as a set of pathparts. + + + f = f.split(slashSplit); + this.debug(this.pattern, 'split', f); // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set; + this.debug(this.pattern, 'set', set); // Find the basename of the path by looking for the last non-empty segment + + var filename; + var i; + + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i]; + var file = f; + + if (options.matchBase && pattern.length === 1) { + file = [filename]; + } + + var hit = this.matchOne(file, pattern, partial); + + if (hit) { + if (options.flipNegate) return true; + return !this.negate; + } + } // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + + + if (options.flipNegate) return false; + return this.negate; +} // set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. + + +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options; + this.debug('matchOne', { + 'this': this, + file: file, + pattern: pattern + }); + this.debug('matchOne', file.length, pattern.length); + + for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug('matchOne loop'); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); // should be impossible. + // some invalid regexp stuff in the set. + + if (p === false) return false; + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]); // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + + var fr = fi; + var pr = pi + 1; + + if (pr === pl) { + this.debug('** at the end'); // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false; + } + + return true; + } // ok, let's see if we can swallow whatever we can. + + + while (fr < fl) { + var swallowee = file[fr]; + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index. + + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee); // found a match. + + return true; + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') { + this.debug('dot detected!', file, fr, pattern, pr); + break; + } // ** swallows a segment, and continue. + + + this.debug('globstar swallow a segment, and continue'); + fr++; + } + } // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + + + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr); + if (fr === fl) return true; + } + + return false; + } // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + + + var hit; + + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase(); + } else { + hit = f === p; + } + + this.debug('string match', p, f, hit); + } else { + hit = f.match(p); + this.debug('pattern match', p, f, hit); + } + + if (!hit) return false; + } // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + // now either we fell off the end of the pattern, or we're done. + + + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true; + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial; + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = fi === fl - 1 && file[fi] === ''; + return emptyFileEnd; + } // should be unreachable. + + + throw new Error('wtf?'); +}; // replace stuff like \* with * + + +function globUnescape(s) { + return s.replace(/\\(.)/g, '$1'); +} + +function regExpEscape(s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +} + +/***/ }), + +/***/ "./node_modules/ms/index.js": +/*!**********************************!*\ + !*** ./node_modules/ms/index.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Helpers. + */ +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + + throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); +}; +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + +function parse(str) { + str = String(str); + + if (str.length > 100) { + return; + } + + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); + + if (!match) { + return; + } + + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + + case 'weeks': + case 'week': + case 'w': + return n * w; + + case 'days': + case 'day': + case 'd': + return n * d; + + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + + default: + return undefined; + } +} +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + + return ms + 'ms'; +} +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + + return ms + ' ms'; +} +/** + * Pluralization helper. + */ + + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} + +/***/ }), + +/***/ "./node_modules/node-libs-browser/mock/empty.js": +/*!******************************************************!*\ + !*** ./node_modules/node-libs-browser/mock/empty.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + + + +/***/ }), + +/***/ "./node_modules/node-libs-browser/node_modules/inherits/inherits_browser.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/node-libs-browser/node_modules/inherits/inherits_browser.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor; + + var TempCtor = function () {}; + + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + }; +} + +/***/ }), + +/***/ "./node_modules/node-libs-browser/node_modules/punycode/punycode.js": +/*!**************************************************************************!*\ + !*** ./node_modules/node-libs-browser/node_modules/punycode/punycode.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ +; + +(function (root) { + /** Detect free variables */ + var freeExports = true && exports && !exports.nodeType && exports; + var freeModule = true && module && !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal) { + root = freeGlobal; + } + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + + + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, + // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, + // 0x80 + delimiter = '-', + // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, + // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, + // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + + function error(type) { + throw new RangeError(errors[type]); + } + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + + + function map(array, fn) { + var length = array.length; + var result = []; + + while (length--) { + result[length] = fn(array[length]); + } + + return result; + } + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + + + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } // Avoid `split(regex)` for IE8 compatibility. See #17. + + + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + + + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + + while (counter < length) { + value = string.charCodeAt(counter++); + + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + + if ((extra & 0xFC00) == 0xDC00) { + // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + + return output; + } + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + + + function ucs2encode(array) { + return map(array, function (value) { + var output = ''; + + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + + output += stringFromCharCode(value); + return output; + }).join(''); + } + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + + + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + + if (codePoint - 65 < 26) { + return codePoint - 65; + } + + if (codePoint - 97 < 26) { + return codePoint - 97; + } + + return base; + } + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + + + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + + + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + + for (; + /* no initialization */ + delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + + + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + + /** Cached calculation results */ + baseMinusT; // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + + output.push(input.charCodeAt(j)); + } // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength;) + /* no final expression */ + { + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base;; + /* no condition */ + k += base) { + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (digit < t) { + break; + } + + baseMinusT = base - t; + + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; // Insert `n` at position `i` of the output + + output.splice(i++, 0, n); + } + + return ucs2encode(output); + } + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + + + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; // Convert the input in UCS-2 to Unicode + + input = ucs2decode(input); // Cache the length + + inputLength = input.length; // Initialize the state + + n = initialN; + delta = 0; + bias = initialBias; // Handle the basic code points + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + // Finish the basic string - if it is not empty - with a delimiter + + if (basicLength) { + output.push(delimiter); + } // Main encoding loop: + + + while (handledCPCount < inputLength) { + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + + + handledCPCountPlusOne = handledCPCount + 1; + + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base;; + /* no condition */ + k += base) { + t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (q < t) { + break; + } + + qMinusT = q - t; + baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + } + + return output.join(''); + } + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + + + function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); + } + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + + + function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); + } + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + + + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.4.1', + + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + + if (true) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return punycode; + }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +})(this); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module), __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/node-libs-browser/node_modules/util/support/isBufferBrowser.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/node-libs-browser/node_modules/util/support/isBufferBrowser.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; +}; + +/***/ }), + +/***/ "./node_modules/node-libs-browser/node_modules/util/util.js": +/*!******************************************************************!*\ + !*** ./node_modules/node-libs-browser/node_modules/util/util.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) { + var keys = Object.keys(obj); + var descriptors = {}; + + for (var i = 0; i < keys.length; i++) { + descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); + } + + return descriptors; +}; + +var formatRegExp = /%[sdj%]/g; + +exports.format = function (f) { + if (!isString(f)) { + var objects = []; + + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function (x) { + if (x === '%%') return '%'; + if (i >= len) return x; + + switch (x) { + case '%s': + return String(args[i++]); + + case '%d': + return Number(args[i++]); + + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + + default: + return x; + } + }); + + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + + return str; +}; // Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. + + +exports.deprecate = function (fn, msg) { + if (typeof process !== 'undefined' && process.noDeprecation === true) { + return fn; + } // Allow for deprecating things in the process of starting up. + + + if (typeof process === 'undefined') { + return function () { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + var warned = false; + + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + + warned = true; + } + + return fn.apply(this, arguments); + } + + return deprecated; +}; + +var debugs = {}; +var debugEnviron; + +exports.debuglog = function (set) { + if (isUndefined(debugEnviron)) debugEnviron = Object({"NODE_ENV":"development","PUBLIC_URL":""}).NODE_DEBUG || ''; + set = set.toUpperCase(); + + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + + debugs[set] = function () { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function () {}; + } + } + + return debugs[set]; +}; +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ + +/* legacy: obj, showHidden, depth, colors*/ + + +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; // legacy... + + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } // set default options + + + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} + +exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics + +inspect.colors = { + 'bold': [1, 22], + 'italic': [3, 23], + 'underline': [4, 24], + 'inverse': [7, 27], + 'white': [37, 39], + 'grey': [90, 39], + 'black': [30, 39], + 'blue': [34, 39], + 'cyan': [36, 39], + 'green': [32, 39], + 'magenta': [35, 39], + 'red': [31, 39], + 'yellow': [33, 39] +}; // Don't use 'blue' not visible on cmd.exe + +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + +function stylizeNoColor(str, styleType) { + return str; +} + +function arrayToHash(array) { + var hash = {}; + array.forEach(function (val, idx) { + hash[val] = true; + }); + return hash; +} + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + + return ret; + } // Primitive types cannot have properties + + + var primitive = formatPrimitive(ctx, value); + + if (primitive) { + return primitive; + } // Look up the keys of the object. + + + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + + + if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } // Some type of object without properties can be shortcutted. + + + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + + if (isError(value)) { + return formatError(value); + } + } + + var base = '', + array = false, + braces = ['{', '}']; // Make Array say that they are Array + + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } // Make functions say that they are functions + + + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } // Make RegExps say that they are RegExps + + + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } // Make dates with properties first say the date + + + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } // Make error with message first say the error + + + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + var output; + + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function (key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + return reduceToSingleString(output, base, braces); +} + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); + + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + + if (isNumber(value)) return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here. + + if (isNull(value)) return ctx.stylize('null', 'null'); +} + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); + } else { + output.push(''); + } + } + + keys.forEach(function (key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); + } + }); + return output; +} + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { + value: value[key] + }; + + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + + name = JSON.stringify('' + key); + + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function (prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} // NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + + +function isArray(ar) { + return Array.isArray(ar); +} + +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} + +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} + +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} + +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} + +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} + +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} + +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} + +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} + +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} + +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); +} + +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} + +exports.isPrimitive = isPrimitive; +exports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ "./node_modules/node-libs-browser/node_modules/util/support/isBufferBrowser.js"); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34 + +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} // log is just a thin wrapper to console.log that prepends a timestamp + + +exports.log = function () { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ + + +exports.inherits = __webpack_require__(/*! inherits */ "./node_modules/node-libs-browser/node_modules/inherits/inherits_browser.js"); + +exports._extend = function (origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + var keys = Object.keys(add); + var i = keys.length; + + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined; + +exports.promisify = function promisify(original) { + if (typeof original !== 'function') throw new TypeError('The "original" argument must be of type Function'); + + if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { + var fn = original[kCustomPromisifiedSymbol]; + + if (typeof fn !== 'function') { + throw new TypeError('The "util.promisify.custom" argument must be of type Function'); + } + + Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, + enumerable: false, + writable: false, + configurable: true + }); + return fn; + } + + function fn() { + var promiseResolve, promiseReject; + var promise = new Promise(function (resolve, reject) { + promiseResolve = resolve; + promiseReject = reject; + }); + var args = []; + + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + + args.push(function (err, value) { + if (err) { + promiseReject(err); + } else { + promiseResolve(value); + } + }); + + try { + original.apply(this, args); + } catch (err) { + promiseReject(err); + } + + return promise; + } + + Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); + if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, + enumerable: false, + writable: false, + configurable: true + }); + return Object.defineProperties(fn, getOwnPropertyDescriptors(original)); +}; + +exports.promisify.custom = kCustomPromisifiedSymbol; + +function callbackifyOnRejected(reason, cb) { + // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). + // Because `null` is a special error value in callbacks which means "no error + // occurred", we error-wrap so the callback consumer can distinguish between + // "the promise rejected with null" or "the promise fulfilled with undefined". + if (!reason) { + var newReason = new Error('Promise was rejected with a falsy value'); + newReason.reason = reason; + reason = newReason; + } + + return cb(reason); +} + +function callbackify(original) { + if (typeof original !== 'function') { + throw new TypeError('The "original" argument must be of type Function'); + } // We DO NOT return the promise as it gives the user a false sense that + // the promise is actually somehow related to the callback's execution + // and that the callback throwing will reject the promise. + + + function callbackified() { + var args = []; + + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + + var maybeCb = args.pop(); + + if (typeof maybeCb !== 'function') { + throw new TypeError('The last argument must be of type Function'); + } + + var self = this; + + var cb = function () { + return maybeCb.apply(self, arguments); + }; // In true node style we process the callback on `nextTick` with all the + // implications (stack, `uncaughtException`, `async_hooks`) + + + original.apply(this, args).then(function (ret) { + process.nextTick(cb, null, ret); + }, function (rej) { + process.nextTick(callbackifyOnRejected, rej, cb); + }); + } + + Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); + Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)); + return callbackified; +} + +exports.callbackify = callbackify; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/number-is-nan/index.js": +/*!*********************************************!*\ + !*** ./node_modules/number-is-nan/index.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = Number.isNaN || function (x) { + return x !== x; +}; + +/***/ }), + +/***/ "./node_modules/object-assign/index.js": +/*!*********************************************!*\ + !*** ./node_modules/object-assign/index.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +/* eslint-disable no-unused-vars */ + +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } // Detect buggy property enumeration order in older V8 versions. + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + + + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + + test1[5] = 'de'; + + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + + + var test2 = {}; + + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + + if (order2.join('') !== '0123456789') { + return false; + } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + + + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + + if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + +/***/ }), + +/***/ "./node_modules/path-browserify/index.js": +/*!***********************************************!*\ + !*** ./node_modules/path-browserify/index.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, +// backported and transplited with Babel, with backwards-compat fixes +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } // if the path is allowed to go above the root, restore leading ..s + + + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} // path.resolve([from ...], to) +// posix version + + +exports.resolve = function () { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = i >= 0 ? arguments[i] : process.cwd(); // Skip empty and invalid entries + + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + // Normalize the path + + + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function (p) { + return !!p; + }), !resolvedAbsolute).join('/'); + return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; +}; // path.normalize(path) +// posix version + + +exports.normalize = function (path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; // Normalize the path + + path = normalizeArray(filter(path.split('/'), function (p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; // posix version + + +exports.isAbsolute = function (path) { + return path.charAt(0) === '/'; +}; // posix version + + +exports.join = function () { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function (p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + + return p; + }).join('/')); +}; // path.relative(from, to) +// posix version + + +exports.relative = function (from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + return outputParts.join('/'); +}; + +exports.sep = '/'; +exports.delimiter = ':'; + +exports.dirname = function (path) { + if (typeof path !== 'string') path = path + ''; + if (path.length === 0) return '.'; + var code = path.charCodeAt(0); + var hasRoot = code === 47 + /*/*/ + ; + var end = -1; + var matchedSlash = true; + + for (var i = path.length - 1; i >= 1; --i) { + code = path.charCodeAt(i); + + if (code === 47 + /*/*/ + ) { + if (!matchedSlash) { + end = i; + break; + } + } else { + // We saw the first non-path separator + matchedSlash = false; + } + } + + if (end === -1) return hasRoot ? '/' : '.'; + + if (hasRoot && end === 1) { + // return '//'; + // Backwards-compat fix: + return '/'; + } + + return path.slice(0, end); +}; + +function basename(path) { + if (typeof path !== 'string') path = path + ''; + var start = 0; + var end = -1; + var matchedSlash = true; + var i; + + for (i = path.length - 1; i >= 0; --i) { + if (path.charCodeAt(i) === 47 + /*/*/ + ) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + start = i + 1; + break; + } + } else if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // path component + matchedSlash = false; + end = i + 1; + } + } + + if (end === -1) return ''; + return path.slice(start, end); +} // Uses a mixed approach for backwards-compatibility, as ext behavior changed +// in new Node.js versions, so only basename() above is backported here + + +exports.basename = function (path, ext) { + var f = basename(path); + + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + + return f; +}; + +exports.extname = function (path) { + if (typeof path !== 'string') path = path + ''; + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + + var preDotState = 0; + + for (var i = path.length - 1; i >= 0; --i) { + var code = path.charCodeAt(i); + + if (code === 47 + /*/*/ + ) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + + continue; + } + + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + + if (code === 46 + /*.*/ + ) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ''; + } + + return path.slice(startDot, end); +}; + +function filter(xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + + return res; +} // String.prototype.substr - negative index don't work in IE8 + + +var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) { + return str.substr(start, len); +} : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); +}; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/path-is-absolute/index.js": +/*!************************************************!*\ + !*** ./node_modules/path-is-absolute/index.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); // UNC paths are always absolute + + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/process/browser.js": +/*!*****************************************!*\ + !*** ./node_modules/process/browser.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} + +function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); +} + +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +})(); + +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } // if setTimeout wasn't available but was latter defined + + + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } +} + +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } // if clearTimeout wasn't available but was latter defined + + + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } +} + +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + + draining = false; + + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + + while (len) { + currentQueue = queue; + queue = []; + + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + + queueIndex = -1; + len = queue.length; + } + + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + + queue.push(new Item(fun, args)); + + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; // v8 likes predictible objects + + +function Item(fun, array) { + this.fun = fun; + this.array = array; +} + +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues + +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { + return []; +}; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { + return '/'; +}; + +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +process.umask = function () { + return 0; +}; + +/***/ }), + +/***/ "./node_modules/prop-types/checkPropTypes.js": +/*!***************************************************!*\ + !*** ./node_modules/prop-types/checkPropTypes.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + +var printWarning = function () {}; + +if (true) { + var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); + + var loggedTypeFailures = {}; + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + printWarning = function (text) { + var message = 'Warning: ' + text; + + if (typeof console !== 'undefined') { + console.error(message); + } + + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ + + +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + + if (error && !(error instanceof Error)) { + printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).'); + } + + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + var stack = getStack ? getStack() : ''; + printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')); + } + } + } + } +} +/** + * Resets warning cache when testing. + * + * @private + */ + + +checkPropTypes.resetWarningCache = function () { + if (true) { + loggedTypeFailures = {}; + } +}; + +module.exports = checkPropTypes; + +/***/ }), + +/***/ "./node_modules/prop-types/factoryWithTypeCheckers.js": +/*!************************************************************!*\ + !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + +var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); + +var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); + +var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); + +var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); + +var has = Function.call.bind(Object.prototype.hasOwnProperty); + +var printWarning = function () {}; + +if (true) { + printWarning = function (text) { + var message = 'Warning: ' + text; + + if (typeof console !== 'undefined') { + console.error(message); + } + + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} + +function emptyFunctionThatReturnsNull() { + return null; +} + +module.exports = function (isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + + var ANONYMOUS = '<>'; // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker + }; + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + + /*eslint-disable no-self-compare*/ + + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + + + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } // Make `instanceof Error` still work for returned errors. + + + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types'); + err.name = 'Invariant Violation'; + throw err; + } else if ( true && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + + if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3) { + printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + + return null; + } + + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + + var propValue = props[propName]; + + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + + if (error instanceof Error) { + return error; + } + } + + return null; + } + + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + + return null; + } + + return createChainableTypeChecker(validate); + } + + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); + } + + return null; + } + + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + + return null; + } + + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (true) { + if (arguments.length > 1) { + printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'); + } else { + printWarning('Invalid argument supplied to oneOf, expected an array.'); + } + } + + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + + if (type === 'symbol') { + return String(value); + } + + return value; + }); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + + var propValue = props[propName]; + var propType = getPropType(propValue); + + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + + if (error instanceof Error) { + return error; + } + } + } + + return null; + } + + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined; + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + + if (typeof checker !== 'function') { + printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + + return null; + } + + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + + if (!checker) { + continue; + } + + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + + if (error) { + return error; + } + } + + return null; + } + + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } // We need to check all keys in case some are required but missing from + // props. + + + var allKeys = assign({}, props[propName], shapeTypes); + + for (var key in allKeys) { + var checker = shapeTypes[key]; + + if (!checker) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')); + } + + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + + if (error) { + return error; + } + } + + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + + case 'boolean': + return !propValue; + + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } // falsy value can't be a Symbol + + + if (!propValue) { + return false; + } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + + + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } // Fallback for non-spec compliant Symbols which are polyfilled. + + + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } // Equivalent of `typeof` but with special handling for array and regexp. + + + function getPropType(propValue) { + var propType = typeof propValue; + + if (Array.isArray(propValue)) { + return 'array'; + } + + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + + return propType; + } // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + + + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + + var propType = getPropType(propValue); + + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + + return propType; + } // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + + + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + + default: + return type; + } + } // Returns class name of the object, if any. + + + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + return ReactPropTypes; +}; + +/***/ }), + +/***/ "./node_modules/prop-types/index.js": +/*!******************************************!*\ + !*** ./node_modules/prop-types/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +if (true) { + var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + + + var throwOnDirectAccess = true; + module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); +} else {} + +/***/ }), + +/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": +/*!*************************************************************!*\ + !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; +module.exports = ReactPropTypesSecret; + +/***/ }), + +/***/ "./node_modules/pyret-codemirror-mode/css/pyret.css": +/*!**********************************************************!*\ + !*** ./node_modules/pyret-codemirror-mode/css/pyret.css ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var content = __webpack_require__(/*! !../../css-loader/dist/cjs.js??ref--6-oneOf-3-1!../../postcss-loader/src??postcss!./pyret.css */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/pyret-codemirror-mode/css/pyret.css"); + +if (typeof content === 'string') { + content = [[module.i, content, '']]; +} + +var options = {} + +options.insert = "head"; +options.singleton = false; + +var update = __webpack_require__(/*! ../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js")(content, options); + +if (content.locals) { + module.exports = content.locals; +} + +if (true) { + if (!content.locals) { + module.hot.accept( + /*! !../../css-loader/dist/cjs.js??ref--6-oneOf-3-1!../../postcss-loader/src??postcss!./pyret.css */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/pyret-codemirror-mode/css/pyret.css", + function () { + var newContent = __webpack_require__(/*! !../../css-loader/dist/cjs.js??ref--6-oneOf-3-1!../../postcss-loader/src??postcss!./pyret.css */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/pyret-codemirror-mode/css/pyret.css"); + + if (typeof newContent === 'string') { + newContent = [[module.i, newContent, '']]; + } + + update(newContent); + } + ) + } + + module.hot.dispose(function() { + update(); + }); +} + +/***/ }), + +/***/ "./node_modules/pyret-codemirror-mode/mode/pyret.js": +/*!**********************************************************!*\ + !*** ./node_modules/pyret-codemirror-mode/mode/pyret.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +CodeMirror.defineMode("pyret", function (config, parserConfig) { + var ERRORCLASS = 'error'; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))(?![a-zA-Z0-9-_])"); + } + + function toToken(type) { + return function (tstr) { + return { + type: type, + string: tstr + }; + }; + } + + const pyret_indent_regex = new RegExp("^[a-zA-Z_][a-zA-Z0-9$_\\-]*"); + const pyret_closing_keywords = ["end"]; + const pyret_closing_builtins = []; + const pyret_closing_tokens = pyret_closing_keywords.map(toToken("keyword")).concat(pyret_closing_builtins.map(toToken("builtin"))); + const pyret_opening_keywords_colon = ["reactor", "try", "ref-graph", "block", "table", "load-table"]; + const pyret_opening_keywords_nocolon = ["fun", "when", "for", "if", "let", "type-let", "ask", "spy", "cases", "data", "shared", "check", "except", "letrec", "lam", "method", "examples", "do", "select", "extend", "transform", "extract", "sieve", "order", "provide"]; + const pyret_opening_keywords = pyret_opening_keywords_colon.concat(pyret_opening_keywords_nocolon); + const pyret_opening_tokens = pyret_opening_keywords.map(toToken("keyword")); + const pyret_openers_closed_by_end = { + "FUN": true, + "WHEN": true, + "DO": true, + "FOR": true, + "IF": true, + "BLOCK": true, + "LET": true, + "TABLE": true, + "LOADTABLE": true, + "SELECT": true, + "EXTEND": true, + "SIEVE": true, + "TRANSFORM": true, + "EXTRACT": true, + "ORDER": true, + "REACTOR": true, + "SPY": true + }; + const pyret_keywords = wordRegexp(["else if"].concat(pyret_opening_keywords_nocolon, pyret_closing_keywords, ["spy", "var", "rec", "import", "include", "type", "newtype", "from", "lazy", "shadow", "ref", "of", "and", "or", "as", "else", "cases", "is==", "is=~", "is<=>", "is", "satisfies", "raises", "violates", "by", "ascending", "descending", "sanitize", "using", "because"])); + const pyret_booleans = wordRegexp(["true", "false"]); + const pyret_keywords_hyphen = wordRegexp(["provide-types", "type-let", "does-not-raise", "raises-violates", "raises-satisfies", "raises-other-than", "is-roughly", "is-not==", "is-not=~", "is-not<=>", "is-not"]); + const pyret_keywords_colon = wordRegexp(pyret_opening_keywords_colon.concat(["doc", "otherwise", "then", "with", "sharing", "where", "do", "row", "source"])); + const pyret_single_punctuation = new RegExp("^([" + [":", ".", "<", ">", ",", "^", "!", ";", "|", "=", "+", "*", "/", "\\\\", // NOTE: No minus + "(", ")", "{", "}", "\\[", "\\]"].join('') + "])"); + const pyret_double_punctuation = new RegExp("^((" + ["<=>", "::", "=~", "==", ">=", "<=", "=>", "->", ":=", "<>"].join(")|(") + "))"); + const initial_operators = { + "-": true, + "+": true, + "*": true, + "/": true, + "<": true, + "<=": true, + ">": true, + ">=": true, + "==": true, + "<>": true, + ".": true, + "^": true, + "<=>": true, + "=~": true, + "is": true, + "is==": true, + "is=~": true, + "is<=>": true, + "because": true, + "is-roughly": true, + "is-not": true, + "is-not==": true, + "is-not=~": true, + "is-not<=>": true, + "satisfies": true, + "violates": true, + "raises": true, + "raises-other-than": true, + "does-not-raise": true, + "raises-satisfies": true, + "raises-violates": true + }; + const pyret_delimiter_type = { + NONE: 0, + // Not a delimiter token + OPENING: 1, + // Opening token (e.g. "fun", "{") + CLOSING: 2, + // Closing token (e.g. "end", "}") + SUBKEYWORD: 3, + // Subkeyword (e.g. "else if") + OPEN_CONTD: 4, + // Extension of opening keyword (e.g. ":") + CLOSE_CONTD: 5, + // Extension of closing keyword (UNUSED) + SUB_CONTD: 6, + // Extension of subkeyword (i.e. colon after "else if") + FOLD_OPEN_CONTD: 7 + }; // Extension of opening keyword (acts like OPEN_CONTD *when folding*) + // Contexts in which function-names can be unprefixed + // (i.e. no "fun" or "method") + + const pyret_unprefixed_contexts = []; // Subkeywords each token can have + + const pyret_subkeywords = { + "if": ["block", "else if", "else"], + "when": ["block"], + "fun": ["block", "where"], + "method": ["block", "where"], + "lam": ["block"], + "for": ["block", "do"], + "let": ["block"], + "letrec": ["block"], + "type-let": ["block"], + "cases": ["block"], + "ask": ["block", "then", "otherwise"], + "data": ["sharing", "where"], + "table": ["row"], + "load-table": ["sanitize", "source"] + }; // Subkeywords which cannot be followed by any other keywords + + const pyret_last_subkeywords = { + "if": "else" + }; // Tokens with closing tokens other than "end" or ";" + + const pyret_special_delimiters = [{ + start: "(", + end: ")" + }, { + start: "[", + end: "]" + }, { + start: "{", + end: "}" + }, { + start: "provide", + end: "*" + }]; + + function ret(state, tokType, content, style) { + state.lastToken = tokType; + state.lastContent = content; //console.log("Token:", state, tokType, content, style); + + return style; + } + + function tokenBase(stream, state) { + if (stream.eatSpace()) return "IGNORED-SPACE"; + var ch = stream.peek(); // Handle Comments + + if (ch === '#') { + if (stream.match("#|", true)) { + state.tokenizer = tokenizeBlockComment; + state.commentNestingDepth = 1; + return ret(state, "COMMENT-START", state.lastContent, 'comment'); + } else { + stream.skipToEnd(); + return ret(state, "COMMENT", state.lastContent, 'comment'); + } + } // Handle Number Literals + + + const unsigned_decimal_part = "[0-9]+(?:\\.[0-9]+)?(?:[eE][-+]?[0-9]+)?"; + const unsigned_rational_part = "[0-9]+/[0-9]+"; + const number = new RegExp("^[-+]?" + unsigned_decimal_part); + const badNumber = new RegExp("^~?[+-]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?"); + const roughnum = new RegExp("^~[-+]?" + "(?:" + unsigned_rational_part + "|" + unsigned_decimal_part + ")"); + const rational = new RegExp("^[-+]?" + unsigned_rational_part); + if (stream.match(roughnum)) return ret(state, 'number', stream.current(), 'roughnum');else if (stream.match(rational)) return ret(state, 'number', stream.current(), 'number');else if (stream.match(number)) return ret(state, 'number', stream.current(), 'number');else if (stream.match(badNumber)) return ret(state, 'number', stream.current(), 'bad-number'); // if (ch === '"') { + // state.tokenizer = tokenStringDouble; + // state.lastToken = '"'; + // stream.eat('"'); + // return state.tokenizer(stream, state); + // } + // if (ch === "'") { + // state.tokenizer = tokenStringSingle; + // state.lastToken = "'"; + // stream.eat("'"); + // return state.tokenizer(stream, state); + // } + + const dquot_str = new RegExp("^\"(?:" + "\\\\[01234567]{1,3}" + "|\\\\x[0-9a-fA-F]{1,2}" + "|\\\\u[0-9a-fA-f]{1,4}" + "|\\\\[\\\\nrt\"\']" + "|[^\\\\\"\n\r])*\""); + const squot_str = new RegExp("^\'(?:" + "\\\\[01234567]{1,3}" + "|\\\\x[0-9a-fA-F]{1,2}" + "|\\\\u[0-9a-fA-f]{1,4}" + "|\\\\[\\\\nrt\"\']" + "|[^\\\\\'\n\r])*\'"); + const unterminated_string = new RegExp("^[\"\'].*"); + var match; + state.maybeShorthandLambda = false; + + if (match = stream.match(dquot_str, true)) { + return ret(state, 'string', match[0], 'string'); + } else if (match = stream.match(squot_str, true)) { + return ret(state, 'string', match[0], 'string'); + } else if (stream.match(/^```/, true)) { + state.tokenizer = tokenStringTriple; + state.inString = stream.column(); + state.lastToken = '```'; + return state.tokenizer(stream, state); + } else if (match = stream.match(unterminated_string, true)) { + return ret(state, 'string', match[0], 'unterminated-string'); + } else if (match = stream.match(/^\.\.\./, true)) { + return ret(state, match[0], match[0], 'builtin'); + } // Level 1 + + + if (match = stream.match(/^({(?=\())/, true)) { + state.maybeShorthandLambda = true; + return ret(state, '{', '{', 'builtin'); + } + + if ((match = stream.match(pyret_double_punctuation, true)) || (match = stream.match(pyret_single_punctuation, true))) { + if (state.dataNoPipeColon && (match[0] == ":" || match[0] == "|")) state.dataNoPipeColon = false; + return ret(state, match[0], match[0], 'builtin'); + } + + if (match = stream.match(pyret_keywords_hyphen, true)) { + return ret(state, match[0], match[0], 'keyword'); + } + + if (match = stream.match(pyret_keywords, true)) { + if (match[0] == "data") state.dataNoPipeColon = true; + return ret(state, match[0], match[0], 'keyword'); + } + + if (match = stream.match(pyret_booleans, true)) { + return ret(state, match[0], match[0], 'boolean'); + } + + if (match = stream.match(pyret_keywords_colon, true)) { + if (stream.peek() === ":") return ret(state, match[0], match[0], 'keyword');else return ret(state, 'name', match[0], 'variable'); + } // Level 2 + + + if (match = stream.match(pyret_indent_regex)) { + if (state.lastToken === "|" || state.lastToken === "::" || state.lastToken === "data" || state.dataNoPipeColon) { + state.dataNoPipeColon = false; + return ret(state, 'name', match[0], 'type'); + } else if (stream.match(/\s*\(/, false)) return ret(state, 'name', match[0], 'function-name'); + + return ret(state, 'name', match[0], 'variable'); + } + + if (stream.eat("-")) return ret(state, '-', '-', 'builtin'); + stream.next(); + return null; + } + + function mkTokenString(singleOrDouble) { + return function (stream, state) { + var insideRE = singleOrDouble === "'" ? new RegExp("[^'\\]") : new RegExp('[^"\\]'); + var endRE = singleOrDouble === "'" ? new RegExp("'") : new RegExp('"'); + + while (!stream.eol()) { + stream.eatWhile(insideRE); + + if (stream.eat('\\')) { + stream.next(); + if (stream.eol()) return ret(state, 'string', stream.current(), 'string'); + } else if (stream.eat(singleOrDouble)) { + state.tokenizer = tokenBase; + return ret(state, 'string', stream.current(), 'string'); + } else stream.eat(endRE); + } + + return ret(state, 'string', stream.current(), 'string'); + }; + } + + function tokenizeBlockComment(stream, state) { + if (stream.match('#|', true)) { + state.commentNestingDepth++; + return ret(state, "COMMENT-START", state.lastContent, 'comment'); + } else if (stream.match('|#', true)) { + state.commentNestingDepth--; + if (state.commentNestingDepth === 0) state.tokenizer = tokenBase; + return ret(state, "COMMENT-END", state.lastContent, 'comment'); + } else { + stream.next(); + stream.eatWhile(/[^#|]/); + return ret(state, "COMMENT", state.lastContent, 'comment'); + } + } + + var tokenStringDouble = mkTokenString('"'); + var tokenStringSingle = mkTokenString("'"); + + function tokenStringTriple(stream, state) { + while (!stream.eol()) { + stream.match(/[^`\\]*/, true); //eatWhile(/[^`\\]|`{1,2}([^`\\]|(?:\\))/); + + if (stream.eat('\\')) { + stream.next(); + + if (stream.eol()) { + return ret(state, 'string', stream.current(), 'string'); + } + } else if (stream.match('```', true)) { + state.tokenizer = tokenBase; + state.inString = false; + return ret(state, 'string', stream.current(), 'string'); + } else stream.next(); + } + + return ret(state, 'string', stream.current(), 'string'); + } // Parsing + + + function Indent(funs, cases, data, shared, trys, except, graph, parens, objects, vars, fields, initial, comments) { + this.fn = funs || 0; + this.c = cases || 0; + this.d = data || 0; + this.s = shared || 0; + this.t = trys || 0; + this.e = except || 0; + this.g = graph || 0; + this.p = parens || 0; + this.o = objects || 0; + this.v = vars || 0; + this.f = fields || 0; + this.i = initial || 0; + this.comments = comments || 0; + } + + Indent.prototype.toString = function () { + return "Fun " + this.fn + ", Cases " + this.c + ", Data " + this.d + ", Shared " + this.s + ", Try " + this.t + ", Except " + this.e + ", Graph " + this.g + ", Parens " + this.p + ", Object " + this.o + ", Vars " + this.v + ", Fields " + this.f + ", Initial " + this.i + ", Comment depth " + this.comments; + }; + + Indent.prototype.copy = function () { + return new Indent(this.fn, this.c, this.d, this.s, this.t, this.e, this.g, this.p, this.o, this.v, this.f, this.i, this.comments); + }; + + Indent.prototype.zeroOut = function () { + this.fn = this.c = this.d = this.s = this.t = this.e = this.g = this.p = this.o = this.v = this.f = this.i = this.comments = 0; + }; + + Indent.prototype.addSelf = function (that) { + this.fn += that.fn; + this.c += that.c; + this.d += that.d; + this.s += that.s; + this.t += that.t; + this.e += that.e; + this.g += that.g; + this.p += that.p; + this.o += that.o; + this.v += that.v; + this.f += that.f; + this.i += that.i; + this.comments += that.comments; + return this; + }; + + Indent.prototype.add = function (that) { + return this.copy().addSelf(that); + }; + + Indent.prototype.subSelf = function (that) { + this.fn -= that.fn; + this.c -= that.c; + this.d -= that.d; + this.s -= that.s; + this.t -= that.t; + that.e -= that.e; + this.g -= that.g; + this.p -= that.p; + this.o -= that.o; + this.v -= that.v; + this.f -= that.f; + this.i -= that.i; + this.comments -= that.comments; + return this; + }; + + Indent.prototype.sub = function (that) { + return this.copy().subSelf(that); + }; + + function LineState(tokens, nestingsAtLineStart, nestingsAtLineEnd, deferedOpened, curOpened, deferedClosed, curClosed, delimType) { + this.tokens = tokens; + this.nestingsAtLineStart = nestingsAtLineStart; + this.nestingsAtLineEnd = nestingsAtLineEnd; + this.deferedOpened = deferedOpened; + this.curOpened = curOpened; + this.deferedClosed = deferedClosed; + this.curClosed = curClosed; + this.delimType = delimType; + } + + LineState.prototype.copy = function () { + return new LineState(this.tokens.concat([]), this.nestingsAtLineStart.copy(), this.nestingsAtLineEnd.copy(), this.deferedOpened.copy(), this.curOpened.copy(), this.deferedClosed.copy(), this.curClosed.copy(), this.delimType); + }; + + LineState.prototype.print = function () { + console.log("LineState is:"); + console.log(" NestingsAtLineStart = " + this.nestingsAtLineStart); + console.log(" NestingsAtLineEnd = " + this.nestingsAtLineEnd); + console.log(" DeferedOpened = " + this.deferedOpened); + console.log(" DeferedClosed = " + this.deferedClosed); + console.log(" CurOpened = " + this.curOpened); + console.log(" CurClosed = " + this.curClosed); + console.log(" Tokens = " + this.tokens); + }; + + function peek(arr) { + return arr[arr.length - 1]; + } + + function hasTop(arr, wanted) { + if (wanted instanceof Array) { + for (var i = 0; i < wanted.length; i++) { + if (arr[arr.length - 1 - i] !== wanted[i]) { + return false; + } + } + + return true; + } else { + return arr[arr.length - 1] === wanted; + } + } // Unused, but temporarily leaving in until + // we are positive that unprefixed function + // definitions will never appear again + + + function isUnprefixedContext(ctx) { + if (ctx.length === 0) return false; // FIXME + + for (var i = 0; i < pyret_unprefixed_contexts.length; i++) { + if (pyret_unprefixed_contexts[i] === ctx[ctx.length - 1]) return true; + } + + return false; //return Array.prototype.includes.bind(pyret_unprefixed_contexts).call(ctx[ctx.length - 1]); + //return pyret_unprefixed_contexts.includes(ctx[ctx.length - 1]); + } + + function parse(firstTokenInLine, state, stream, style) { + ls = state.lineState; // Sometimes we want to pick a delimiter type based on the + // previous token's type + + var inOpening = ls.delimType === pyret_delimiter_type.OPENING || ls.delimType === pyret_delimiter_type.OPEN_CONTD; + var inSubkw = ls.delimType === pyret_delimiter_type.SUBKEYWORD || ls.delimType === pyret_delimiter_type.SUB_CONTD; + ls.delimType = pyret_delimiter_type.NONE; + + if (firstTokenInLine) { + ls.nestingsAtLineStart = ls.nestingsAtLineEnd.copy(); + } // Special case: period-separated names in for (...) expressions + // Philip: disabling for now, since this is only useful for staying visible when folding... + // ...not to mention that it's been broken for who-knows-how-long and no one has + // noticed since it's not even really used + + /*if ((state.lastToken === "name" || state.lastToken === ".") && hasTop(ls.tokens, ["WANTCOLONORBLOCK", "FOR"])) { + if (inOpening) + ls.delimType = pyret_delimiter_type.OPEN_CONTD; + }*/ + // Special case: don't hide function-names when folding + + + if (state.lastToken === "name" && style === 'function-name' && hasTop(ls.tokens, ["WANTOPENPAREN", "WANTCLOSEPAREN", "WANTCOLONORBLOCK", "FUN"])) { + if (inOpening) // Slightly redundant, but let's be safe + ls.delimType = pyret_delimiter_type.FOLD_OPEN_CONTD; + } // Uncomment if pyret_unprefixed_contexts is ever used again + + /*if (state.lastToken === "name" && style === 'function-name' && isUnprefixedContext(ls.tokens)) { + ls.delimType = pyret_delimiter_type.OPENING; + }*/ + + + if (ls.nestingsAtLineStart.comments > 0 || ls.curOpened.comments > 0 || ls.deferedOpened.comments > 0) { + if (state.lastToken === "COMMENT-END") { + if (ls.curOpened.comments > 0) ls.curOpened.comments--;else if (ls.deferedOpened.comments > 0) ls.deferedOpened.comments--;else if (firstTokenInLine) ls.curClosed.comments++;else ls.deferedClosed.comments++; + } else if (state.lastToken === "COMMENT-START") { + ls.deferedOpened.comments++; + } + } else if (state.lastToken === "COMMENT-START") { + ls.deferedOpened.comments++; + } else if (state.lastToken === "COMMENT") {// nothing to do + } else if (hasTop(ls.tokens, "NEEDSOMETHING")) { + ls.tokens.pop(); + + if (hasTop(ls.tokens, "VAR") && ls.deferedOpened.v > 0) { + ls.deferedOpened.v--; + ls.tokens.pop(); + } + + parse(firstTokenInLine, state, stream, style); // keep going; haven't processed token yet + } else if (firstTokenInLine && (initial_operators[state.lastToken] && (state.lastToken == "." || stream.match(/^\s+/)) || state.lastToken === "is" && stream.match(/^%/) || state.lastToken === "is-not" && stream.match(/^%/))) { + ls.curOpened.i++; + ls.deferedClosed.i++; + } else if (state.lastToken === ":") { + if (inOpening) ls.delimType = pyret_delimiter_type.OPEN_CONTD;else if (inSubkw) ls.delimType = pyret_delimiter_type.SUB_CONTD; + if (hasTop(ls.tokens, "WANTCOLON") || hasTop(ls.tokens, "WANTCOLONOREQUAL") || hasTop(ls.tokens, "WANTCOLONORBLOCK")) ls.tokens.pop();else if (hasTop(ls.tokens, "OBJECT") || hasTop(ls.tokens, "REACTOR") || hasTop(ls.tokens, "SHARED") || hasTop(ls.tokens, "BRACEDEXPR") || hasTop(ls.tokens, "BRACEDEXPR_NOLAMBDA")) { + if (hasTop(ls.tokens, "BRACEDEXPR") || hasTop(ls.tokens, "BRACEDEXPR_NOLAMBDA")) { + ls.tokens.pop(); + ls.tokens.push("OBJECT"); + } + + ls.deferedOpened.f++; + ls.tokens.push("FIELD", "NEEDSOMETHING"); + } + } else if (state.lastToken === ";") { + if (hasTop(ls.tokens, "BRACEDEXPR") || hasTop(ls.tokens, "BRACEDEXPR_NOLAMBDA")) { + ls.tokens.pop(); + ls.tokens.push("TUPLE"); + } + } else if (state.lastToken === "::") { + if (hasTop(ls.tokens, "OBJECT") || hasTop(ls.tokens, "SHARED")) { + ls.deferedOpened.f++; + ls.tokens.push("FIELD", "NEEDSOMETHING"); + } + } else if (state.lastToken === ",") { + if (hasTop(ls.tokens, "FIELD")) { + ls.tokens.pop(); + if (ls.curOpened.f > 0) ls.curOpened.f--;else if (ls.deferedOpened.f > 0) ls.deferedOpened.f--;else ls.deferedClosed.f++; + } + } else if (state.lastToken === "=") { + if (hasTop(ls.tokens, "WANTCOLONOREQUAL")) ls.tokens.pop();else { + while (hasTop(ls.tokens, "VAR")) { + ls.tokens.pop(); + ls.curClosed.v++; + } + + ls.deferedOpened.v++; + ls.tokens.push("VAR", "NEEDSOMETHING"); + } + } else if (state.lastToken === "var" || state.lastToken === "rec") { + ls.deferedOpened.v++; + ls.tokens.push("VAR", "NEEDSOMETHING", "WANTCOLONOREQUAL"); + } else if (state.lastToken === "fun" || state.lastToken === "method" || state.lastToken === "lam") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("FUN", "WANTCOLONORBLOCK", "WANTCLOSEPAREN", "WANTOPENPAREN"); + } else if (state.lastToken === "method") { + if (hasTop(ls.tokens, "BRACEDEXPR") || hasTop(ls.tokens, "BRACEDEXPR_NOLAMBDA")) { + ls.tokens.pop(); + ls.tokens.push("OBJECT"); + } + + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("FUN", "WANTCOLONORBLOCK", "WANTCLOSEPAREN", "WANTOPENPAREN"); + } else if (state.lastToken === "let" || state.lastToken === "letrec" || state.lastToken === "type-let") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("LET", "WANTCOLONORBLOCK"); + } else if (state.lastToken === "when") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; // when indents like functions + + ls.tokens.push("WHEN", "WANTCOLONORBLOCK"); + } else if (state.lastToken === "do") { + if (hasTop(ls.tokens, "DO")) { + if (ls.curOpened.fn > 0) ls.curOpened.fn--;else if (ls.deferedOpened.fn > 0) ls.deferedOpened.fn--;else ls.curClosed.fn++; + ls.deferedOpened.fn++; + ls.tokens.push("WHEN", "WANTCOLON"); + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } + } else if (state.lastToken === "for") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; // for-loops indent like functions + + ls.tokens.push("FOR", "WANTCOLONORBLOCK"); + } else if (state.lastToken === "cases") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.c++; + ls.tokens.push("CASES", "WANTCOLONORBLOCK", "WANTCLOSEPAREN", "WANTOPENPAREN"); + } else if (state.lastToken === "data") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.d++; + ls.tokens.push("DATA", "WANTCOLON", "NEEDSOMETHING"); + } else if (state.lastToken === "ask") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.c++; + ls.tokens.push("IFCOND", "WANTCOLONORBLOCK"); + } else if (state.lastToken === "spy") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("SPY", "WANTCOLON"); + } else if (state.lastToken === "if") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("IF", "WANTCOLONORBLOCK", "NEEDSOMETHING"); + } else if (state.lastToken === "else if") { + if (hasTop(ls.tokens, "IF")) { + if (ls.curOpened.fn > 0) ls.curOpened.fn--;else if (ls.deferedOpened.fn > 0) ls.deferedOpened.fn--;else ls.curClosed.fn++; + ls.deferedOpened.fn++; + ls.tokens.push("WANTCOLON", "NEEDSOMETHING"); + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } + } else if (state.lastToken === "else") { + if (hasTop(ls.tokens, "IF")) { + if (ls.curOpened.fn > 0) ls.curOpened.fn--;else if (ls.deferedOpened.fn > 0) ls.deferedOpened.fn--;else ls.curClosed.fn++; + ls.deferedOpened.fn++; + ls.tokens.push("WANTCOLON"); + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } + } else if (state.lastToken === "row") { + if (hasTop(ls.tokens, "TABLEROW")) { + if (ls.curOpened.fn > 0) ls.curOpened.fn--;else if (ls.deferedOpened.fn > 0) ls.deferedOpened.fn--;else ls.curClosed.fn++; + ls.deferedOpened.fn++; + ls.tokens.push("WANTCOLON"); + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } else if (hasTop(ls.tokens, "TABLE")) { + ls.deferedOpened.fn++; + ls.tokens.push("TABLEROW", "WANTCOLON"); + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } + } else if (state.lastToken === "source") { + if (hasTop(ls.tokens, "LOADTABLESPEC")) { + if (ls.curOpened.fn > 0) ls.curOpened.fn--;else if (ls.deferedOpened.fn > 0) ls.deferedOpened.fn--;else ls.curClosed.fn++; + ls.deferedOpened.fn++; + ls.tokens.push("NEEDSOMETHING", "WANTCOLON"); + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } else if (hasTop(ls.tokens, "LOADTABLE")) { + ls.deferedOpened.fn++; + ls.tokens.push("LOADTABLESPEC", "NEEDSOMETHING", "WANTCOLON"); + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } + } else if (state.lastToken === "sanitize") { + if (hasTop(ls.tokens, "LOADTABLESPEC")) { + if (ls.curOpened.fn > 0) ls.curOpened.fn--;else if (ls.deferedOpened.fn > 0) ls.deferedOpened.fn--;else ls.curClosed.fn++; + ls.deferedOpened.fn++; + ls.tokens.push("NEEDSOMETHING"); + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } else if (hasTop(ls.tokens, "LOADTABLE")) { + ls.deferedOpened.fn++; + ls.tokens.push("LOADTABLESPEC", "NEEDSOMETHING"); + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } + } else if (state.lastToken === "|") { + if (hasTop(ls.tokens, ["OBJECT", "DATA"]) || hasTop(ls.tokens, ["FIELD", "OBJECT", "DATA"])) { + //ls.curClosed.o++; + if (hasTop(ls.tokens, "FIELD")) { + ls.tokens.pop(); + if (ls.curOpened.f > 0) ls.curOpened.f--;else if (ls.deferedOpened.f > 0) ls.deferedOpened.f--;else ls.curClosed.f++; + } + + if (hasTop(ls.tokens, "OBJECT")) ls.tokens.pop(); + } else if (hasTop(ls.tokens, "DATA")) ls.tokens.push("NEEDSOMETHING"); + } else if (state.lastToken === "with") { + if (hasTop(ls.tokens, ["WANTOPENPAREN", "WANTCLOSEPAREN", "DATA"])) { + ls.tokens.pop(); + ls.tokens.pop(); + ls.tokens.push("OBJECT", "WANTCOLON"); + } else if (hasTop(ls.tokens, ["DATA"])) { + ls.tokens.push("OBJECT", "WANTCOLON"); + } + } else if (state.lastToken === "provide") { + ls.tokens.push("PROVIDE"); + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.s++; + } else if (state.lastToken === "sharing") { + ls.curClosed.d++; + ls.deferedOpened.s++; + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + + if (hasTop(ls.tokens, ["FIELD", "OBJECT", "DATA"])) { + ls.tokens.pop(); + ls.tokens.pop(); + ls.tokens.pop(); + ls.curClosed.o++; + ls.tokens.push("SHARED", "WANTCOLON"); + } else if (hasTop(ls.tokens, ["OBJECT", "DATA"])) { + ls.tokens.pop(); + ls.tokens.pop(); //ls.curClosed.o++; + + ls.tokens.push("SHARED", "WANTCOLON"); + } else if (hasTop(ls.tokens, "DATA")) { + ls.tokens.pop(); + ls.tokens.push("SHARED", "WANTCOLON"); + } + } else if (state.lastToken === "where" || state.lastToken === "examples" && ls.tokens.length > 0) { + ls.delimType = state.lastToken === "where" ? pyret_delimiter_type.SUBKEYWORD : pyret_delimiter_type.OPENING; + + if (hasTop(ls.tokens, ["FIELD", "OBJECT", "DATA"])) { + ls.tokens.pop(); + ls.tokens.pop(); + ls.curClosed.o++; + ls.curClosed.d++; + ls.deferedOpened.s++; + } else if (hasTop(ls.tokens, ["OBJECT", "DATA"])) { + ls.tokens.pop(); // ls.curClosed.o++; + + ls.curClosed.d++; + ls.deferedOpened.s++; + } else if (hasTop(ls.tokens, "DATA")) { + ls.curClosed.d++; + ls.deferedOpened.s++; + } else if (hasTop(ls.tokens, "FUN")) { + ls.curClosed.f++; + ls.deferedOpened.s++; + } else if (hasTop(ls.tokens, "SHARED")) { + ls.curClosed.s++; + ls.deferedOpened.s++; + } + + ls.tokens.pop(); + ls.tokens.push("CHECK", "WANTCOLON"); + } else if (state.lastToken === "check" || state.lastToken === "examples" && ls.tokens.length === 0) { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.s++; + ls.tokens.push("CHECK", "WANTCOLON"); + } else if (state.lastToken === "try") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.t++; + ls.tokens.push("TRY", "WANTCOLON"); + } else if (state.lastToken === "except") { + ls.delimType = pyret_delimiter_type.OPENING; + if (ls.curOpened.t > 0) ls.curOpened.t--;else if (ls.deferedOpened.t > 0) ls.deferedOpened.t--;else ls.curClosed.t++; + + if (hasTop(ls.tokens, "TRY")) { + ls.tokens.pop(); + ls.tokens.push("WANTCOLON", "WANTCLOSEPAREN", "WANTOPENPAREN"); + } + } else if (state.lastToken === "then" || state.lastToken === "otherwise") { + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } else if (state.lastToken === "block") { + if (hasTop(ls.tokens, "WANTCOLONORBLOCK")) { + ls.delimType = pyret_delimiter_type.SUBKEYWORD; + } else { + ls.deferedOpened.fn++; + ls.tokens.push("BLOCK", "WANTCOLON"); + ls.delimType = pyret_delimiter_type.OPENING; + } + } else if (state.lastToken === "reactor") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("REACTOR", "WANTCOLON"); + } else if (state.lastToken === "table") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("TABLE", "WANTCOLON"); + } else if (state.lastToken === "load-table") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("LOADTABLE", "WANTCOLON"); + } else if (state.lastToken === "select") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("SELECT", "WANTCOLON"); + } else if (state.lastToken === "extend") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("EXTEND", "WANTCOLON"); + } else if (state.lastToken === "transform") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("TRANSFORM", "WANTCOLON"); + } else if (state.lastToken === "extract") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("EXTRACT", "WANTCOLON"); + } else if (state.lastToken === "sieve") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("SIEVE", "WANTCOLON"); + } else if (state.lastToken === "order") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.fn++; + ls.tokens.push("ORDER", "WANTCOLON"); + } else if (state.lastToken === "ref-graph") { + ls.deferedOpened.g++; + ls.tokens.push("GRAPH", "WANTCOLON"); + } else if (state.lastToken === "[") { + ls.deferedOpened.o++; + ls.tokens.push("ARRAY"); + ls.delimType = pyret_delimiter_type.OPENING; + } else if (state.lastToken === "]") { + ls.delimType = pyret_delimiter_type.CLOSING; + if (firstTokenInLine) ls.curClosed.o++;else ls.deferedClosed.o++; + if (hasTop(ls.tokens, "ARRAY")) ls.tokens.pop(); + + while (hasTop(ls.tokens, "VAR")) { + ls.tokens.pop(); + ls.deferedClosed.v++; + } + } else if (state.lastToken === "{") { + ls.deferedOpened.o++; + if (state.maybeShorthandLambda) ls.tokens.push("BRACEDEXPR");else ls.tokens.push("BRACEDEXPR_NOLAMBDA"); + ls.delimType = pyret_delimiter_type.OPENING; + } else if (state.lastToken === "}") { + ls.delimType = pyret_delimiter_type.CLOSING; + if (firstTokenInLine) ls.curClosed.o++;else ls.deferedClosed.o++; + + if (hasTop(ls.tokens, "FIELD")) { + ls.tokens.pop(); + if (ls.curOpened.f > 0) ls.curOpened.f--;else if (ls.deferedOpened.f > 0) ls.deferedOpened.f--;else ls.curClosed.f++; + } + + if (hasTop(ls.tokens, "OBJECT") || hasTop(ls.tokens, "BRACEDEXPR") || hasTop(ls.tokens, "BRACEDEXPR_NOLAMBDA") || hasTop(ls.tokens, "TUPLE") || hasTop(ls.tokens, "SHORTHANDLAMBDA")) ls.tokens.pop(); + + while (hasTop(ls.tokens, "VAR")) { + ls.tokens.pop(); + ls.deferedClosed.v++; + } + } else if (state.lastToken === "(") { + ls.delimType = pyret_delimiter_type.OPENING; + ls.deferedOpened.p++; + + if (hasTop(ls.tokens, "WANTOPENPAREN")) { + ls.tokens.pop(); + } else if (hasTop(ls.tokens, "BRACEDEXPR")) { + ls.tokens.pop(); + ls.tokens.push("SHORTHANDLAMBDA", "WANTCOLONORBLOCK"); + } else if (hasTop(ls.tokens, "OBJECT") || hasTop(ls.tokens, "SHARED")) { + ls.tokens.push("FUN", "WANTCOLONORBLOCK"); + ls.deferedOpened.fn++; + } else { + ls.tokens.push("WANTCLOSEPAREN"); + } + } else if (state.lastToken === ")") { + ls.delimType = pyret_delimiter_type.CLOSING; + + if (ls.curOpened.p > 0) { + ls.curOpened.p--; + } else if (ls.deferedOpened.p > 0) { + ls.deferedOpened.p--; + } else { + ls.deferedClosed.p++; + } + + if (hasTop(ls.tokens, "WANTCLOSEPAREN")) ls.tokens.pop(); + + while (hasTop(ls.tokens, "VAR")) { + ls.tokens.pop(); + ls.deferedClosed.v++; + } + } else if (state.lastToken === "end") { + ls.delimType = pyret_delimiter_type.CLOSING; + + if (hasTop(ls.tokens, ["FIELD", "OBJECT", "DATA"])) { + /* Handles situations such as + * data A: + * | a with: + * b : 2 # <- indents as an object field + * end + */ + ls.curClosed.f++; + ls.tokens.pop(); + ls.tokens.pop(); + } else if (hasTop(ls.tokens, ["OBJECT", "DATA"])) { + //ls.curClosed.o++; + ls.tokens.pop(); + } else if (hasTop(ls.tokens, ["TABLEROW", "TABLE"]) || hasTop(ls.tokens, ["LOADTABLESPEC", "LOADTABLE"])) { + ls.tokens.pop(); + ls.curClosed.o++; + } + + var top = peek(ls.tokens); + var stillUnclosed = true; + + while (stillUnclosed && ls.tokens.length) { + // Things that are not counted at all: + // wantcolon, wantcolonorequal, needsomething, wantopenparen + // Things that are counted but not closable by end: + if (top === "OBJECT" || top === "ARRAY") { + if (ls.curOpened.o > 0) ls.curOpened.o--;else if (ls.deferedOpened.o > 0) ls.deferedOpened.o--;else ls.curClosed.o++; + } else if (top === "WANTCLOSEPAREN") { + if (ls.curOpened.p > 0) ls.curOpened.p--;else if (ls.deferedOpened.p > 0) ls.deferedOpened.p--;else ls.curClosed.p++; + } else if (top === "FIELD") { + if (ls.curOpened.f > 0) ls.curOpened.f--;else if (ls.deferedOpened.f > 0) ls.deferedOpened.f--;else ls.curClosed.f++; + } else if (top === "VAR") { + if (ls.curOpened.v > 0) ls.curOpened.v--;else if (ls.deferedOpened.v > 0) ls.deferedOpened.v--;else ls.curClosed.v++; + } else if (top === "PROVIDE") { + if (ls.curOpened.s > 0) ls.curOpened.s--;else if (ls.deferedOpened.s > 0) ls.deferedOpened.s--;else ls.curClosed.s++; + } // Things that are counted, and closable by end: + else if (pyret_openers_closed_by_end[top] === true) { + if (ls.curOpened.fn > 0) ls.curOpened.fn--;else if (ls.deferedOpened.fn > 0) ls.deferedOpened.fn--;else ls.curClosed.fn++; + stillUnclosed = false; + } else if (top === "CASES" || top === "IFCOND") { + if (ls.curOpened.c > 0) ls.curOpened.c--;else if (ls.deferedOpened.c > 0) ls.deferedOpened.c--;else ls.curClosed.c++; + stillUnclosed = false; + } else if (top === "DATA") { + if (ls.curOpened.d > 0) ls.curOpened.d--;else if (ls.deferedOpened.d > 0) ls.deferedOpened.d--;else ls.curClosed.d++; + stillUnclosed = false; + } else if (top === "SHARED" || top === "CHECK") { + if (ls.curOpened.s > 0) ls.curOpened.s--;else if (ls.deferedOpened.s > 0) ls.deferedOpened.s--;else ls.curClosed.s++; + stillUnclosed = false; + } else if (top === "TRY") { + if (ls.curOpened.t > 0) ls.curOpened.t--;else if (ls.deferedOpened.t > 0) ls.deferedOpened.t--;else ls.curClosed.t++; + stillUnclosed = false; + } else if (top === "EXCEPT") { + if (ls.curOpened.e > 0) ls.curOpened.e--;else if (ls.deferedOpened.e > 0) ls.deferedOpened.e--;else ls.curClosed.e++; + stillUnclosed = false; + } else if (top === "GRAPH") { + if (ls.curOpened.g > 0) ls.curOpened.g--;else if (ls.deferedOpened.g > 0) ls.deferedOpened.g--;else ls.curClosed.g++; + stillUnclosed = false; + } + + ls.tokens.pop(); + top = peek(ls.tokens); + } + } else if (state.lastToken === "*" && hasTop(ls.tokens, ["PROVIDE"])) { + ls.deferedClosed.s++; + ls.delimType = pyret_delimiter_type.CLOSING; + ls.tokens.pop(); + } + + if (stream.match(/\s*$/, false)) { + // End of line; close out nestings fields + // console.log("We think we're at an end of line"); + // console.log("LineState is currently"); + // ls.print(); + ls.nestingsAtLineStart.addSelf(ls.curOpened).subSelf(ls.curClosed); + + while (hasTop(ls.tokens, "VAR")) { + ls.tokens.pop(); + ls.curClosed.v++; + } + + ls.nestingsAtLineEnd.addSelf(ls.curOpened).addSelf(ls.deferedOpened).subSelf(ls.curClosed).subSelf(ls.deferedClosed); + ls.tokens = ls.tokens.concat([]); + ls.curOpened.zeroOut(); + ls.deferedOpened.zeroOut(); + ls.curClosed.zeroOut(); + ls.deferedClosed.zeroOut(); + } // console.log("LineState is now"); + // ls.print(); + + } + + const INDENTATION = new Indent(1, 2, 2, 1, 1, 1, 1 + /*could be 0*/ + , 1, 1, 1, 1, 1, 1.5); + + function copyState(oldState) { + return { + tokenizer: oldState.tokenizer, + lineState: oldState.lineState.copy(), + lastToken: oldState.lastToken, + lastContent: oldState.lastContent, + commentNestingDepth: oldState.commentNestingDepth, + inString: oldState.inString, + dataNoPipeColon: oldState.dataNoPipeColon, + sol: oldState.sol, + maybeShorthandLambda: oldState.maybeShorthandLambda + }; + } + + function indent(state, textAfter, fullLine) { + var indentUnit = config.indentUnit; + var taSS = new CodeMirror.StringStream(textAfter, config.tabSize); + var sol = true; + var inString = state.inString; // console.log("***** In indent, before processing textAfter (" + textAfter + ")"); + // state.lineState.print(); + + state = copyState(state); + + if (state.commentNestingDepth > 0) { + state.lineState.nestingsAtLineStart = state.lineState.nestingsAtLineEnd.copy(); + } + + if (/^\s*$/.test(textAfter)) { + state.lineState.nestingsAtLineStart = state.lineState.nestingsAtLineEnd.copy(); + } else { + // TODO: track nested comment state in here, to indent if needed + while (!taSS.eol()) { + var style = state.tokenizer(taSS, state); + + if (style !== "IGNORED-SPACE") { + parse(sol, state, taSS, style); + sol = false; + } + } + } // console.log("***** In indent, after processing textAfter (" + textAfter + ")"); + // state.lineState.print(); + + + var indentSpec = state.lineState.nestingsAtLineStart; + var indent = 0; + + for (var key in INDENTATION) { + if (INDENTATION.hasOwnProperty(key)) indent += (indentSpec[key] || 0) * INDENTATION[key]; + } + + if (indentSpec.comments > 0 || inString !== false) { + var spaces = fullLine.match(/\s*/)[0].length; + if (spaces > 0) return spaces;else if (inString !== false) return inString;else return indent * indentUnit; + } else if (/^\s*\|([^#]|$)/.test(fullLine)) { + return (indent - 1) * indentUnit; + } else { + return indent * indentUnit; + } + } + + var external = { + startState: function (basecolumn) { + return { + tokenizer: tokenBase, + inString: false, + commentNestingDepth: 0, + lineState: new LineState([], new Indent(), new Indent(), new Indent(), new Indent(), new Indent(), new Indent(), pyret_delimiter_type.NONE), + sol: true + }; + }, + blankLine: function blankLine(state) { + // console.log("*** In BlankLine"); + state.lineState.nestingsAtLineStart = state.lineState.nestingsAtLineEnd.copy(); // state.lineState.print(); + }, + copyState: copyState, + token: function (stream, state) { + // console.log("In token for stream = "); + // console.log(stream); + if (!state.sol && stream.sol()) { + state.sol = true; + state.indentation = stream.indentation(); + } + + var style = state.tokenizer(stream, state); + if (style === "IGNORED-SPACE") return null; + parse(state.sol, state, stream, style); + state.sol = false; + return style; + }, + indent: indent, + electricInput: new RegExp("(?:[de.\\]}|:]|\|#|[-enst\\*\\+/=<>^~]\\s|is%|is-not%)$"), + fold: "pyret", + delimiters: { + opening: pyret_opening_tokens, + closing: pyret_closing_tokens, + subkeywords: pyret_subkeywords, + lastSubkeywords: pyret_last_subkeywords, + special: pyret_special_delimiters, + types: pyret_delimiter_type + }, + // FIXME: Should be deleted + unprefixedContexts: ["SHARED", "OBJECT"] + }; + return external; +}); // CodeMirror.defineMIME("text/x-pyret", "pyret"); + +/***/ }), + +/***/ "./node_modules/querystring-es3/decode.js": +/*!************************************************!*\ + !*** ./node_modules/querystring-es3/decode.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + // If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +module.exports = function (qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + var maxKeys = 1000; + + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; // maxKeys <= 0 means that we should not limit keys count + + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, + vstr, + k, + v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +/***/ }), + +/***/ "./node_modules/querystring-es3/encode.js": +/*!************************************************!*\ + !*** ./node_modules/querystring-es3/encode.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + +var stringifyPrimitive = function (v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + +module.exports = function (obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return map(objectKeys(obj), function (k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + + if (isArray(obj[k])) { + return map(obj[k], function (v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +function map(xs, f) { + if (xs.map) return xs.map(f); + var res = []; + + for (var i = 0; i < xs.length; i++) { + res.push(f(xs[i], i)); + } + + return res; +} + +var objectKeys = Object.keys || function (obj) { + var res = []; + + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); + } + + return res; +}; + +/***/ }), + +/***/ "./node_modules/querystring-es3/index.js": +/*!***********************************************!*\ + !*** ./node_modules/querystring-es3/index.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.decode = exports.parse = __webpack_require__(/*! ./decode */ "./node_modules/querystring-es3/decode.js"); +exports.encode = exports.stringify = __webpack_require__(/*! ./encode */ "./node_modules/querystring-es3/encode.js"); + +/***/ }), + +/***/ "./node_modules/querystringify/index.js": +/*!**********************************************!*\ + !*** ./node_modules/querystringify/index.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty, + undef; +/** + * Decode a URI encoded string. + * + * @param {String} input The URI encoded string. + * @returns {String|Null} The decoded string. + * @api private + */ + +function decode(input) { + try { + return decodeURIComponent(input.replace(/\+/g, ' ')); + } catch (e) { + return null; + } +} +/** + * Attempts to encode a given input. + * + * @param {String} input The string that needs to be encoded. + * @returns {String|Null} The encoded string. + * @api private + */ + + +function encode(input) { + try { + return encodeURIComponent(input); + } catch (e) { + return null; + } +} +/** + * Simple query string parser. + * + * @param {String} query The query string that needs to be parsed. + * @returns {Object} + * @api public + */ + + +function querystring(query) { + var parser = /([^=?&]+)=?([^&]*)/g, + result = {}, + part; + + while (part = parser.exec(query)) { + var key = decode(part[1]), + value = decode(part[2]); // + // Prevent overriding of existing properties. This ensures that build-in + // methods like `toString` or __proto__ are not overriden by malicious + // querystrings. + // + // In the case if failed decoding, we want to omit the key/value pairs + // from the result. + // + + if (key === null || value === null || key in result) continue; + result[key] = value; + } + + return result; +} +/** + * Transform a query string to an object. + * + * @param {Object} obj Object that should be transformed. + * @param {String} prefix Optional prefix. + * @returns {String} + * @api public + */ + + +function querystringify(obj, prefix) { + prefix = prefix || ''; + var pairs = [], + value, + key; // + // Optionally prefix with a '?' if needed + // + + if ('string' !== typeof prefix) prefix = '?'; + + for (key in obj) { + if (has.call(obj, key)) { + value = obj[key]; // + // Edge cases where we actually want to encode the value to an empty + // string instead of the stringified value. + // + + if (!value && (value === null || value === undef || isNaN(value))) { + value = ''; + } + + key = encodeURIComponent(key); + value = encodeURIComponent(value); // + // If we failed to encode the strings, we should bail out as we don't + // want to add invalid strings to the query. + // + + if (key === null || value === null) continue; + pairs.push(key + '=' + value); + } + } + + return pairs.length ? prefix + pairs.join('&') : ''; +} // +// Expose the module. +// + + +exports.stringify = querystringify; +exports.parse = querystring; + +/***/ }), + +/***/ "./node_modules/raf-schd/dist/raf-schd.esm.js": +/*!****************************************************!*\ + !*** ./node_modules/raf-schd/dist/raf-schd.esm.js ***! + \****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +var rafSchd = function rafSchd(fn) { + var lastArgs = []; + var frameId = null; + + var wrapperFn = function wrapperFn() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + lastArgs = args; + + if (frameId) { + return; + } + + frameId = requestAnimationFrame(function () { + frameId = null; + fn.apply(void 0, lastArgs); + }); + }; + + wrapperFn.cancel = function () { + if (!frameId) { + return; + } + + cancelAnimationFrame(frameId); + frameId = null; + }; + + return wrapperFn; +}; + +/* harmony default export */ __webpack_exports__["default"] = (rafSchd); + +/***/ }), + +/***/ "./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js": +/*!**************************************************************************!*\ + !*** ./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js ***! + \**************************************************************************/ +/*! exports provided: DragDropContext, Draggable, Droppable, resetServerContext */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragDropContext", function() { return DragDropContext; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Draggable", function() { return ConnectedDraggable; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Droppable", function() { return ConnectedDroppable; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetServerContext", function() { return resetServerContext; }); +/* harmony import */ var _babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/extends */ "./node_modules/@babel/runtime-corejs2/helpers/esm/extends.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var use_memo_one__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! use-memo-one */ "./node_modules/use-memo-one/dist/use-memo-one.esm.js"); +/* harmony import */ var _babel_runtime_corejs2_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime-corejs2/helpers/esm/inheritsLoose.js"); +/* harmony import */ var tiny_invariant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tiny-invariant */ "./node_modules/tiny-invariant/dist/tiny-invariant.esm.js"); +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! redux */ "./node_modules/redux/es/redux.js"); +/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); +/* harmony import */ var css_box_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! css-box-model */ "./node_modules/css-box-model/dist/css-box-model.esm.js"); +/* harmony import */ var memoize_one__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! memoize-one */ "./node_modules/memoize-one/dist/memoize-one.esm.js"); +/* harmony import */ var _babel_runtime_corejs2_core_js_object_values__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime-corejs2/core-js/object/values */ "./node_modules/@babel/runtime-corejs2/core-js/object/values.js"); +/* harmony import */ var _babel_runtime_corejs2_core_js_object_values__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs2_core_js_object_values__WEBPACK_IMPORTED_MODULE_9__); +/* harmony import */ var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @babel/runtime-corejs2/core-js/object/keys */ "./node_modules/@babel/runtime-corejs2/core-js/object/keys.js"); +/* harmony import */ var _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_10__); +/* harmony import */ var _babel_runtime_corejs2_core_js_date_now__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @babel/runtime-corejs2/core-js/date/now */ "./node_modules/@babel/runtime-corejs2/core-js/date/now.js"); +/* harmony import */ var _babel_runtime_corejs2_core_js_date_now__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs2_core_js_date_now__WEBPACK_IMPORTED_MODULE_11__); +/* harmony import */ var raf_schd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! raf-schd */ "./node_modules/raf-schd/dist/raf-schd.esm.js"); +/* harmony import */ var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @babel/runtime-corejs2/core-js/object/assign */ "./node_modules/@babel/runtime-corejs2/core-js/object/assign.js"); +/* harmony import */ var _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_13__); +/* harmony import */ var _babel_runtime_corejs2_core_js_number_is_integer__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @babel/runtime-corejs2/core-js/number/is-integer */ "./node_modules/@babel/runtime-corejs2/core-js/number/is-integer.js"); +/* harmony import */ var _babel_runtime_corejs2_core_js_number_is_integer__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs2_core_js_number_is_integer__WEBPACK_IMPORTED_MODULE_14__); + + + + + + + + + + + + + + + +var isProduction = "development" === 'production'; +var spacesAndTabs = /[ \t]{2,}/g; +var lineStartWithSpaces = /^[ \t]*/gm; + +var clean = function clean(value) { + return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim(); +}; + +var getDevMessage = function getDevMessage(message) { + return clean("\n %creact-beautiful-dnd\n\n %c" + clean(message) + "\n\n %c\uD83D\uDC77\u200D This is a development only message. It will be removed in production builds.\n"); +}; + +var getFormattedMessage = function getFormattedMessage(message) { + return [getDevMessage(message), 'color: #00C584; font-size: 1.2em; font-weight: bold;', 'line-height: 1.5', 'color: #723874;']; +}; + +var isDisabledFlag = '__react-beautiful-dnd-disable-dev-warnings'; + +var warning = function warning(message) { + var _console; + + if (isProduction) { + return; + } + + if (typeof window !== 'undefined' && window[isDisabledFlag]) { + return; + } + + (_console = console).warn.apply(_console, getFormattedMessage(message)); +}; + +function printFatalError(error) { + var _console; + + if (false) {} + + (_console = console).error.apply(_console, getFormattedMessage("\n An error has occurred while a drag is occurring.\n Any existing drag will be cancelled.\n\n > " + error.message + "\n ")); + + console.error('raw', error); +} + +function shouldRecover(error) { + return error.message.indexOf('Invariant failed') !== -1; +} + +var ErrorBoundary = function (_React$Component) { + Object(_babel_runtime_corejs2_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__["default"])(ErrorBoundary, _React$Component); + + function ErrorBoundary() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.onError = void 0; + + _this.setOnError = function (fn) { + _this.onError = fn; + }; + + _this.onFatalError = function (error) { + printFatalError(error); + + if (_this.onError) { + _this.onError(); + } else { + true ? warning('Could not find recovering function') : undefined; + } + + if (shouldRecover(error)) { + _this.setState({}); + } + }; + + return _this; + } + + var _proto = ErrorBoundary.prototype; + + _proto.componentDidMount = function componentDidMount() { + window.addEventListener('error', this.onFatalError); + }; + + _proto.componentWillUnmount = function componentWillUnmount() { + window.removeEventListener('error', this.onFatalError); + }; + + _proto.componentDidCatch = function componentDidCatch(error) { + this.onFatalError(error); + + if (!shouldRecover(error)) { + throw error; + } + }; + + _proto.render = function render() { + return this.props.children(this.setOnError); + }; + + return ErrorBoundary; +}(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); + +var origin = { + x: 0, + y: 0 +}; + +var add = function add(point1, point2) { + return { + x: point1.x + point2.x, + y: point1.y + point2.y + }; +}; + +var subtract = function subtract(point1, point2) { + return { + x: point1.x - point2.x, + y: point1.y - point2.y + }; +}; + +var isEqual = function isEqual(point1, point2) { + return point1.x === point2.x && point1.y === point2.y; +}; + +var negate = function negate(point) { + return { + x: point.x !== 0 ? -point.x : 0, + y: point.y !== 0 ? -point.y : 0 + }; +}; + +var patch = function patch(line, value, otherValue) { + var _ref; + + if (otherValue === void 0) { + otherValue = 0; + } + + return _ref = {}, _ref[line] = value, _ref[line === 'x' ? 'y' : 'x'] = otherValue, _ref; +}; + +var distance = function distance(point1, point2) { + return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2)); +}; + +var closest = function closest(target, points) { + return Math.min.apply(Math, points.map(function (point) { + return distance(target, point); + })); +}; + +var apply = function apply(fn) { + return function (point) { + return { + x: fn(point.x), + y: fn(point.y) + }; + }; +}; + +var executeClip = function (frame, subject) { + var result = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["getRect"])({ + top: Math.max(subject.top, frame.top), + right: Math.min(subject.right, frame.right), + bottom: Math.min(subject.bottom, frame.bottom), + left: Math.max(subject.left, frame.left) + }); + + if (result.width <= 0 || result.height <= 0) { + return null; + } + + return result; +}; + +var isEqual$1 = function isEqual(first, second) { + return first.top === second.top && first.right === second.right && first.bottom === second.bottom && first.left === second.left; +}; + +var offsetByPosition = function offsetByPosition(spacing, point) { + return { + top: spacing.top + point.y, + left: spacing.left + point.x, + bottom: spacing.bottom + point.y, + right: spacing.right + point.x + }; +}; + +var getCorners = function getCorners(spacing) { + return [{ + x: spacing.left, + y: spacing.top + }, { + x: spacing.right, + y: spacing.top + }, { + x: spacing.left, + y: spacing.bottom + }, { + x: spacing.right, + y: spacing.bottom + }]; +}; + +var noSpacing = { + top: 0, + right: 0, + bottom: 0, + left: 0 +}; + +var scroll = function scroll(target, frame) { + if (!frame) { + return target; + } + + return offsetByPosition(target, frame.scroll.diff.displacement); +}; + +var increase = function increase(target, axis, withPlaceholder) { + if (withPlaceholder && withPlaceholder.increasedBy) { + var _extends2; + + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, target, (_extends2 = {}, _extends2[axis.end] = target[axis.end] + withPlaceholder.increasedBy[axis.line], _extends2)); + } + + return target; +}; + +var clip = function clip(target, frame) { + if (frame && frame.shouldClipSubject) { + return executeClip(frame.pageMarginBox, target); + } + + return Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["getRect"])(target); +}; + +var getSubject = function (_ref) { + var page = _ref.page, + withPlaceholder = _ref.withPlaceholder, + axis = _ref.axis, + frame = _ref.frame; + var scrolled = scroll(page.marginBox, frame); + var increased = increase(scrolled, axis, withPlaceholder); + var clipped = clip(increased, frame); + return { + page: page, + withPlaceholder: withPlaceholder, + active: clipped + }; +}; + +var scrollDroppable = function (droppable, newScroll) { + !droppable.frame ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false) : undefined : void 0; + var scrollable = droppable.frame; + var scrollDiff = subtract(newScroll, scrollable.scroll.initial); + var scrollDisplacement = negate(scrollDiff); + + var frame = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, scrollable, { + scroll: { + initial: scrollable.scroll.initial, + current: newScroll, + diff: { + value: scrollDiff, + displacement: scrollDisplacement + }, + max: scrollable.scroll.max + } + }); + + var subject = getSubject({ + page: droppable.subject.page, + withPlaceholder: droppable.subject.withPlaceholder, + axis: droppable.axis, + frame: frame + }); + + var result = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, droppable, { + frame: frame, + subject: subject + }); + + return result; +}; + +var records = {}; +var isEnabled = false; + +var isTimingsEnabled = function isTimingsEnabled() { + return isEnabled; +}; + +var start = function start(key) { + if (true) { + if (!isTimingsEnabled()) { + return; + } + + var now = performance.now(); + records[key] = now; + } +}; + +var finish = function finish(key) { + if (true) { + if (!isTimingsEnabled()) { + return; + } + + var now = performance.now(); + var previous = records[key]; + + if (!previous) { + console.warn('cannot finish timing as no previous time found', key); + return; + } + + var result = now - previous; + var rounded = result.toFixed(2); + + var style = function () { + if (result < 12) { + return { + textColor: 'green', + symbol: '✅' + }; + } + + if (result < 40) { + return { + textColor: 'orange', + symbol: '⚠️' + }; + } + + return { + textColor: 'red', + symbol: '❌' + }; + }(); + + console.log(style.symbol + " %cTiming %c" + rounded + " %cms %c" + key, 'color: blue; font-weight: bold;', "color: " + style.textColor + "; font-size: 1.1em;", 'color: grey;', 'color: purple; font-weight: bold;'); + } +}; + +var whatIsDraggedOver = function (impact) { + var merge = impact.merge, + destination = impact.destination; + + if (destination) { + return destination.droppableId; + } + + if (merge) { + return merge.combine.droppableId; + } + + return null; +}; + +function values(map) { + return _babel_runtime_corejs2_core_js_object_values__WEBPACK_IMPORTED_MODULE_9___default()(map); +} + +function findIndex(list, predicate) { + if (list.findIndex) { + return list.findIndex(predicate); + } + + for (var i = 0; i < list.length; i++) { + if (predicate(list[i])) { + return i; + } + } + + return -1; +} + +function find(list, predicate) { + if (list.find) { + return list.find(predicate); + } + + var index = findIndex(list, predicate); + + if (index !== -1) { + return list[index]; + } + + return undefined; +} + +var toDroppableMap = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (droppables) { + return droppables.reduce(function (previous, current) { + previous[current.descriptor.id] = current; + return previous; + }, {}); +}); +var toDraggableMap = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (draggables) { + return draggables.reduce(function (previous, current) { + previous[current.descriptor.id] = current; + return previous; + }, {}); +}); +var toDroppableList = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (droppables) { + return values(droppables); +}); +var toDraggableList = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (draggables) { + return values(draggables); +}); + +var isWithin = function (lowerBound, upperBound) { + return function (value) { + return lowerBound <= value && value <= upperBound; + }; +}; + +var isPositionInFrame = function (frame) { + var isWithinVertical = isWithin(frame.top, frame.bottom); + var isWithinHorizontal = isWithin(frame.left, frame.right); + return function (point) { + return isWithinVertical(point.y) && isWithinVertical(point.y) && isWithinHorizontal(point.x) && isWithinHorizontal(point.x); + }; +}; + +var getDroppableOver = function (_ref) { + var target = _ref.target, + droppables = _ref.droppables; + var maybe = find(toDroppableList(droppables), function (droppable) { + if (!droppable.isEnabled) { + return false; + } + + var active = droppable.subject.active; + + if (!active) { + return false; + } + + return isPositionInFrame(active)(target); + }); + return maybe ? maybe.descriptor.id : null; +}; + +var getDraggablesInsideDroppable = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (droppableId, draggables) { + var result = toDraggableList(draggables).filter(function (draggable) { + return droppableId === draggable.descriptor.droppableId; + }).sort(function (a, b) { + return a.descriptor.index - b.descriptor.index; + }); + return result; +}); + +var withDroppableScroll = function (droppable, point) { + var frame = droppable.frame; + + if (!frame) { + return point; + } + + return add(point, frame.scroll.diff.value); +}; + +var vertical = { + direction: 'vertical', + line: 'y', + crossAxisLine: 'x', + start: 'top', + end: 'bottom', + size: 'height', + crossAxisStart: 'left', + crossAxisEnd: 'right', + crossAxisSize: 'width' +}; +var horizontal = { + direction: 'horizontal', + line: 'x', + crossAxisLine: 'y', + start: 'left', + end: 'right', + size: 'width', + crossAxisStart: 'top', + crossAxisEnd: 'bottom', + crossAxisSize: 'height' +}; + +var isUserMovingForward = function (axis, direction) { + return axis === vertical ? direction.vertical === 'down' : direction.horizontal === 'right'; +}; + +var didStartDisplaced = function (draggableId, onLift) { + return Boolean(onLift.wasDisplaced[draggableId]); +}; + +var getCombinedItemDisplacement = function (_ref) { + var displaced = _ref.displaced, + onLift = _ref.onLift, + combineWith = _ref.combineWith, + displacedBy = _ref.displacedBy; + var isDisplaced = Boolean(displaced[combineWith]); + + if (didStartDisplaced(combineWith, onLift)) { + return isDisplaced ? origin : negate(displacedBy.point); + } + + return isDisplaced ? displacedBy.point : origin; +}; + +var getWhenEntered = function getWhenEntered(id, current, oldMerge) { + if (!oldMerge) { + return current; + } + + if (id !== oldMerge.combine.draggableId) { + return current; + } + + return oldMerge.whenEntered; +}; + +var isCombiningWith = function isCombiningWith(_ref) { + var id = _ref.id, + currentCenter = _ref.currentCenter, + axis = _ref.axis, + borderBox = _ref.borderBox, + displaceBy = _ref.displaceBy, + currentUserDirection = _ref.currentUserDirection, + oldMerge = _ref.oldMerge; + var start = borderBox[axis.start] + displaceBy[axis.line]; + var end = borderBox[axis.end] + displaceBy[axis.line]; + var size = borderBox[axis.size]; + var twoThirdsOfSize = size * 0.666; + var whenEntered = getWhenEntered(id, currentUserDirection, oldMerge); + var isMovingForward = isUserMovingForward(axis, whenEntered); + var targetCenter = currentCenter[axis.line]; + + if (isMovingForward) { + return isWithin(start, start + twoThirdsOfSize)(targetCenter); + } + + return isWithin(end - twoThirdsOfSize, end)(targetCenter); +}; + +var getCombineImpact = function (_ref2) { + var currentCenter = _ref2.pageBorderBoxCenterWithDroppableScrollChange, + previousImpact = _ref2.previousImpact, + destination = _ref2.destination, + insideDestinationWithoutDraggable = _ref2.insideDestinationWithoutDraggable, + userDirection = _ref2.userDirection, + onLift = _ref2.onLift; + + if (!destination.isCombineEnabled) { + return null; + } + + var axis = destination.axis; + var map = previousImpact.movement.map; + var canBeDisplacedBy = previousImpact.movement.displacedBy; + var oldMerge = previousImpact.merge; + var target = find(insideDestinationWithoutDraggable, function (child) { + var id = child.descriptor.id; + var displaceBy = getCombinedItemDisplacement({ + displaced: map, + onLift: onLift, + combineWith: id, + displacedBy: canBeDisplacedBy + }); + return isCombiningWith({ + id: id, + currentCenter: currentCenter, + axis: axis, + borderBox: child.page.borderBox, + displaceBy: displaceBy, + currentUserDirection: userDirection, + oldMerge: oldMerge + }); + }); + + if (!target) { + return null; + } + + var merge = { + whenEntered: getWhenEntered(target.descriptor.id, userDirection, oldMerge), + combine: { + draggableId: target.descriptor.id, + droppableId: destination.descriptor.id + } + }; + + var withMerge = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, previousImpact, { + destination: null, + merge: merge + }); + + return withMerge; +}; + +var isPartiallyVisibleThroughFrame = function (frame) { + var isWithinVertical = isWithin(frame.top, frame.bottom); + var isWithinHorizontal = isWithin(frame.left, frame.right); + return function (subject) { + var isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right); + + if (isContained) { + return true; + } + + var isPartiallyVisibleVertically = isWithinVertical(subject.top) || isWithinVertical(subject.bottom); + var isPartiallyVisibleHorizontally = isWithinHorizontal(subject.left) || isWithinHorizontal(subject.right); + var isPartiallyContained = isPartiallyVisibleVertically && isPartiallyVisibleHorizontally; + + if (isPartiallyContained) { + return true; + } + + var isBiggerVertically = subject.top < frame.top && subject.bottom > frame.bottom; + var isBiggerHorizontally = subject.left < frame.left && subject.right > frame.right; + var isTargetBiggerThanFrame = isBiggerVertically && isBiggerHorizontally; + + if (isTargetBiggerThanFrame) { + return true; + } + + var isTargetBiggerOnOneAxis = isBiggerVertically && isPartiallyVisibleHorizontally || isBiggerHorizontally && isPartiallyVisibleVertically; + return isTargetBiggerOnOneAxis; + }; +}; + +var isTotallyVisibleThroughFrame = function (frame) { + var isWithinVertical = isWithin(frame.top, frame.bottom); + var isWithinHorizontal = isWithin(frame.left, frame.right); + return function (subject) { + var isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right); + return isContained; + }; +}; + +var isTotallyVisibleThroughFrameOnAxis = function (axis) { + return function (frame) { + var isWithinVertical = isWithin(frame.top, frame.bottom); + var isWithinHorizontal = isWithin(frame.left, frame.right); + return function (subject) { + if (axis === vertical) { + return isWithinVertical(subject.top) && isWithinVertical(subject.bottom); + } + + return isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right); + }; + }; +}; + +var getDroppableDisplaced = function getDroppableDisplaced(target, destination) { + var displacement = destination.frame ? destination.frame.scroll.diff.displacement : origin; + return offsetByPosition(target, displacement); +}; + +var isVisibleInDroppable = function isVisibleInDroppable(target, destination, isVisibleThroughFrameFn) { + if (!destination.subject.active) { + return false; + } + + return isVisibleThroughFrameFn(destination.subject.active)(target); +}; + +var isVisibleInViewport = function isVisibleInViewport(target, viewport, isVisibleThroughFrameFn) { + return isVisibleThroughFrameFn(viewport)(target); +}; + +var isVisible = function isVisible(_ref) { + var toBeDisplaced = _ref.target, + destination = _ref.destination, + viewport = _ref.viewport, + withDroppableDisplacement = _ref.withDroppableDisplacement, + isVisibleThroughFrameFn = _ref.isVisibleThroughFrameFn; + var displacedTarget = withDroppableDisplacement ? getDroppableDisplaced(toBeDisplaced, destination) : toBeDisplaced; + return isVisibleInDroppable(displacedTarget, destination, isVisibleThroughFrameFn) && isVisibleInViewport(displacedTarget, viewport, isVisibleThroughFrameFn); +}; + +var isPartiallyVisible = function isPartiallyVisible(args) { + return isVisible(Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, args, { + isVisibleThroughFrameFn: isPartiallyVisibleThroughFrame + })); +}; + +var isTotallyVisible = function isTotallyVisible(args) { + return isVisible(Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, args, { + isVisibleThroughFrameFn: isTotallyVisibleThroughFrame + })); +}; + +var isTotallyVisibleOnAxis = function isTotallyVisibleOnAxis(args) { + return isVisible(Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, args, { + isVisibleThroughFrameFn: isTotallyVisibleThroughFrameOnAxis(args.destination.axis) + })); +}; + +var getShouldAnimate = function getShouldAnimate(forceShouldAnimate, isVisible, previous) { + if (typeof forceShouldAnimate === 'boolean') { + return forceShouldAnimate; + } + + if (!isVisible) { + return false; + } + + if (!previous) { + return true; + } + + return previous.shouldAnimate; +}; + +var getTarget = function getTarget(draggable, onLift) { + var marginBox = draggable.page.marginBox; + + if (!didStartDisplaced(draggable.descriptor.id, onLift)) { + return marginBox; + } + + var expandBy = { + top: onLift.displacedBy.point.y, + right: 0, + bottom: 0, + left: onLift.displacedBy.point.x + }; + return Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["getRect"])(Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["expand"])(marginBox, expandBy)); +}; + +var getDisplacement = function (_ref) { + var draggable = _ref.draggable, + destination = _ref.destination, + previousImpact = _ref.previousImpact, + viewport = _ref.viewport, + onLift = _ref.onLift, + forceShouldAnimate = _ref.forceShouldAnimate; + var id = draggable.descriptor.id; + var map = previousImpact.movement.map; + var target = getTarget(draggable, onLift); + var isVisible = isPartiallyVisible({ + target: target, + destination: destination, + viewport: viewport, + withDroppableDisplacement: true + }); + var shouldAnimate = getShouldAnimate(forceShouldAnimate, isVisible, map[id]); + var displacement = { + draggableId: id, + isVisible: isVisible, + shouldAnimate: shouldAnimate + }; + return displacement; +}; + +var getDisplacementMap = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (displaced) { + return displaced.reduce(function (map, displacement) { + map[displacement.draggableId] = displacement; + return map; + }, {}); +}); +var getDisplacedBy = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (axis, displaceBy) { + var displacement = displaceBy[axis.line]; + return { + value: displacement, + point: patch(axis.line, displacement) + }; +}); + +var getReorderImpact = function (_ref) { + var currentCenter = _ref.pageBorderBoxCenterWithDroppableScrollChange, + draggable = _ref.draggable, + destination = _ref.destination, + insideDestinationWithoutDraggable = _ref.insideDestinationWithoutDraggable, + previousImpact = _ref.previousImpact, + viewport = _ref.viewport, + userDirection = _ref.userDirection, + onLift = _ref.onLift; + var axis = destination.axis; + var isMovingForward = isUserMovingForward(destination.axis, userDirection); + var displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy); + var targetCenter = currentCenter[axis.line]; + var displacement = displacedBy.value; + var displaced = insideDestinationWithoutDraggable.filter(function (child) { + var borderBox = child.page.borderBox; + var start = borderBox[axis.start]; + var end = borderBox[axis.end]; + var didStartDisplaced$1 = didStartDisplaced(child.descriptor.id, onLift); + + if (isMovingForward) { + if (didStartDisplaced$1) { + return targetCenter < start; + } + + return targetCenter < start + displacement; + } + + if (didStartDisplaced$1) { + return targetCenter <= end - displacement; + } + + return targetCenter <= end; + }).map(function (dimension) { + return getDisplacement({ + draggable: dimension, + destination: destination, + previousImpact: previousImpact, + viewport: viewport.frame, + onLift: onLift + }); + }); + var newIndex = insideDestinationWithoutDraggable.length - displaced.length; + var movement = { + displacedBy: displacedBy, + displaced: displaced, + map: getDisplacementMap(displaced) + }; + var impact = { + movement: movement, + destination: { + droppableId: destination.descriptor.id, + index: newIndex + }, + merge: null + }; + return impact; +}; + +var noDisplacedBy = { + point: origin, + value: 0 +}; +var noMovement = { + displaced: [], + map: {}, + displacedBy: noDisplacedBy +}; +var noImpact = { + movement: noMovement, + destination: null, + merge: null +}; +var removeDraggableFromList = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (remove, list) { + return list.filter(function (item) { + return item.descriptor.id !== remove.descriptor.id; + }); +}); + +var getDragImpact = function (_ref) { + var pageBorderBoxCenter = _ref.pageBorderBoxCenter, + draggable = _ref.draggable, + draggables = _ref.draggables, + droppables = _ref.droppables, + previousImpact = _ref.previousImpact, + viewport = _ref.viewport, + userDirection = _ref.userDirection, + onLift = _ref.onLift; + var destinationId = getDroppableOver({ + target: pageBorderBoxCenter, + droppables: droppables + }); + + if (!destinationId) { + return noImpact; + } + + var destination = droppables[destinationId]; + var insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables); + var insideDestinationWithoutDraggable = removeDraggableFromList(draggable, insideDestination); + var pageBorderBoxCenterWithDroppableScrollChange = withDroppableScroll(destination, pageBorderBoxCenter); + var withMerge = getCombineImpact({ + pageBorderBoxCenterWithDroppableScrollChange: pageBorderBoxCenterWithDroppableScrollChange, + previousImpact: previousImpact, + destination: destination, + insideDestinationWithoutDraggable: insideDestinationWithoutDraggable, + userDirection: userDirection, + onLift: onLift + }); + + if (withMerge) { + return withMerge; + } + + return getReorderImpact({ + pageBorderBoxCenterWithDroppableScrollChange: pageBorderBoxCenterWithDroppableScrollChange, + destination: destination, + draggable: draggable, + insideDestinationWithoutDraggable: insideDestinationWithoutDraggable, + previousImpact: previousImpact, + viewport: viewport, + userDirection: userDirection, + onLift: onLift + }); +}; + +var getHomeLocation = function (descriptor) { + return { + index: descriptor.index, + droppableId: descriptor.droppableId + }; +}; + +var getHomeOnLift = function (_ref) { + var draggable = _ref.draggable, + home = _ref.home, + draggables = _ref.draggables, + viewport = _ref.viewport; + var displacedBy = getDisplacedBy(home.axis, draggable.displaceBy); + var insideHome = getDraggablesInsideDroppable(home.descriptor.id, draggables); + var originallyDisplaced = insideHome.slice(draggable.descriptor.index + 1); + var wasDisplaced = originallyDisplaced.reduce(function (previous, item) { + previous[item.descriptor.id] = true; + return previous; + }, {}); + var onLift = { + displacedBy: displacedBy, + wasDisplaced: wasDisplaced + }; + var displaced = originallyDisplaced.map(function (dimension) { + return getDisplacement({ + draggable: dimension, + destination: home, + previousImpact: noImpact, + viewport: viewport.frame, + forceShouldAnimate: false, + onLift: onLift + }); + }); + var movement = { + displaced: displaced, + map: getDisplacementMap(displaced), + displacedBy: displacedBy + }; + var impact = { + movement: movement, + destination: getHomeLocation(draggable.descriptor), + merge: null + }; + return { + impact: impact, + onLift: onLift + }; +}; + +var getDragPositions = function (_ref) { + var oldInitial = _ref.initial, + oldCurrent = _ref.current, + oldClientBorderBoxCenter = _ref.oldClientBorderBoxCenter, + newClientBorderBoxCenter = _ref.newClientBorderBoxCenter, + viewport = _ref.viewport; + var shift = subtract(newClientBorderBoxCenter, oldClientBorderBoxCenter); + + var initial = function () { + var client = { + selection: add(oldInitial.client.selection, shift), + borderBoxCenter: newClientBorderBoxCenter, + offset: origin + }; + var page = { + selection: add(client.selection, viewport.scroll.initial), + borderBoxCenter: add(client.selection, viewport.scroll.initial) + }; + return { + client: client, + page: page + }; + }(); + + var current = function () { + var reverse = negate(shift); + var offset = add(oldCurrent.client.offset, reverse); + var client = { + selection: add(initial.client.selection, offset), + borderBoxCenter: add(initial.client.borderBoxCenter, offset), + offset: offset + }; + var page = { + selection: add(client.selection, viewport.scroll.current), + borderBoxCenter: add(client.borderBoxCenter, viewport.scroll.current) + }; + !isEqual(oldCurrent.client.borderBoxCenter, client.borderBoxCenter) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "\n Incorrect new client center position.\n Expected (" + oldCurrent.client.borderBoxCenter.x + ", " + oldCurrent.client.borderBoxCenter.y + ")\n to equal (" + client.borderBoxCenter.x + ", " + client.borderBoxCenter.y + ")\n ") : undefined : void 0; + return { + client: client, + page: page + }; + }(); + + return { + current: current, + initial: initial + }; +}; + +var offsetDraggable = function (_ref) { + var draggable = _ref.draggable, + offset$1 = _ref.offset, + initialWindowScroll = _ref.initialWindowScroll; + var client = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["offset"])(draggable.client, offset$1); + var page = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["withScroll"])(client, initialWindowScroll); + + var moved = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, draggable, { + placeholder: Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, draggable.placeholder, { + client: client + }), + client: client, + page: page + }); + + return moved; +}; + +var adjustExistingForAdditionsAndRemovals = function (_ref) { + var existing = _ref.existing, + droppables = _ref.droppables, + addedDraggables = _ref.additions, + removedDraggables = _ref.removals, + viewport = _ref.viewport; + var shifted = {}; + toDroppableList(droppables).forEach(function (droppable) { + var axis = droppable.axis; + var original = getDraggablesInsideDroppable(droppable.descriptor.id, existing); + var toShift = {}; + + var addShift = function addShift(id, shift) { + var previous = toShift[id]; + + if (!previous) { + toShift[id] = shift; + return; + } + + toShift[id] = { + indexChange: previous.indexChange + shift.indexChange, + offset: add(previous.offset, shift.offset) + }; + }; + + var removals = toDraggableMap(removedDraggables.map(function (id) { + var item = existing[id]; + !item ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Could not find removed draggable \"" + id + "\"") : undefined : void 0; + return item; + }).filter(function (draggable) { + return draggable.descriptor.droppableId === droppable.descriptor.id; + })); + var withRemovals = original.filter(function (item, index) { + var isBeingRemoved = Boolean(removals[item.descriptor.id]); + + if (!isBeingRemoved) { + return true; + } + + var offset = negate(patch(axis.line, item.displaceBy[axis.line])); + original.slice(index).forEach(function (sibling) { + if (removals[sibling.descriptor.id]) { + return; + } + + addShift(sibling.descriptor.id, { + indexChange: -1, + offset: offset + }); + }); + return false; + }); + var additions = addedDraggables.filter(function (draggable) { + return draggable.descriptor.droppableId === droppable.descriptor.id; + }); + var withAdditions = withRemovals.slice(0); + additions.forEach(function (item) { + withAdditions.splice(item.descriptor.index, 0, item); + }); + var additionMap = toDraggableMap(additions); + withAdditions.forEach(function (item, index) { + var wasAdded = Boolean(additionMap[item.descriptor.id]); + + if (!wasAdded) { + return; + } + + var offset = patch(axis.line, item.client.marginBox[axis.size]); + withAdditions.slice(index).forEach(function (sibling) { + if (additionMap[sibling.descriptor.id]) { + return; + } + + addShift(sibling.descriptor.id, { + indexChange: 1, + offset: offset + }); + }); + }); + withAdditions.forEach(function (item) { + if (additionMap[item.descriptor.id]) { + return; + } + + var shift = toShift[item.descriptor.id]; + + if (!shift) { + return; + } + + var moved = offsetDraggable({ + draggable: item, + offset: shift.offset, + initialWindowScroll: viewport.scroll.initial + }); + var index = item.descriptor.index + shift.indexChange; + + var updated = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, moved, { + descriptor: Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, item.descriptor, { + index: index + }) + }); + + shifted[moved.descriptor.id] = updated; + }); + }); + + var map = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, existing, shifted); + + return map; +}; + +var adjustAdditionsForScrollChanges = function (_ref) { + var additions = _ref.additions, + updatedDroppables = _ref.updatedDroppables, + viewport = _ref.viewport; + var windowScrollChange = viewport.scroll.diff.value; + return additions.map(function (draggable) { + var droppableId = draggable.descriptor.droppableId; + var modified = updatedDroppables[droppableId]; + var frame = modified.frame; + !frame ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false) : undefined : void 0; + var droppableScrollChange = frame.scroll.diff.value; + var totalChange = add(windowScrollChange, droppableScrollChange); + var moved = offsetDraggable({ + draggable: draggable, + offset: totalChange, + initialWindowScroll: viewport.scroll.initial + }); + return moved; + }); +}; + +var adjustAdditionsForCollapsedHome = function (_ref) { + var additions = _ref.additions, + dragging = _ref.dragging, + home = _ref.home, + viewport = _ref.viewport; + var displacedBy = getDisplacedBy(home.axis, dragging.displaceBy); + return additions.map(function (draggable) { + if (draggable.descriptor.droppableId !== home.descriptor.id) { + return draggable; + } + + if (draggable.descriptor.index < dragging.descriptor.index) { + return draggable; + } + + return offsetDraggable({ + draggable: draggable, + offset: displacedBy.point, + initialWindowScroll: viewport.scroll.initial + }); + }); +}; + +var updateDraggables = function (_ref) { + var updatedDroppables = _ref.updatedDroppables, + criticalId = _ref.criticalId, + unmodifiedExisting = _ref.existing, + unmodifiedAdditions = _ref.additions, + removals = _ref.removals, + viewport = _ref.viewport; + var existing = adjustExistingForAdditionsAndRemovals({ + droppables: updatedDroppables, + existing: unmodifiedExisting, + additions: unmodifiedAdditions, + removals: removals, + viewport: viewport + }); + var dragging = existing[criticalId]; + var home = updatedDroppables[dragging.descriptor.droppableId]; + var scrolledAdditions = adjustAdditionsForScrollChanges({ + additions: unmodifiedAdditions, + updatedDroppables: updatedDroppables, + viewport: viewport + }); + var additions = adjustAdditionsForCollapsedHome({ + additions: scrolledAdditions, + dragging: dragging, + home: home, + viewport: viewport + }); + + var map = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, existing, toDraggableMap(additions)); + + removals.forEach(function (id) { + delete map[id]; + }); + return map; +}; + +var getMaxScroll = function (_ref) { + var scrollHeight = _ref.scrollHeight, + scrollWidth = _ref.scrollWidth, + height = _ref.height, + width = _ref.width; + var maxScroll = subtract({ + x: scrollWidth, + y: scrollHeight + }, { + x: width, + y: height + }); + var adjustedMaxScroll = { + x: Math.max(0, maxScroll.x), + y: Math.max(0, maxScroll.y) + }; + return adjustedMaxScroll; +}; + +var getDroppableDimension = function (_ref) { + var descriptor = _ref.descriptor, + isEnabled = _ref.isEnabled, + isCombineEnabled = _ref.isCombineEnabled, + isFixedOnPage = _ref.isFixedOnPage, + direction = _ref.direction, + client = _ref.client, + page = _ref.page, + closest = _ref.closest; + + var frame = function () { + if (!closest) { + return null; + } + + var scrollSize = closest.scrollSize, + frameClient = closest.client; + var maxScroll = getMaxScroll({ + scrollHeight: scrollSize.scrollHeight, + scrollWidth: scrollSize.scrollWidth, + height: frameClient.paddingBox.height, + width: frameClient.paddingBox.width + }); + return { + pageMarginBox: closest.page.marginBox, + frameClient: frameClient, + scrollSize: scrollSize, + shouldClipSubject: closest.shouldClipSubject, + scroll: { + initial: closest.scroll, + current: closest.scroll, + max: maxScroll, + diff: { + value: origin, + displacement: origin + } + } + }; + }(); + + var axis = direction === 'vertical' ? vertical : horizontal; + var subject = getSubject({ + page: page, + withPlaceholder: null, + axis: axis, + frame: frame + }); + var dimension = { + descriptor: descriptor, + isCombineEnabled: isCombineEnabled, + isFixedOnPage: isFixedOnPage, + axis: axis, + isEnabled: isEnabled, + client: client, + page: page, + frame: frame, + subject: subject + }; + return dimension; +}; + +var isHomeOf = function (draggable, destination) { + return draggable.descriptor.droppableId === destination.descriptor.id; +}; + +var getRequiredGrowthForPlaceholder = function getRequiredGrowthForPlaceholder(droppable, placeholderSize, draggables) { + var axis = droppable.axis; + var availableSpace = droppable.subject.page.contentBox[axis.size]; + var insideDroppable = getDraggablesInsideDroppable(droppable.descriptor.id, draggables); + var spaceUsed = insideDroppable.reduce(function (sum, dimension) { + return sum + dimension.client.marginBox[axis.size]; + }, 0); + var requiredSpace = spaceUsed + placeholderSize[axis.line]; + var needsToGrowBy = requiredSpace - availableSpace; + + if (needsToGrowBy <= 0) { + return null; + } + + return patch(axis.line, needsToGrowBy); +}; + +var withMaxScroll = function withMaxScroll(frame, max) { + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, frame, { + scroll: Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, frame.scroll, { + max: max + }) + }); +}; + +var addPlaceholder = function addPlaceholder(droppable, draggable, draggables) { + var frame = droppable.frame; + !!isHomeOf(draggable, droppable) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Should not add placeholder space to home list') : undefined : void 0; + !!droppable.subject.withPlaceholder ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot add placeholder size to a subject when it already has one') : undefined : void 0; + var placeholderSize = getDisplacedBy(droppable.axis, draggable.displaceBy).point; + var requiredGrowth = getRequiredGrowthForPlaceholder(droppable, placeholderSize, draggables); + var added = { + placeholderSize: placeholderSize, + increasedBy: requiredGrowth, + oldFrameMaxScroll: droppable.frame ? droppable.frame.scroll.max : null + }; + + if (!frame) { + var _subject = getSubject({ + page: droppable.subject.page, + withPlaceholder: added, + axis: droppable.axis, + frame: droppable.frame + }); + + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, droppable, { + subject: _subject + }); + } + + var maxScroll = requiredGrowth ? add(frame.scroll.max, requiredGrowth) : frame.scroll.max; + var newFrame = withMaxScroll(frame, maxScroll); + var subject = getSubject({ + page: droppable.subject.page, + withPlaceholder: added, + axis: droppable.axis, + frame: newFrame + }); + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, droppable, { + subject: subject, + frame: newFrame + }); +}; + +var removePlaceholder = function removePlaceholder(droppable) { + var added = droppable.subject.withPlaceholder; + !added ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot remove placeholder form subject when there was none') : undefined : void 0; + var frame = droppable.frame; + + if (!frame) { + var _subject2 = getSubject({ + page: droppable.subject.page, + axis: droppable.axis, + frame: null, + withPlaceholder: null + }); + + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, droppable, { + subject: _subject2 + }); + } + + var oldMaxScroll = added.oldFrameMaxScroll; + !oldMaxScroll ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Expected droppable with frame to have old max frame scroll when removing placeholder') : undefined : void 0; + var newFrame = withMaxScroll(frame, oldMaxScroll); + var subject = getSubject({ + page: droppable.subject.page, + axis: droppable.axis, + frame: newFrame, + withPlaceholder: null + }); + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, droppable, { + subject: subject, + frame: newFrame + }); +}; + +var getFrame = function (droppable) { + var frame = droppable.frame; + !frame ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Expected Droppable to have a frame') : undefined : void 0; + return frame; +}; + +var throwIfSpacingChange = function throwIfSpacingChange(old, fresh) { + if (true) { + var getMessage = function getMessage(spacingType) { + return "Cannot change the " + spacingType + " of a Droppable during a drag"; + }; + + !isEqual$1(old.margin, fresh.margin) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, getMessage('margin')) : undefined : void 0; + !isEqual$1(old.border, fresh.border) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, getMessage('border')) : undefined : void 0; + !isEqual$1(old.padding, fresh.padding) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, getMessage('padding')) : undefined : void 0; + } +}; + +var adjustBorderBoxSize = function adjustBorderBoxSize(axis, old, fresh) { + return { + top: old.top, + left: old.left, + right: old.left + fresh.width, + bottom: old.top + fresh.height + }; +}; + +var updateDroppables = function (_ref) { + var modified = _ref.modified, + existing = _ref.existing, + viewport = _ref.viewport; + + if (!modified.length) { + return existing; + } + + var adjusted = modified.map(function (provided) { + var raw = existing[provided.descriptor.id]; + !raw ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Could not locate droppable in existing droppables') : undefined : void 0; + var hasPlaceholder = Boolean(raw.subject.withPlaceholder); + var dimension = hasPlaceholder ? removePlaceholder(raw) : raw; + var oldClient = dimension.client; + var newClient = provided.client; + var oldScrollable = getFrame(dimension); + var newScrollable = getFrame(provided); + + if (true) { + throwIfSpacingChange(dimension.client, provided.client); + throwIfSpacingChange(oldScrollable.frameClient, newScrollable.frameClient); + var isFrameEqual = oldScrollable.frameClient.borderBox.height === newScrollable.frameClient.borderBox.height && oldScrollable.frameClient.borderBox.width === newScrollable.frameClient.borderBox.width; + !isFrameEqual ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'The width and height of your Droppable scroll container cannot change when adding or removing Draggables during a drag') : undefined : void 0; + } + + var client = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["createBox"])({ + borderBox: adjustBorderBoxSize(dimension.axis, oldClient.borderBox, newClient.borderBox), + margin: oldClient.margin, + border: oldClient.border, + padding: oldClient.padding + }); + var closest = { + client: oldScrollable.frameClient, + page: Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["withScroll"])(oldScrollable.frameClient, viewport.scroll.initial), + shouldClipSubject: oldScrollable.shouldClipSubject, + scrollSize: newScrollable.scrollSize, + scroll: oldScrollable.scroll.initial + }; + var withSizeChanged = getDroppableDimension({ + descriptor: provided.descriptor, + isEnabled: provided.isEnabled, + isCombineEnabled: provided.isCombineEnabled, + isFixedOnPage: provided.isFixedOnPage, + direction: provided.axis.direction, + client: client, + page: Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["withScroll"])(client, viewport.scroll.initial), + closest: closest + }); + var scrolled = scrollDroppable(withSizeChanged, newScrollable.scroll.current); + return scrolled; + }); + + var result = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, existing, toDroppableMap(adjusted)); + + return result; +}; + +var withNoAnimatedDisplacement = function (impact) { + var displaced = impact.movement.displaced; + + if (!displaced.length) { + return impact; + } + + var withoutAnimation = displaced.map(function (displacement) { + if (!displacement.isVisible) { + return displacement; + } + + if (!displacement.shouldAnimate) { + return displacement; + } + + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, displacement, { + shouldAnimate: false + }); + }); + + var result = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, impact, { + movement: Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, impact.movement, { + displaced: withoutAnimation, + map: getDisplacementMap(withoutAnimation) + }) + }); + + return result; +}; + +var patchDroppableMap = function (droppables, updated) { + var _extends2; + + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, droppables, (_extends2 = {}, _extends2[updated.descriptor.id] = updated, _extends2)); +}; + +var clearUnusedPlaceholder = function clearUnusedPlaceholder(_ref) { + var previousImpact = _ref.previousImpact, + impact = _ref.impact, + droppables = _ref.droppables; + var last = whatIsDraggedOver(previousImpact); + var now = whatIsDraggedOver(impact); + + if (!last) { + return droppables; + } + + if (last === now) { + return droppables; + } + + var lastDroppable = droppables[last]; + + if (!lastDroppable.subject.withPlaceholder) { + return droppables; + } + + var updated = removePlaceholder(lastDroppable); + return patchDroppableMap(droppables, updated); +}; + +var recomputePlaceholders = function (_ref2) { + var draggable = _ref2.draggable, + draggables = _ref2.draggables, + droppables = _ref2.droppables, + previousImpact = _ref2.previousImpact, + impact = _ref2.impact; + var cleaned = clearUnusedPlaceholder({ + previousImpact: previousImpact, + impact: impact, + droppables: droppables + }); + var isOver = whatIsDraggedOver(impact); + + if (!isOver) { + return cleaned; + } + + var droppable = droppables[isOver]; + + if (isHomeOf(draggable, droppable)) { + return cleaned; + } + + if (droppable.subject.withPlaceholder) { + return cleaned; + } + + var patched = addPlaceholder(droppable, draggable, draggables); + return patchDroppableMap(cleaned, patched); +}; + +var timingsKey = 'Processing dynamic changes'; + +var publishWhileDragging = function (_ref) { + var _extends2, _extends3; + + var state = _ref.state, + published = _ref.published; + start(timingsKey); + var updatedDroppables = updateDroppables({ + modified: published.modified, + existing: state.dimensions.droppables, + viewport: state.viewport + }); + var draggables = updateDraggables({ + updatedDroppables: updatedDroppables, + criticalId: state.critical.draggable.id, + existing: state.dimensions.draggables, + additions: published.additions, + removals: published.removals, + viewport: state.viewport + }); + var critical = { + draggable: draggables[state.critical.draggable.id].descriptor, + droppable: updatedDroppables[state.critical.droppable.id].descriptor + }; + var original = state.dimensions.draggables[critical.draggable.id]; + var updated = draggables[critical.draggable.id]; + var droppables = recomputePlaceholders({ + draggable: updated, + draggables: draggables, + droppables: updatedDroppables, + previousImpact: state.impact, + impact: state.impact + }); + var dimensions = { + draggables: draggables, + droppables: droppables + }; + + var _getDragPositions = getDragPositions({ + initial: state.initial, + current: state.current, + oldClientBorderBoxCenter: original.client.borderBox.center, + newClientBorderBoxCenter: updated.client.borderBox.center, + viewport: state.viewport + }), + initial = _getDragPositions.initial, + current = _getDragPositions.current; + + var _getHomeOnLift = getHomeOnLift({ + draggable: updated, + home: dimensions.droppables[critical.droppable.id], + draggables: dimensions.draggables, + viewport: state.viewport + }), + homeImpact = _getHomeOnLift.impact, + onLift = _getHomeOnLift.onLift; + + var impact = withNoAnimatedDisplacement(getDragImpact({ + pageBorderBoxCenter: current.page.borderBoxCenter, + draggable: updated, + draggables: dimensions.draggables, + droppables: dimensions.droppables, + previousImpact: homeImpact, + viewport: state.viewport, + userDirection: state.userDirection, + onLift: onLift + })); + var isOrphaned = Boolean(state.movementMode === 'SNAP' && !whatIsDraggedOver(impact)); + !!isOrphaned ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Dragging item no longer has a valid merge/destination after a dynamic update. This is not supported') : undefined : void 0; + finish(timingsKey); + + var draggingState = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ + phase: 'DRAGGING' + }, state, (_extends2 = {}, _extends2["phase"] = 'DRAGGING', _extends2.critical = critical, _extends2.current = current, _extends2.initial = initial, _extends2.impact = impact, _extends2.dimensions = dimensions, _extends2.onLift = onLift, _extends2.onLiftImpact = homeImpact, _extends2.forceShouldAnimate = false, _extends2)); + + if (state.phase === 'COLLECTING') { + return draggingState; + } + + var dropPending = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ + phase: 'DROP_PENDING' + }, draggingState, (_extends3 = {}, _extends3["phase"] = 'DROP_PENDING', _extends3.reason = state.reason, _extends3.isWaiting = false, _extends3)); + + return dropPending; +}; + +var forward = { + vertical: 'down', + horizontal: 'right' +}; +var backward = { + vertical: 'up', + horizontal: 'left' +}; + +var moveToNextCombine = function (_ref) { + var isMovingForward = _ref.isMovingForward, + isInHomeList = _ref.isInHomeList, + draggable = _ref.draggable, + destination = _ref.destination, + originalInsideDestination = _ref.insideDestination, + previousImpact = _ref.previousImpact; + + if (!destination.isCombineEnabled) { + return null; + } + + if (previousImpact.merge) { + return null; + } + + var location = previousImpact.destination; + !location ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Need a previous location to move from into a combine') : undefined : void 0; + var currentIndex = location.index; + + var currentInsideDestination = function () { + var shallow = originalInsideDestination.slice(); + + if (isInHomeList) { + shallow.splice(draggable.descriptor.index, 1); + } + + shallow.splice(location.index, 0, draggable); + return shallow; + }(); + + var targetIndex = isMovingForward ? currentIndex + 1 : currentIndex - 1; + + if (targetIndex < 0) { + return null; + } + + if (targetIndex > currentInsideDestination.length - 1) { + return null; + } + + var target = currentInsideDestination[targetIndex]; + !(target !== draggable) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot combine with self') : undefined : void 0; + var merge = { + whenEntered: isMovingForward ? forward : backward, + combine: { + draggableId: target.descriptor.id, + droppableId: destination.descriptor.id + } + }; + var impact = { + movement: previousImpact.movement, + destination: null, + merge: merge + }; + return impact; +}; + +var addClosest = function addClosest(add, displaced) { + var added = { + draggableId: add.descriptor.id, + isVisible: true, + shouldAnimate: true + }; + return [added].concat(displaced); +}; + +var removeClosest = function removeClosest(displaced) { + return displaced.slice(1); +}; + +var fromReorder = function (_ref) { + var isMovingForward = _ref.isMovingForward, + isInHomeList = _ref.isInHomeList, + draggable = _ref.draggable, + initialInside = _ref.insideDestination, + location = _ref.location; + var insideDestination = initialInside.slice(); + var currentIndex = location.index; + var isInForeignList = !isInHomeList; + + if (isInForeignList) { + insideDestination.splice(location.index, 0, draggable); + } + + var proposedIndex = isMovingForward ? currentIndex + 1 : currentIndex - 1; + + if (proposedIndex < 0) { + return null; + } + + if (proposedIndex > insideDestination.length - 1) { + return null; + } + + return { + proposedIndex: proposedIndex, + modifyDisplacement: true + }; +}; + +var fromCombine = function (_ref) { + var isMovingForward = _ref.isMovingForward, + destination = _ref.destination, + previousImpact = _ref.previousImpact, + draggables = _ref.draggables, + merge = _ref.merge, + onLift = _ref.onLift; + + if (!destination.isCombineEnabled) { + return null; + } + + var movement = previousImpact.movement; + var combineId = merge.combine.draggableId; + var combine = draggables[combineId]; + var combineIndex = combine.descriptor.index; + var wasDisplacedAtStart = didStartDisplaced(combineId, onLift); + + if (wasDisplacedAtStart) { + var hasDisplacedFromStart = !movement.map[combineId]; + + if (hasDisplacedFromStart) { + if (isMovingForward) { + return { + proposedIndex: combineIndex, + modifyDisplacement: false + }; + } + + return { + proposedIndex: combineIndex - 1, + modifyDisplacement: true + }; + } + + if (isMovingForward) { + return { + proposedIndex: combineIndex, + modifyDisplacement: true + }; + } + + return { + proposedIndex: combineIndex - 1, + modifyDisplacement: false + }; + } + + var isDisplaced = Boolean(movement.map[combineId]); + + if (isDisplaced) { + if (isMovingForward) { + return { + proposedIndex: combineIndex + 1, + modifyDisplacement: true + }; + } + + return { + proposedIndex: combineIndex, + modifyDisplacement: false + }; + } + + if (isMovingForward) { + return { + proposedIndex: combineIndex + 1, + modifyDisplacement: false + }; + } + + return { + proposedIndex: combineIndex, + modifyDisplacement: true + }; +}; + +var moveToNextIndex = function (_ref) { + var isMovingForward = _ref.isMovingForward, + isInHomeList = _ref.isInHomeList, + draggable = _ref.draggable, + draggables = _ref.draggables, + destination = _ref.destination, + insideDestination = _ref.insideDestination, + previousImpact = _ref.previousImpact, + onLift = _ref.onLift; + + var instruction = function () { + if (previousImpact.destination) { + return fromReorder({ + isMovingForward: isMovingForward, + isInHomeList: isInHomeList, + draggable: draggable, + location: previousImpact.destination, + insideDestination: insideDestination + }); + } + + if (previousImpact.merge) { + return fromCombine({ + isMovingForward: isMovingForward, + destination: destination, + previousImpact: previousImpact, + draggables: draggables, + merge: previousImpact.merge, + onLift: onLift + }); + } + + return null; + }(); + + if (instruction == null) { + return null; + } + + var proposedIndex = instruction.proposedIndex, + modifyDisplacement = instruction.modifyDisplacement; + var displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy); + + var displaced = function () { + var lastDisplaced = previousImpact.movement.displaced; + + if (!modifyDisplacement) { + return lastDisplaced; + } + + if (isMovingForward) { + return removeClosest(lastDisplaced); + } + + var withoutDraggable = removeDraggableFromList(draggable, insideDestination); + var atProposedIndex = withoutDraggable[proposedIndex]; + return addClosest(atProposedIndex, lastDisplaced); + }(); + + return { + movement: { + displacedBy: displacedBy, + displaced: displaced, + map: getDisplacementMap(displaced) + }, + destination: { + droppableId: destination.descriptor.id, + index: proposedIndex + }, + merge: null + }; +}; + +var whenCombining = function (_ref) { + var combine = _ref.combine, + onLift = _ref.onLift, + movement = _ref.movement, + draggables = _ref.draggables; + var combineWith = combine.draggableId; + var center = draggables[combineWith].page.borderBox.center; + var displaceBy = getCombinedItemDisplacement({ + displaced: movement.map, + onLift: onLift, + combineWith: combineWith, + displacedBy: movement.displacedBy + }); + return add(center, displaceBy); +}; + +var distanceFromStartToBorderBoxCenter = function distanceFromStartToBorderBoxCenter(axis, box) { + return box.margin[axis.start] + box.borderBox[axis.size] / 2; +}; + +var distanceFromEndToBorderBoxCenter = function distanceFromEndToBorderBoxCenter(axis, box) { + return box.margin[axis.end] + box.borderBox[axis.size] / 2; +}; + +var getCrossAxisBorderBoxCenter = function getCrossAxisBorderBoxCenter(axis, target, isMoving) { + return target[axis.crossAxisStart] + isMoving.margin[axis.crossAxisStart] + isMoving.borderBox[axis.crossAxisSize] / 2; +}; + +var goAfter = function goAfter(_ref) { + var axis = _ref.axis, + moveRelativeTo = _ref.moveRelativeTo, + isMoving = _ref.isMoving; + return patch(axis.line, moveRelativeTo.marginBox[axis.end] + distanceFromStartToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving)); +}; + +var goBefore = function goBefore(_ref2) { + var axis = _ref2.axis, + moveRelativeTo = _ref2.moveRelativeTo, + isMoving = _ref2.isMoving; + return patch(axis.line, moveRelativeTo.marginBox[axis.start] - distanceFromEndToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving)); +}; + +var goIntoStart = function goIntoStart(_ref3) { + var axis = _ref3.axis, + moveInto = _ref3.moveInto, + isMoving = _ref3.isMoving; + return patch(axis.line, moveInto.contentBox[axis.start] + distanceFromStartToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveInto.contentBox, isMoving)); +}; + +var whenReordering = function (_ref) { + var movement = _ref.movement, + draggable = _ref.draggable, + draggables = _ref.draggables, + droppable = _ref.droppable, + onLift = _ref.onLift; + var insideDestination = getDraggablesInsideDroppable(droppable.descriptor.id, draggables); + var draggablePage = draggable.page; + var axis = droppable.axis; + + if (!insideDestination.length) { + return goIntoStart({ + axis: axis, + moveInto: droppable.page, + isMoving: draggablePage + }); + } + + var displaced = movement.displaced, + displacedBy = movement.displacedBy; + + if (displaced.length) { + var closestAfter = draggables[displaced[0].draggableId]; + + if (didStartDisplaced(closestAfter.descriptor.id, onLift)) { + return goBefore({ + axis: axis, + moveRelativeTo: closestAfter.page, + isMoving: draggablePage + }); + } + + var withDisplacement = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["offset"])(closestAfter.page, displacedBy.point); + return goBefore({ + axis: axis, + moveRelativeTo: withDisplacement, + isMoving: draggablePage + }); + } + + var last = insideDestination[insideDestination.length - 1]; + + if (last.descriptor.id === draggable.descriptor.id) { + return draggablePage.borderBox.center; + } + + if (didStartDisplaced(last.descriptor.id, onLift)) { + var page = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["offset"])(last.page, negate(onLift.displacedBy.point)); + return goAfter({ + axis: axis, + moveRelativeTo: page, + isMoving: draggablePage + }); + } + + return goAfter({ + axis: axis, + moveRelativeTo: last.page, + isMoving: draggablePage + }); +}; + +var withDroppableDisplacement = function (droppable, point) { + var frame = droppable.frame; + + if (!frame) { + return point; + } + + return add(point, frame.scroll.diff.displacement); +}; + +var getResultWithoutDroppableDisplacement = function getResultWithoutDroppableDisplacement(_ref) { + var impact = _ref.impact, + draggable = _ref.draggable, + droppable = _ref.droppable, + draggables = _ref.draggables, + onLift = _ref.onLift; + var merge = impact.merge; + var destination = impact.destination; + var original = draggable.page.borderBox.center; + + if (!droppable) { + return original; + } + + if (destination) { + return whenReordering({ + movement: impact.movement, + draggable: draggable, + draggables: draggables, + droppable: droppable, + onLift: onLift + }); + } + + if (merge) { + return whenCombining({ + movement: impact.movement, + combine: merge.combine, + draggables: draggables, + onLift: onLift + }); + } + + return original; +}; + +var getPageBorderBoxCenterFromImpact = function (args) { + var withoutDisplacement = getResultWithoutDroppableDisplacement(args); + var droppable = args.droppable; + var withDisplacement = droppable ? withDroppableDisplacement(droppable, withoutDisplacement) : withoutDisplacement; + return withDisplacement; +}; + +var scrollViewport = function (viewport, newScroll) { + var diff = subtract(newScroll, viewport.scroll.initial); + var displacement = negate(diff); + var frame = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["getRect"])({ + top: newScroll.y, + bottom: newScroll.y + viewport.frame.height, + left: newScroll.x, + right: newScroll.x + viewport.frame.width + }); + var updated = { + frame: frame, + scroll: { + initial: viewport.scroll.initial, + max: viewport.scroll.max, + current: newScroll, + diff: { + value: diff, + displacement: displacement + } + } + }; + return updated; +}; + +var withNewDisplacement = function (impact, displaced) { + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, impact, { + movement: Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, impact.movement, { + displaced: displaced, + map: getDisplacementMap(displaced) + }) + }); +}; + +var speculativelyIncrease = function (_ref) { + var impact = _ref.impact, + viewport = _ref.viewport, + destination = _ref.destination, + draggables = _ref.draggables, + maxScrollChange = _ref.maxScrollChange, + onLift = _ref.onLift; + var displaced = impact.movement.displaced; + var scrolledViewport = scrollViewport(viewport, add(viewport.scroll.current, maxScrollChange)); + var scrolledDroppable = destination.frame ? scrollDroppable(destination, add(destination.frame.scroll.current, maxScrollChange)) : destination; + var updated = displaced.map(function (entry) { + if (entry.isVisible) { + return entry; + } + + var draggable = draggables[entry.draggableId]; + var withScrolledViewport = getDisplacement({ + draggable: draggable, + destination: destination, + previousImpact: impact, + viewport: scrolledViewport.frame, + onLift: onLift, + forceShouldAnimate: false + }); + + if (withScrolledViewport.isVisible) { + return withScrolledViewport; + } + + var withScrolledDroppable = getDisplacement({ + draggable: draggable, + destination: scrolledDroppable, + previousImpact: impact, + viewport: viewport.frame, + onLift: onLift, + forceShouldAnimate: false + }); + + if (withScrolledDroppable.isVisible) { + return withScrolledDroppable; + } + + return entry; + }); + return withNewDisplacement(impact, updated); +}; + +var withViewportDisplacement = function (viewport, point) { + return add(viewport.scroll.diff.displacement, point); +}; + +var getClientFromPageBorderBoxCenter = function (_ref) { + var pageBorderBoxCenter = _ref.pageBorderBoxCenter, + draggable = _ref.draggable, + viewport = _ref.viewport; + var withoutPageScrollChange = withViewportDisplacement(viewport, pageBorderBoxCenter); + var offset = subtract(withoutPageScrollChange, draggable.page.borderBox.center); + return add(draggable.client.borderBox.center, offset); +}; + +var isTotallyVisibleInNewLocation = function (_ref) { + var draggable = _ref.draggable, + destination = _ref.destination, + newPageBorderBoxCenter = _ref.newPageBorderBoxCenter, + viewport = _ref.viewport, + withDroppableDisplacement = _ref.withDroppableDisplacement, + _ref$onlyOnMainAxis = _ref.onlyOnMainAxis, + onlyOnMainAxis = _ref$onlyOnMainAxis === void 0 ? false : _ref$onlyOnMainAxis; + var changeNeeded = subtract(newPageBorderBoxCenter, draggable.page.borderBox.center); + var shifted = offsetByPosition(draggable.page.borderBox, changeNeeded); + var args = { + target: shifted, + destination: destination, + withDroppableDisplacement: withDroppableDisplacement, + viewport: viewport + }; + return onlyOnMainAxis ? isTotallyVisibleOnAxis(args) : isTotallyVisible(args); +}; + +var moveToNextPlace = function (_ref) { + var isMovingForward = _ref.isMovingForward, + draggable = _ref.draggable, + destination = _ref.destination, + draggables = _ref.draggables, + previousImpact = _ref.previousImpact, + viewport = _ref.viewport, + previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter, + previousClientSelection = _ref.previousClientSelection, + onLift = _ref.onLift; + + if (!destination.isEnabled) { + return null; + } + + var insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables); + var isInHomeList = isHomeOf(draggable, destination); + var impact = moveToNextCombine({ + isInHomeList: isInHomeList, + isMovingForward: isMovingForward, + draggable: draggable, + destination: destination, + insideDestination: insideDestination, + previousImpact: previousImpact + }) || moveToNextIndex({ + isMovingForward: isMovingForward, + isInHomeList: isInHomeList, + draggable: draggable, + draggables: draggables, + destination: destination, + insideDestination: insideDestination, + previousImpact: previousImpact, + onLift: onLift + }); + + if (!impact) { + return null; + } + + var pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({ + impact: impact, + draggable: draggable, + droppable: destination, + draggables: draggables, + onLift: onLift + }); + var isVisibleInNewLocation = isTotallyVisibleInNewLocation({ + draggable: draggable, + destination: destination, + newPageBorderBoxCenter: pageBorderBoxCenter, + viewport: viewport.frame, + withDroppableDisplacement: false, + onlyOnMainAxis: true + }); + + if (isVisibleInNewLocation) { + var clientSelection = getClientFromPageBorderBoxCenter({ + pageBorderBoxCenter: pageBorderBoxCenter, + draggable: draggable, + viewport: viewport + }); + return { + clientSelection: clientSelection, + impact: impact, + scrollJumpRequest: null + }; + } + + var distance = subtract(pageBorderBoxCenter, previousPageBorderBoxCenter); + var cautious = speculativelyIncrease({ + impact: impact, + viewport: viewport, + destination: destination, + draggables: draggables, + maxScrollChange: distance, + onLift: onLift + }); + return { + clientSelection: previousClientSelection, + impact: cautious, + scrollJumpRequest: distance + }; +}; + +var getKnownActive = function getKnownActive(droppable) { + var rect = droppable.subject.active; + !rect ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot get clipped area from droppable') : undefined : void 0; + return rect; +}; + +var getBestCrossAxisDroppable = function (_ref) { + var isMovingForward = _ref.isMovingForward, + pageBorderBoxCenter = _ref.pageBorderBoxCenter, + source = _ref.source, + droppables = _ref.droppables, + viewport = _ref.viewport; + var active = source.subject.active; + + if (!active) { + return null; + } + + var axis = source.axis; + var isBetweenSourceClipped = isWithin(active[axis.start], active[axis.end]); + var candidates = toDroppableList(droppables).filter(function (droppable) { + return droppable !== source; + }).filter(function (droppable) { + return droppable.isEnabled; + }).filter(function (droppable) { + return Boolean(droppable.subject.active); + }).filter(function (droppable) { + return isPartiallyVisibleThroughFrame(viewport.frame)(getKnownActive(droppable)); + }).filter(function (droppable) { + var activeOfTarget = getKnownActive(droppable); + + if (isMovingForward) { + return active[axis.crossAxisEnd] < activeOfTarget[axis.crossAxisEnd]; + } + + return activeOfTarget[axis.crossAxisStart] < active[axis.crossAxisStart]; + }).filter(function (droppable) { + var activeOfTarget = getKnownActive(droppable); + var isBetweenDestinationClipped = isWithin(activeOfTarget[axis.start], activeOfTarget[axis.end]); + return isBetweenSourceClipped(activeOfTarget[axis.start]) || isBetweenSourceClipped(activeOfTarget[axis.end]) || isBetweenDestinationClipped(active[axis.start]) || isBetweenDestinationClipped(active[axis.end]); + }).sort(function (a, b) { + var first = getKnownActive(a)[axis.crossAxisStart]; + var second = getKnownActive(b)[axis.crossAxisStart]; + + if (isMovingForward) { + return first - second; + } + + return second - first; + }).filter(function (droppable, index, array) { + return getKnownActive(droppable)[axis.crossAxisStart] === getKnownActive(array[0])[axis.crossAxisStart]; + }); + + if (!candidates.length) { + return null; + } + + if (candidates.length === 1) { + return candidates[0]; + } + + var contains = candidates.filter(function (droppable) { + var isWithinDroppable = isWithin(getKnownActive(droppable)[axis.start], getKnownActive(droppable)[axis.end]); + return isWithinDroppable(pageBorderBoxCenter[axis.line]); + }); + + if (contains.length === 1) { + return contains[0]; + } + + if (contains.length > 1) { + return contains.sort(function (a, b) { + return getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start]; + })[0]; + } + + return candidates.sort(function (a, b) { + var first = closest(pageBorderBoxCenter, getCorners(getKnownActive(a))); + var second = closest(pageBorderBoxCenter, getCorners(getKnownActive(b))); + + if (first !== second) { + return first - second; + } + + return getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start]; + })[0]; +}; + +var getCurrentPageBorderBoxCenter = function getCurrentPageBorderBoxCenter(draggable, onLift) { + var original = draggable.page.borderBox.center; + return didStartDisplaced(draggable.descriptor.id, onLift) ? subtract(original, onLift.displacedBy.point) : original; +}; + +var getCurrentPageBorderBox = function getCurrentPageBorderBox(draggable, onLift) { + var original = draggable.page.borderBox; + return didStartDisplaced(draggable.descriptor.id, onLift) ? offsetByPosition(original, negate(onLift.displacedBy.point)) : original; +}; + +var getClosestDraggable = function (_ref) { + var pageBorderBoxCenter = _ref.pageBorderBoxCenter, + viewport = _ref.viewport, + destination = _ref.destination, + insideDestination = _ref.insideDestination, + onLift = _ref.onLift; + var sorted = insideDestination.filter(function (draggable) { + return isTotallyVisible({ + target: getCurrentPageBorderBox(draggable, onLift), + destination: destination, + viewport: viewport.frame, + withDroppableDisplacement: true + }); + }).sort(function (a, b) { + var distanceToA = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, getCurrentPageBorderBoxCenter(a, onLift))); + var distanceToB = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, getCurrentPageBorderBoxCenter(b, onLift))); + + if (distanceToA < distanceToB) { + return -1; + } + + if (distanceToB < distanceToA) { + return 1; + } + + return a.descriptor.index - b.descriptor.index; + }); + return sorted[0] || null; +}; + +var moveToNewDroppable = function (_ref) { + var previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter, + moveRelativeTo = _ref.moveRelativeTo, + insideDestination = _ref.insideDestination, + draggable = _ref.draggable, + draggables = _ref.draggables, + destination = _ref.destination, + previousImpact = _ref.previousImpact, + viewport = _ref.viewport, + onLift = _ref.onLift; + + if (!moveRelativeTo) { + if (insideDestination.length) { + return null; + } + + var proposed = { + movement: noMovement, + destination: { + droppableId: destination.descriptor.id, + index: 0 + }, + merge: null + }; + var proposedPageBorderBoxCenter = getPageBorderBoxCenterFromImpact({ + impact: proposed, + draggable: draggable, + droppable: destination, + draggables: draggables, + onLift: onLift + }); + var withPlaceholder = isHomeOf(draggable, destination) ? destination : addPlaceholder(destination, draggable, draggables); + var isVisibleInNewLocation = isTotallyVisibleInNewLocation({ + draggable: draggable, + destination: withPlaceholder, + newPageBorderBoxCenter: proposedPageBorderBoxCenter, + viewport: viewport.frame, + withDroppableDisplacement: false, + onlyOnMainAxis: true + }); + return isVisibleInNewLocation ? proposed : null; + } + + var isGoingBeforeTarget = Boolean(previousPageBorderBoxCenter[destination.axis.line] < moveRelativeTo.page.borderBox.center[destination.axis.line]); + var targetIndex = insideDestination.indexOf(moveRelativeTo); + !(targetIndex !== -1) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot find target in list') : undefined : void 0; + + var proposedIndex = function () { + if (moveRelativeTo.descriptor.id === draggable.descriptor.id) { + return targetIndex; + } + + if (isGoingBeforeTarget) { + return targetIndex; + } + + return targetIndex + 1; + }(); + + var displaced = removeDraggableFromList(draggable, insideDestination).slice(proposedIndex).map(function (dimension) { + return getDisplacement({ + draggable: dimension, + destination: destination, + viewport: viewport.frame, + previousImpact: previousImpact, + onLift: onLift + }); + }); + var displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy); + var impact = { + movement: { + displacedBy: displacedBy, + displaced: displaced, + map: getDisplacementMap(displaced) + }, + destination: { + droppableId: destination.descriptor.id, + index: proposedIndex + }, + merge: null + }; + return impact; +}; + +var moveCrossAxis = function (_ref) { + var isMovingForward = _ref.isMovingForward, + previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter, + draggable = _ref.draggable, + isOver = _ref.isOver, + draggables = _ref.draggables, + droppables = _ref.droppables, + previousImpact = _ref.previousImpact, + viewport = _ref.viewport, + onLift = _ref.onLift; + var destination = getBestCrossAxisDroppable({ + isMovingForward: isMovingForward, + pageBorderBoxCenter: previousPageBorderBoxCenter, + source: isOver, + droppables: droppables, + viewport: viewport + }); + + if (!destination) { + return null; + } + + var insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables); + var moveRelativeTo = getClosestDraggable({ + pageBorderBoxCenter: previousPageBorderBoxCenter, + viewport: viewport, + destination: destination, + insideDestination: insideDestination, + onLift: onLift + }); + var impact = moveToNewDroppable({ + previousPageBorderBoxCenter: previousPageBorderBoxCenter, + destination: destination, + draggable: draggable, + draggables: draggables, + moveRelativeTo: moveRelativeTo, + insideDestination: insideDestination, + previousImpact: previousImpact, + viewport: viewport, + onLift: onLift + }); + + if (!impact) { + return null; + } + + var pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({ + impact: impact, + draggable: draggable, + droppable: destination, + draggables: draggables, + onLift: onLift + }); + var clientSelection = getClientFromPageBorderBoxCenter({ + pageBorderBoxCenter: pageBorderBoxCenter, + draggable: draggable, + viewport: viewport + }); + return { + clientSelection: clientSelection, + impact: impact, + scrollJumpRequest: null + }; +}; + +var getDroppableOver$1 = function getDroppableOver(impact, droppables) { + var id = whatIsDraggedOver(impact); + return id ? droppables[id] : null; +}; + +var moveInDirection = function (_ref) { + var state = _ref.state, + type = _ref.type; + var isActuallyOver = getDroppableOver$1(state.impact, state.dimensions.droppables); + var isMainAxisMovementAllowed = Boolean(isActuallyOver); + var home = state.dimensions.droppables[state.critical.droppable.id]; + var isOver = isActuallyOver || home; + var direction = isOver.axis.direction; + var isMovingOnMainAxis = direction === 'vertical' && (type === 'MOVE_UP' || type === 'MOVE_DOWN') || direction === 'horizontal' && (type === 'MOVE_LEFT' || type === 'MOVE_RIGHT'); + + if (isMovingOnMainAxis && !isMainAxisMovementAllowed) { + return null; + } + + var isMovingForward = type === 'MOVE_DOWN' || type === 'MOVE_RIGHT'; + var draggable = state.dimensions.draggables[state.critical.draggable.id]; + var previousPageBorderBoxCenter = state.current.page.borderBoxCenter; + var _state$dimensions = state.dimensions, + draggables = _state$dimensions.draggables, + droppables = _state$dimensions.droppables; + return isMovingOnMainAxis ? moveToNextPlace({ + isMovingForward: isMovingForward, + previousPageBorderBoxCenter: previousPageBorderBoxCenter, + draggable: draggable, + destination: isOver, + draggables: draggables, + viewport: state.viewport, + previousClientSelection: state.current.client.selection, + previousImpact: state.impact, + onLift: state.onLift + }) : moveCrossAxis({ + isMovingForward: isMovingForward, + previousPageBorderBoxCenter: previousPageBorderBoxCenter, + draggable: draggable, + isOver: isOver, + draggables: draggables, + droppables: droppables, + previousImpact: state.impact, + viewport: state.viewport, + onLift: state.onLift + }); +}; + +function isMovementAllowed(state) { + return state.phase === 'DRAGGING' || state.phase === 'COLLECTING'; +} + +var getVertical = function getVertical(previous, diff) { + if (diff === 0) { + return previous; + } + + return diff > 0 ? 'down' : 'up'; +}; + +var getHorizontal = function getHorizontal(previous, diff) { + if (diff === 0) { + return previous; + } + + return diff > 0 ? 'right' : 'left'; +}; + +var getUserDirection = function (previous, oldPageBorderBoxCenter, newPageBorderBoxCenter) { + var diff = subtract(newPageBorderBoxCenter, oldPageBorderBoxCenter); + return { + horizontal: getHorizontal(previous.horizontal, diff.x), + vertical: getVertical(previous.vertical, diff.y) + }; +}; + +var update = function (_ref) { + var state = _ref.state, + forcedClientSelection = _ref.clientSelection, + forcedDimensions = _ref.dimensions, + forcedViewport = _ref.viewport, + forcedImpact = _ref.impact, + scrollJumpRequest = _ref.scrollJumpRequest; + var viewport = forcedViewport || state.viewport; + var currentWindowScroll = viewport.scroll.current; + var dimensions = forcedDimensions || state.dimensions; + var clientSelection = forcedClientSelection || state.current.client.selection; + var offset = subtract(clientSelection, state.initial.client.selection); + var client = { + offset: offset, + selection: clientSelection, + borderBoxCenter: add(state.initial.client.borderBoxCenter, offset) + }; + var page = { + selection: add(client.selection, currentWindowScroll), + borderBoxCenter: add(client.borderBoxCenter, currentWindowScroll) + }; + var current = { + client: client, + page: page + }; + var userDirection = getUserDirection(state.userDirection, state.current.page.borderBoxCenter, current.page.borderBoxCenter); + + if (state.phase === 'COLLECTING') { + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ + phase: 'COLLECTING' + }, state, { + dimensions: dimensions, + viewport: viewport, + current: current, + userDirection: userDirection + }); + } + + var draggable = dimensions.draggables[state.critical.draggable.id]; + var newImpact = forcedImpact || getDragImpact({ + pageBorderBoxCenter: page.borderBoxCenter, + draggable: draggable, + draggables: dimensions.draggables, + droppables: dimensions.droppables, + previousImpact: state.impact, + viewport: viewport, + userDirection: userDirection, + onLift: state.onLift + }); + var withUpdatedPlaceholders = recomputePlaceholders({ + draggable: draggable, + impact: newImpact, + previousImpact: state.impact, + draggables: dimensions.draggables, + droppables: dimensions.droppables + }); + + var result = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, state, { + current: current, + userDirection: userDirection, + dimensions: { + draggables: dimensions.draggables, + droppables: withUpdatedPlaceholders + }, + impact: newImpact, + viewport: viewport, + scrollJumpRequest: scrollJumpRequest || null, + forceShouldAnimate: scrollJumpRequest ? false : null + }); + + return result; +}; + +var recompute = function (_ref) { + var impact = _ref.impact, + viewport = _ref.viewport, + destination = _ref.destination, + draggables = _ref.draggables, + onLift = _ref.onLift, + forceShouldAnimate = _ref.forceShouldAnimate; + var updated = impact.movement.displaced.map(function (entry) { + return getDisplacement({ + draggable: draggables[entry.draggableId], + destination: destination, + previousImpact: impact, + viewport: viewport.frame, + onLift: onLift, + forceShouldAnimate: forceShouldAnimate + }); + }); + return withNewDisplacement(impact, updated); +}; + +var getClientBorderBoxCenter = function (_ref) { + var impact = _ref.impact, + draggable = _ref.draggable, + droppable = _ref.droppable, + draggables = _ref.draggables, + viewport = _ref.viewport, + onLift = _ref.onLift; + var pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({ + impact: impact, + draggable: draggable, + draggables: draggables, + droppable: droppable, + onLift: onLift + }); + return getClientFromPageBorderBoxCenter({ + pageBorderBoxCenter: pageBorderBoxCenter, + draggable: draggable, + viewport: viewport + }); +}; + +var refreshSnap = function (_ref) { + var state = _ref.state, + forcedDimensions = _ref.dimensions, + forcedViewport = _ref.viewport; + !(state.movementMode === 'SNAP') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false) : undefined : void 0; + var needsVisibilityCheck = state.impact; + var viewport = forcedViewport || state.viewport; + var dimensions = forcedDimensions || state.dimensions; + var draggables = dimensions.draggables, + droppables = dimensions.droppables; + var draggable = draggables[state.critical.draggable.id]; + var isOver = whatIsDraggedOver(needsVisibilityCheck); + !isOver ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Must be over a destination in SNAP movement mode') : undefined : void 0; + var destination = droppables[isOver]; + var impact = recompute({ + impact: needsVisibilityCheck, + viewport: viewport, + destination: destination, + draggables: draggables, + onLift: state.onLift + }); + var clientSelection = getClientBorderBoxCenter({ + impact: impact, + draggable: draggable, + droppable: destination, + draggables: draggables, + viewport: viewport, + onLift: state.onLift + }); + return update({ + impact: impact, + clientSelection: clientSelection, + state: state, + dimensions: dimensions, + viewport: viewport + }); +}; + +var patchDimensionMap = function (dimensions, updated) { + return { + draggables: dimensions.draggables, + droppables: patchDroppableMap(dimensions.droppables, updated) + }; +}; + +var isSnapping = function isSnapping(state) { + return state.movementMode === 'SNAP'; +}; + +var postDroppableChange = function postDroppableChange(state, updated, isEnabledChanging) { + var dimensions = patchDimensionMap(state.dimensions, updated); + + if (!isSnapping(state) || isEnabledChanging) { + return update({ + state: state, + dimensions: dimensions + }); + } + + return refreshSnap({ + state: state, + dimensions: dimensions + }); +}; + +var idle = { + phase: 'IDLE', + completed: null, + shouldFlush: false +}; + +var reducer = function (state, action) { + if (state === void 0) { + state = idle; + } + + if (action.type === 'CLEAN') { + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, idle, { + shouldFlush: action.payload.shouldFlush + }); + } + + if (action.type === 'INITIAL_PUBLISH') { + !(state.phase === 'IDLE') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'INITIAL_PUBLISH must come after a IDLE phase') : undefined : void 0; + var _action$payload = action.payload, + critical = _action$payload.critical, + clientSelection = _action$payload.clientSelection, + viewport = _action$payload.viewport, + dimensions = _action$payload.dimensions, + movementMode = _action$payload.movementMode; + var draggable = dimensions.draggables[critical.draggable.id]; + var home = dimensions.droppables[critical.droppable.id]; + var client = { + selection: clientSelection, + borderBoxCenter: draggable.client.borderBox.center, + offset: origin + }; + var initial = { + client: client, + page: { + selection: add(client.selection, viewport.scroll.initial), + borderBoxCenter: add(client.selection, viewport.scroll.initial) + } + }; + var isWindowScrollAllowed = toDroppableList(dimensions.droppables).every(function (item) { + return !item.isFixedOnPage; + }); + + var _getHomeOnLift = getHomeOnLift({ + draggable: draggable, + home: home, + draggables: dimensions.draggables, + viewport: viewport + }), + impact = _getHomeOnLift.impact, + onLift = _getHomeOnLift.onLift; + + var result = { + phase: 'DRAGGING', + isDragging: true, + critical: critical, + movementMode: movementMode, + dimensions: dimensions, + initial: initial, + current: initial, + isWindowScrollAllowed: isWindowScrollAllowed, + impact: impact, + onLift: onLift, + onLiftImpact: impact, + viewport: viewport, + userDirection: forward, + scrollJumpRequest: null, + forceShouldAnimate: null + }; + return result; + } + + if (action.type === 'COLLECTION_STARTING') { + var _extends2; + + if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') { + return state; + } + + !(state.phase === 'DRAGGING') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Collection cannot start from phase " + state.phase) : undefined : void 0; + + var _result = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ + phase: 'COLLECTING' + }, state, (_extends2 = {}, _extends2["phase"] = 'COLLECTING', _extends2)); + + return _result; + } + + if (action.type === 'PUBLISH_WHILE_DRAGGING') { + !(state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Unexpected " + action.type + " received in phase " + state.phase) : undefined : void 0; + return publishWhileDragging({ + state: state, + published: action.payload + }); + } + + if (action.type === 'MOVE') { + if (state.phase === 'DROP_PENDING') { + return state; + } + + !isMovementAllowed(state) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, action.type + " not permitted in phase " + state.phase) : undefined : void 0; + var _clientSelection = action.payload.client; + + if (isEqual(_clientSelection, state.current.client.selection)) { + return state; + } + + return update({ + state: state, + clientSelection: _clientSelection, + impact: isSnapping(state) ? state.impact : null + }); + } + + if (action.type === 'UPDATE_DROPPABLE_SCROLL') { + if (state.phase === 'DROP_PENDING') { + return state; + } + + if (state.phase === 'COLLECTING') { + return state; + } + + !isMovementAllowed(state) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, action.type + " not permitted in phase " + state.phase) : undefined : void 0; + var _action$payload2 = action.payload, + id = _action$payload2.id, + offset = _action$payload2.offset; + var target = state.dimensions.droppables[id]; + + if (!target) { + return state; + } + + var scrolled = scrollDroppable(target, offset); + return postDroppableChange(state, scrolled, false); + } + + if (action.type === 'UPDATE_DROPPABLE_IS_ENABLED') { + if (state.phase === 'DROP_PENDING') { + return state; + } + + !isMovementAllowed(state) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Attempting to move in an unsupported phase " + state.phase) : undefined : void 0; + var _action$payload3 = action.payload, + _id = _action$payload3.id, + isEnabled = _action$payload3.isEnabled; + var _target = state.dimensions.droppables[_id]; + !_target ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot find Droppable[id: " + _id + "] to toggle its enabled state") : undefined : void 0; + !(_target.isEnabled !== isEnabled) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Trying to set droppable isEnabled to " + String(isEnabled) + "\n but it is already " + String(_target.isEnabled)) : undefined : void 0; + + var updated = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, _target, { + isEnabled: isEnabled + }); + + return postDroppableChange(state, updated, true); + } + + if (action.type === 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED') { + if (state.phase === 'DROP_PENDING') { + return state; + } + + !isMovementAllowed(state) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Attempting to move in an unsupported phase " + state.phase) : undefined : void 0; + var _action$payload4 = action.payload, + _id2 = _action$payload4.id, + isCombineEnabled = _action$payload4.isCombineEnabled; + var _target2 = state.dimensions.droppables[_id2]; + !_target2 ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot find Droppable[id: " + _id2 + "] to toggle its isCombineEnabled state") : undefined : void 0; + !(_target2.isCombineEnabled !== isCombineEnabled) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Trying to set droppable isCombineEnabled to " + String(isCombineEnabled) + "\n but it is already " + String(_target2.isCombineEnabled)) : undefined : void 0; + + var _updated = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, _target2, { + isCombineEnabled: isCombineEnabled + }); + + return postDroppableChange(state, _updated, true); + } + + if (action.type === 'MOVE_BY_WINDOW_SCROLL') { + if (state.phase === 'DROP_PENDING' || state.phase === 'DROP_ANIMATING') { + return state; + } + + !isMovementAllowed(state) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot move by window in phase " + state.phase) : undefined : void 0; + !state.isWindowScrollAllowed ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Window scrolling is currently not supported for fixed lists. Aborting drag') : undefined : void 0; + var newScroll = action.payload.newScroll; + + if (isEqual(state.viewport.scroll.current, newScroll)) { + return state; + } + + var _viewport = scrollViewport(state.viewport, newScroll); + + if (isSnapping(state)) { + return refreshSnap({ + state: state, + viewport: _viewport + }); + } + + return update({ + state: state, + viewport: _viewport + }); + } + + if (action.type === 'UPDATE_VIEWPORT_MAX_SCROLL') { + if (!isMovementAllowed(state)) { + return state; + } + + var maxScroll = action.payload.maxScroll; + + if (isEqual(maxScroll, state.viewport.scroll.max)) { + return state; + } + + var withMaxScroll = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, state.viewport, { + scroll: Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, state.viewport.scroll, { + max: maxScroll + }) + }); + + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ + phase: 'DRAGGING' + }, state, { + viewport: withMaxScroll + }); + } + + if (action.type === 'MOVE_UP' || action.type === 'MOVE_DOWN' || action.type === 'MOVE_LEFT' || action.type === 'MOVE_RIGHT') { + if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') { + return state; + } + + !(state.phase === 'DRAGGING') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, action.type + " received while not in DRAGGING phase") : undefined : void 0; + + var _result2 = moveInDirection({ + state: state, + type: action.type + }); + + if (!_result2) { + return state; + } + + return update({ + state: state, + impact: _result2.impact, + clientSelection: _result2.clientSelection, + scrollJumpRequest: _result2.scrollJumpRequest + }); + } + + if (action.type === 'DROP_PENDING') { + var _extends3; + + var reason = action.payload.reason; + !(state.phase === 'COLLECTING') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Can only move into the DROP_PENDING phase from the COLLECTING phase') : undefined : void 0; + + var newState = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ + phase: 'DROP_PENDING' + }, state, (_extends3 = {}, _extends3["phase"] = 'DROP_PENDING', _extends3.isWaiting = true, _extends3.reason = reason, _extends3)); + + return newState; + } + + if (action.type === 'DROP_ANIMATE') { + var _action$payload5 = action.payload, + completed = _action$payload5.completed, + dropDuration = _action$payload5.dropDuration, + newHomeClientOffset = _action$payload5.newHomeClientOffset; + !(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot animate drop from phase " + state.phase) : undefined : void 0; + var _result3 = { + phase: 'DROP_ANIMATING', + dimensions: state.dimensions, + completed: completed, + dropDuration: dropDuration, + newHomeClientOffset: newHomeClientOffset + }; + return _result3; + } + + if (action.type === 'DROP_COMPLETE') { + var _action$payload6 = action.payload, + _completed = _action$payload6.completed, + shouldFlush = _action$payload6.shouldFlush; + return { + phase: 'IDLE', + completed: _completed, + shouldFlush: shouldFlush + }; + } + + return state; +}; + +var lift = function lift(args) { + return { + type: 'LIFT', + payload: args + }; +}; + +var initialPublish = function initialPublish(args) { + return { + type: 'INITIAL_PUBLISH', + payload: args + }; +}; + +var publishWhileDragging$1 = function publishWhileDragging(args) { + return { + type: 'PUBLISH_WHILE_DRAGGING', + payload: args + }; +}; + +var collectionStarting = function collectionStarting() { + return { + type: 'COLLECTION_STARTING', + payload: null + }; +}; + +var updateDroppableScroll = function updateDroppableScroll(args) { + return { + type: 'UPDATE_DROPPABLE_SCROLL', + payload: args + }; +}; + +var updateDroppableIsEnabled = function updateDroppableIsEnabled(args) { + return { + type: 'UPDATE_DROPPABLE_IS_ENABLED', + payload: args + }; +}; + +var updateDroppableIsCombineEnabled = function updateDroppableIsCombineEnabled(args) { + return { + type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED', + payload: args + }; +}; + +var move = function move(args) { + return { + type: 'MOVE', + payload: args + }; +}; + +var moveByWindowScroll = function moveByWindowScroll(args) { + return { + type: 'MOVE_BY_WINDOW_SCROLL', + payload: args + }; +}; + +var updateViewportMaxScroll = function updateViewportMaxScroll(args) { + return { + type: 'UPDATE_VIEWPORT_MAX_SCROLL', + payload: args + }; +}; + +var moveUp = function moveUp() { + return { + type: 'MOVE_UP', + payload: null + }; +}; + +var moveDown = function moveDown() { + return { + type: 'MOVE_DOWN', + payload: null + }; +}; + +var moveRight = function moveRight() { + return { + type: 'MOVE_RIGHT', + payload: null + }; +}; + +var moveLeft = function moveLeft() { + return { + type: 'MOVE_LEFT', + payload: null + }; +}; + +var clean$1 = function clean(args) { + if (args === void 0) { + args = { + shouldFlush: false + }; + } + + return { + type: 'CLEAN', + payload: args + }; +}; + +var animateDrop = function animateDrop(args) { + return { + type: 'DROP_ANIMATE', + payload: args + }; +}; + +var completeDrop = function completeDrop(args) { + return { + type: 'DROP_COMPLETE', + payload: args + }; +}; + +var drop = function drop(args) { + return { + type: 'DROP', + payload: args + }; +}; + +var dropPending = function dropPending(args) { + return { + type: 'DROP_PENDING', + payload: args + }; +}; + +var dropAnimationFinished = function dropAnimationFinished() { + return { + type: 'DROP_ANIMATION_FINISHED', + payload: null + }; +}; + +var lift$1 = function (marshal) { + return function (_ref) { + var getState = _ref.getState, + dispatch = _ref.dispatch; + return function (next) { + return function (action) { + if (action.type !== 'LIFT') { + next(action); + return; + } + + var _action$payload = action.payload, + id = _action$payload.id, + clientSelection = _action$payload.clientSelection, + movementMode = _action$payload.movementMode; + var initial = getState(); + + if (initial.phase === 'DROP_ANIMATING') { + dispatch(completeDrop({ + completed: initial.completed, + shouldFlush: true + })); + } + + !(getState().phase === 'IDLE') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Incorrect phase to start a drag') : undefined : void 0; + var scrollOptions = { + shouldPublishImmediately: movementMode === 'SNAP' + }; + var request = { + draggableId: id, + scrollOptions: scrollOptions + }; + + var _marshal$startPublish = marshal.startPublishing(request), + critical = _marshal$startPublish.critical, + dimensions = _marshal$startPublish.dimensions, + viewport = _marshal$startPublish.viewport; + + dispatch(initialPublish({ + critical: critical, + dimensions: dimensions, + clientSelection: clientSelection, + movementMode: movementMode, + viewport: viewport + })); + }; + }; + }; +}; + +var style = function (marshal) { + return function () { + return function (next) { + return function (action) { + if (action.type === 'INITIAL_PUBLISH') { + marshal.dragging(); + } + + if (action.type === 'DROP_ANIMATE') { + marshal.dropping(action.payload.completed.result.reason); + } + + if (action.type === 'CLEAN' || action.type === 'DROP_COMPLETE') { + marshal.resting(); + } + + next(action); + }; + }; + }; +}; + +var curves = { + outOfTheWay: 'cubic-bezier(0.2, 0, 0, 1)', + drop: 'cubic-bezier(.2,1,.1,1)' +}; +var combine = { + opacity: { + drop: 0, + combining: 0.7 + }, + scale: { + drop: 0.75 + } +}; +var timings = { + outOfTheWay: 0.2, + minDropTime: 0.33, + maxDropTime: 0.55 +}; +var outOfTheWayTiming = timings.outOfTheWay + "s " + curves.outOfTheWay; +var transitions = { + fluid: "opacity " + outOfTheWayTiming, + snap: "transform " + outOfTheWayTiming + ", opacity " + outOfTheWayTiming, + drop: function drop(duration) { + var timing = duration + "s " + curves.drop; + return "transform " + timing + ", opacity " + timing; + }, + outOfTheWay: "transform " + outOfTheWayTiming, + placeholder: "height " + outOfTheWayTiming + ", width " + outOfTheWayTiming + ", margin " + outOfTheWayTiming +}; + +var moveTo = function moveTo(offset) { + return isEqual(offset, origin) ? null : "translate(" + offset.x + "px, " + offset.y + "px)"; +}; + +var transforms = { + moveTo: moveTo, + drop: function drop(offset, isCombining) { + var translate = moveTo(offset); + + if (!translate) { + return null; + } + + if (!isCombining) { + return translate; + } + + return translate + " scale(" + combine.scale.drop + ")"; + } +}; +var minDropTime = timings.minDropTime, + maxDropTime = timings.maxDropTime; +var dropTimeRange = maxDropTime - minDropTime; +var maxDropTimeAtDistance = 1500; +var cancelDropModifier = 0.6; + +var getDropDuration = function (_ref) { + var current = _ref.current, + destination = _ref.destination, + reason = _ref.reason; + var distance$1 = distance(current, destination); + + if (distance$1 <= 0) { + return minDropTime; + } + + if (distance$1 >= maxDropTimeAtDistance) { + return maxDropTime; + } + + var percentage = distance$1 / maxDropTimeAtDistance; + var duration = minDropTime + dropTimeRange * percentage; + var withDuration = reason === 'CANCEL' ? duration * cancelDropModifier : duration; + return Number(withDuration.toFixed(2)); +}; + +var getNewHomeClientOffset = function (_ref) { + var impact = _ref.impact, + draggable = _ref.draggable, + dimensions = _ref.dimensions, + viewport = _ref.viewport, + onLift = _ref.onLift; + var draggables = dimensions.draggables, + droppables = dimensions.droppables; + var droppableId = whatIsDraggedOver(impact); + var destination = droppableId ? droppables[droppableId] : null; + var home = droppables[draggable.descriptor.droppableId]; + var newClientCenter = getClientBorderBoxCenter({ + impact: impact, + draggable: draggable, + draggables: draggables, + onLift: onLift, + droppable: destination || home, + viewport: viewport + }); + var offset = subtract(newClientCenter, draggable.client.borderBox.center); + var merge = impact.merge; + + if (merge && didStartDisplaced(merge.combine.draggableId, onLift)) { + return subtract(offset, onLift.displacedBy.point); + } + + return offset; +}; + +var getDropImpact = function (_ref) { + var reason = _ref.reason, + lastImpact = _ref.lastImpact, + home = _ref.home, + viewport = _ref.viewport, + draggables = _ref.draggables, + onLiftImpact = _ref.onLiftImpact, + onLift = _ref.onLift; + var didDropInsideDroppable = reason === 'DROP' && Boolean(whatIsDraggedOver(lastImpact)); + + if (!didDropInsideDroppable) { + var impact = recompute({ + impact: onLiftImpact, + destination: home, + viewport: viewport, + draggables: draggables, + onLift: onLift, + forceShouldAnimate: true + }); + return { + impact: impact, + didDropInsideDroppable: didDropInsideDroppable + }; + } + + if (lastImpact.destination) { + return { + impact: lastImpact, + didDropInsideDroppable: didDropInsideDroppable + }; + } + + var withoutMovement = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, lastImpact, { + movement: noMovement + }); + + return { + impact: withoutMovement, + didDropInsideDroppable: didDropInsideDroppable + }; +}; + +var drop$1 = function (_ref) { + var getState = _ref.getState, + dispatch = _ref.dispatch; + return function (next) { + return function (action) { + if (action.type !== 'DROP') { + next(action); + return; + } + + var state = getState(); + var reason = action.payload.reason; + + if (state.phase === 'COLLECTING') { + dispatch(dropPending({ + reason: reason + })); + return; + } + + if (state.phase === 'IDLE') { + return; + } + + var isWaitingForDrop = state.phase === 'DROP_PENDING' && state.isWaiting; + !!isWaitingForDrop ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'A DROP action occurred while DROP_PENDING and still waiting') : undefined : void 0; + !(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot drop in phase: " + state.phase) : undefined : void 0; + var critical = state.critical; + var dimensions = state.dimensions; + + var _getDropImpact = getDropImpact({ + reason: reason, + lastImpact: state.impact, + onLift: state.onLift, + onLiftImpact: state.onLiftImpact, + home: state.dimensions.droppables[state.critical.droppable.id], + viewport: state.viewport, + draggables: state.dimensions.draggables + }), + impact = _getDropImpact.impact, + didDropInsideDroppable = _getDropImpact.didDropInsideDroppable; + + var draggable = dimensions.draggables[state.critical.draggable.id]; + var destination = didDropInsideDroppable ? impact.destination : null; + var combine = didDropInsideDroppable && impact.merge ? impact.merge.combine : null; + var source = { + index: critical.draggable.index, + droppableId: critical.droppable.id + }; + var result = { + draggableId: draggable.descriptor.id, + type: draggable.descriptor.type, + source: source, + reason: reason, + mode: state.movementMode, + destination: destination, + combine: combine + }; + var newHomeClientOffset = getNewHomeClientOffset({ + impact: impact, + draggable: draggable, + dimensions: dimensions, + viewport: state.viewport, + onLift: state.onLift + }); + var completed = { + critical: state.critical, + result: result, + impact: impact + }; + var isAnimationRequired = !isEqual(state.current.client.offset, newHomeClientOffset) || Boolean(result.combine); + + if (!isAnimationRequired) { + dispatch(completeDrop({ + completed: completed, + shouldFlush: false + })); + return; + } + + var dropDuration = getDropDuration({ + current: state.current.client.offset, + destination: newHomeClientOffset, + reason: reason + }); + var args = { + newHomeClientOffset: newHomeClientOffset, + dropDuration: dropDuration, + completed: completed + }; + dispatch(animateDrop(args)); + }; + }; +}; + +var position = function position(index) { + return index + 1; +}; + +var onDragStart = function onDragStart(start) { + return "\n You have lifted an item in position " + position(start.source.index) + ".\n Use the arrow keys to move, space bar to drop, and escape to cancel.\n"; +}; + +var withLocation = function withLocation(source, destination) { + var isInHomeList = source.droppableId === destination.droppableId; + var startPosition = position(source.index); + var endPosition = position(destination.index); + + if (isInHomeList) { + return "\n You have moved the item from position " + startPosition + "\n to position " + endPosition + "\n "; + } + + return "\n You have moved the item from position " + startPosition + "\n in list " + source.droppableId + "\n to list " + destination.droppableId + "\n in position " + endPosition + "\n "; +}; + +var withCombine = function withCombine(id, source, combine) { + var inHomeList = source.droppableId === combine.droppableId; + + if (inHomeList) { + return "\n The item " + id + "\n has been combined with " + combine.draggableId; + } + + return "\n The item " + id + "\n in list " + source.droppableId + "\n has been combined with " + combine.draggableId + "\n in list " + combine.droppableId + "\n "; +}; + +var onDragUpdate = function onDragUpdate(update) { + var location = update.destination; + + if (location) { + return withLocation(update.source, location); + } + + var combine = update.combine; + + if (combine) { + return withCombine(update.draggableId, update.source, combine); + } + + return 'You are over an area that cannot be dropped on'; +}; + +var returnedToStart = function returnedToStart(source) { + return "\n The item has returned to its starting position\n of " + position(source.index) + "\n"; +}; + +var onDragEnd = function onDragEnd(result) { + if (result.reason === 'CANCEL') { + return "\n Movement cancelled.\n " + returnedToStart(result.source) + "\n "; + } + + var location = result.destination; + var combine = result.combine; + + if (location) { + return "\n You have dropped the item.\n " + withLocation(result.source, location) + "\n "; + } + + if (combine) { + return "\n You have dropped the item.\n " + withCombine(result.draggableId, result.source, combine) + "\n "; + } + + return "\n The item has been dropped while not over a drop area.\n " + returnedToStart(result.source) + "\n "; +}; + +var preset = { + onDragStart: onDragStart, + onDragUpdate: onDragUpdate, + onDragEnd: onDragEnd +}; + +var getExpiringAnnounce = function (announce) { + var wasCalled = false; + var isExpired = false; + var timeoutId = setTimeout(function () { + isExpired = true; + }); + + var result = function result(message) { + if (wasCalled) { + true ? warning('Announcement already made. Not making a second announcement') : undefined; + return; + } + + if (isExpired) { + true ? warning("\n Announcements cannot be made asynchronously.\n Default message has already been announced.\n ") : undefined; + return; + } + + wasCalled = true; + announce(message); + clearTimeout(timeoutId); + }; + + result.wasCalled = function () { + return wasCalled; + }; + + return result; +}; + +var getAsyncMarshal = function () { + var entries = []; + + var execute = function execute(timerId) { + var index = findIndex(entries, function (item) { + return item.timerId === timerId; + }); + !(index !== -1) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Could not find timer') : undefined : void 0; + + var _entries$splice = entries.splice(index, 1), + entry = _entries$splice[0]; + + entry.callback(); + }; + + var add = function add(fn) { + var timerId = setTimeout(function () { + return execute(timerId); + }); + var entry = { + timerId: timerId, + callback: fn + }; + entries.push(entry); + }; + + var flush = function flush() { + if (!entries.length) { + return; + } + + var shallow = [].concat(entries); + entries.length = 0; + shallow.forEach(function (entry) { + clearTimeout(entry.timerId); + entry.callback(); + }); + }; + + return { + add: add, + flush: flush + }; +}; + +var areLocationsEqual = function areLocationsEqual(first, second) { + if (first == null && second == null) { + return true; + } + + if (first == null || second == null) { + return false; + } + + return first.droppableId === second.droppableId && first.index === second.index; +}; + +var isCombineEqual = function isCombineEqual(first, second) { + if (first == null && second == null) { + return true; + } + + if (first == null || second == null) { + return false; + } + + return first.draggableId === second.draggableId && first.droppableId === second.droppableId; +}; + +var isCriticalEqual = function isCriticalEqual(first, second) { + if (first === second) { + return true; + } + + var isDraggableEqual = first.draggable.id === second.draggable.id && first.draggable.droppableId === second.draggable.droppableId && first.draggable.type === second.draggable.type && first.draggable.index === second.draggable.index; + var isDroppableEqual = first.droppable.id === second.droppable.id && first.droppable.type === second.droppable.type; + return isDraggableEqual && isDroppableEqual; +}; + +var withTimings = function withTimings(key, fn) { + start(key); + fn(); + finish(key); +}; + +var getDragStart = function getDragStart(critical, mode) { + return { + draggableId: critical.draggable.id, + type: critical.droppable.type, + source: { + droppableId: critical.droppable.id, + index: critical.draggable.index + }, + mode: mode + }; +}; + +var execute = function execute(responder, data, announce, getDefaultMessage) { + if (!responder) { + announce(getDefaultMessage(data)); + return; + } + + var willExpire = getExpiringAnnounce(announce); + var provided = { + announce: willExpire + }; + responder(data, provided); + + if (!willExpire.wasCalled()) { + announce(getDefaultMessage(data)); + } +}; + +var getPublisher = function (getResponders, announce) { + var asyncMarshal = getAsyncMarshal(); + var dragging = null; + + var beforeStart = function beforeStart(critical, mode) { + !!dragging ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot fire onBeforeDragStart as a drag start has already been published') : undefined : void 0; + withTimings('onBeforeDragStart', function () { + var fn = getResponders().onBeforeDragStart; + + if (fn) { + fn(getDragStart(critical, mode)); + } + }); + }; + + var start = function start(critical, mode) { + !!dragging ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot fire onBeforeDragStart as a drag start has already been published') : undefined : void 0; + var data = getDragStart(critical, mode); + dragging = { + mode: mode, + lastCritical: critical, + lastLocation: data.source, + lastCombine: null + }; + asyncMarshal.add(function () { + withTimings('onDragStart', function () { + return execute(getResponders().onDragStart, data, announce, preset.onDragStart); + }); + }); + }; + + var update = function update(critical, impact) { + var location = impact.destination; + var combine = impact.merge ? impact.merge.combine : null; + !dragging ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot fire onDragMove when onDragStart has not been called') : undefined : void 0; + var hasCriticalChanged = !isCriticalEqual(critical, dragging.lastCritical); + + if (hasCriticalChanged) { + dragging.lastCritical = critical; + } + + var hasLocationChanged = !areLocationsEqual(dragging.lastLocation, location); + + if (hasLocationChanged) { + dragging.lastLocation = location; + } + + var hasGroupingChanged = !isCombineEqual(dragging.lastCombine, combine); + + if (hasGroupingChanged) { + dragging.lastCombine = combine; + } + + if (!hasCriticalChanged && !hasLocationChanged && !hasGroupingChanged) { + return; + } + + var data = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, getDragStart(critical, dragging.mode), { + combine: combine, + destination: location + }); + + asyncMarshal.add(function () { + withTimings('onDragUpdate', function () { + return execute(getResponders().onDragUpdate, data, announce, preset.onDragUpdate); + }); + }); + }; + + var flush = function flush() { + !dragging ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Can only flush responders while dragging') : undefined : void 0; + asyncMarshal.flush(); + }; + + var drop = function drop(result) { + !dragging ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot fire onDragEnd when there is no matching onDragStart') : undefined : void 0; + dragging = null; + withTimings('onDragEnd', function () { + return execute(getResponders().onDragEnd, result, announce, preset.onDragEnd); + }); + }; + + var abort = function abort() { + if (!dragging) { + return; + } + + var result = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, getDragStart(dragging.lastCritical, dragging.mode), { + combine: null, + destination: null, + reason: 'CANCEL' + }); + + drop(result); + }; + + return { + beforeStart: beforeStart, + start: start, + update: update, + flush: flush, + drop: drop, + abort: abort + }; +}; + +var responders = function (getResponders, announce) { + var publisher = getPublisher(getResponders, announce); + return function (store) { + return function (next) { + return function (action) { + if (action.type === 'INITIAL_PUBLISH') { + var critical = action.payload.critical; + publisher.beforeStart(critical, action.payload.movementMode); + next(action); + publisher.start(critical, action.payload.movementMode); + return; + } + + if (action.type === 'DROP_COMPLETE') { + var result = action.payload.completed.result; + publisher.flush(); + next(action); + publisher.drop(result); + return; + } + + next(action); + + if (action.type === 'CLEAN') { + publisher.abort(); + return; + } + + var state = store.getState(); + + if (state.phase === 'DRAGGING') { + publisher.update(state.critical, state.impact); + } + }; + }; + }; +}; + +var dropAnimationFinish = function (store) { + return function (next) { + return function (action) { + if (action.type !== 'DROP_ANIMATION_FINISHED') { + next(action); + return; + } + + var state = store.getState(); + !(state.phase === 'DROP_ANIMATING') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot finish a drop animating when no drop is occurring') : undefined : void 0; + store.dispatch(completeDrop({ + completed: state.completed, + shouldFlush: false + })); + }; + }; +}; + +var dimensionMarshalStopper = function (marshal) { + return function () { + return function (next) { + return function (action) { + if (action.type === 'DROP_COMPLETE' || action.type === 'CLEAN' || action.type === 'DROP_ANIMATE') { + marshal.stopPublishing(); + } + + next(action); + }; + }; + }; +}; + +var shouldEnd = function shouldEnd(action) { + return action.type === 'DROP_COMPLETE' || action.type === 'DROP_ANIMATE' || action.type === 'CLEAN'; +}; + +var shouldCancelPending = function shouldCancelPending(action) { + return action.type === 'COLLECTION_STARTING'; +}; + +var autoScroll = function (autoScroller) { + return function (store) { + return function (next) { + return function (action) { + if (shouldEnd(action)) { + autoScroller.stop(); + next(action); + return; + } + + if (shouldCancelPending(action)) { + autoScroller.cancelPending(); + next(action); + return; + } + + if (action.type === 'INITIAL_PUBLISH') { + next(action); + var state = store.getState(); + !(state.phase === 'DRAGGING') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Expected phase to be DRAGGING after INITIAL_PUBLISH') : undefined : void 0; + autoScroller.start(state); + return; + } + + next(action); + autoScroller.scroll(store.getState()); + }; + }; + }; +}; + +var pendingDrop = function (store) { + return function (next) { + return function (action) { + next(action); + + if (action.type !== 'PUBLISH_WHILE_DRAGGING') { + return; + } + + var postActionState = store.getState(); + + if (postActionState.phase !== 'DROP_PENDING') { + return; + } + + if (postActionState.isWaiting) { + return; + } + + store.dispatch(drop({ + reason: postActionState.reason + })); + }; + }; +}; + +var composeEnhancers = true && typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : redux__WEBPACK_IMPORTED_MODULE_5__["compose"]; + +var createStore = function (_ref) { + var dimensionMarshal = _ref.dimensionMarshal, + styleMarshal = _ref.styleMarshal, + getResponders = _ref.getResponders, + announce = _ref.announce, + autoScroller = _ref.autoScroller; + return Object(redux__WEBPACK_IMPORTED_MODULE_5__["createStore"])(reducer, composeEnhancers(Object(redux__WEBPACK_IMPORTED_MODULE_5__["applyMiddleware"])(style(styleMarshal), dimensionMarshalStopper(dimensionMarshal), lift$1(dimensionMarshal), drop$1, dropAnimationFinish, pendingDrop, autoScroll(autoScroller), responders(getResponders, announce)))); +}; + +var clean$2 = function clean() { + return { + additions: {}, + removals: {}, + modified: {} + }; +}; + +var timingKey = 'Publish collection from DOM'; + +var createPublisher = function (_ref) { + var getEntries = _ref.getEntries, + callbacks = _ref.callbacks; + + var advancedUsageWarning = function () { + if (false) {} + + var hasAnnounced = false; + return function () { + if (hasAnnounced) { + return; + } + + hasAnnounced = true; + true ? warning("\n Advanced usage warning: you are adding or removing a dimension during a drag\n This an advanced feature.\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/changes-while-dragging.md\n ") : undefined; + }; + }(); + + var staging = clean$2(); + var frameId = null; + + var collect = function collect() { + advancedUsageWarning(); + + if (frameId) { + return; + } + + frameId = requestAnimationFrame(function () { + frameId = null; + callbacks.collectionStarting(); + var critical = callbacks.getCritical(); + start(timingKey); + var entries = getEntries(); + var _staging = staging, + additions = _staging.additions, + removals = _staging.removals, + modified = _staging.modified; + + var added = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(additions).map(function (id) { + return entries.draggables[id].getDimension(origin); + }).sort(function (a, b) { + return a.descriptor.index - b.descriptor.index; + }); + + var updated = _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(modified).map(function (id) { + var entry = entries.droppables[id]; + !entry ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot find dynamically added droppable in cache') : undefined : void 0; + var isHome = entry.descriptor.id === critical.droppable.id; + var options = { + withoutPlaceholder: !isHome + }; + return entry.callbacks.recollect(options); + }); + + var result = { + additions: added, + removals: _babel_runtime_corejs2_core_js_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(removals), + modified: updated + }; + staging = clean$2(); + finish(timingKey); + callbacks.publish(result); + }); + }; + + var add = function add(descriptor) { + staging.additions[descriptor.id] = descriptor; + staging.modified[descriptor.droppableId] = true; + + if (staging.removals[descriptor.id]) { + delete staging.removals[descriptor.id]; + } + + collect(); + }; + + var remove = function remove(descriptor) { + staging.removals[descriptor.id] = descriptor; + staging.modified[descriptor.droppableId] = true; + + if (staging.additions[descriptor.id]) { + delete staging.additions[descriptor.id]; + } + + collect(); + }; + + var stop = function stop() { + if (!frameId) { + return; + } + + cancelAnimationFrame(frameId); + frameId = null; + staging = clean$2(); + }; + + return { + add: add, + remove: remove, + stop: stop + }; +}; + +var getWindowScroll = function () { + return { + x: window.pageXOffset, + y: window.pageYOffset + }; +}; + +var getDocumentElement = function () { + var doc = document.documentElement; + !doc ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot find document.documentElement') : undefined : void 0; + return doc; +}; + +var getMaxWindowScroll = function () { + var doc = getDocumentElement(); + var maxScroll = getMaxScroll({ + scrollHeight: doc.scrollHeight, + scrollWidth: doc.scrollWidth, + width: doc.clientWidth, + height: doc.clientHeight + }); + return maxScroll; +}; + +var getViewport = function () { + var scroll = getWindowScroll(); + var maxScroll = getMaxWindowScroll(); + var top = scroll.y; + var left = scroll.x; + var doc = getDocumentElement(); + var width = doc.clientWidth; + var height = doc.clientHeight; + var right = left + width; + var bottom = top + height; + var frame = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["getRect"])({ + top: top, + left: left, + right: right, + bottom: bottom + }); + var viewport = { + frame: frame, + scroll: { + initial: scroll, + current: scroll, + max: maxScroll, + diff: { + value: origin, + displacement: origin + } + } + }; + return viewport; +}; + +var getInitialPublish = function (_ref) { + var critical = _ref.critical, + scrollOptions = _ref.scrollOptions, + entries = _ref.entries; + var timingKey = 'Initial collection from DOM'; + start(timingKey); + var viewport = getViewport(); + var windowScroll = viewport.scroll.current; + var home = critical.droppable; + var droppables = values(entries.droppables).filter(function (entry) { + return entry.descriptor.type === home.type; + }).map(function (entry) { + return entry.callbacks.getDimensionAndWatchScroll(windowScroll, scrollOptions); + }); + var draggables = values(entries.draggables).filter(function (entry) { + return entry.descriptor.type === critical.draggable.type; + }).map(function (entry) { + return entry.getDimension(windowScroll); + }); + var dimensions = { + draggables: toDraggableMap(draggables), + droppables: toDroppableMap(droppables) + }; + finish(timingKey); + var result = { + dimensions: dimensions, + critical: critical, + viewport: viewport + }; + return result; +}; + +var throwIfAddOrRemoveOfWrongType = function throwIfAddOrRemoveOfWrongType(collection, descriptor) { + !(collection.critical.draggable.type === descriptor.type) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "We have detected that you have added a Draggable during a drag.\n This is not of the same type as the dragging item\n\n Dragging type: " + collection.critical.draggable.type + ".\n Added type: " + descriptor.type + "\n\n We are not allowing this as you can run into problems if your change\n has shifted the positioning of other Droppables, or has changed the size of the page") : undefined : void 0; +}; + +var createDimensionMarshal = function (callbacks) { + var entries = { + droppables: {}, + draggables: {} + }; + var collection = null; + var publisher = createPublisher({ + callbacks: { + publish: callbacks.publishWhileDragging, + collectionStarting: callbacks.collectionStarting, + getCritical: function getCritical() { + !collection ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot get critical when there is no collection') : undefined : void 0; + return collection.critical; + } + }, + getEntries: function getEntries() { + return entries; + } + }); + + var registerDraggable = function registerDraggable(descriptor, getDimension) { + var entry = { + descriptor: descriptor, + getDimension: getDimension + }; + entries.draggables[descriptor.id] = entry; + + if (!collection) { + return; + } + + throwIfAddOrRemoveOfWrongType(collection, descriptor); + publisher.add(descriptor); + }; + + var updateDraggable = function updateDraggable(published, descriptor, getDimension) { + var existing = entries.draggables[published.id]; + !existing ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot update draggable registration as no published registration was found') : undefined : void 0; + + if (existing.descriptor === published) { + delete entries.draggables[published.id]; + } else { + true ? warning("\n Detected incorrect usage of 'key' on '\n\n Your 'key' should be:\n - Unique for each Draggable in a list\n - Not be based on the index of the Draggable\n\n Usually you want your 'key' to just be the 'draggableId'\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/api/draggable.md#keys-for-a-list-of-draggable-\n ") : undefined; + } + + var entry = { + descriptor: descriptor, + getDimension: getDimension + }; + entries.draggables[descriptor.id] = entry; + }; + + var unregisterDraggable = function unregisterDraggable(descriptor) { + var entry = entries.draggables[descriptor.id]; + !entry ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot unregister Draggable with id:\n " + descriptor.id + " as it is not registered") : undefined : void 0; + + if (entry.descriptor !== descriptor) { + return; + } + + delete entries.draggables[descriptor.id]; + + if (!collection) { + return; + } + + !(collection.critical.draggable.id !== descriptor.id) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot remove the dragging item during a drag') : undefined : void 0; + throwIfAddOrRemoveOfWrongType(collection, descriptor); + publisher.remove(descriptor); + }; + + var registerDroppable = function registerDroppable(descriptor, droppableCallbacks) { + var id = descriptor.id; + entries.droppables[id] = { + descriptor: descriptor, + callbacks: droppableCallbacks + }; + !!collection ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot add a Droppable during a drag') : undefined : void 0; + }; + + var unregisterDroppable = function unregisterDroppable(descriptor) { + var entry = entries.droppables[descriptor.id]; + !entry ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot unregister Droppable with id " + descriptor.id + " as as it is not registered") : undefined : void 0; + + if (entry.descriptor !== descriptor) { + return; + } + + delete entries.droppables[descriptor.id]; + !!collection ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot add a Droppable during a drag') : undefined : void 0; + }; + + var updateDroppableIsEnabled = function updateDroppableIsEnabled(id, isEnabled) { + !entries.droppables[id] ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot update is enabled flag of Droppable " + id + " as it is not registered") : undefined : void 0; + + if (!collection) { + return; + } + + callbacks.updateDroppableIsEnabled({ + id: id, + isEnabled: isEnabled + }); + }; + + var updateDroppableIsCombineEnabled = function updateDroppableIsCombineEnabled(id, isCombineEnabled) { + !entries.droppables[id] ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot update isCombineEnabled flag of Droppable " + id + " as it is not registered") : undefined : void 0; + + if (!collection) { + return; + } + + callbacks.updateDroppableIsCombineEnabled({ + id: id, + isCombineEnabled: isCombineEnabled + }); + }; + + var updateDroppableScroll = function updateDroppableScroll(id, newScroll) { + !entries.droppables[id] ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot update the scroll on Droppable " + id + " as it is not registered") : undefined : void 0; + + if (!collection) { + return; + } + + callbacks.updateDroppableScroll({ + id: id, + offset: newScroll + }); + }; + + var scrollDroppable = function scrollDroppable(id, change) { + var entry = entries.droppables[id]; + !entry ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Cannot scroll Droppable " + id + " as it is not registered") : undefined : void 0; + + if (!collection) { + return; + } + + entry.callbacks.scroll(change); + }; + + var stopPublishing = function stopPublishing() { + if (!collection) { + return; + } + + publisher.stop(); + var home = collection.critical.droppable; + values(entries.droppables).filter(function (entry) { + return entry.descriptor.type === home.type; + }).forEach(function (entry) { + return entry.callbacks.dragStopped(); + }); + collection = null; + }; + + var startPublishing = function startPublishing(request) { + !!collection ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot start capturing critical dimensions as there is already a collection') : undefined : void 0; + var entry = entries.draggables[request.draggableId]; + !entry ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot find critical draggable entry') : undefined : void 0; + var home = entries.droppables[entry.descriptor.droppableId]; + !home ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot find critical droppable entry') : undefined : void 0; + var critical = { + draggable: entry.descriptor, + droppable: home.descriptor + }; + collection = { + critical: critical + }; + return getInitialPublish({ + critical: critical, + entries: entries, + scrollOptions: request.scrollOptions + }); + }; + + var marshal = { + registerDraggable: registerDraggable, + updateDraggable: updateDraggable, + unregisterDraggable: unregisterDraggable, + registerDroppable: registerDroppable, + unregisterDroppable: unregisterDroppable, + updateDroppableIsEnabled: updateDroppableIsEnabled, + updateDroppableIsCombineEnabled: updateDroppableIsCombineEnabled, + scrollDroppable: scrollDroppable, + updateDroppableScroll: updateDroppableScroll, + startPublishing: startPublishing, + stopPublishing: stopPublishing + }; + return marshal; +}; + +var canStartDrag = function (state, id) { + if (state.phase === 'IDLE') { + return true; + } + + if (state.phase !== 'DROP_ANIMATING') { + return false; + } + + if (state.completed.result.draggableId === id) { + return false; + } + + return state.completed.result.reason === 'DROP'; +}; + +var scrollWindow = function (change) { + window.scrollBy(change.x, change.y); +}; + +var getScrollableDroppables = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (droppables) { + return toDroppableList(droppables).filter(function (droppable) { + if (!droppable.isEnabled) { + return false; + } + + if (!droppable.frame) { + return false; + } + + return true; + }); +}); + +var getScrollableDroppableOver = function getScrollableDroppableOver(target, droppables) { + var maybe = find(getScrollableDroppables(droppables), function (droppable) { + !droppable.frame ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Invalid result') : undefined : void 0; + return isPositionInFrame(droppable.frame.pageMarginBox)(target); + }); + return maybe; +}; + +var getBestScrollableDroppable = function (_ref) { + var center = _ref.center, + destination = _ref.destination, + droppables = _ref.droppables; + + if (destination) { + var _dimension = droppables[destination]; + + if (!_dimension.frame) { + return null; + } + + return _dimension; + } + + var dimension = getScrollableDroppableOver(center, droppables); + return dimension; +}; + +var config = { + startFromPercentage: 0.25, + maxScrollAtPercentage: 0.05, + maxPixelScroll: 28, + ease: function ease(percentage) { + return Math.pow(percentage, 2); + }, + durationDampening: { + stopDampeningAt: 1200, + accelerateAt: 360 + } +}; + +var getDistanceThresholds = function (container, axis) { + var startScrollingFrom = container[axis.size] * config.startFromPercentage; + var maxScrollValueAt = container[axis.size] * config.maxScrollAtPercentage; + var thresholds = { + startScrollingFrom: startScrollingFrom, + maxScrollValueAt: maxScrollValueAt + }; + return thresholds; +}; + +var getPercentage = function (_ref) { + var startOfRange = _ref.startOfRange, + endOfRange = _ref.endOfRange, + current = _ref.current; + var range = endOfRange - startOfRange; + + if (range === 0) { + true ? warning("\n Detected distance range of 0 in the fluid auto scroller\n This is unexpected and would cause a divide by 0 issue.\n Not allowing an auto scroll\n ") : undefined; + return 0; + } + + var currentInRange = current - startOfRange; + var percentage = currentInRange / range; + return percentage; +}; + +var minScroll = 1; + +var getValueFromDistance = function (distanceToEdge, thresholds) { + if (distanceToEdge > thresholds.startScrollingFrom) { + return 0; + } + + if (distanceToEdge <= thresholds.maxScrollValueAt) { + return config.maxPixelScroll; + } + + if (distanceToEdge === thresholds.startScrollingFrom) { + return minScroll; + } + + var percentageFromMaxScrollValueAt = getPercentage({ + startOfRange: thresholds.maxScrollValueAt, + endOfRange: thresholds.startScrollingFrom, + current: distanceToEdge + }); + var percentageFromStartScrollingFrom = 1 - percentageFromMaxScrollValueAt; + var scroll = config.maxPixelScroll * config.ease(percentageFromStartScrollingFrom); + return Math.ceil(scroll); +}; + +var accelerateAt = config.durationDampening.accelerateAt; +var stopAt = config.durationDampening.stopDampeningAt; + +var dampenValueByTime = function (proposedScroll, dragStartTime) { + var startOfRange = dragStartTime; + var endOfRange = stopAt; + + var now = _babel_runtime_corejs2_core_js_date_now__WEBPACK_IMPORTED_MODULE_11___default()(); + + var runTime = now - startOfRange; + + if (runTime >= stopAt) { + return proposedScroll; + } + + if (runTime < accelerateAt) { + return minScroll; + } + + var betweenAccelerateAtAndStopAtPercentage = getPercentage({ + startOfRange: accelerateAt, + endOfRange: endOfRange, + current: runTime + }); + var scroll = proposedScroll * config.ease(betweenAccelerateAtAndStopAtPercentage); + return Math.ceil(scroll); +}; + +var getValue = function (_ref) { + var distanceToEdge = _ref.distanceToEdge, + thresholds = _ref.thresholds, + dragStartTime = _ref.dragStartTime, + shouldUseTimeDampening = _ref.shouldUseTimeDampening; + var scroll = getValueFromDistance(distanceToEdge, thresholds); + + if (scroll === 0) { + return 0; + } + + if (!shouldUseTimeDampening) { + return scroll; + } + + return Math.max(dampenValueByTime(scroll, dragStartTime), minScroll); +}; + +var getScrollOnAxis = function (_ref) { + var container = _ref.container, + distanceToEdges = _ref.distanceToEdges, + dragStartTime = _ref.dragStartTime, + axis = _ref.axis, + shouldUseTimeDampening = _ref.shouldUseTimeDampening; + var thresholds = getDistanceThresholds(container, axis); + var isCloserToEnd = distanceToEdges[axis.end] < distanceToEdges[axis.start]; + + if (isCloserToEnd) { + return getValue({ + distanceToEdge: distanceToEdges[axis.end], + thresholds: thresholds, + dragStartTime: dragStartTime, + shouldUseTimeDampening: shouldUseTimeDampening + }); + } + + return -1 * getValue({ + distanceToEdge: distanceToEdges[axis.start], + thresholds: thresholds, + dragStartTime: dragStartTime, + shouldUseTimeDampening: shouldUseTimeDampening + }); +}; + +var adjustForSizeLimits = function (_ref) { + var container = _ref.container, + subject = _ref.subject, + proposedScroll = _ref.proposedScroll; + var isTooBigVertically = subject.height > container.height; + var isTooBigHorizontally = subject.width > container.width; + + if (!isTooBigHorizontally && !isTooBigVertically) { + return proposedScroll; + } + + if (isTooBigHorizontally && isTooBigVertically) { + return null; + } + + return { + x: isTooBigHorizontally ? 0 : proposedScroll.x, + y: isTooBigVertically ? 0 : proposedScroll.y + }; +}; + +var clean$3 = apply(function (value) { + return value === 0 ? 0 : value; +}); + +var getScroll = function (_ref) { + var dragStartTime = _ref.dragStartTime, + container = _ref.container, + subject = _ref.subject, + center = _ref.center, + shouldUseTimeDampening = _ref.shouldUseTimeDampening; + var distanceToEdges = { + top: center.y - container.top, + right: container.right - center.x, + bottom: container.bottom - center.y, + left: center.x - container.left + }; + var y = getScrollOnAxis({ + container: container, + distanceToEdges: distanceToEdges, + dragStartTime: dragStartTime, + axis: vertical, + shouldUseTimeDampening: shouldUseTimeDampening + }); + var x = getScrollOnAxis({ + container: container, + distanceToEdges: distanceToEdges, + dragStartTime: dragStartTime, + axis: horizontal, + shouldUseTimeDampening: shouldUseTimeDampening + }); + var required = clean$3({ + x: x, + y: y + }); + + if (isEqual(required, origin)) { + return null; + } + + var limited = adjustForSizeLimits({ + container: container, + subject: subject, + proposedScroll: required + }); + + if (!limited) { + return null; + } + + return isEqual(limited, origin) ? null : limited; +}; + +var smallestSigned = apply(function (value) { + if (value === 0) { + return 0; + } + + return value > 0 ? 1 : -1; +}); + +var getOverlap = function () { + var getRemainder = function getRemainder(target, max) { + if (target < 0) { + return target; + } + + if (target > max) { + return target - max; + } + + return 0; + }; + + return function (_ref) { + var current = _ref.current, + max = _ref.max, + change = _ref.change; + var targetScroll = add(current, change); + var overlap = { + x: getRemainder(targetScroll.x, max.x), + y: getRemainder(targetScroll.y, max.y) + }; + + if (isEqual(overlap, origin)) { + return null; + } + + return overlap; + }; +}(); + +var canPartiallyScroll = function canPartiallyScroll(_ref2) { + var rawMax = _ref2.max, + current = _ref2.current, + change = _ref2.change; + var max = { + x: Math.max(current.x, rawMax.x), + y: Math.max(current.y, rawMax.y) + }; + var smallestChange = smallestSigned(change); + var overlap = getOverlap({ + max: max, + current: current, + change: smallestChange + }); + + if (!overlap) { + return true; + } + + if (smallestChange.x !== 0 && overlap.x === 0) { + return true; + } + + if (smallestChange.y !== 0 && overlap.y === 0) { + return true; + } + + return false; +}; + +var canScrollWindow = function canScrollWindow(viewport, change) { + return canPartiallyScroll({ + current: viewport.scroll.current, + max: viewport.scroll.max, + change: change + }); +}; + +var getWindowOverlap = function getWindowOverlap(viewport, change) { + if (!canScrollWindow(viewport, change)) { + return null; + } + + var max = viewport.scroll.max; + var current = viewport.scroll.current; + return getOverlap({ + current: current, + max: max, + change: change + }); +}; + +var canScrollDroppable = function canScrollDroppable(droppable, change) { + var frame = droppable.frame; + + if (!frame) { + return false; + } + + return canPartiallyScroll({ + current: frame.scroll.current, + max: frame.scroll.max, + change: change + }); +}; + +var getDroppableOverlap = function getDroppableOverlap(droppable, change) { + var frame = droppable.frame; + + if (!frame) { + return null; + } + + if (!canScrollDroppable(droppable, change)) { + return null; + } + + return getOverlap({ + current: frame.scroll.current, + max: frame.scroll.max, + change: change + }); +}; + +var getWindowScrollChange = function (_ref) { + var viewport = _ref.viewport, + subject = _ref.subject, + center = _ref.center, + dragStartTime = _ref.dragStartTime, + shouldUseTimeDampening = _ref.shouldUseTimeDampening; + var scroll = getScroll({ + dragStartTime: dragStartTime, + container: viewport.frame, + subject: subject, + center: center, + shouldUseTimeDampening: shouldUseTimeDampening + }); + return scroll && canScrollWindow(viewport, scroll) ? scroll : null; +}; + +var getDroppableScrollChange = function (_ref) { + var droppable = _ref.droppable, + subject = _ref.subject, + center = _ref.center, + dragStartTime = _ref.dragStartTime, + shouldUseTimeDampening = _ref.shouldUseTimeDampening; + var frame = droppable.frame; + + if (!frame) { + return null; + } + + var scroll = getScroll({ + dragStartTime: dragStartTime, + container: frame.pageMarginBox, + subject: subject, + center: center, + shouldUseTimeDampening: shouldUseTimeDampening + }); + return scroll && canScrollDroppable(droppable, scroll) ? scroll : null; +}; + +var scroll$1 = function (_ref) { + var state = _ref.state, + dragStartTime = _ref.dragStartTime, + shouldUseTimeDampening = _ref.shouldUseTimeDampening, + scrollWindow = _ref.scrollWindow, + scrollDroppable = _ref.scrollDroppable; + var center = state.current.page.borderBoxCenter; + var draggable = state.dimensions.draggables[state.critical.draggable.id]; + var subject = draggable.page.marginBox; + + if (state.isWindowScrollAllowed) { + var viewport = state.viewport; + + var _change = getWindowScrollChange({ + dragStartTime: dragStartTime, + viewport: viewport, + subject: subject, + center: center, + shouldUseTimeDampening: shouldUseTimeDampening + }); + + if (_change) { + scrollWindow(_change); + return; + } + } + + var droppable = getBestScrollableDroppable({ + center: center, + destination: whatIsDraggedOver(state.impact), + droppables: state.dimensions.droppables + }); + + if (!droppable) { + return; + } + + var change = getDroppableScrollChange({ + dragStartTime: dragStartTime, + droppable: droppable, + subject: subject, + center: center, + shouldUseTimeDampening: shouldUseTimeDampening + }); + + if (change) { + scrollDroppable(droppable.descriptor.id, change); + } +}; + +var createFluidScroller = function (_ref) { + var scrollWindow = _ref.scrollWindow, + scrollDroppable = _ref.scrollDroppable; + var scheduleWindowScroll = Object(raf_schd__WEBPACK_IMPORTED_MODULE_12__["default"])(scrollWindow); + var scheduleDroppableScroll = Object(raf_schd__WEBPACK_IMPORTED_MODULE_12__["default"])(scrollDroppable); + var dragging = null; + + var tryScroll = function tryScroll(state) { + !dragging ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot fluid scroll if not dragging') : undefined : void 0; + var _dragging = dragging, + shouldUseTimeDampening = _dragging.shouldUseTimeDampening, + dragStartTime = _dragging.dragStartTime; + scroll$1({ + state: state, + scrollWindow: scheduleWindowScroll, + scrollDroppable: scheduleDroppableScroll, + dragStartTime: dragStartTime, + shouldUseTimeDampening: shouldUseTimeDampening + }); + }; + + var cancelPending = function cancelPending() { + !dragging ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot cancel pending fluid scroll when not started') : undefined : void 0; + scheduleWindowScroll.cancel(); + scheduleDroppableScroll.cancel(); + }; + + var start$1 = function start$1(state) { + start('starting fluid scroller'); + !!dragging ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot start auto scrolling when already started') : undefined : void 0; + + var dragStartTime = _babel_runtime_corejs2_core_js_date_now__WEBPACK_IMPORTED_MODULE_11___default()(); + + var wasScrollNeeded = false; + + var fakeScrollCallback = function fakeScrollCallback() { + wasScrollNeeded = true; + }; + + scroll$1({ + state: state, + dragStartTime: 0, + shouldUseTimeDampening: false, + scrollWindow: fakeScrollCallback, + scrollDroppable: fakeScrollCallback + }); + dragging = { + dragStartTime: dragStartTime, + shouldUseTimeDampening: wasScrollNeeded + }; + finish('starting fluid scroller'); + + if (wasScrollNeeded) { + tryScroll(state); + } + }; + + var stop = function stop() { + if (!dragging) { + return; + } + + cancelPending(); + dragging = null; + }; + + return { + start: start$1, + stop: stop, + cancelPending: cancelPending, + scroll: tryScroll + }; +}; + +var createJumpScroller = function (_ref) { + var move = _ref.move, + scrollDroppable = _ref.scrollDroppable, + scrollWindow = _ref.scrollWindow; + + var moveByOffset = function moveByOffset(state, offset) { + var client = add(state.current.client.selection, offset); + move({ + client: client + }); + }; + + var scrollDroppableAsMuchAsItCan = function scrollDroppableAsMuchAsItCan(droppable, change) { + if (!canScrollDroppable(droppable, change)) { + return change; + } + + var overlap = getDroppableOverlap(droppable, change); + + if (!overlap) { + scrollDroppable(droppable.descriptor.id, change); + return null; + } + + var whatTheDroppableCanScroll = subtract(change, overlap); + scrollDroppable(droppable.descriptor.id, whatTheDroppableCanScroll); + var remainder = subtract(change, whatTheDroppableCanScroll); + return remainder; + }; + + var scrollWindowAsMuchAsItCan = function scrollWindowAsMuchAsItCan(isWindowScrollAllowed, viewport, change) { + if (!isWindowScrollAllowed) { + return change; + } + + if (!canScrollWindow(viewport, change)) { + return change; + } + + var overlap = getWindowOverlap(viewport, change); + + if (!overlap) { + scrollWindow(change); + return null; + } + + var whatTheWindowCanScroll = subtract(change, overlap); + scrollWindow(whatTheWindowCanScroll); + var remainder = subtract(change, whatTheWindowCanScroll); + return remainder; + }; + + var jumpScroller = function jumpScroller(state) { + var request = state.scrollJumpRequest; + + if (!request) { + return; + } + + var destination = whatIsDraggedOver(state.impact); + !destination ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot perform a jump scroll when there is no destination') : undefined : void 0; + var droppableRemainder = scrollDroppableAsMuchAsItCan(state.dimensions.droppables[destination], request); + + if (!droppableRemainder) { + return; + } + + var viewport = state.viewport; + var windowRemainder = scrollWindowAsMuchAsItCan(state.isWindowScrollAllowed, viewport, droppableRemainder); + + if (!windowRemainder) { + return; + } + + moveByOffset(state, windowRemainder); + }; + + return jumpScroller; +}; + +var createAutoScroller = function (_ref) { + var scrollDroppable = _ref.scrollDroppable, + scrollWindow = _ref.scrollWindow, + move = _ref.move; + var fluidScroller = createFluidScroller({ + scrollWindow: scrollWindow, + scrollDroppable: scrollDroppable + }); + var jumpScroll = createJumpScroller({ + move: move, + scrollWindow: scrollWindow, + scrollDroppable: scrollDroppable + }); + + var scroll = function scroll(state) { + if (state.phase !== 'DRAGGING') { + return; + } + + if (state.movementMode === 'FLUID') { + fluidScroller.scroll(state); + return; + } + + if (!state.scrollJumpRequest) { + return; + } + + jumpScroll(state); + }; + + var scroller = { + scroll: scroll, + cancelPending: fluidScroller.cancelPending, + start: fluidScroller.start, + stop: fluidScroller.stop + }; + return scroller; +}; + +var prefix = 'data-react-beautiful-dnd'; +var dragHandle = prefix + "-drag-handle"; +var draggable = prefix + "-draggable"; +var droppable = prefix + "-droppable"; + +var makeGetSelector = function makeGetSelector(context) { + return function (attribute) { + return "[" + attribute + "=\"" + context + "\"]"; + }; +}; + +var getStyles = function getStyles(rules, property) { + return rules.map(function (rule) { + var value = rule.styles[property]; + + if (!value) { + return ''; + } + + return rule.selector + " { " + value + " }"; + }).join(' '); +}; + +var noPointerEvents = 'pointer-events: none;'; + +var getStyles$1 = function (uniqueContext) { + var getSelector = makeGetSelector(uniqueContext); + + var dragHandle$1 = function () { + var grabCursor = "\n cursor: -webkit-grab;\n cursor: grab;\n "; + return { + selector: getSelector(dragHandle), + styles: { + always: "\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ", + resting: grabCursor, + dragging: noPointerEvents, + dropAnimating: grabCursor + } + }; + }(); + + var draggable$1 = function () { + var transition = "\n transition: " + transitions.outOfTheWay + ";\n "; + return { + selector: getSelector(draggable), + styles: { + dragging: transition, + dropAnimating: transition, + userCancel: transition + } + }; + }(); + + var droppable$1 = { + selector: getSelector(droppable), + styles: { + always: "overflow-anchor: none;" + } + }; + var body = { + selector: 'body', + styles: { + dragging: "\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n " + } + }; + var rules = [draggable$1, dragHandle$1, droppable$1, body]; + return { + always: getStyles(rules, 'always'), + resting: getStyles(rules, 'resting'), + dragging: getStyles(rules, 'dragging'), + dropAnimating: getStyles(rules, 'dropAnimating'), + userCancel: getStyles(rules, 'userCancel') + }; +}; + +var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? react__WEBPACK_IMPORTED_MODULE_1__["useLayoutEffect"] : react__WEBPACK_IMPORTED_MODULE_1__["useEffect"]; + +var getHead = function getHead() { + var head = document.querySelector('head'); + !head ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot find the head to append a style to') : undefined : void 0; + return head; +}; + +var createStyleEl = function createStyleEl() { + var el = document.createElement('style'); + el.type = 'text/css'; + return el; +}; + +function useStyleMarshal(uniqueId) { + var uniqueContext = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return "" + uniqueId; + }, [uniqueId]); + var styles = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return getStyles$1(uniqueContext); + }, [uniqueContext]); + var alwaysRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + var dynamicRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + var setDynamicStyle = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (proposed) { + var el = dynamicRef.current; + !el ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot set dynamic style element if it is not set') : undefined : void 0; + el.textContent = proposed; + }), []); + var setAlwaysStyle = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (proposed) { + var el = alwaysRef.current; + !el ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot set dynamic style element if it is not set') : undefined : void 0; + el.textContent = proposed; + }, []); + useIsomorphicLayoutEffect(function () { + !(!alwaysRef.current && !dynamicRef.current) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'style elements already mounted') : undefined : void 0; + var always = createStyleEl(); + var dynamic = createStyleEl(); + alwaysRef.current = always; + dynamicRef.current = dynamic; + always.setAttribute(prefix + "-always", uniqueContext); + dynamic.setAttribute(prefix + "-dynamic", uniqueContext); + getHead().appendChild(always); + getHead().appendChild(dynamic); + setAlwaysStyle(styles.always); + setDynamicStyle(styles.resting); + return function () { + var remove = function remove(ref) { + var current = ref.current; + !current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot unmount ref as it is not set') : undefined : void 0; + getHead().removeChild(current); + ref.current = null; + }; + + remove(alwaysRef); + remove(dynamicRef); + }; + }, [setAlwaysStyle, setDynamicStyle, styles.always, styles.resting, uniqueContext]); + var dragging = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return setDynamicStyle(styles.dragging); + }, [setDynamicStyle, styles.dragging]); + var dropping = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (reason) { + if (reason === 'DROP') { + setDynamicStyle(styles.dropAnimating); + return; + } + + setDynamicStyle(styles.userCancel); + }, [setDynamicStyle, styles.dropAnimating, styles.userCancel]); + var resting = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + if (!dynamicRef.current) { + return; + } + + setDynamicStyle(styles.resting); + }, [setDynamicStyle, styles.resting]); + var marshal = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + dragging: dragging, + dropping: dropping, + resting: resting, + styleContext: uniqueContext + }; + }, [dragging, dropping, resting, uniqueContext]); + return marshal; +} + +var StoreContext = react__WEBPACK_IMPORTED_MODULE_1___default.a.createContext(null); + +var getBodyElement = function () { + var body = document.body; + !body ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot find document.body') : undefined : void 0; + return body; +}; + +var visuallyHidden = { + position: 'absolute', + width: '1px', + height: '1px', + margin: '-1px', + border: '0', + padding: '0', + overflow: 'hidden', + clip: 'rect(0 0 0 0)', + 'clip-path': 'inset(100%)' +}; + +var getId = function getId(uniqueId) { + return "react-beautiful-dnd-announcement-" + uniqueId; +}; + +function useAnnouncer(uniqueId) { + var id = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return getId(uniqueId); + }, [uniqueId]); + var ref = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () { + !!ref.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Announcement node already mounted') : undefined : void 0; + var el = document.createElement('div'); + ref.current = el; + el.id = id; + el.setAttribute('aria-live', 'assertive'); + el.setAttribute('role', 'log'); + el.setAttribute('aria-atomic', 'true'); + + _babel_runtime_corejs2_core_js_object_assign__WEBPACK_IMPORTED_MODULE_13___default()(el.style, visuallyHidden); + + getBodyElement().appendChild(el); + return function () { + var toBeRemoved = ref.current; + !toBeRemoved ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot unmount announcement node') : undefined : void 0; + getBodyElement().removeChild(toBeRemoved); + ref.current = null; + }; + }, [id]); + var announce = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (message) { + var el = ref.current; + + if (el) { + el.textContent = message; + return; + } + + true ? warning("\n A screen reader message was trying to be announced but it was unable to do so.\n This can occur if you unmount your in your onDragEnd.\n Consider calling provided.announce() before the unmount so that the instruction will\n not be lost for users relying on a screen reader.\n\n Message not passed to screen reader:\n\n \"" + message + "\"\n ") : undefined; + }, []); + return announce; +} + +var AppContext = react__WEBPACK_IMPORTED_MODULE_1___default.a.createContext(null); +var peerDependencies = { + react: "^16.8.5" +}; +var semver = /(\d+)\.(\d+)\.(\d+)/; + +var getVersion = function getVersion(value) { + var result = semver.exec(value); + !(result != null) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "Unable to parse React version " + value) : undefined : void 0; + var major = Number(result[1]); + var minor = Number(result[2]); + var patch = Number(result[3]); + return { + major: major, + minor: minor, + patch: patch, + raw: value + }; +}; + +var isSatisfied = function isSatisfied(expected, actual) { + if (actual.major > expected.major) { + return true; + } + + if (actual.major < expected.major) { + return false; + } + + if (actual.minor > expected.minor) { + return true; + } + + if (actual.minor < expected.minor) { + return false; + } + + return actual.patch >= expected.patch; +}; + +var checkReactVersion = function (peerDepValue, actualValue) { + var peerDep = getVersion(peerDepValue); + var actual = getVersion(actualValue); + + if (isSatisfied(peerDep, actual)) { + return; + } + + true ? warning("\n React version: [" + actual.raw + "]\n does not satisfy expected peer dependency version: [" + peerDep.raw + "]\n\n This can result in run time bugs, and even fatal crashes\n ") : undefined; +}; + +var suffix = "\n We expect a html5 doctype: \n This is to ensure consistent browser layout and measurement\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md\n"; + +var checkDoctype = function (doc) { + var doctype = doc.doctype; + + if (!doctype) { + true ? warning("\n No found.\n\n " + suffix + "\n ") : undefined; + return; + } + + if (doctype.name.toLowerCase() !== 'html') { + true ? warning("\n Unexpected found: (" + doctype.name + ")\n\n " + suffix + "\n ") : undefined; + } + + if (doctype.publicId !== '') { + true ? warning("\n Unexpected publicId found: (" + doctype.publicId + ")\n A html5 doctype does not have a publicId\n\n " + suffix + "\n ") : undefined; + } +}; + +function useStartupValidation() { + Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () { + if (false) {} + + checkReactVersion(peerDependencies.react, react__WEBPACK_IMPORTED_MODULE_1___default.a.version); + checkDoctype(document); + }, []); +} + +function usePrevious(current) { + var ref = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(current); + Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () { + ref.current = current; + }); + return ref; +} + +var createResponders = function createResponders(props) { + return { + onBeforeDragStart: props.onBeforeDragStart, + onDragStart: props.onDragStart, + onDragEnd: props.onDragEnd, + onDragUpdate: props.onDragUpdate + }; +}; + +function getStore(lazyRef) { + !lazyRef.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Could not find store from lazy ref') : undefined : void 0; + return lazyRef.current; +} + +function App(props) { + var uniqueId = props.uniqueId, + setOnError = props.setOnError; + var lazyStoreRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + useStartupValidation(); + var lastPropsRef = usePrevious(props); + var getResponders = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return createResponders(lastPropsRef.current); + }, [lastPropsRef]); + var announce = useAnnouncer(uniqueId); + var styleMarshal = useStyleMarshal(uniqueId); + var lazyDispatch = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (action) { + getStore(lazyStoreRef).dispatch(action); + }, []); + var callbacks = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return Object(redux__WEBPACK_IMPORTED_MODULE_5__["bindActionCreators"])({ + publishWhileDragging: publishWhileDragging$1, + updateDroppableScroll: updateDroppableScroll, + updateDroppableIsEnabled: updateDroppableIsEnabled, + updateDroppableIsCombineEnabled: updateDroppableIsCombineEnabled, + collectionStarting: collectionStarting + }, lazyDispatch); + }, [lazyDispatch]); + var dimensionMarshal = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return createDimensionMarshal(callbacks); + }, [callbacks]); + var autoScroller = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return createAutoScroller(Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ + scrollWindow: scrollWindow, + scrollDroppable: dimensionMarshal.scrollDroppable + }, Object(redux__WEBPACK_IMPORTED_MODULE_5__["bindActionCreators"])({ + move: move + }, lazyDispatch))); + }, [dimensionMarshal.scrollDroppable, lazyDispatch]); + var store = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return createStore({ + dimensionMarshal: dimensionMarshal, + styleMarshal: styleMarshal, + announce: announce, + autoScroller: autoScroller, + getResponders: getResponders + }); + }, [announce, autoScroller, dimensionMarshal, getResponders, styleMarshal]); + + if (true) { + if (lazyStoreRef.current && lazyStoreRef.current !== store) { + true ? warning('unexpected store change') : undefined; + } + } + + lazyStoreRef.current = store; + var tryResetStore = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var current = getStore(lazyStoreRef); + var state = current.getState(); + + if (state.phase !== 'IDLE') { + current.dispatch(clean$1({ + shouldFlush: true + })); + } + }, []); + setOnError(tryResetStore); + var getCanLift = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (id) { + return canStartDrag(getStore(lazyStoreRef).getState(), id); + }, []); + var getIsMovementAllowed = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return isMovementAllowed(getStore(lazyStoreRef).getState()); + }, []); + var appContext = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + marshal: dimensionMarshal, + style: styleMarshal.styleContext, + canLift: getCanLift, + isMovementAllowed: getIsMovementAllowed + }; + }, [dimensionMarshal, getCanLift, getIsMovementAllowed, styleMarshal.styleContext]); + Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () { + return tryResetStore; + }, [tryResetStore]); + return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(AppContext.Provider, { + value: appContext + }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(react_redux__WEBPACK_IMPORTED_MODULE_6__["Provider"], { + context: StoreContext, + store: store + }, props.children)); +} + +var instanceCount = 0; + +function resetServerContext() { + instanceCount = 0; +} + +function DragDropContext(props) { + var uniqueId = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return instanceCount++; + }, []); + return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ErrorBoundary, null, function (setOnError) { + return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(App, Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({ + setOnError: setOnError, + uniqueId: uniqueId + }, props), props.children); + }); +} + +var isEqual$2 = function isEqual(base) { + return function (value) { + return base === value; + }; +}; + +var isScroll = isEqual$2('scroll'); +var isAuto = isEqual$2('auto'); +var isVisible$1 = isEqual$2('visible'); + +var isEither = function isEither(overflow, fn) { + return fn(overflow.overflowX) || fn(overflow.overflowY); +}; + +var isBoth = function isBoth(overflow, fn) { + return fn(overflow.overflowX) && fn(overflow.overflowY); +}; + +var isElementScrollable = function isElementScrollable(el) { + var style = window.getComputedStyle(el); + var overflow = { + overflowX: style.overflowX, + overflowY: style.overflowY + }; + return isEither(overflow, isScroll) || isEither(overflow, isAuto); +}; + +var isBodyScrollable = function isBodyScrollable() { + if (false) {} + + var body = getBodyElement(); + var html = document.documentElement; + !html ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false) : undefined : void 0; + + if (!isElementScrollable(body)) { + return false; + } + + var htmlStyle = window.getComputedStyle(html); + var htmlOverflow = { + overflowX: htmlStyle.overflowX, + overflowY: htmlStyle.overflowY + }; + + if (isBoth(htmlOverflow, isVisible$1)) { + return false; + } + + true ? warning("\n We have detected that your element might be a scroll container.\n We have found no reliable way of detecting whether the element is a scroll container.\n Under most circumstances a scroll bar will be on the element (document.documentElement)\n\n Because we cannot determine if the is a scroll container, and generally it is not one,\n we will be treating the as *not* a scroll container\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/how-we-detect-scroll-containers.md\n ") : undefined; + return false; +}; + +var getClosestScrollable = function getClosestScrollable(el) { + if (el == null) { + return null; + } + + if (el === document.body) { + return isBodyScrollable() ? el : null; + } + + if (el === document.documentElement) { + return null; + } + + if (!isElementScrollable(el)) { + return getClosestScrollable(el.parentElement); + } + + return el; +}; + +var checkForNestedScrollContainers = function (scrollable) { + if (!scrollable) { + return; + } + + var anotherScrollParent = getClosestScrollable(scrollable.parentElement); + + if (!anotherScrollParent) { + return; + } + + true ? warning("\n Droppable: unsupported nested scroll container detected.\n A Droppable can only have one scroll parent (which can be itself)\n Nested scroll containers are currently not supported.\n\n We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131\n ") : undefined; +}; + +var getScroll$1 = function (el) { + return { + x: el.scrollLeft, + y: el.scrollTop + }; +}; + +var getIsFixed = function getIsFixed(el) { + if (!el) { + return false; + } + + var style = window.getComputedStyle(el); + + if (style.position === 'fixed') { + return true; + } + + return getIsFixed(el.parentElement); +}; + +var getEnv = function (start) { + var closestScrollable = getClosestScrollable(start); + var isFixedOnPage = getIsFixed(start); + return { + closestScrollable: closestScrollable, + isFixedOnPage: isFixedOnPage + }; +}; + +var getClient = function getClient(targetRef, closestScrollable) { + var base = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["getBox"])(targetRef); + + if (!closestScrollable) { + return base; + } + + if (targetRef !== closestScrollable) { + return base; + } + + var top = base.paddingBox.top - closestScrollable.scrollTop; + var left = base.paddingBox.left - closestScrollable.scrollLeft; + var bottom = top + closestScrollable.scrollHeight; + var right = left + closestScrollable.scrollWidth; + var paddingBox = { + top: top, + right: right, + bottom: bottom, + left: left + }; + var borderBox = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["expand"])(paddingBox, base.border); + var client = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["createBox"])({ + borderBox: borderBox, + margin: base.margin, + border: base.border, + padding: base.padding + }); + return client; +}; + +var getDimension = function (_ref) { + var ref = _ref.ref, + descriptor = _ref.descriptor, + env = _ref.env, + windowScroll = _ref.windowScroll, + direction = _ref.direction, + isDropDisabled = _ref.isDropDisabled, + isCombineEnabled = _ref.isCombineEnabled, + shouldClipSubject = _ref.shouldClipSubject; + var closestScrollable = env.closestScrollable; + var client = getClient(ref, closestScrollable); + var page = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["withScroll"])(client, windowScroll); + + var closest = function () { + if (!closestScrollable) { + return null; + } + + var frameClient = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["getBox"])(closestScrollable); + var scrollSize = { + scrollHeight: closestScrollable.scrollHeight, + scrollWidth: closestScrollable.scrollWidth + }; + return { + client: frameClient, + page: Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["withScroll"])(frameClient, windowScroll), + scroll: getScroll$1(closestScrollable), + scrollSize: scrollSize, + shouldClipSubject: shouldClipSubject + }; + }(); + + var dimension = getDroppableDimension({ + descriptor: descriptor, + isEnabled: !isDropDisabled, + isCombineEnabled: isCombineEnabled, + isFixedOnPage: env.isFixedOnPage, + direction: direction, + client: client, + page: page, + closest: closest + }); + return dimension; +}; + +function withoutPlaceholder(placeholder, fn) { + if (!placeholder) { + return fn(); + } + + var last = placeholder.style.display; + placeholder.style.display = 'none'; + var result = fn(); + placeholder.style.display = last; + return result; +} + +var immediate = { + passive: false +}; +var delayed = { + passive: true +}; + +var getListenerOptions = function (options) { + return options.shouldPublishImmediately ? immediate : delayed; +}; + +function useRequiredContext(Context) { + var result = Object(react__WEBPACK_IMPORTED_MODULE_1__["useContext"])(Context); + !result ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Could not find required context') : undefined : void 0; + return result; +} + +var getClosestScrollableFromDrag = function getClosestScrollableFromDrag(dragging) { + return dragging && dragging.env.closestScrollable || null; +}; + +function useDroppableDimensionPublisher(args) { + var whileDraggingRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + var appContext = useRequiredContext(AppContext); + var marshal = appContext.marshal; + var previousRef = usePrevious(args); + var descriptor = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + id: args.droppableId, + type: args.type + }; + }, [args.droppableId, args.type]); + var publishedDescriptorRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(descriptor); + var memoizedUpdateScroll = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (x, y) { + !whileDraggingRef.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Can only update scroll when dragging') : undefined : void 0; + var scroll = { + x: x, + y: y + }; + marshal.updateDroppableScroll(descriptor.id, scroll); + }); + }, [descriptor.id, marshal]); + var getClosestScroll = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var dragging = whileDraggingRef.current; + + if (!dragging || !dragging.env.closestScrollable) { + return origin; + } + + return getScroll$1(dragging.env.closestScrollable); + }, []); + var updateScroll = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var scroll = getClosestScroll(); + memoizedUpdateScroll(scroll.x, scroll.y); + }, [getClosestScroll, memoizedUpdateScroll]); + var scheduleScrollUpdate = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return Object(raf_schd__WEBPACK_IMPORTED_MODULE_12__["default"])(updateScroll); + }, [updateScroll]); + var onClosestScroll = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var dragging = whileDraggingRef.current; + var closest = getClosestScrollableFromDrag(dragging); + !(dragging && closest) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Could not find scroll options while scrolling') : undefined : void 0; + var options = dragging.scrollOptions; + + if (options.shouldPublishImmediately) { + updateScroll(); + return; + } + + scheduleScrollUpdate(); + }, [scheduleScrollUpdate, updateScroll]); + var getDimensionAndWatchScroll = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (windowScroll, options) { + !!whileDraggingRef.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot collect a droppable while a drag is occurring') : undefined : void 0; + var previous = previousRef.current; + var ref = previous.getDroppableRef(); + !ref ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot collect without a droppable ref') : undefined : void 0; + var env = getEnv(ref); + var dragging = { + ref: ref, + descriptor: descriptor, + env: env, + scrollOptions: options + }; + whileDraggingRef.current = dragging; + var dimension = getDimension({ + ref: ref, + descriptor: descriptor, + env: env, + windowScroll: windowScroll, + direction: previous.direction, + isDropDisabled: previous.isDropDisabled, + isCombineEnabled: previous.isCombineEnabled, + shouldClipSubject: !previous.ignoreContainerClipping + }); + + if (env.closestScrollable) { + env.closestScrollable.addEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions)); + + if (true) { + checkForNestedScrollContainers(env.closestScrollable); + } + } + + return dimension; + }, [descriptor, onClosestScroll, previousRef]); + var recollect = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (options) { + var dragging = whileDraggingRef.current; + var closest = getClosestScrollableFromDrag(dragging); + !(dragging && closest) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Can only recollect Droppable client for Droppables that have a scroll container') : undefined : void 0; + var previous = previousRef.current; + + var execute = function execute() { + return getDimension({ + ref: dragging.ref, + descriptor: dragging.descriptor, + env: dragging.env, + windowScroll: origin, + direction: previous.direction, + isDropDisabled: previous.isDropDisabled, + isCombineEnabled: previous.isCombineEnabled, + shouldClipSubject: !previous.ignoreContainerClipping + }); + }; + + if (!options.withoutPlaceholder) { + return execute(); + } + + return withoutPlaceholder(previous.getPlaceholderRef(), execute); + }, [previousRef]); + var dragStopped = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var dragging = whileDraggingRef.current; + !dragging ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot stop drag when no active drag') : undefined : void 0; + var closest = getClosestScrollableFromDrag(dragging); + whileDraggingRef.current = null; + + if (!closest) { + return; + } + + scheduleScrollUpdate.cancel(); + closest.removeEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions)); + }, [onClosestScroll, scheduleScrollUpdate]); + var scroll = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (change) { + var dragging = whileDraggingRef.current; + !dragging ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot scroll when there is no drag') : undefined : void 0; + var closest = getClosestScrollableFromDrag(dragging); + !closest ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot scroll a droppable with no closest scrollable') : undefined : void 0; + closest.scrollTop += change.y; + closest.scrollLeft += change.x; + }, []); + var callbacks = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + getDimensionAndWatchScroll: getDimensionAndWatchScroll, + recollect: recollect, + dragStopped: dragStopped, + scroll: scroll + }; + }, [dragStopped, getDimensionAndWatchScroll, recollect, scroll]); + useIsomorphicLayoutEffect(function () { + publishedDescriptorRef.current = descriptor; + marshal.registerDroppable(descriptor, callbacks); + return function () { + if (whileDraggingRef.current) { + true ? warning('Unsupported: changing the droppableId or type of a Droppable during a drag') : undefined; + dragStopped(); + } + + marshal.unregisterDroppable(descriptor); + }; + }, [callbacks, descriptor, dragStopped, marshal]); + useIsomorphicLayoutEffect(function () { + if (!whileDraggingRef.current) { + return; + } + + marshal.updateDroppableIsEnabled(publishedDescriptorRef.current.id, !args.isDropDisabled); + }, [args.isDropDisabled, marshal]); + useIsomorphicLayoutEffect(function () { + if (!whileDraggingRef.current) { + return; + } + + marshal.updateDroppableIsCombineEnabled(publishedDescriptorRef.current.id, args.isCombineEnabled); + }, [args.isCombineEnabled, marshal]); +} + +function noop() {} + +var empty = { + width: 0, + height: 0, + margin: noSpacing +}; + +var getSize = function getSize(_ref) { + var isAnimatingOpenOnMount = _ref.isAnimatingOpenOnMount, + placeholder = _ref.placeholder, + animate = _ref.animate; + + if (isAnimatingOpenOnMount) { + return empty; + } + + if (animate === 'close') { + return empty; + } + + return { + height: placeholder.client.borderBox.height, + width: placeholder.client.borderBox.width, + margin: placeholder.client.margin + }; +}; + +var getStyle = function getStyle(_ref2) { + var isAnimatingOpenOnMount = _ref2.isAnimatingOpenOnMount, + placeholder = _ref2.placeholder, + animate = _ref2.animate; + var size = getSize({ + isAnimatingOpenOnMount: isAnimatingOpenOnMount, + placeholder: placeholder, + animate: animate + }); + return { + display: placeholder.display, + boxSizing: 'border-box', + width: size.width, + height: size.height, + marginTop: size.margin.top, + marginRight: size.margin.right, + marginBottom: size.margin.bottom, + marginLeft: size.margin.left, + flexShrink: '0', + flexGrow: '0', + pointerEvents: 'none', + transition: transitions.placeholder + }; +}; + +function Placeholder(props) { + var animateOpenTimerRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + var tryClearAnimateOpenTimer = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + if (!animateOpenTimerRef.current) { + return; + } + + clearTimeout(animateOpenTimerRef.current); + animateOpenTimerRef.current = null; + }, []); + var animate = props.animate, + onTransitionEnd = props.onTransitionEnd, + onClose = props.onClose, + styleContext = props.styleContext; + + var _useState = Object(react__WEBPACK_IMPORTED_MODULE_1__["useState"])(props.animate === 'open'), + isAnimatingOpenOnMount = _useState[0], + setIsAnimatingOpenOnMount = _useState[1]; + + Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () { + if (!isAnimatingOpenOnMount) { + return noop; + } + + if (animate !== 'open') { + tryClearAnimateOpenTimer(); + setIsAnimatingOpenOnMount(false); + return noop; + } + + if (animateOpenTimerRef.current) { + return noop; + } + + animateOpenTimerRef.current = setTimeout(function () { + animateOpenTimerRef.current = null; + setIsAnimatingOpenOnMount(false); + }); + return tryClearAnimateOpenTimer; + }, [animate, isAnimatingOpenOnMount, tryClearAnimateOpenTimer]); + var onSizeChangeEnd = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (event) { + if (event.propertyName !== 'height') { + return; + } + + onTransitionEnd(); + + if (animate === 'close') { + onClose(); + } + }, [animate, onClose, onTransitionEnd]); + var style = getStyle({ + isAnimatingOpenOnMount: isAnimatingOpenOnMount, + animate: props.animate, + placeholder: props.placeholder + }); + return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(props.placeholder.tagName, { + style: style, + 'data-react-beautiful-dnd-placeholder': styleContext, + onTransitionEnd: onSizeChangeEnd, + ref: props.innerRef + }); +} + +var Placeholder$1 = react__WEBPACK_IMPORTED_MODULE_1___default.a.memo(Placeholder); +var DroppableContext = react__WEBPACK_IMPORTED_MODULE_1___default.a.createContext(null); + +var getWindowFromEl = function (el) { + return el && el.ownerDocument ? el.ownerDocument.defaultView : window; +}; + +function isHtmlElement(el) { + return el instanceof getWindowFromEl(el).HTMLElement; +} + +function checkIsValidInnerRef(el) { + !(el && isHtmlElement(el)) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "\n provided.innerRef has not been provided with a HTMLElement.\n\n You can find a guide on using the innerRef callback functions at:\n https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/using-inner-ref.md\n ") : undefined : void 0; +} + +function checkOwnProps(props) { + !props.droppableId ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'A Droppable requires a droppableId prop') : undefined : void 0; + !(typeof props.isDropDisabled === 'boolean') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'isDropDisabled must be a boolean') : undefined : void 0; + !(typeof props.isCombineEnabled === 'boolean') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'isCombineEnabled must be a boolean') : undefined : void 0; + !(typeof props.ignoreContainerClipping === 'boolean') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'ignoreContainerClipping must be a boolean') : undefined : void 0; +} + +function checkPlaceholderRef(props, placeholderEl) { + if (!props.placeholder) { + return; + } + + if (placeholderEl) { + return; + } + + true ? warning("\n Droppable setup issue [droppableId: \"" + props.droppableId + "\"]:\n DroppableProvided > placeholder could not be found.\n\n Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/api/droppable.md\n ") : undefined; +} + +function useValidation(_ref) { + var props = _ref.props, + getDroppableRef = _ref.getDroppableRef, + getPlaceholderRef = _ref.getPlaceholderRef; + Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () { + if (true) { + checkOwnProps(props); + checkIsValidInnerRef(getDroppableRef()); + checkPlaceholderRef(props, getPlaceholderRef()); + } + }); +} + +var AnimateInOut = function (_React$PureComponent) { + Object(_babel_runtime_corejs2_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__["default"])(AnimateInOut, _React$PureComponent); + + function AnimateInOut() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this; + _this.state = { + isVisible: Boolean(_this.props.on), + data: _this.props.on, + animate: _this.props.shouldAnimate && _this.props.on ? 'open' : 'none' + }; + + _this.onClose = function () { + if (_this.state.animate !== 'close') { + return; + } + + _this.setState({ + isVisible: false + }); + }; + + return _this; + } + + AnimateInOut.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) { + if (!props.shouldAnimate) { + return { + isVisible: Boolean(props.on), + data: props.on, + animate: 'none' + }; + } + + if (props.on) { + return { + isVisible: true, + data: props.on, + animate: 'open' + }; + } + + if (state.isVisible) { + return { + isVisible: true, + data: state.data, + animate: 'close' + }; + } + + return { + isVisible: false, + animate: 'close', + data: null + }; + }; + + var _proto = AnimateInOut.prototype; + + _proto.render = function render() { + if (!this.state.isVisible) { + return null; + } + + var provided = { + onClose: this.onClose, + data: this.state.data, + animate: this.state.animate + }; + return this.props.children(provided); + }; + + return AnimateInOut; +}(react__WEBPACK_IMPORTED_MODULE_1___default.a.PureComponent); + +function Droppable(props) { + var appContext = Object(react__WEBPACK_IMPORTED_MODULE_1__["useContext"])(AppContext); + !appContext ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Could not find app context') : undefined : void 0; + var styleContext = appContext.style, + isMovementAllowed = appContext.isMovementAllowed; + var droppableRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + var placeholderRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + var children = props.children, + droppableId = props.droppableId, + type = props.type, + direction = props.direction, + ignoreContainerClipping = props.ignoreContainerClipping, + isDropDisabled = props.isDropDisabled, + isCombineEnabled = props.isCombineEnabled, + snapshot = props.snapshot, + updateViewportMaxScroll = props.updateViewportMaxScroll; + var getDroppableRef = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return droppableRef.current; + }, []); + var getPlaceholderRef = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return placeholderRef.current; + }, []); + var setDroppableRef = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (value) { + droppableRef.current = value; + }, []); + var setPlaceholderRef = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (value) { + placeholderRef.current = value; + }, []); + var onPlaceholderTransitionEnd = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + if (isMovementAllowed()) { + updateViewportMaxScroll({ + maxScroll: getMaxWindowScroll() + }); + } + }, [isMovementAllowed, updateViewportMaxScroll]); + useDroppableDimensionPublisher({ + droppableId: droppableId, + type: type, + direction: direction, + isDropDisabled: isDropDisabled, + isCombineEnabled: isCombineEnabled, + ignoreContainerClipping: ignoreContainerClipping, + getDroppableRef: getDroppableRef, + getPlaceholderRef: getPlaceholderRef + }); + var placeholder = react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(AnimateInOut, { + on: props.placeholder, + shouldAnimate: props.shouldAnimatePlaceholder + }, function (_ref) { + var onClose = _ref.onClose, + data = _ref.data, + animate = _ref.animate; + return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(Placeholder$1, { + placeholder: data, + onClose: onClose, + innerRef: setPlaceholderRef, + animate: animate, + styleContext: styleContext, + onTransitionEnd: onPlaceholderTransitionEnd + }); + }); + var provided = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + innerRef: setDroppableRef, + placeholder: placeholder, + droppableProps: { + 'data-react-beautiful-dnd-droppable': styleContext + } + }; + }, [placeholder, setDroppableRef, styleContext]); + var droppableContext = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + droppableId: droppableId, + type: type + }; + }, [droppableId, type]); + useValidation({ + props: props, + getDroppableRef: function getDroppableRef() { + return droppableRef.current; + }, + getPlaceholderRef: function getPlaceholderRef() { + return placeholderRef.current; + } + }); + return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(DroppableContext.Provider, { + value: droppableContext + }, children(provided, snapshot)); +} + +var isStrictEqual = function (a, b) { + return a === b; +}; + +var whatIsDraggedOverFromResult = function (result) { + var combine = result.combine, + destination = result.destination; + + if (destination) { + return destination.droppableId; + } + + if (combine) { + return combine.droppableId; + } + + return null; +}; + +var isMatchingType = function isMatchingType(type, critical) { + return type === critical.droppable.type; +}; + +var getDraggable = function getDraggable(critical, dimensions) { + return dimensions.draggables[critical.draggable.id]; +}; + +var makeMapStateToProps = function makeMapStateToProps() { + var idle = { + placeholder: null, + shouldAnimatePlaceholder: true, + snapshot: { + isDraggingOver: false, + draggingOverWith: null, + draggingFromThisWith: null + } + }; + + var idleWithoutAnimation = Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, idle, { + shouldAnimatePlaceholder: false + }); + + var getMapProps = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (id, isDraggingOver, dragging, snapshot) { + var isHome = dragging.descriptor.droppableId === id; + + if (isHome) { + return { + placeholder: dragging.placeholder, + shouldAnimatePlaceholder: false, + snapshot: snapshot + }; + } + + if (!isDraggingOver) { + return idle; + } + + return { + placeholder: dragging.placeholder, + shouldAnimatePlaceholder: true, + snapshot: snapshot + }; + }); + var getSnapshot = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (id, isDraggingOver, dragging) { + var draggableId = dragging.descriptor.id; + var isHome = dragging.descriptor.droppableId === id; + var draggingOverWith = isDraggingOver ? draggableId : null; + var draggingFromThisWith = isHome ? draggableId : null; + return { + isDraggingOver: isDraggingOver, + draggingOverWith: draggingOverWith, + draggingFromThisWith: draggingFromThisWith + }; + }); + + var selector = function selector(state, ownProps) { + var id = ownProps.droppableId; + var type = ownProps.type; + + if (state.isDragging) { + var critical = state.critical; + + if (!isMatchingType(type, critical)) { + return idle; + } + + var dragging = getDraggable(critical, state.dimensions); + var isDraggingOver = whatIsDraggedOver(state.impact) === id; + var snapshot = getSnapshot(id, isDraggingOver, dragging); + return getMapProps(id, isDraggingOver, dragging, snapshot); + } + + if (state.phase === 'DROP_ANIMATING') { + var completed = state.completed; + + if (!isMatchingType(type, completed.critical)) { + return idle; + } + + var _dragging = getDraggable(completed.critical, state.dimensions); + + var _snapshot = getSnapshot(id, whatIsDraggedOverFromResult(completed.result) === id, _dragging); + + return getMapProps(id, whatIsDraggedOver(completed.impact) === id, _dragging, _snapshot); + } + + if (state.phase === 'IDLE' && !state.completed && state.shouldFlush) { + return idleWithoutAnimation; + } + + if (state.phase === 'IDLE' && state.completed) { + var _completed = state.completed; + + if (!isMatchingType(type, _completed.critical)) { + return idle; + } + + var wasOver = whatIsDraggedOver(_completed.impact) === id; + var wasCombining = Boolean(_completed.impact.merge); + + if (state.shouldFlush) { + return idleWithoutAnimation; + } + + if (wasOver) { + return wasCombining ? idle : idleWithoutAnimation; + } + + return idle; + } + + return idle; + }; + + return selector; +}; + +var mapDispatchToProps = { + updateViewportMaxScroll: updateViewportMaxScroll +}; +var defaultProps = { + type: 'DEFAULT', + direction: 'vertical', + isDropDisabled: false, + isCombineEnabled: false, + ignoreContainerClipping: false +}; +var ConnectedDroppable = Object(react_redux__WEBPACK_IMPORTED_MODULE_6__["connect"])(makeMapStateToProps, mapDispatchToProps, null, { + context: StoreContext, + pure: true, + areStatePropsEqual: isStrictEqual +})(Droppable); +ConnectedDroppable.defaultProps = defaultProps; +var zIndexOptions = { + dragging: 5000, + dropAnimating: 4500 +}; + +var getDraggingTransition = function getDraggingTransition(shouldAnimateDragMovement, dropping) { + if (dropping) { + return transitions.drop(dropping.duration); + } + + if (shouldAnimateDragMovement) { + return transitions.snap; + } + + return transitions.fluid; +}; + +var getDraggingOpacity = function getDraggingOpacity(isCombining, isDropAnimating) { + if (!isCombining) { + return null; + } + + return isDropAnimating ? combine.opacity.drop : combine.opacity.combining; +}; + +var getShouldDraggingAnimate = function getShouldDraggingAnimate(dragging) { + if (dragging.forceShouldAnimate != null) { + return dragging.forceShouldAnimate; + } + + return dragging.mode === 'SNAP'; +}; + +function getDraggingStyle(dragging) { + var dimension = dragging.dimension; + var box = dimension.client; + var offset = dragging.offset, + combineWith = dragging.combineWith, + dropping = dragging.dropping; + var isCombining = Boolean(combineWith); + var shouldAnimate = getShouldDraggingAnimate(dragging); + var isDropAnimating = Boolean(dropping); + var transform = isDropAnimating ? transforms.drop(offset, isCombining) : transforms.moveTo(offset); + var style = { + position: 'fixed', + top: box.marginBox.top, + left: box.marginBox.left, + boxSizing: 'border-box', + width: box.borderBox.width, + height: box.borderBox.height, + transition: getDraggingTransition(shouldAnimate, dropping), + transform: transform, + opacity: getDraggingOpacity(isCombining, isDropAnimating), + zIndex: isDropAnimating ? zIndexOptions.dropAnimating : zIndexOptions.dragging, + pointerEvents: 'none' + }; + return style; +} + +function getSecondaryStyle(secondary) { + return { + transform: transforms.moveTo(secondary.offset), + transition: secondary.shouldAnimateDisplacement ? null : 'none' + }; +} + +function getStyle$1(mapped) { + return mapped.type === 'DRAGGING' ? getDraggingStyle(mapped) : getSecondaryStyle(mapped); +} + +var createEventMarshal = function () { + var isMouseDownHandled = false; + + var handle = function handle() { + !!isMouseDownHandled ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot handle mouse down as it is already handled') : undefined : void 0; + isMouseDownHandled = true; + }; + + var isHandled = function isHandled() { + return isMouseDownHandled; + }; + + var reset = function reset() { + isMouseDownHandled = false; + }; + + return { + handle: handle, + isHandled: isHandled, + reset: reset + }; +}; + +var getOptions = function getOptions(shared, fromBinding) { + return Object(_babel_runtime_corejs2_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, shared, fromBinding); +}; + +var bindEvents = function bindEvents(el, bindings, sharedOptions) { + bindings.forEach(function (binding) { + var options = getOptions(sharedOptions, binding.options); + el.addEventListener(binding.eventName, binding.fn, options); + }); +}; + +var unbindEvents = function unbindEvents(el, bindings, sharedOptions) { + bindings.forEach(function (binding) { + var options = getOptions(sharedOptions, binding.options); + el.removeEventListener(binding.eventName, binding.fn, options); + }); +}; + +var createScheduler = function (callbacks) { + var memoizedMove = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (x, y) { + var point = { + x: x, + y: y + }; + callbacks.onMove(point); + }); + var move = Object(raf_schd__WEBPACK_IMPORTED_MODULE_12__["default"])(function (point) { + return memoizedMove(point.x, point.y); + }); + var moveUp = Object(raf_schd__WEBPACK_IMPORTED_MODULE_12__["default"])(callbacks.onMoveUp); + var moveDown = Object(raf_schd__WEBPACK_IMPORTED_MODULE_12__["default"])(callbacks.onMoveDown); + var moveRight = Object(raf_schd__WEBPACK_IMPORTED_MODULE_12__["default"])(callbacks.onMoveRight); + var moveLeft = Object(raf_schd__WEBPACK_IMPORTED_MODULE_12__["default"])(callbacks.onMoveLeft); + var windowScrollMove = Object(raf_schd__WEBPACK_IMPORTED_MODULE_12__["default"])(callbacks.onWindowScroll); + + var cancel = function cancel() { + move.cancel(); + moveUp.cancel(); + moveDown.cancel(); + moveRight.cancel(); + moveLeft.cancel(); + windowScrollMove.cancel(); + }; + + return { + move: move, + moveUp: moveUp, + moveDown: moveDown, + moveRight: moveRight, + moveLeft: moveLeft, + windowScrollMove: windowScrollMove, + cancel: cancel + }; +}; + +var tab = 9; +var enter = 13; +var escape = 27; +var space = 32; +var pageUp = 33; +var pageDown = 34; +var end = 35; +var home = 36; +var arrowLeft = 37; +var arrowUp = 38; +var arrowRight = 39; +var arrowDown = 40; + +var supportedEventName = function () { + var base = 'visibilitychange'; + + if (typeof document === 'undefined') { + return base; + } + + var candidates = [base, "ms" + base, "webkit" + base, "moz" + base, "o" + base]; + var supported = find(candidates, function (eventName) { + return "on" + eventName in document; + }); + return supported || base; +}(); + +var sharedOptions = { + capture: true +}; + +var createPostDragEventPreventer = function (getWindow) { + var isBound = false; + + var bind = function bind() { + if (isBound) { + return; + } + + isBound = true; + bindEvents(getWindow(), pointerEvents, sharedOptions); + }; + + var unbind = function unbind() { + if (!isBound) { + return; + } + + isBound = false; + unbindEvents(getWindow(), pointerEvents, sharedOptions); + }; + + var pointerEvents = [{ + eventName: 'click', + fn: function fn(event) { + event.preventDefault(); + unbind(); + } + }, { + eventName: 'mousedown', + fn: unbind + }, { + eventName: 'touchstart', + fn: unbind + }]; + + var preventNext = function preventNext() { + if (isBound) { + unbind(); + } + + bind(); + }; + + var preventer = { + preventNext: preventNext, + abort: unbind + }; + return preventer; +}; + +var sloppyClickThreshold = 5; + +var isSloppyClickThresholdExceeded = function (original, current) { + return Math.abs(current.x - original.x) >= sloppyClickThreshold || Math.abs(current.y - original.y) >= sloppyClickThreshold; +}; + +var _preventedKeys; + +var preventedKeys = (_preventedKeys = {}, _preventedKeys[enter] = true, _preventedKeys[tab] = true, _preventedKeys); + +var preventStandardKeyEvents = function (event) { + if (preventedKeys[event.keyCode]) { + event.preventDefault(); + } +}; + +var primaryButton = 0; + +var noop$1 = function noop() {}; + +var mouseDownMarshal = createEventMarshal(); + +function useMouseSensor(args) { + var canStartCapturing = args.canStartCapturing, + getWindow = args.getWindow, + callbacks = args.callbacks, + onCaptureStart = args.onCaptureStart, + onCaptureEnd = args.onCaptureEnd; + var pendingRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + var isDraggingRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(false); + var unbindWindowEventsRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(noop$1); + var getIsCapturing = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return Boolean(pendingRef.current || isDraggingRef.current); + }, []); + var schedule = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + !!getIsCapturing() ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Should not recreate scheduler while capturing') : undefined : void 0; + return createScheduler(callbacks); + }, [callbacks, getIsCapturing]); + var postDragEventPreventer = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return createPostDragEventPreventer(getWindow); + }, [getWindow]); + var stop = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + if (!getIsCapturing()) { + return; + } + + schedule.cancel(); + unbindWindowEventsRef.current(); + var shouldBlockClick = isDraggingRef.current; + mouseDownMarshal.reset(); + + if (shouldBlockClick) { + postDragEventPreventer.preventNext(); + } + + pendingRef.current = null; + isDraggingRef.current = false; + onCaptureEnd(); + }, [getIsCapturing, onCaptureEnd, postDragEventPreventer, schedule]); + var cancel = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var wasDragging = isDraggingRef.current; + stop(); + + if (wasDragging) { + callbacks.onCancel(); + } + }, [callbacks, stop]); + var startDragging = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + !!isDraggingRef.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot start a drag while dragging') : undefined : void 0; + var pending = pendingRef.current; + !pending ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot start a drag without a pending drag') : undefined : void 0; + pendingRef.current = null; + isDraggingRef.current = true; + callbacks.onLift({ + clientSelection: pending, + movementMode: 'FLUID' + }); + }, [callbacks]); + var windowBindings = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + !!getIsCapturing() ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Should not recreate window bindings while capturing') : undefined : void 0; + var bindings = [{ + eventName: 'mousemove', + fn: function fn(event) { + var button = event.button, + clientX = event.clientX, + clientY = event.clientY; + + if (button !== primaryButton) { + return; + } + + var point = { + x: clientX, + y: clientY + }; + + if (isDraggingRef.current) { + event.preventDefault(); + schedule.move(point); + return; + } + + var pending = pendingRef.current; + + if (!pending) { + stop(); + true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Expected there to be an active or pending drag when window mousemove event is received') : undefined; + } + + if (!isSloppyClickThresholdExceeded(pending, point)) { + return; + } + + event.preventDefault(); + startDragging(); + } + }, { + eventName: 'mouseup', + fn: function fn(event) { + var wasDragging = isDraggingRef.current; + stop(); + + if (wasDragging) { + event.preventDefault(); + callbacks.onDrop(); + } + } + }, { + eventName: 'mousedown', + fn: function fn(event) { + if (isDraggingRef.current) { + event.preventDefault(); + } + + cancel(); + } + }, { + eventName: 'keydown', + fn: function fn(event) { + if (pendingRef.current) { + stop(); + return; + } + + if (event.keyCode === escape) { + event.preventDefault(); + cancel(); + return; + } + + preventStandardKeyEvents(event); + } + }, { + eventName: 'resize', + fn: cancel + }, { + eventName: 'scroll', + options: { + passive: true, + capture: false + }, + fn: function fn(event) { + if (event.currentTarget !== getWindow()) { + return; + } + + if (pendingRef.current) { + stop(); + return; + } + + schedule.windowScrollMove(); + } + }, { + eventName: 'webkitmouseforcedown', + fn: function fn() { + cancel(); + } + }, { + eventName: supportedEventName, + fn: cancel + }]; + return bindings; + }, [getIsCapturing, cancel, startDragging, schedule, stop, callbacks, getWindow]); + var bindWindowEvents = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var win = getWindow(); + var options = { + capture: true + }; + + unbindWindowEventsRef.current = function () { + return unbindEvents(win, windowBindings, options); + }; + + bindEvents(win, windowBindings, options); + }, [getWindow, windowBindings]); + var startPendingDrag = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (point) { + !!pendingRef.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Expected there to be no pending drag') : undefined : void 0; + pendingRef.current = point; + onCaptureStart(stop); + bindWindowEvents(); + }, [bindWindowEvents, onCaptureStart, stop]); + var onMouseDown = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (event) { + if (mouseDownMarshal.isHandled()) { + return; + } + + !!getIsCapturing() ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Should not be able to perform a mouse down while a drag or pending drag is occurring') : undefined : void 0; + + if (!canStartCapturing(event)) { + return; + } + + if (event.button !== primaryButton) { + return; + } + + if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) { + return; + } + + mouseDownMarshal.handle(); + event.preventDefault(); + var point = { + x: event.clientX, + y: event.clientY + }; + startPendingDrag(point); + }, [canStartCapturing, getIsCapturing, startPendingDrag]); + return onMouseDown; +} + +function isElement(el) { + return el instanceof getWindowFromEl(el).Element; +} + +var interactiveTagNames = { + input: true, + button: true, + textarea: true, + select: true, + option: true, + optgroup: true, + video: true, + audio: true +}; + +var isAnInteractiveElement = function isAnInteractiveElement(parent, current) { + if (current == null) { + return false; + } + + var hasAnInteractiveTag = Boolean(interactiveTagNames[current.tagName.toLowerCase()]); + + if (hasAnInteractiveTag) { + return true; + } + + var attribute = current.getAttribute('contenteditable'); + + if (attribute === 'true' || attribute === '') { + return true; + } + + if (current === parent) { + return false; + } + + return isAnInteractiveElement(parent, current.parentElement); +}; + +var shouldAllowDraggingFromTarget = function (event, canDragInteractiveElements) { + if (canDragInteractiveElements) { + return true; + } + + var target = event.target, + currentTarget = event.currentTarget; + + if (!isElement(target) || !isElement(currentTarget)) { + return true; + } + + return !isAnInteractiveElement(currentTarget, target); +}; + +var getBorderBoxCenterPosition = function (el) { + return Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["getRect"])(el.getBoundingClientRect()).center; +}; + +var _scrollJumpKeys; + +var scrollJumpKeys = (_scrollJumpKeys = {}, _scrollJumpKeys[pageDown] = true, _scrollJumpKeys[pageUp] = true, _scrollJumpKeys[home] = true, _scrollJumpKeys[end] = true, _scrollJumpKeys); + +function noop$2() {} + +function useKeyboardSensor(args) { + var canStartCapturing = args.canStartCapturing, + getWindow = args.getWindow, + callbacks = args.callbacks, + onCaptureStart = args.onCaptureStart, + onCaptureEnd = args.onCaptureEnd, + getDraggableRef = args.getDraggableRef; + var isDraggingRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(false); + var unbindWindowEventsRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(noop$2); + var getIsDragging = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return isDraggingRef.current; + }, []); + var schedule = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + !!getIsDragging() ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Should not recreate scheduler while capturing') : undefined : void 0; + return createScheduler(callbacks); + }, [callbacks, getIsDragging]); + var stop = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + if (!getIsDragging()) { + return; + } + + schedule.cancel(); + unbindWindowEventsRef.current(); + isDraggingRef.current = false; + onCaptureEnd(); + }, [getIsDragging, onCaptureEnd, schedule]); + var cancel = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var wasDragging = isDraggingRef.current; + stop(); + + if (wasDragging) { + callbacks.onCancel(); + } + }, [callbacks, stop]); + var windowBindings = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + !!getIsDragging() ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Should not recreate window bindings when dragging') : undefined : void 0; + return [{ + eventName: 'mousedown', + fn: cancel + }, { + eventName: 'mouseup', + fn: cancel + }, { + eventName: 'click', + fn: cancel + }, { + eventName: 'touchstart', + fn: cancel + }, { + eventName: 'resize', + fn: cancel + }, { + eventName: 'wheel', + fn: cancel, + options: { + passive: true + } + }, { + eventName: 'scroll', + options: { + capture: false + }, + fn: function fn(event) { + if (event.currentTarget !== getWindow()) { + return; + } + + callbacks.onWindowScroll(); + } + }, { + eventName: supportedEventName, + fn: cancel + }]; + }, [callbacks, cancel, getIsDragging, getWindow]); + var bindWindowEvents = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var win = getWindow(); + var options = { + capture: true + }; + + unbindWindowEventsRef.current = function () { + return unbindEvents(win, windowBindings, options); + }; + + bindEvents(win, windowBindings, options); + }, [getWindow, windowBindings]); + var startDragging = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + !!isDraggingRef.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot start a drag while dragging') : undefined : void 0; + var ref = getDraggableRef(); + !ref ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot start a keyboard drag without a draggable ref') : undefined : void 0; + isDraggingRef.current = true; + onCaptureStart(stop); + bindWindowEvents(); + var center = getBorderBoxCenterPosition(ref); + callbacks.onLift({ + clientSelection: center, + movementMode: 'SNAP' + }); + }, [bindWindowEvents, callbacks, getDraggableRef, onCaptureStart, stop]); + var onKeyDown = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (event) { + if (!getIsDragging()) { + if (event.defaultPrevented) { + return; + } + + if (!canStartCapturing(event)) { + return; + } + + if (event.keyCode !== space) { + return; + } + + event.preventDefault(); + startDragging(); + return; + } + + if (event.keyCode === escape) { + event.preventDefault(); + cancel(); + return; + } + + if (event.keyCode === space) { + event.preventDefault(); + stop(); + callbacks.onDrop(); + return; + } + + if (event.keyCode === arrowDown) { + event.preventDefault(); + schedule.moveDown(); + return; + } + + if (event.keyCode === arrowUp) { + event.preventDefault(); + schedule.moveUp(); + return; + } + + if (event.keyCode === arrowRight) { + event.preventDefault(); + schedule.moveRight(); + return; + } + + if (event.keyCode === arrowLeft) { + event.preventDefault(); + schedule.moveLeft(); + return; + } + + if (scrollJumpKeys[event.keyCode]) { + event.preventDefault(); + return; + } + + preventStandardKeyEvents(event); + }, [callbacks, canStartCapturing, cancel, getIsDragging, schedule, startDragging, stop]); + return onKeyDown; +} + +var timeForLongPress = 120; +var forcePressThreshold = 0.15; +var touchStartMarshal = createEventMarshal(); + +var noop$3 = function noop() {}; + +function useTouchSensor(args) { + var callbacks = args.callbacks, + getWindow = args.getWindow, + canStartCapturing = args.canStartCapturing, + getShouldRespectForcePress = args.getShouldRespectForcePress, + onCaptureStart = args.onCaptureStart, + onCaptureEnd = args.onCaptureEnd; + var pendingRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + var isDraggingRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(false); + var hasMovedRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(false); + var unbindWindowEventsRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(noop$3); + var getIsCapturing = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return Boolean(pendingRef.current || isDraggingRef.current); + }, []); + var postDragClickPreventer = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return createPostDragEventPreventer(getWindow); + }, [getWindow]); + var schedule = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + !!getIsCapturing() ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Should not recreate scheduler while capturing') : undefined : void 0; + return createScheduler(callbacks); + }, [callbacks, getIsCapturing]); + var stop = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + if (!getIsCapturing()) { + return; + } + + schedule.cancel(); + unbindWindowEventsRef.current(); + touchStartMarshal.reset(); + hasMovedRef.current = false; + onCaptureEnd(); + + if (isDraggingRef.current) { + postDragClickPreventer.preventNext(); + isDraggingRef.current = false; + return; + } + + var pending = pendingRef.current; + !pending ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Expected a pending drag') : undefined : void 0; + clearTimeout(pending.longPressTimerId); + pendingRef.current = null; + }, [getIsCapturing, onCaptureEnd, postDragClickPreventer, schedule]); + var cancel = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var wasDragging = isDraggingRef.current; + stop(); + + if (wasDragging) { + callbacks.onCancel(); + } + }, [callbacks, stop]); + var windowBindings = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + !!getIsCapturing() ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Should not recreate window bindings while capturing') : undefined : void 0; + var bindings = [{ + eventName: 'touchmove', + options: { + passive: false, + capture: false + }, + fn: function fn(event) { + if (!isDraggingRef.current) { + stop(); + return; + } + + if (!hasMovedRef.current) { + hasMovedRef.current = true; + } + + var touch = event.touches[0]; + + if (!touch) { + return; + } + + var point = { + x: touch.clientX, + y: touch.clientY + }; + event.preventDefault(); + schedule.move(point); + } + }, { + eventName: 'touchend', + fn: function fn(event) { + if (!isDraggingRef.current) { + stop(); + return; + } + + event.preventDefault(); + stop(); + callbacks.onDrop(); + } + }, { + eventName: 'touchcancel', + fn: function fn(event) { + if (!isDraggingRef.current) { + stop(); + return; + } + + event.preventDefault(); + cancel(); + } + }, { + eventName: 'touchstart', + fn: cancel + }, { + eventName: 'orientationchange', + fn: cancel + }, { + eventName: 'resize', + fn: cancel + }, { + eventName: 'scroll', + options: { + passive: true, + capture: false + }, + fn: function fn() { + if (pendingRef.current) { + stop(); + return; + } + + schedule.windowScrollMove(); + } + }, { + eventName: 'contextmenu', + fn: function fn(event) { + event.preventDefault(); + } + }, { + eventName: 'keydown', + fn: function fn(event) { + if (!isDraggingRef.current) { + cancel(); + return; + } + + if (event.keyCode === escape) { + event.preventDefault(); + } + + cancel(); + } + }, { + eventName: 'touchforcechange', + fn: function fn(event) { + var touch = event.touches[0]; + var isForcePress = touch.force >= forcePressThreshold; + + if (!isForcePress) { + return; + } + + var shouldRespect = getShouldRespectForcePress(); + + if (pendingRef.current) { + if (shouldRespect) { + cancel(); + } + + return; + } + + if (shouldRespect) { + if (hasMovedRef.current) { + event.preventDefault(); + return; + } + + cancel(); + return; + } + + event.preventDefault(); + } + }, { + eventName: supportedEventName, + fn: cancel + }]; + return bindings; + }, [callbacks, cancel, getIsCapturing, getShouldRespectForcePress, schedule, stop]); + var bindWindowEvents = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var win = getWindow(); + var options = { + capture: true + }; + + unbindWindowEventsRef.current = function () { + return unbindEvents(win, windowBindings, options); + }; + + bindEvents(win, windowBindings, options); + }, [getWindow, windowBindings]); + var startDragging = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + var pending = pendingRef.current; + !pending ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot start a drag without a pending drag') : undefined : void 0; + isDraggingRef.current = true; + pendingRef.current = null; + hasMovedRef.current = false; + callbacks.onLift({ + clientSelection: pending.point, + movementMode: 'FLUID' + }); + }, [callbacks]); + var startPendingDrag = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (event) { + !!pendingRef.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Expected there to be no pending drag') : undefined : void 0; + var touch = event.touches[0]; + var clientX = touch.clientX, + clientY = touch.clientY; + var point = { + x: clientX, + y: clientY + }; + var longPressTimerId = setTimeout(startDragging, timeForLongPress); + var pending = { + point: point, + longPressTimerId: longPressTimerId + }; + pendingRef.current = pending; + onCaptureStart(stop); + bindWindowEvents(); + }, [bindWindowEvents, onCaptureStart, startDragging, stop]); + + var onTouchStart = function onTouchStart(event) { + if (touchStartMarshal.isHandled()) { + return; + } + + !!getIsCapturing() ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Should not be able to perform a touch start while a drag or pending drag is occurring') : undefined : void 0; + + if (!canStartCapturing(event)) { + return; + } + + touchStartMarshal.handle(); + startPendingDrag(event); + }; + + useIsomorphicLayoutEffect(function webkitHack() { + var unbind = bindEvents(window, [{ + eventName: 'touchmove', + fn: noop$3, + options: { + capture: false, + passive: false + } + }]); + return unbind; + }, []); + return onTouchStart; +} + +function isSvgElement(el) { + return Boolean(getWindowFromEl(el).SVGElement) && el instanceof getWindowFromEl(el).SVGElement; +} + +var selector = "[" + dragHandle + "]"; + +var throwIfSVG = function throwIfSVG(el) { + !!isSvgElement(el) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "A drag handle cannot be an SVGElement: it has inconsistent focus support.\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/dragging-svgs.md") : undefined : void 0; +}; + +var getDragHandleRef = function getDragHandleRef(draggableRef) { + if (draggableRef.hasAttribute(dragHandle)) { + throwIfSVG(draggableRef); + return draggableRef; + } + + var el = draggableRef.querySelector(selector); + throwIfSVG(draggableRef); + !el ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, "\n Cannot find drag handle element inside of Draggable.\n Please be sure to apply the {...provided.dragHandleProps} to your Draggable\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/api/draggable.md\n ") : undefined : void 0; + !isHtmlElement(el) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'A drag handle must be a HTMLElement') : undefined : void 0; + return el; +}; + +function useValidation$1(_ref) { + var isEnabled = _ref.isEnabled, + getDraggableRef = _ref.getDraggableRef; + Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () { + if (true) { + if (!isEnabled) { + return; + } + + var draggableRef = getDraggableRef(); + !draggableRef ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Drag handle was unable to find draggable ref') : undefined : void 0; + getDragHandleRef(draggableRef); + } + }, [getDraggableRef, isEnabled]); +} + +var retainingFocusFor = null; +var listenerOptions = { + capture: true +}; + +var clearRetentionOnFocusChange = function () { + var isBound = false; + + var bind = function bind() { + if (isBound) { + return; + } + + isBound = true; + window.addEventListener('focus', onWindowFocusChange, listenerOptions); + }; + + var unbind = function unbind() { + if (!isBound) { + return; + } + + isBound = false; + window.removeEventListener('focus', onWindowFocusChange, listenerOptions); + }; + + var onWindowFocusChange = function onWindowFocusChange() { + unbind(); + retainingFocusFor = null; + }; + + var result = function result() { + return bind(); + }; + + result.cancel = function () { + return unbind(); + }; + + return result; +}(); + +var retain = function retain(id) { + retainingFocusFor = id; + clearRetentionOnFocusChange(); +}; + +var tryRestoreFocus = function tryRestoreFocus(id, draggableRef) { + if (!retainingFocusFor) { + return; + } + + if (id !== retainingFocusFor) { + return; + } + + retainingFocusFor = null; + clearRetentionOnFocusChange.cancel(); + var dragHandleRef = getDragHandleRef(draggableRef); + + if (!dragHandleRef) { + true ? warning('Could not find drag handle in the DOM to focus on it') : undefined; + return; + } + + dragHandleRef.focus(); +}; + +var retainer = { + retain: retain, + tryRestoreFocus: tryRestoreFocus +}; + +function noop$4() {} + +function useFocusRetainer(args) { + var isFocusedRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(false); + var lastArgsRef = usePrevious(args); + var getDraggableRef = args.getDraggableRef; + var onFocus = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + isFocusedRef.current = true; + }, []); + var onBlur = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + isFocusedRef.current = false; + }, []); + useIsomorphicLayoutEffect(function () { + var first = lastArgsRef.current; + + if (!first.isEnabled) { + return noop$4; + } + + var draggable = getDraggableRef(); + !draggable ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Drag handle could not obtain draggable ref') : undefined : void 0; + var dragHandle = getDragHandleRef(draggable); + retainer.tryRestoreFocus(first.draggableId, dragHandle); + return function () { + var last = lastArgsRef.current; + + var shouldRetainFocus = function () { + if (!last.isEnabled) { + return false; + } + + if (!isFocusedRef.current) { + return false; + } + + return last.isDragging || last.isDropAnimating; + }(); + + if (shouldRetainFocus) { + retainer.retain(last.draggableId); + } + }; + }, [getDraggableRef, lastArgsRef]); + var lastDraggableRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + useIsomorphicLayoutEffect(function () { + if (!lastDraggableRef.current) { + return; + } + + var draggableRef = getDraggableRef(); + + if (!draggableRef) { + return; + } + + if (draggableRef === lastDraggableRef.current) { + return; + } + + if (isFocusedRef.current && lastArgsRef.current.isEnabled) { + getDragHandleRef(draggableRef).focus(); + } + }); + useIsomorphicLayoutEffect(function () { + lastDraggableRef.current = getDraggableRef(); + }); + return { + onBlur: onBlur, + onFocus: onFocus + }; +} + +function preventHtml5Dnd(event) { + event.preventDefault(); +} + +function useDragHandle(args) { + var capturingRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + var onCaptureStart = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (abort) { + !!capturingRef.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot start capturing while something else is') : undefined : void 0; + capturingRef.current = { + abort: abort + }; + }, []); + var onCaptureEnd = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + !capturingRef.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot stop capturing while nothing is capturing') : undefined : void 0; + capturingRef.current = null; + }, []); + var abortCapture = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + !capturingRef.current ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot abort capture when there is none') : undefined : void 0; + capturingRef.current.abort(); + }, []); + + var _useRequiredContext = useRequiredContext(AppContext), + canLift = _useRequiredContext.canLift, + styleContext = _useRequiredContext.style; + + var isDragging = args.isDragging, + isEnabled = args.isEnabled, + draggableId = args.draggableId, + callbacks = args.callbacks, + getDraggableRef = args.getDraggableRef, + getShouldRespectForcePress = args.getShouldRespectForcePress, + canDragInteractiveElements = args.canDragInteractiveElements; + var lastArgsRef = usePrevious(args); + useValidation$1({ + isEnabled: isEnabled, + getDraggableRef: getDraggableRef + }); + var getWindow = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return getWindowFromEl(getDraggableRef()); + }, [getDraggableRef]); + var canStartCapturing = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (event) { + if (!isEnabled) { + return false; + } + + if (capturingRef.current) { + return false; + } + + if (!canLift(draggableId)) { + return false; + } + + return shouldAllowDraggingFromTarget(event, canDragInteractiveElements); + }, [canDragInteractiveElements, canLift, draggableId, isEnabled]); + + var _useFocusRetainer = useFocusRetainer(args), + onBlur = _useFocusRetainer.onBlur, + onFocus = _useFocusRetainer.onFocus; + + var mouseArgs = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + callbacks: callbacks, + getDraggableRef: getDraggableRef, + getWindow: getWindow, + canStartCapturing: canStartCapturing, + onCaptureStart: onCaptureStart, + onCaptureEnd: onCaptureEnd, + getShouldRespectForcePress: getShouldRespectForcePress + }; + }, [callbacks, getDraggableRef, getWindow, canStartCapturing, onCaptureStart, onCaptureEnd, getShouldRespectForcePress]); + var onMouseDown = useMouseSensor(mouseArgs); + var keyboardArgs = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + callbacks: callbacks, + getDraggableRef: getDraggableRef, + getWindow: getWindow, + canStartCapturing: canStartCapturing, + onCaptureStart: onCaptureStart, + onCaptureEnd: onCaptureEnd + }; + }, [callbacks, canStartCapturing, getDraggableRef, getWindow, onCaptureEnd, onCaptureStart]); + var onKeyDown = useKeyboardSensor(keyboardArgs); + var touchArgs = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + callbacks: callbacks, + getDraggableRef: getDraggableRef, + getWindow: getWindow, + canStartCapturing: canStartCapturing, + getShouldRespectForcePress: getShouldRespectForcePress, + onCaptureStart: onCaptureStart, + onCaptureEnd: onCaptureEnd + }; + }, [callbacks, getDraggableRef, getWindow, canStartCapturing, getShouldRespectForcePress, onCaptureStart, onCaptureEnd]); + var onTouchStart = useTouchSensor(touchArgs); + useIsomorphicLayoutEffect(function () { + return function () { + if (!capturingRef.current) { + return; + } + + abortCapture(); + + if (lastArgsRef.current.isDragging) { + lastArgsRef.current.callbacks.onCancel(); + } + }; + }, []); + + if (!isEnabled && capturingRef.current) { + abortCapture(); + + if (lastArgsRef.current.isDragging) { + true ? warning('You have disabled dragging on a Draggable while it was dragging. The drag has been cancelled') : undefined; + callbacks.onCancel(); + } + } + + useIsomorphicLayoutEffect(function () { + if (!isDragging && capturingRef.current) { + abortCapture(); + } + }, [abortCapture, isDragging]); + var props = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + if (!isEnabled) { + return null; + } + + return { + onMouseDown: onMouseDown, + onKeyDown: onKeyDown, + onTouchStart: onTouchStart, + onFocus: onFocus, + onBlur: onBlur, + tabIndex: 0, + 'data-react-beautiful-dnd-drag-handle': styleContext, + 'aria-roledescription': 'Draggable item. Press space bar to lift', + draggable: false, + onDragStart: preventHtml5Dnd + }; + }, [isEnabled, onBlur, onFocus, onKeyDown, onMouseDown, onTouchStart, styleContext]); + return props; +} + +function getDimension$1(descriptor, el, windowScroll) { + if (windowScroll === void 0) { + windowScroll = origin; + } + + var computedStyles = window.getComputedStyle(el); + var borderBox = el.getBoundingClientRect(); + var client = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["calculateBox"])(borderBox, computedStyles); + var page = Object(css_box_model__WEBPACK_IMPORTED_MODULE_7__["withScroll"])(client, windowScroll); + var placeholder = { + client: client, + tagName: el.tagName.toLowerCase(), + display: computedStyles.display + }; + var displaceBy = { + x: client.marginBox.width, + y: client.marginBox.height + }; + var dimension = { + descriptor: descriptor, + placeholder: placeholder, + displaceBy: displaceBy, + client: client, + page: page + }; + return dimension; +} + +function useDraggableDimensionPublisher(args) { + var draggableId = args.draggableId, + index = args.index, + getDraggableRef = args.getDraggableRef; + var appContext = useRequiredContext(AppContext); + var marshal = appContext.marshal; + var droppableContext = useRequiredContext(DroppableContext); + var droppableId = droppableContext.droppableId, + type = droppableContext.type; + var descriptor = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + var result = { + id: draggableId, + droppableId: droppableId, + type: type, + index: index + }; + return result; + }, [draggableId, droppableId, index, type]); + var publishedDescriptorRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(descriptor); + var makeDimension = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (windowScroll) { + var latest = publishedDescriptorRef.current; + var el = getDraggableRef(); + !el ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot get dimension when no ref is set') : undefined : void 0; + return getDimension$1(latest, el, windowScroll); + }, [getDraggableRef]); + useIsomorphicLayoutEffect(function () { + marshal.registerDraggable(publishedDescriptorRef.current, makeDimension); + return function () { + return marshal.unregisterDraggable(publishedDescriptorRef.current); + }; + }, [makeDimension, marshal]); + useIsomorphicLayoutEffect(function () { + if (publishedDescriptorRef.current === descriptor) { + return; + } + + var previous = publishedDescriptorRef.current; + publishedDescriptorRef.current = descriptor; + marshal.updateDraggable(previous, descriptor, makeDimension); + }, [descriptor, makeDimension, marshal]); +} + +function checkOwnProps$1(props) { + !_babel_runtime_corejs2_core_js_number_is_integer__WEBPACK_IMPORTED_MODULE_14___default()(props.index) ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Draggable requires an integer index prop') : undefined : void 0; + !props.draggableId ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Draggable requires a draggableId') : undefined : void 0; + !(typeof props.isDragDisabled === 'boolean') ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'isDragDisabled must be a boolean') : undefined : void 0; +} + +function checkForOutdatedProps(props) { + if (Object.prototype.hasOwnProperty.call(props, 'shouldRespectForceTouch')) { + true ? warning('shouldRespectForceTouch has been renamed to shouldRespectForcePress') : undefined; + } +} + +function useValidation$2(props, getRef) { + Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () { + if (true) { + checkOwnProps$1(props); + checkForOutdatedProps(props); + checkIsValidInnerRef(getRef()); + } + }); +} + +function Draggable(props) { + var ref = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null); + var setRef = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (el) { + ref.current = el; + }, []); + var getRef = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return ref.current; + }, []); + var appContext = useRequiredContext(AppContext); + useValidation$2(props, getRef); + var children = props.children, + draggableId = props.draggableId, + isDragDisabled = props.isDragDisabled, + shouldRespectForcePress = props.shouldRespectForcePress, + canDragInteractiveElements = props.disableInteractiveElementBlocking, + index = props.index, + mapped = props.mapped, + moveUpAction = props.moveUp, + moveAction = props.move, + dropAction = props.drop, + moveDownAction = props.moveDown, + moveRightAction = props.moveRight, + moveLeftAction = props.moveLeft, + moveByWindowScrollAction = props.moveByWindowScroll, + liftAction = props.lift, + dropAnimationFinishedAction = props.dropAnimationFinished; + var forPublisher = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + draggableId: draggableId, + index: index, + getDraggableRef: getRef + }; + }, [draggableId, getRef, index]); + useDraggableDimensionPublisher(forPublisher); + var onLift = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (options) { + start('LIFT'); + var el = ref.current; + !el ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false) : undefined : void 0; + !!isDragDisabled ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__["default"])(false, 'Cannot lift a Draggable when it is disabled') : undefined : void 0; + var clientSelection = options.clientSelection, + movementMode = options.movementMode; + liftAction({ + id: draggableId, + clientSelection: clientSelection, + movementMode: movementMode + }); + finish('LIFT'); + }, [draggableId, isDragDisabled, liftAction]); + var getShouldRespectForcePress = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () { + return shouldRespectForcePress; + }, [shouldRespectForcePress]); + var callbacks = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + onLift: onLift, + onMove: function onMove(clientSelection) { + return moveAction({ + client: clientSelection + }); + }, + onDrop: function onDrop() { + return dropAction({ + reason: 'DROP' + }); + }, + onCancel: function onCancel() { + return dropAction({ + reason: 'CANCEL' + }); + }, + onMoveUp: moveUpAction, + onMoveDown: moveDownAction, + onMoveRight: moveRightAction, + onMoveLeft: moveLeftAction, + onWindowScroll: function onWindowScroll() { + return moveByWindowScrollAction({ + newScroll: getWindowScroll() + }); + } + }; + }, [dropAction, moveAction, moveByWindowScrollAction, moveDownAction, moveLeftAction, moveRightAction, moveUpAction, onLift]); + var isDragging = mapped.type === 'DRAGGING'; + var isDropAnimating = mapped.type === 'DRAGGING' && Boolean(mapped.dropping); + var dragHandleArgs = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + return { + draggableId: draggableId, + isDragging: isDragging, + isDropAnimating: isDropAnimating, + isEnabled: !isDragDisabled, + callbacks: callbacks, + getDraggableRef: getRef, + canDragInteractiveElements: canDragInteractiveElements, + getShouldRespectForcePress: getShouldRespectForcePress + }; + }, [callbacks, canDragInteractiveElements, draggableId, getRef, getShouldRespectForcePress, isDragDisabled, isDragging, isDropAnimating]); + var dragHandleProps = useDragHandle(dragHandleArgs); + var onMoveEnd = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (event) { + if (mapped.type !== 'DRAGGING') { + return; + } + + if (!mapped.dropping) { + return; + } + + if (event.propertyName !== 'transform') { + return; + } + + dropAnimationFinishedAction(); + }, [dropAnimationFinishedAction, mapped]); + var provided = Object(use_memo_one__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () { + var style = getStyle$1(mapped); + var onTransitionEnd = mapped.type === 'DRAGGING' && mapped.dropping ? onMoveEnd : null; + var result = { + innerRef: setRef, + draggableProps: { + 'data-react-beautiful-dnd-draggable': appContext.style, + style: style, + onTransitionEnd: onTransitionEnd + }, + dragHandleProps: dragHandleProps + }; + return result; + }, [appContext.style, dragHandleProps, mapped, onMoveEnd, setRef]); + return children(provided, mapped.snapshot); +} + +var getCombineWithFromResult = function getCombineWithFromResult(result) { + return result.combine ? result.combine.draggableId : null; +}; + +var getCombineWithFromImpact = function getCombineWithFromImpact(impact) { + return impact.merge ? impact.merge.combine.draggableId : null; +}; + +var makeMapStateToProps$1 = function makeMapStateToProps() { + var getDraggingSnapshot = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (mode, draggingOver, combineWith, dropping) { + return { + isDragging: true, + isDropAnimating: Boolean(dropping), + dropAnimation: dropping, + mode: mode, + draggingOver: draggingOver, + combineWith: combineWith, + combineTargetFor: null + }; + }); + var getSecondarySnapshot = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (combineTargetFor) { + return { + isDragging: false, + isDropAnimating: false, + dropAnimation: null, + mode: null, + draggingOver: null, + combineTargetFor: combineTargetFor, + combineWith: null + }; + }); + var defaultMapProps = { + mapped: { + type: 'SECONDARY', + offset: origin, + combineTargetFor: null, + shouldAnimateDisplacement: true, + snapshot: getSecondarySnapshot(null) + } + }; + var memoizedOffset = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (x, y) { + return { + x: x, + y: y + }; + }); + var getDraggingProps = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (offset, mode, dimension, draggingOver, combineWith, forceShouldAnimate) { + return { + mapped: { + type: 'DRAGGING', + dropping: null, + draggingOver: draggingOver, + combineWith: combineWith, + mode: mode, + offset: offset, + dimension: dimension, + forceShouldAnimate: forceShouldAnimate, + snapshot: getDraggingSnapshot(mode, draggingOver, combineWith, null) + } + }; + }); + var getSecondaryProps = Object(memoize_one__WEBPACK_IMPORTED_MODULE_8__["default"])(function (offset, combineTargetFor, shouldAnimateDisplacement) { + if (combineTargetFor === void 0) { + combineTargetFor = null; + } + + return { + mapped: { + type: 'SECONDARY', + offset: offset, + combineTargetFor: combineTargetFor, + shouldAnimateDisplacement: shouldAnimateDisplacement, + snapshot: getSecondarySnapshot(combineTargetFor) + } + }; + }); + + var getSecondaryMovement = function getSecondaryMovement(ownId, draggingId, impact) { + var map = impact.movement.map; + var displacement = map[ownId]; + var movement = impact.movement; + var merge = impact.merge; + var isCombinedWith = Boolean(merge && merge.combine.draggableId === ownId); + var displacedBy = movement.displacedBy.point; + var offset = memoizedOffset(displacedBy.x, displacedBy.y); + + if (isCombinedWith) { + return getSecondaryProps(displacement ? offset : origin, draggingId, displacement ? displacement.shouldAnimate : true); + } + + if (!displacement) { + return null; + } + + if (!displacement.isVisible) { + return null; + } + + return getSecondaryProps(offset, null, displacement.shouldAnimate); + }; + + var draggingSelector = function draggingSelector(state, ownProps) { + if (state.isDragging) { + if (state.critical.draggable.id !== ownProps.draggableId) { + return null; + } + + var offset = state.current.client.offset; + var dimension = state.dimensions.draggables[ownProps.draggableId]; + var mode = state.movementMode; + var draggingOver = whatIsDraggedOver(state.impact); + var combineWith = getCombineWithFromImpact(state.impact); + var forceShouldAnimate = state.forceShouldAnimate; + return getDraggingProps(memoizedOffset(offset.x, offset.y), mode, dimension, draggingOver, combineWith, forceShouldAnimate); + } + + if (state.phase === 'DROP_ANIMATING') { + var completed = state.completed; + + if (completed.result.draggableId !== ownProps.draggableId) { + return null; + } + + var _dimension = state.dimensions.draggables[ownProps.draggableId]; + var result = completed.result; + var _mode = result.mode; + + var _draggingOver = whatIsDraggedOverFromResult(result); + + var _combineWith = getCombineWithFromResult(result); + + var duration = state.dropDuration; + var dropping = { + duration: duration, + curve: curves.drop, + moveTo: state.newHomeClientOffset, + opacity: _combineWith ? combine.opacity.drop : null, + scale: _combineWith ? combine.scale.drop : null + }; + return { + mapped: { + type: 'DRAGGING', + offset: state.newHomeClientOffset, + dimension: _dimension, + dropping: dropping, + draggingOver: _draggingOver, + combineWith: _combineWith, + mode: _mode, + forceShouldAnimate: null, + snapshot: getDraggingSnapshot(_mode, _draggingOver, _combineWith, dropping) + } + }; + } + + return null; + }; + + var secondarySelector = function secondarySelector(state, ownProps) { + if (state.isDragging) { + if (state.critical.draggable.id === ownProps.draggableId) { + return null; + } + + return getSecondaryMovement(ownProps.draggableId, state.critical.draggable.id, state.impact); + } + + if (state.phase === 'DROP_ANIMATING') { + var completed = state.completed; + + if (completed.result.draggableId === ownProps.draggableId) { + return null; + } + + return getSecondaryMovement(ownProps.draggableId, completed.result.draggableId, completed.impact); + } + + return null; + }; + + var selector = function selector(state, ownProps) { + return draggingSelector(state, ownProps) || secondarySelector(state, ownProps) || defaultMapProps; + }; + + return selector; +}; + +var mapDispatchToProps$1 = { + lift: lift, + move: move, + moveUp: moveUp, + moveDown: moveDown, + moveLeft: moveLeft, + moveRight: moveRight, + moveByWindowScroll: moveByWindowScroll, + drop: drop, + dropAnimationFinished: dropAnimationFinished +}; +var defaultProps$1 = { + isDragDisabled: false, + disableInteractiveElementBlocking: false, + shouldRespectForcePress: false +}; +var ConnectedDraggable = Object(react_redux__WEBPACK_IMPORTED_MODULE_6__["connect"])(makeMapStateToProps$1, mapDispatchToProps$1, null, { + context: StoreContext, + pure: true, + areStatePropsEqual: isStrictEqual +})(Draggable); +ConnectedDraggable.defaultProps = defaultProps$1; + + +/***/ }), + +/***/ "./node_modules/react-codemirror2/index.js": +/*!*************************************************!*\ + !*** ./node_modules/react-codemirror2/index.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function _typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); +} + +var __extends = void 0 && (void 0).__extends || function () { + var _extendStatics = function extendStatics(d, b) { + _extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + + return _extendStatics(d, b); + }; + + return function (d, b) { + _extendStatics(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +}(); + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var React = __webpack_require__(/*! react */ "./node_modules/react/index.js"); + +var SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true; +var cm; + +if (!SERVER_RENDERED) { + cm = __webpack_require__(/*! codemirror */ "./node_modules/codemirror/lib/codemirror.js"); +} + +var Helper = function () { + function Helper() {} + + Helper.equals = function (x, y) { + var _this = this; + + var ok = Object.keys, + tx = _typeof(x), + ty = _typeof(y); + + return x && y && tx === 'object' && tx === ty ? ok(x).length === ok(y).length && ok(x).every(function (key) { + return _this.equals(x[key], y[key]); + }) : x === y; + }; + + return Helper; +}(); + +var Shared = function () { + function Shared(editor, props) { + this.editor = editor; + this.props = props; + } + + Shared.prototype.delegateCursor = function (position, scroll, focus) { + var doc = this.editor.getDoc(); + + if (focus) { + this.editor.focus(); + } + + scroll ? doc.setCursor(position) : doc.setCursor(position, null, { + scroll: false + }); + }; + + Shared.prototype.delegateScroll = function (coordinates) { + this.editor.scrollTo(coordinates.x, coordinates.y); + }; + + Shared.prototype.delegateSelection = function (ranges, focus) { + var doc = this.editor.getDoc(); + doc.setSelections(ranges); + + if (focus) { + this.editor.focus(); + } + }; + + Shared.prototype.apply = function (props) { + if (props && props.selection && props.selection.ranges) { + this.delegateSelection(props.selection.ranges, props.selection.focus || false); + } + + if (props && props.cursor) { + this.delegateCursor(props.cursor, props.autoScroll || false, this.editor.getOption('autofocus') || false); + } + + if (props && props.scroll) { + this.delegateScroll(props.scroll); + } + }; + + Shared.prototype.applyNext = function (props, next, preserved) { + if (props && props.selection && props.selection.ranges) { + if (next && next.selection && next.selection.ranges && !Helper.equals(props.selection.ranges, next.selection.ranges)) { + this.delegateSelection(next.selection.ranges, next.selection.focus || false); + } + } + + if (props && props.cursor) { + if (next && next.cursor && !Helper.equals(props.cursor, next.cursor)) { + this.delegateCursor(preserved.cursor || next.cursor, next.autoScroll || false, next.autoCursor || false); + } + } + + if (props && props.scroll) { + if (next && next.scroll && !Helper.equals(props.scroll, next.scroll)) { + this.delegateScroll(next.scroll); + } + } + }; + + Shared.prototype.applyUserDefined = function (props, preserved) { + if (preserved && preserved.cursor) { + this.delegateCursor(preserved.cursor, props.autoScroll || false, this.editor.getOption('autofocus') || false); + } + }; + + Shared.prototype.wire = function (props) { + var _this = this; + + Object.keys(props || {}).filter(function (p) { + return /^on/.test(p); + }).forEach(function (prop) { + switch (prop) { + case 'onBlur': + { + _this.editor.on('blur', function (cm, event) { + _this.props.onBlur(_this.editor, event); + }); + } + break; + + case 'onContextMenu': + { + _this.editor.on('contextmenu', function (cm, event) { + _this.props.onContextMenu(_this.editor, event); + }); + + break; + } + + case 'onCopy': + { + _this.editor.on('copy', function (cm, event) { + _this.props.onCopy(_this.editor, event); + }); + + break; + } + + case 'onCursor': + { + _this.editor.on('cursorActivity', function (cm) { + _this.props.onCursor(_this.editor, _this.editor.getDoc().getCursor()); + }); + } + break; + + case 'onCursorActivity': + { + _this.editor.on('cursorActivity', function (cm) { + _this.props.onCursorActivity(_this.editor); + }); + } + break; + + case 'onCut': + { + _this.editor.on('cut', function (cm, event) { + _this.props.onCut(_this.editor, event); + }); + + break; + } + + case 'onDblClick': + { + _this.editor.on('dblclick', function (cm, event) { + _this.props.onDblClick(_this.editor, event); + }); + + break; + } + + case 'onDragEnter': + { + _this.editor.on('dragenter', function (cm, event) { + _this.props.onDragEnter(_this.editor, event); + }); + } + break; + + case 'onDragLeave': + { + _this.editor.on('dragleave', function (cm, event) { + _this.props.onDragLeave(_this.editor, event); + }); + + break; + } + + case 'onDragOver': + { + _this.editor.on('dragover', function (cm, event) { + _this.props.onDragOver(_this.editor, event); + }); + } + break; + + case 'onDragStart': + { + _this.editor.on('dragstart', function (cm, event) { + _this.props.onDragStart(_this.editor, event); + }); + + break; + } + + case 'onDrop': + { + _this.editor.on('drop', function (cm, event) { + _this.props.onDrop(_this.editor, event); + }); + } + break; + + case 'onFocus': + { + _this.editor.on('focus', function (cm, event) { + _this.props.onFocus(_this.editor, event); + }); + } + break; + + case 'onGutterClick': + { + _this.editor.on('gutterClick', function (cm, lineNumber, gutter, event) { + _this.props.onGutterClick(_this.editor, lineNumber, gutter, event); + }); + } + break; + + case 'onKeyDown': + { + _this.editor.on('keydown', function (cm, event) { + _this.props.onKeyDown(_this.editor, event); + }); + } + break; + + case 'onKeyPress': + { + _this.editor.on('keypress', function (cm, event) { + _this.props.onKeyPress(_this.editor, event); + }); + } + break; + + case 'onKeyUp': + { + _this.editor.on('keyup', function (cm, event) { + _this.props.onKeyUp(_this.editor, event); + }); + } + break; + + case 'onMouseDown': + { + _this.editor.on('mousedown', function (cm, event) { + _this.props.onMouseDown(_this.editor, event); + }); + + break; + } + + case 'onPaste': + { + _this.editor.on('paste', function (cm, event) { + _this.props.onPaste(_this.editor, event); + }); + + break; + } + + case 'onRenderLine': + { + _this.editor.on('renderLine', function (cm, line, element) { + _this.props.onRenderLine(_this.editor, line, element); + }); + + break; + } + + case 'onScroll': + { + _this.editor.on('scroll', function (cm) { + _this.props.onScroll(_this.editor, _this.editor.getScrollInfo()); + }); + } + break; + + case 'onSelection': + { + _this.editor.on('beforeSelectionChange', function (cm, data) { + _this.props.onSelection(_this.editor, data); + }); + } + break; + + case 'onTouchStart': + { + _this.editor.on('touchstart', function (cm, event) { + _this.props.onTouchStart(_this.editor, event); + }); + + break; + } + + case 'onUpdate': + { + _this.editor.on('update', function (cm) { + _this.props.onUpdate(_this.editor); + }); + } + break; + + case 'onViewportChange': + { + _this.editor.on('viewportChange', function (cm, from, to) { + _this.props.onViewportChange(_this.editor, from, to); + }); + } + break; + } + }); + }; + + return Shared; +}(); + +var Controlled = function (_super) { + __extends(Controlled, _super); + + function Controlled(props) { + var _this = _super.call(this, props) || this; + + if (SERVER_RENDERED) return _this; + _this.applied = false; + _this.appliedNext = false; + _this.appliedUserDefined = false; + _this.deferred = null; + _this.emulating = false; + _this.hydrated = false; + + _this.initCb = function () { + if (_this.props.editorDidConfigure) { + _this.props.editorDidConfigure(_this.editor); + } + }; + + _this.mounted = false; + return _this; + } + + Controlled.prototype.hydrate = function (props) { + var _this = this; + + var _options = props && props.options ? props.options : {}; + + var userDefinedOptions = _extends({}, cm.defaults, this.editor.options, _options); + + var optionDelta = Object.keys(userDefinedOptions).some(function (key) { + return _this.editor.getOption(key) !== userDefinedOptions[key]; + }); + + if (optionDelta) { + Object.keys(userDefinedOptions).forEach(function (key) { + if (_options.hasOwnProperty(key)) { + if (_this.editor.getOption(key) !== userDefinedOptions[key]) { + _this.editor.setOption(key, userDefinedOptions[key]); + + _this.mirror.setOption(key, userDefinedOptions[key]); + } + } + }); + } + + if (!this.hydrated) { + this.deferred ? this.resolveChange() : this.initChange(props.value || ''); + } + + this.hydrated = true; + }; + + Controlled.prototype.initChange = function (value) { + this.emulating = true; + var doc = this.editor.getDoc(); + var lastLine = doc.lastLine(); + var lastChar = doc.getLine(doc.lastLine()).length; + doc.replaceRange(value || '', { + line: 0, + ch: 0 + }, { + line: lastLine, + ch: lastChar + }); + this.mirror.setValue(value); + doc.clearHistory(); + this.mirror.clearHistory(); + this.emulating = false; + }; + + Controlled.prototype.resolveChange = function () { + this.emulating = true; + var doc = this.editor.getDoc(); + + if (this.deferred.origin === 'undo') { + doc.undo(); + } else if (this.deferred.origin === 'redo') { + doc.redo(); + } else { + doc.replaceRange(this.deferred.text, this.deferred.from, this.deferred.to, this.deferred.origin); + } + + this.emulating = false; + this.deferred = null; + }; + + Controlled.prototype.mirrorChange = function (deferred) { + var doc = this.editor.getDoc(); + + if (deferred.origin === 'undo') { + doc.setHistory(this.mirror.getHistory()); + this.mirror.undo(); + } else if (deferred.origin === 'redo') { + doc.setHistory(this.mirror.getHistory()); + this.mirror.redo(); + } else { + this.mirror.replaceRange(deferred.text, deferred.from, deferred.to, deferred.origin); + } + + return this.mirror.getValue(); + }; + + Controlled.prototype.componentDidMount = function () { + var _this = this; + + if (SERVER_RENDERED) return; + + if (this.props.defineMode) { + if (this.props.defineMode.name && this.props.defineMode.fn) { + cm.defineMode(this.props.defineMode.name, this.props.defineMode.fn); + } + } + + this.editor = cm(this.ref); + this.shared = new Shared(this.editor, this.props); + this.mirror = cm(function () {}); + this.editor.on('electricInput', function () { + _this.mirror.setHistory(_this.editor.getDoc().getHistory()); + }); + this.editor.on('cursorActivity', function () { + _this.mirror.setCursor(_this.editor.getDoc().getCursor()); + }); + this.editor.on('beforeChange', function (cm, data) { + if (_this.emulating) { + return; + } + + data.cancel(); + _this.deferred = data; + + var phantomChange = _this.mirrorChange(_this.deferred); + + if (_this.props.onBeforeChange) _this.props.onBeforeChange(_this.editor, _this.deferred, phantomChange); + }); + this.editor.on('change', function (cm, data) { + if (!_this.mounted) { + return; + } + + if (_this.props.onChange) { + _this.props.onChange(_this.editor, data, _this.editor.getValue()); + } + }); + this.hydrate(this.props); + this.shared.apply(this.props); + this.applied = true; + this.mounted = true; + this.shared.wire(this.props); + + if (this.editor.getOption('autofocus')) { + this.editor.focus(); + } + + if (this.props.editorDidMount) { + this.props.editorDidMount(this.editor, this.editor.getValue(), this.initCb); + } + }; + + Controlled.prototype.componentWillReceiveProps = function (nextProps) { + if (SERVER_RENDERED) return; + var preserved = { + cursor: null + }; + + if (nextProps.value !== this.props.value) { + this.hydrated = false; + } + + if (!this.props.autoCursor && this.props.autoCursor !== undefined) { + preserved.cursor = this.editor.getDoc().getCursor(); + } + + this.hydrate(nextProps); + + if (!this.appliedNext) { + this.shared.applyNext(this.props, nextProps, preserved); + this.appliedNext = true; + } + + this.shared.applyUserDefined(this.props, preserved); + this.appliedUserDefined = true; + }; + + Controlled.prototype.componentWillUnmount = function () { + if (SERVER_RENDERED) return; + + if (this.props.editorWillUnmount) { + this.props.editorWillUnmount(cm); + } + }; + + Controlled.prototype.shouldComponentUpdate = function (nextProps, nextState) { + return !SERVER_RENDERED; + }; + + Controlled.prototype.render = function () { + var _this = this; + + if (SERVER_RENDERED) return null; + var className = this.props.className ? 'react-codemirror2 ' + this.props.className : 'react-codemirror2'; + return React.createElement('div', { + className: className, + ref: function ref(self) { + return _this.ref = self; + } + }); + }; + + return Controlled; +}(React.Component); + +exports.Controlled = Controlled; + +var UnControlled = function (_super) { + __extends(UnControlled, _super); + + function UnControlled(props) { + var _this = _super.call(this, props) || this; + + if (SERVER_RENDERED) return _this; + _this.applied = false; + _this.appliedUserDefined = false; + _this.continueChange = false; + _this.detached = false; + _this.hydrated = false; + + _this.initCb = function () { + if (_this.props.editorDidConfigure) { + _this.props.editorDidConfigure(_this.editor); + } + }; + + _this.mounted = false; + + _this.onBeforeChangeCb = function () { + _this.continueChange = true; + }; + + return _this; + } + + UnControlled.prototype.hydrate = function (props) { + var _this = this; + + var _options = props && props.options ? props.options : {}; + + var userDefinedOptions = _extends({}, cm.defaults, this.editor.options, _options); + + var optionDelta = Object.keys(userDefinedOptions).some(function (key) { + return _this.editor.getOption(key) !== userDefinedOptions[key]; + }); + + if (optionDelta) { + Object.keys(userDefinedOptions).forEach(function (key) { + if (_options.hasOwnProperty(key)) { + if (_this.editor.getOption(key) !== userDefinedOptions[key]) { + _this.editor.setOption(key, userDefinedOptions[key]); + } + } + }); + } + + if (!this.hydrated) { + var doc = this.editor.getDoc(); + var lastLine = doc.lastLine(); + var lastChar = doc.getLine(doc.lastLine()).length; + doc.replaceRange(props.value || '', { + line: 0, + ch: 0 + }, { + line: lastLine, + ch: lastChar + }); + } + + this.hydrated = true; + }; + + UnControlled.prototype.componentDidMount = function () { + var _this = this; + + if (SERVER_RENDERED) return; + this.detached = this.props.detach === true; + + if (this.props.defineMode) { + if (this.props.defineMode.name && this.props.defineMode.fn) { + cm.defineMode(this.props.defineMode.name, this.props.defineMode.fn); + } + } + + this.editor = cm(this.ref); + this.shared = new Shared(this.editor, this.props); + this.editor.on('beforeChange', function (cm, data) { + if (_this.props.onBeforeChange) { + _this.props.onBeforeChange(_this.editor, data, _this.editor.getValue(), _this.onBeforeChangeCb); + } + }); + this.editor.on('change', function (cm, data) { + if (!_this.mounted || !_this.props.onChange) { + return; + } + + if (_this.props.onBeforeChange) { + if (_this.continueChange) { + _this.props.onChange(_this.editor, data, _this.editor.getValue()); + } + } else { + _this.props.onChange(_this.editor, data, _this.editor.getValue()); + } + }); + this.hydrate(this.props); + this.shared.apply(this.props); + this.applied = true; + this.mounted = true; + this.shared.wire(this.props); + this.editor.getDoc().clearHistory(); + + if (this.props.editorDidMount) { + this.props.editorDidMount(this.editor, this.editor.getValue(), this.initCb); + } + }; + + UnControlled.prototype.componentWillReceiveProps = function (nextProps) { + if (this.detached && nextProps.detach === false) { + this.detached = false; + + if (this.props.editorDidAttach) { + this.props.editorDidAttach(this.editor); + } + } + + if (!this.detached && nextProps.detach === true) { + this.detached = true; + + if (this.props.editorDidDetach) { + this.props.editorDidDetach(this.editor); + } + } + + if (SERVER_RENDERED || this.detached) return; + var preserved = { + cursor: null + }; + + if (nextProps.value !== this.props.value) { + this.hydrated = false; + this.applied = false; + this.appliedUserDefined = false; + } + + if (!this.props.autoCursor && this.props.autoCursor !== undefined) { + preserved.cursor = this.editor.getDoc().getCursor(); + } + + this.hydrate(nextProps); + + if (!this.applied) { + this.shared.apply(this.props); + this.applied = true; + } + + if (!this.appliedUserDefined) { + this.shared.applyUserDefined(this.props, preserved); + this.appliedUserDefined = true; + } + }; + + UnControlled.prototype.componentWillUnmount = function () { + if (SERVER_RENDERED) return; + + if (this.props.editorWillUnmount) { + this.props.editorWillUnmount(cm); + } + }; + + UnControlled.prototype.shouldComponentUpdate = function (nextProps, nextState) { + var update = true; + if (SERVER_RENDERED) update = false; + if (this.detached) update = false; + return update; + }; + + UnControlled.prototype.render = function () { + var _this = this; + + if (SERVER_RENDERED) return null; + var className = this.props.className ? 'react-codemirror2 ' + this.props.className : 'react-codemirror2'; + return React.createElement('div', { + className: className, + ref: function ref(self) { + return _this.ref = self; + } + }); + }; + + return UnControlled; +}(React.Component); + +exports.UnControlled = UnControlled; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/react-copy-to-clipboard/lib/Component.js": +/*!***************************************************************!*\ + !*** ./node_modules/react-copy-to-clipboard/lib/Component.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.CopyToClipboard = undefined; + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; + +var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + +var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js"); + +var _react2 = _interopRequireDefault(_react); + +var _copyToClipboard = __webpack_require__(/*! copy-to-clipboard */ "./node_modules/copy-to-clipboard/index.js"); + +var _copyToClipboard2 = _interopRequireDefault(_copyToClipboard); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +function _objectWithoutProperties(obj, keys) { + var target = {}; + + for (var i in obj) { + if (keys.indexOf(i) >= 0) continue; + if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; + target[i] = obj[i]; + } + + return target; +} + +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +} + +function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +} + +var CopyToClipboard = exports.CopyToClipboard = function (_React$PureComponent) { + _inherits(CopyToClipboard, _React$PureComponent); + + function CopyToClipboard() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, CopyToClipboard); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = CopyToClipboard.__proto__ || Object.getPrototypeOf(CopyToClipboard)).call.apply(_ref, [this].concat(args))), _this), _this.onClick = function (event) { + var _this$props = _this.props, + text = _this$props.text, + onCopy = _this$props.onCopy, + children = _this$props.children, + options = _this$props.options; + + var elem = _react2.default.Children.only(children); + + var result = (0, _copyToClipboard2.default)(text, options); + + if (onCopy) { + onCopy(text, result); + } // Bypass onClick if it was present + + + if (elem && elem.props && typeof elem.props.onClick === 'function') { + elem.props.onClick(event); + } + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(CopyToClipboard, [{ + key: 'render', + value: function render() { + var _props = this.props, + _text = _props.text, + _onCopy = _props.onCopy, + _options = _props.options, + children = _props.children, + props = _objectWithoutProperties(_props, ['text', 'onCopy', 'options', 'children']); + + var elem = _react2.default.Children.only(children); + + return _react2.default.cloneElement(elem, _extends({}, props, { + onClick: this.onClick + })); + } + }]); + + return CopyToClipboard; +}(_react2.default.PureComponent); + +CopyToClipboard.defaultProps = { + onCopy: undefined, + options: undefined +}; + +/***/ }), + +/***/ "./node_modules/react-copy-to-clipboard/lib/index.js": +/*!***********************************************************!*\ + !*** ./node_modules/react-copy-to-clipboard/lib/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _require = __webpack_require__(/*! ./Component */ "./node_modules/react-copy-to-clipboard/lib/Component.js"), + CopyToClipboard = _require.CopyToClipboard; + +CopyToClipboard.CopyToClipboard = CopyToClipboard; +module.exports = CopyToClipboard; + +/***/ }), + +/***/ "./node_modules/react-dev-utils/formatWebpackMessages.js": +/*!***************************************************************!*\ + !*** ./node_modules/react-dev-utils/formatWebpackMessages.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + +var _slicedToArray = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js"); + +const chalk = __webpack_require__(/*! chalk */ "./node_modules/chalk/index.js"); + +const friendlySyntaxErrorLabel = 'Syntax error:'; + +function isLikelyASyntaxError(message) { + return message.indexOf(friendlySyntaxErrorLabel) !== -1; +} // Cleans up webpack error messages. + + +function formatMessage(message) { + let lines = message.split('\n'); // Strip Webpack-added headers off errors/warnings + // https://github.com/webpack/webpack/blob/master/lib/ModuleError.js + + lines = lines.filter(line => !/Module [A-z ]+\(from/.test(line)); // Transform parsing error into syntax error + // TODO: move this to our ESLint formatter? + + lines = lines.map(line => { + const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(line); + + if (!parsingError) { + return line; + } + + const _parsingError = _slicedToArray(parsingError, 4), + errorLine = _parsingError[1], + errorColumn = _parsingError[2], + errorMessage = _parsingError[3]; + + return "".concat(friendlySyntaxErrorLabel, " ").concat(errorMessage, " (").concat(errorLine, ":").concat(errorColumn, ")"); + }); + message = lines.join('\n'); // Smoosh syntax errors (commonly found in CSS) + + message = message.replace(/SyntaxError\s+\((\d+):(\d+)\)\s*(.+?)\n/g, "".concat(friendlySyntaxErrorLabel, " $3 ($1:$2)\n")); // Remove columns from ESLint formatter output (we added these for more + // accurate syntax errors) + + message = message.replace(/Line (\d+):\d+:/g, 'Line $1:'); // Clean up export errors + + message = message.replace(/^.*export '(.+?)' was not found in '(.+?)'.*$/gm, "Attempted import error: '$1' is not exported from '$2'."); + message = message.replace(/^.*export 'default' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm, "Attempted import error: '$2' does not contain a default export (imported as '$1')."); + message = message.replace(/^.*export '(.+?)' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm, "Attempted import error: '$1' is not exported from '$3' (imported as '$2')."); + lines = message.split('\n'); // Remove leading newline + + if (lines.length > 2 && lines[1].trim() === '') { + lines.splice(1, 1); + } // Clean up file name + + + lines[0] = lines[0].replace(/^(.*) \d+:\d+-\d+$/, '$1'); // Cleans up verbose "module not found" messages for files and packages. + + if (lines[1] && lines[1].indexOf('Module not found: ') === 0) { + lines = [lines[0], lines[1].replace('Error: ', '').replace('Module not found: Cannot find file:', 'Cannot find file:')]; + } // Add helpful message for users trying to use Sass for the first time + + + if (lines[1] && lines[1].match(/Cannot find module.+node-sass/)) { + lines[1] = 'To import Sass files, you first need to install node-sass.\n'; + lines[1] += 'Run `npm install node-sass` or `yarn add node-sass` inside your workspace.'; + } + + lines[0] = chalk.inverse(lines[0]); + message = lines.join('\n'); // Internal stacks are generally useless so we strip them... with the + // exception of stacks containing `webpack:` because they're normally + // from user code generated by Webpack. For more information see + // https://github.com/facebook/create-react-app/pull/1050 + + message = message.replace(/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm, ''); // at ... ...:x:y + + message = message.replace(/^\s*at\s(\n|$)/gm, ''); // at + + lines = message.split('\n'); // Remove duplicated newlines + + lines = lines.filter((line, index, arr) => index === 0 || line.trim() !== '' || line.trim() !== arr[index - 1].trim()); // Reassemble the message + + message = lines.join('\n'); + return message.trim(); +} + +function formatWebpackMessages(json) { + const formattedErrors = json.errors.map(function (message) { + return formatMessage(message, true); + }); + const formattedWarnings = json.warnings.map(function (message) { + return formatMessage(message, false); + }); + const result = { + errors: formattedErrors, + warnings: formattedWarnings + }; + + if (result.errors.some(isLikelyASyntaxError)) { + // If there are any syntax errors, show just them. + result.errors = result.errors.filter(isLikelyASyntaxError); + } + + return result; +} + +module.exports = formatWebpackMessages; + +/***/ }), + +/***/ "./node_modules/react-dev-utils/launchEditorEndpoint.js": +/*!**************************************************************!*\ + !*** ./node_modules/react-dev-utils/launchEditorEndpoint.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + // TODO: we might want to make this injectable to support DEV-time non-root URLs. + +module.exports = '/__open-stack-frame-in-editor'; + +/***/ }), + +/***/ "./node_modules/react-dev-utils/webpackHotDevClient.js": +/*!*************************************************************!*\ + !*** ./node_modules/react-dev-utils/webpackHotDevClient.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + // This alternative WebpackDevServer combines the functionality of: +// https://github.com/webpack/webpack-dev-server/blob/webpack-1/client/index.js +// https://github.com/webpack/webpack/blob/webpack-1/hot/dev-server.js +// It only supports their simplest configuration (hot updates on same server). +// It makes some opinionated choices on top, like adding a syntax error overlay +// that looks similar to our console output. The error overlay is inspired by: +// https://github.com/glenjamin/webpack-hot-middleware + +var SockJS = __webpack_require__(/*! sockjs-client */ "./node_modules/sockjs-client/lib/entry.js"); + +var stripAnsi = __webpack_require__(/*! strip-ansi */ "./node_modules/strip-ansi/index.js"); + +var url = __webpack_require__(/*! url */ "./node_modules/url/url.js"); + +var launchEditorEndpoint = __webpack_require__(/*! ./launchEditorEndpoint */ "./node_modules/react-dev-utils/launchEditorEndpoint.js"); + +var formatWebpackMessages = __webpack_require__(/*! ./formatWebpackMessages */ "./node_modules/react-dev-utils/formatWebpackMessages.js"); + +var ErrorOverlay = __webpack_require__(/*! react-error-overlay */ "./node_modules/react-error-overlay/lib/index.js"); + +ErrorOverlay.setEditorHandler(function editorHandler(errorLocation) { + // Keep this sync with errorOverlayMiddleware.js + fetch(launchEditorEndpoint + '?fileName=' + window.encodeURIComponent(errorLocation.fileName) + '&lineNumber=' + window.encodeURIComponent(errorLocation.lineNumber || 1) + '&colNumber=' + window.encodeURIComponent(errorLocation.colNumber || 1)); +}); // We need to keep track of if there has been a runtime error. +// Essentially, we cannot guarantee application state was not corrupted by the +// runtime error. To prevent confusing behavior, we forcibly reload the entire +// application. This is handled below when we are notified of a compile (code +// change). +// See https://github.com/facebook/create-react-app/issues/3096 + +var hadRuntimeError = false; +ErrorOverlay.startReportingRuntimeErrors({ + onError: function () { + hadRuntimeError = true; + }, + filename: '/static/js/bundle.js' +}); + +if ( true && typeof module.hot.dispose === 'function') { + module.hot.dispose(function () { + // TODO: why do we need this? + ErrorOverlay.stopReportingRuntimeErrors(); + }); +} // Connect to WebpackDevServer via a socket. + + +var connection = new SockJS(url.format({ + protocol: window.location.protocol, + hostname: window.location.hostname, + port: window.location.port, + // Hardcoded in WebpackDevServer + pathname: '/sockjs-node' +})); // Unlike WebpackDevServer client, we won't try to reconnect +// to avoid spamming the console. Disconnect usually happens +// when developer stops the server. + +connection.onclose = function () { + if (typeof console !== 'undefined' && typeof console.info === 'function') { + console.info('The development server has disconnected.\nRefresh the page if necessary.'); + } +}; // Remember some state related to hot module replacement. + + +var isFirstCompilation = true; +var mostRecentCompilationHash = null; +var hasCompileErrors = false; + +function clearOutdatedErrors() { + // Clean up outdated compile errors, if any. + if (typeof console !== 'undefined' && typeof console.clear === 'function') { + if (hasCompileErrors) { + console.clear(); + } + } +} // Successful compilation. + + +function handleSuccess() { + clearOutdatedErrors(); + var isHotUpdate = !isFirstCompilation; + isFirstCompilation = false; + hasCompileErrors = false; // Attempt to apply hot updates or reload. + + if (isHotUpdate) { + tryApplyUpdates(function onHotUpdateSuccess() { + // Only dismiss it when we're sure it's a hot update. + // Otherwise it would flicker right before the reload. + tryDismissErrorOverlay(); + }); + } +} // Compilation with warnings (e.g. ESLint). + + +function handleWarnings(warnings) { + clearOutdatedErrors(); + var isHotUpdate = !isFirstCompilation; + isFirstCompilation = false; + hasCompileErrors = false; + + function printWarnings() { + // Print warnings to the console. + var formatted = formatWebpackMessages({ + warnings: warnings, + errors: [] + }); + + if (typeof console !== 'undefined' && typeof console.warn === 'function') { + for (var i = 0; i < formatted.warnings.length; i++) { + if (i === 5) { + console.warn('There were more warnings in other files.\n' + 'You can find a complete log in the terminal.'); + break; + } + + console.warn(stripAnsi(formatted.warnings[i])); + } + } + } + + printWarnings(); // Attempt to apply hot updates or reload. + + if (isHotUpdate) { + tryApplyUpdates(function onSuccessfulHotUpdate() { + // Only dismiss it when we're sure it's a hot update. + // Otherwise it would flicker right before the reload. + tryDismissErrorOverlay(); + }); + } +} // Compilation with errors (e.g. syntax error or missing modules). + + +function handleErrors(errors) { + clearOutdatedErrors(); + isFirstCompilation = false; + hasCompileErrors = true; // "Massage" webpack messages. + + var formatted = formatWebpackMessages({ + errors: errors, + warnings: [] + }); // Only show the first error. + + ErrorOverlay.reportBuildError(formatted.errors[0]); // Also log them to the console. + + if (typeof console !== 'undefined' && typeof console.error === 'function') { + for (var i = 0; i < formatted.errors.length; i++) { + console.error(stripAnsi(formatted.errors[i])); + } + } // Do not attempt to reload now. + // We will reload on next success instead. + +} + +function tryDismissErrorOverlay() { + if (!hasCompileErrors) { + ErrorOverlay.dismissBuildError(); + } +} // There is a newer version of the code available. + + +function handleAvailableHash(hash) { + // Update last known compilation hash. + mostRecentCompilationHash = hash; +} // Handle messages from the server. + + +connection.onmessage = function (e) { + var message = JSON.parse(e.data); + + switch (message.type) { + case 'hash': + handleAvailableHash(message.data); + break; + + case 'still-ok': + case 'ok': + handleSuccess(); + break; + + case 'content-changed': + // Triggered when a file from `contentBase` changed. + window.location.reload(); + break; + + case 'warnings': + handleWarnings(message.data); + break; + + case 'errors': + handleErrors(message.data); + break; + + default: // Do nothing. + + } +}; // Is there a newer version of this code available? + + +function isUpdateAvailable() { + /* globals __webpack_hash__ */ + // __webpack_hash__ is the hash of the current compilation. + // It's a global variable injected by Webpack. + return mostRecentCompilationHash !== __webpack_require__.h(); +} // Webpack disallows updates in other states. + + +function canApplyUpdates() { + return module.hot.status() === 'idle'; +} // Attempt to update code on the fly, fall back to a hard reload. + + +function tryApplyUpdates(onHotUpdateSuccess) { + if (false) {} + + if (!isUpdateAvailable() || !canApplyUpdates()) { + return; + } + + function handleApplyUpdates(err, updatedModules) { + if (err || !updatedModules || hadRuntimeError) { + window.location.reload(); + return; + } + + if (typeof onHotUpdateSuccess === 'function') { + // Maybe we want to do something. + onHotUpdateSuccess(); + } + + if (isUpdateAvailable()) { + // While we were updating, there was a new update! Do it again. + tryApplyUpdates(); + } + } // https://webpack.github.io/docs/hot-module-replacement.html#check + + + var result = module.hot.check( + /* autoApply */ + true, handleApplyUpdates); // // Webpack 2 returns a Promise instead of invoking a callback + + if (result && result.then) { + result.then(function (updatedModules) { + handleApplyUpdates(null, updatedModules); + }, function (err) { + handleApplyUpdates(err, null); + }); + } +} + +/***/ }), + +/***/ "./node_modules/react-dom/cjs/react-dom.development.js": +/*!*************************************************************!*\ + !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** @license React v16.9.0 + * react-dom.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + +if (true) { + (function () { + 'use strict'; + + var React = __webpack_require__(/*! react */ "./node_modules/react/index.js"); + + var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); + + var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); + + var Scheduler = __webpack_require__(/*! scheduler */ "./node_modules/scheduler/index.js"); + + var tracing = __webpack_require__(/*! scheduler/tracing */ "./node_modules/scheduler/tracing.js"); // Do not require this module directly! Use normal `invariant` calls with + // template literal strings. The messages will be converted to ReactError during + // build, and in production they will be minified. + // Do not require this module directly! Use normal `invariant` calls with + // template literal strings. The messages will be converted to ReactError during + // build, and in production they will be minified. + + + function ReactError(error) { + error.name = 'Invariant Violation'; + return error; + } + /** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + + + (function () { + if (!React) { + { + throw ReactError(Error('ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.')); + } + } + })(); + /** + * Injectable ordering of event plugins. + */ + + + var eventPluginOrder = null; + /** + * Injectable mapping from names to event plugin modules. + */ + + var namesToPlugins = {}; + /** + * Recomputes the plugin list using the injected plugins and plugin ordering. + * + * @private + */ + + function recomputePluginOrdering() { + if (!eventPluginOrder) { + // Wait until an `eventPluginOrder` is injected. + return; + } + + for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName]; + var pluginIndex = eventPluginOrder.indexOf(pluginName); + + (function () { + if (!(pluginIndex > -1)) { + { + throw ReactError(Error('EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `' + pluginName + '`.')); + } + } + })(); + + if (plugins[pluginIndex]) { + continue; + } + + (function () { + if (!pluginModule.extractEvents) { + { + throw ReactError(Error('EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `' + pluginName + '` does not.')); + } + } + })(); + + plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + + for (var eventName in publishedEvents) { + (function () { + if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { + { + throw ReactError(Error('EventPluginRegistry: Failed to publish event `' + eventName + '` for plugin `' + pluginName + '`.')); + } + } + })(); + } + } + } + /** + * Publishes an event so that it can be dispatched by the supplied plugin. + * + * @param {object} dispatchConfig Dispatch configuration for the event. + * @param {object} PluginModule Plugin publishing the event. + * @return {boolean} True if the event was successfully published. + * @private + */ + + + function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + (function () { + if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) { + { + throw ReactError(Error('EventPluginHub: More than one plugin attempted to publish the same event name, `' + eventName + '`.')); + } + } + })(); + + eventNameDispatchConfigs[eventName] = dispatchConfig; + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) { + if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); + } + } + + return true; + } else if (dispatchConfig.registrationName) { + publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); + return true; + } + + return false; + } + /** + * Publishes a registration name that is used to identify dispatched events. + * + * @param {string} registrationName Registration name to add. + * @param {object} PluginModule Plugin publishing the event. + * @private + */ + + + function publishRegistrationName(registrationName, pluginModule, eventName) { + (function () { + if (!!registrationNameModules[registrationName]) { + { + throw ReactError(Error('EventPluginHub: More than one plugin attempted to publish the same registration name, `' + registrationName + '`.')); + } + } + })(); + + registrationNameModules[registrationName] = pluginModule; + registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + { + var lowerCasedName = registrationName.toLowerCase(); + possibleRegistrationNames[lowerCasedName] = registrationName; + + if (registrationName === 'onDoubleClick') { + possibleRegistrationNames.ondblclick = registrationName; + } + } + } + /** + * Registers plugins so that they can extract and dispatch events. + * + * @see {EventPluginHub} + */ + + /** + * Ordered list of injected plugins. + */ + + + var plugins = []; + /** + * Mapping from event name to dispatch config + */ + + var eventNameDispatchConfigs = {}; + /** + * Mapping from registration name to plugin module + */ + + var registrationNameModules = {}; + /** + * Mapping from registration name to event name + */ + + var registrationNameDependencies = {}; + /** + * Mapping from lowercase registration names to the properly cased version, + * used to warn in the case of missing event handlers. Available + * only in true. + * @type {Object} + */ + + var possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true + + /** + * Injects an ordering of plugins (by plugin name). This allows the ordering + * to be decoupled from injection of the actual plugins so that ordering is + * always deterministic regardless of packaging, on-the-fly injection, etc. + * + * @param {array} InjectedEventPluginOrder + * @internal + * @see {EventPluginHub.injection.injectEventPluginOrder} + */ + + function injectEventPluginOrder(injectedEventPluginOrder) { + (function () { + if (!!eventPluginOrder) { + { + throw ReactError(Error('EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.')); + } + } + })(); // Clone the ordering so it cannot be dynamically mutated. + + + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); + recomputePluginOrdering(); + } + /** + * Injects plugins to be used by `EventPluginHub`. The plugin names must be + * in the ordering injected by `injectEventPluginOrder`. + * + * Plugins can be injected as part of page initialization or on-the-fly. + * + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + * @internal + * @see {EventPluginHub.injection.injectEventPluginsByName} + */ + + + function injectEventPluginsByName(injectedNamesToPlugins) { + var isOrderingDirty = false; + + for (var pluginName in injectedNamesToPlugins) { + if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { + continue; + } + + var pluginModule = injectedNamesToPlugins[pluginName]; + + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { + (function () { + if (!!namesToPlugins[pluginName]) { + { + throw ReactError(Error('EventPluginRegistry: Cannot inject two different event plugins using the same name, `' + pluginName + '`.')); + } + } + })(); + + namesToPlugins[pluginName] = pluginModule; + isOrderingDirty = true; + } + } + + if (isOrderingDirty) { + recomputePluginOrdering(); + } + } + + var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) { + var funcArgs = Array.prototype.slice.call(arguments, 3); + + try { + func.apply(context, funcArgs); + } catch (error) { + this.onError(error); + } + }; + + { + // In DEV mode, we swap out invokeGuardedCallback for a special version + // that plays more nicely with the browser's DevTools. The idea is to preserve + // "Pause on exceptions" behavior. Because React wraps all user-provided + // functions in invokeGuardedCallback, and the production version of + // invokeGuardedCallback uses a try-catch, all user exceptions are treated + // like caught exceptions, and the DevTools won't pause unless the developer + // takes the extra step of enabling pause on caught exceptions. This is + // unintuitive, though, because even though React has caught the error, from + // the developer's perspective, the error is uncaught. + // + // To preserve the expected "Pause on exceptions" behavior, we don't use a + // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake + // DOM node, and call the user-provided callback from inside an event handler + // for that fake event. If the callback throws, the error is "captured" using + // a global event handler. But because the error happens in a different + // event loop context, it does not interrupt the normal program flow. + // Effectively, this gives us try-catch behavior without actually using + // try-catch. Neat! + // Check that the browser supports the APIs we need to implement our special + // DEV version of invokeGuardedCallback + if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { + var fakeNode = document.createElement('react'); + + var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) { + // If document doesn't exist we know for sure we will crash in this method + // when we call document.createEvent(). However this can cause confusing + // errors: https://github.com/facebookincubator/create-react-app/issues/3482 + // So we preemptively throw with a better message instead. + (function () { + if (!(typeof document !== 'undefined')) { + { + throw ReactError(Error('The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.')); + } + } + })(); + + var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We + // set this to true at the beginning, then set it to false right after + // calling the function. If the function errors, `didError` will never be + // set to false. This strategy works even if the browser is flaky and + // fails to call our global error handler, because it doesn't rely on + // the error event at all. + + var didError = true; // Keeps track of the value of window.event so that we can reset it + // during the callback to let user code access window.event in the + // browsers that support it. + + var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event + // dispatching: https://github.com/facebook/react/issues/13688 + + var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously + // dispatch our fake event using `dispatchEvent`. Inside the handler, we + // call the user-provided callback. + + var funcArgs = Array.prototype.slice.call(arguments, 3); + + function callCallback() { + // We immediately remove the callback from event listeners so that + // nested `invokeGuardedCallback` calls do not clash. Otherwise, a + // nested call would trigger the fake event handlers of any call higher + // in the stack. + fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the + // window.event assignment in both IE <= 10 as they throw an error + // "Member not found" in strict mode, and in Firefox which does not + // support window.event. + + if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { + window.event = windowEvent; + } + + func.apply(context, funcArgs); + didError = false; + } // Create a global error event handler. We use this to capture the value + // that was thrown. It's possible that this error handler will fire more + // than once; for example, if non-React code also calls `dispatchEvent` + // and a handler for that event throws. We should be resilient to most of + // those cases. Even if our error event handler fires more than once, the + // last error event is always used. If the callback actually does error, + // we know that the last error event is the correct one, because it's not + // possible for anything else to have happened in between our callback + // erroring and the code that follows the `dispatchEvent` call below. If + // the callback doesn't error, but the error event was fired, we know to + // ignore it because `didError` will be false, as described above. + + + var error = void 0; // Use this to track whether the error event is ever called. + + var didSetError = false; + var isCrossOriginError = false; + + function handleWindowError(event) { + error = event.error; + didSetError = true; + + if (error === null && event.colno === 0 && event.lineno === 0) { + isCrossOriginError = true; + } + + if (event.defaultPrevented) { + // Some other error handler has prevented default. + // Browsers silence the error report if this happens. + // We'll remember this to later decide whether to log it or not. + if (error != null && typeof error === 'object') { + try { + error._suppressLogging = true; + } catch (inner) {// Ignore. + } + } + } + } // Create a fake event type. + + + var evtType = 'react-' + (name ? name : 'invokeguardedcallback'); // Attach our event handlers + + window.addEventListener('error', handleWindowError); + fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function + // errors, it will trigger our global error handler. + + evt.initEvent(evtType, false, false); + fakeNode.dispatchEvent(evt); + + if (windowEventDescriptor) { + Object.defineProperty(window, 'event', windowEventDescriptor); + } + + if (didError) { + if (!didSetError) { + // The callback errored, but the error event never fired. + error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.'); + } else if (isCrossOriginError) { + error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.'); + } + + this.onError(error); + } // Remove our event listeners + + + window.removeEventListener('error', handleWindowError); + }; + + invokeGuardedCallbackImpl = invokeGuardedCallbackDev; + } + } + var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; // Used by Fiber to simulate a try-catch. + + var hasError = false; + var caughtError = null; // Used by event system to capture/rethrow the first error. + + var hasRethrowError = false; + var rethrowError = null; + var reporter = { + onError: function (error) { + hasError = true; + caughtError = error; + } + }; + /** + * Call a function while guarding against errors that happens within it. + * Returns an error if it throws, otherwise null. + * + * In production, this is implemented using a try-catch. The reason we don't + * use a try-catch directly is so that we can swap out a different + * implementation in DEV mode. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + + function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { + hasError = false; + caughtError = null; + invokeGuardedCallbackImpl$1.apply(reporter, arguments); + } + /** + * Same as invokeGuardedCallback, but instead of returning an error, it stores + * it in a global so it can be rethrown by `rethrowCaughtError` later. + * TODO: See if caughtError and rethrowError can be unified. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + + + function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { + invokeGuardedCallback.apply(this, arguments); + + if (hasError) { + var error = clearCaughtError(); + + if (!hasRethrowError) { + hasRethrowError = true; + rethrowError = error; + } + } + } + /** + * During execution of guarded functions we will capture the first error which + * we will rethrow to be handled by the top level error handler. + */ + + + function rethrowCaughtError() { + if (hasRethrowError) { + var error = rethrowError; + hasRethrowError = false; + rethrowError = null; + throw error; + } + } + + function hasCaughtError() { + return hasError; + } + + function clearCaughtError() { + if (hasError) { + var error = caughtError; + hasError = false; + caughtError = null; + return error; + } else { + (function () { + { + { + throw ReactError(Error('clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.')); + } + } + })(); + } + } + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + + var warningWithoutStack = function () {}; + + { + warningWithoutStack = function (condition, format) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + if (format === undefined) { + throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (args.length > 8) { + // Check before the condition to catch violations early. + throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); + } + + if (condition) { + return; + } + + if (typeof console !== 'undefined') { + var argsWithFormat = args.map(function (item) { + return '' + item; + }); + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + + Function.prototype.apply.call(console.error, console, argsWithFormat); + } + + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + throw new Error(message); + } catch (x) {} + }; + } + var warningWithoutStack$1 = warningWithoutStack; + var getFiberCurrentPropsFromNode = null; + var getInstanceFromNode = null; + var getNodeFromInstance = null; + + function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { + getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; + getInstanceFromNode = getInstanceFromNodeImpl; + getNodeFromInstance = getNodeFromInstanceImpl; + { + !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; + } + } + + var validateEventDispatches = void 0; + { + validateEventDispatches = function (event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + var listenersIsArr = Array.isArray(dispatchListeners); + var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; + var instancesIsArr = Array.isArray(dispatchInstances); + var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0; + }; + } + /** + * Dispatch the event to the listener. + * @param {SyntheticEvent} event SyntheticEvent to handle + * @param {function} listener Application-level callback + * @param {*} inst Internal component instance + */ + + function executeDispatch(event, listener, inst) { + var type = event.type || 'unknown-event'; + event.currentTarget = getNodeFromInstance(inst); + invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); + event.currentTarget = null; + } + /** + * Standard/simple iteration through an event's collected dispatches. + */ + + + function executeDispatchesInOrder(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + { + validateEventDispatches(event); + } + + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } // Listeners and Instances are two parallel arrays that are always in sync. + + + executeDispatch(event, dispatchListeners[i], dispatchInstances[i]); + } + } else if (dispatchListeners) { + executeDispatch(event, dispatchListeners, dispatchInstances); + } + + event._dispatchListeners = null; + event._dispatchInstances = null; + } + /** + * @see executeDispatchesInOrderStopAtTrueImpl + */ + + /** + * Execution of a "direct" dispatch - there must be at most one dispatch + * accumulated on the event or it is considered an error. It doesn't really make + * sense for an event with multiple dispatches (bubbled) to keep track of the + * return values at each dispatch execution, but it does tend to make sense when + * dealing with "direct" dispatches. + * + * @return {*} The return value of executing the single dispatch. + */ + + /** + * @param {SyntheticEvent} event + * @return {boolean} True iff number of dispatches accumulated is greater than 0. + */ + + /** + * Accumulates items that must not be null or undefined into the first one. This + * is used to conserve memory by avoiding array allocations, and thus sacrifices + * API cleanness. Since `current` can be null before being passed in and not + * null after this function, make sure to assign it back to `current`: + * + * `a = accumulateInto(a, b);` + * + * This API should be sparingly used. Try `accumulate` for something cleaner. + * + * @return {*|array<*>} An accumulation of items. + */ + + + function accumulateInto(current, next) { + (function () { + if (!(next != null)) { + { + throw ReactError(Error('accumulateInto(...): Accumulated items must not be null or undefined.')); + } + } + })(); + + if (current == null) { + return next; + } // Both are not empty. Warning: Never call x.concat(y) when you are not + // certain that x is an Array (x could be a string with concat method). + + + if (Array.isArray(current)) { + if (Array.isArray(next)) { + current.push.apply(current, next); + return current; + } + + current.push(next); + return current; + } + + if (Array.isArray(next)) { + // A bit too dangerous to mutate `next`. + return [current].concat(next); + } + + return [current, next]; + } + /** + * @param {array} arr an "accumulation" of items which is either an Array or + * a single item. Useful when paired with the `accumulate` module. This is a + * simple utility that allows us to reason about a collection of items, but + * handling the case when there is exactly one item (and we do not need to + * allocate an array). + * @param {function} cb Callback invoked with each element or a collection. + * @param {?} [scope] Scope used as `this` in a callback. + */ + + + function forEachAccumulated(arr, cb, scope) { + if (Array.isArray(arr)) { + arr.forEach(cb, scope); + } else if (arr) { + cb.call(scope, arr); + } + } + /** + * Internal queue of events that have accumulated their dispatches and are + * waiting to have their dispatches executed. + */ + + + var eventQueue = null; + /** + * Dispatches an event and releases it back into the pool, unless persistent. + * + * @param {?object} event Synthetic event to be dispatched. + * @private + */ + + var executeDispatchesAndRelease = function (event) { + if (event) { + executeDispatchesInOrder(event); + + if (!event.isPersistent()) { + event.constructor.release(event); + } + } + }; + + var executeDispatchesAndReleaseTopLevel = function (e) { + return executeDispatchesAndRelease(e); + }; + + function runEventsInBatch(events) { + if (events !== null) { + eventQueue = accumulateInto(eventQueue, events); + } // Set `eventQueue` to null before processing it so that we can tell if more + // events get enqueued while processing. + + + var processingEventQueue = eventQueue; + eventQueue = null; + + if (!processingEventQueue) { + return; + } + + forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); + + (function () { + if (!!eventQueue) { + { + throw ReactError(Error('processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.')); + } + } + })(); // This would be a good time to rethrow if any of the event handlers threw. + + + rethrowCaughtError(); + } + + function isInteractive(tag) { + return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; + } + + function shouldPreventMouseEvent(name, type, props) { + switch (name) { + case 'onClick': + case 'onClickCapture': + case 'onDoubleClick': + case 'onDoubleClickCapture': + case 'onMouseDown': + case 'onMouseDownCapture': + case 'onMouseMove': + case 'onMouseMoveCapture': + case 'onMouseUp': + case 'onMouseUpCapture': + return !!(props.disabled && isInteractive(type)); + + default: + return false; + } + } + /** + * This is a unified interface for event plugins to be installed and configured. + * + * Event plugins can implement the following properties: + * + * `extractEvents` {function(string, DOMEventTarget, string, object): *} + * Required. When a top-level event is fired, this method is expected to + * extract synthetic events that will in turn be queued and dispatched. + * + * `eventTypes` {object} + * Optional, plugins that fire events must publish a mapping of registration + * names that are used to register listeners. Values of this mapping must + * be objects that contain `registrationName` or `phasedRegistrationNames`. + * + * `executeDispatch` {function(object, function, string)} + * Optional, allows plugins to override how an event gets dispatched. By + * default, the listener is simply invoked. + * + * Each plugin that is injected into `EventsPluginHub` is immediately operable. + * + * @public + */ + + /** + * Methods for injecting dependencies. + */ + + + var injection = { + /** + * @param {array} InjectedEventPluginOrder + * @public + */ + injectEventPluginOrder: injectEventPluginOrder, + + /** + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + */ + injectEventPluginsByName: injectEventPluginsByName + }; + /** + * @param {object} inst The instance, which is the source of events. + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @return {?function} The stored callback. + */ + + function getListener(inst, registrationName) { + var listener = void 0; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not + // live here; needs to be moved to a better place soon + + var stateNode = inst.stateNode; + + if (!stateNode) { + // Work in progress (ex: onload events in incremental mode). + return null; + } + + var props = getFiberCurrentPropsFromNode(stateNode); + + if (!props) { + // Work in progress. + return null; + } + + listener = props[registrationName]; + + if (shouldPreventMouseEvent(registrationName, inst.type, props)) { + return null; + } + + (function () { + if (!(!listener || typeof listener === 'function')) { + { + throw ReactError(Error('Expected `' + registrationName + '` listener to be a function, instead got a value of `' + typeof listener + '` type.')); + } + } + })(); + + return listener; + } + /** + * Allows registered plugins an opportunity to extract events from top-level + * native browser events. + * + * @return {*} An accumulation of synthetic events. + * @internal + */ + + + function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = null; + + for (var i = 0; i < plugins.length; i++) { + // Not every plugin in the ordering may be loaded at runtime. + var possiblePlugin = plugins[i]; + + if (possiblePlugin) { + var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + + if (extractedEvents) { + events = accumulateInto(events, extractedEvents); + } + } + } + + return events; + } + + function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + runEventsInBatch(events); + } + + var FunctionComponent = 0; + var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class + + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + + var HostComponent = 5; + var HostText = 6; + var Fragment = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedSuspenseComponent = 18; + var SuspenseListComponent = 19; + var FundamentalComponent = 20; + var randomKey = Math.random().toString(36).slice(2); + var internalInstanceKey = '__reactInternalInstance$' + randomKey; + var internalEventHandlersKey = '__reactEventHandlers$' + randomKey; + + function precacheFiberNode(hostInst, node) { + node[internalInstanceKey] = hostInst; + } + /** + * Given a DOM node, return the closest ReactDOMComponent or + * ReactDOMTextComponent instance ancestor. + */ + + + function getClosestInstanceFromNode(node) { + if (node[internalInstanceKey]) { + return node[internalInstanceKey]; + } + + while (!node[internalInstanceKey]) { + if (node.parentNode) { + node = node.parentNode; + } else { + // Top of the tree. This node must not be part of a React tree (or is + // unmounted, potentially). + return null; + } + } + + var inst = node[internalInstanceKey]; + + if (inst.tag === HostComponent || inst.tag === HostText) { + // In Fiber, this will always be the deepest root. + return inst; + } + + return null; + } + /** + * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent + * instance, or null if the node was not rendered by this React. + */ + + + function getInstanceFromNode$1(node) { + var inst = node[internalInstanceKey]; + + if (inst) { + if (inst.tag === HostComponent || inst.tag === HostText) { + return inst; + } else { + return null; + } + } + + return null; + } + /** + * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding + * DOM node. + */ + + + function getNodeFromInstance$1(inst) { + if (inst.tag === HostComponent || inst.tag === HostText) { + // In Fiber this, is just the state node right now. We assume it will be + // a host component or host text. + return inst.stateNode; + } // Without this first invariant, passing a non-DOM-component triggers the next + // invariant for a missing parent, which is super confusing. + + + (function () { + { + { + throw ReactError(Error('getNodeFromInstance: Invalid argument.')); + } + } + })(); + } + + function getFiberCurrentPropsFromNode$1(node) { + return node[internalEventHandlersKey] || null; + } + + function updateFiberProps(node, props) { + node[internalEventHandlersKey] = props; + } + + function getParent(inst) { + do { + inst = inst.return; // TODO: If this is a HostRoot we might want to bail out. + // That is depending on if we want nested subtrees (layers) to bubble + // events to their parent. We could also go through parentNode on the + // host node but that wouldn't work for React Native and doesn't let us + // do the portal feature. + } while (inst && inst.tag !== HostComponent); + + if (inst) { + return inst; + } + + return null; + } + /** + * Return the lowest common ancestor of A and B, or null if they are in + * different trees. + */ + + + function getLowestCommonAncestor(instA, instB) { + var depthA = 0; + + for (var tempA = instA; tempA; tempA = getParent(tempA)) { + depthA++; + } + + var depthB = 0; + + for (var tempB = instB; tempB; tempB = getParent(tempB)) { + depthB++; + } // If A is deeper, crawl up. + + + while (depthA - depthB > 0) { + instA = getParent(instA); + depthA--; + } // If B is deeper, crawl up. + + + while (depthB - depthA > 0) { + instB = getParent(instB); + depthB--; + } // Walk in lockstep until we find a match. + + + var depth = depthA; + + while (depth--) { + if (instA === instB || instA === instB.alternate) { + return instA; + } + + instA = getParent(instA); + instB = getParent(instB); + } + + return null; + } + /** + * Return if A is an ancestor of B. + */ + + /** + * Return the parent instance of the passed-in instance. + */ + + /** + * Simulates the traversal of a two-phase, capture/bubble event dispatch. + */ + + + function traverseTwoPhase(inst, fn, arg) { + var path = []; + + while (inst) { + path.push(inst); + inst = getParent(inst); + } + + var i = void 0; + + for (i = path.length; i-- > 0;) { + fn(path[i], 'captured', arg); + } + + for (i = 0; i < path.length; i++) { + fn(path[i], 'bubbled', arg); + } + } + /** + * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that + * should would receive a `mouseEnter` or `mouseLeave` event. + * + * Does not invoke the callback on the nearest common ancestor because nothing + * "entered" or "left" that element. + */ + + + function traverseEnterLeave(from, to, fn, argFrom, argTo) { + var common = from && to ? getLowestCommonAncestor(from, to) : null; + var pathFrom = []; + + while (true) { + if (!from) { + break; + } + + if (from === common) { + break; + } + + var alternate = from.alternate; + + if (alternate !== null && alternate === common) { + break; + } + + pathFrom.push(from); + from = getParent(from); + } + + var pathTo = []; + + while (true) { + if (!to) { + break; + } + + if (to === common) { + break; + } + + var _alternate = to.alternate; + + if (_alternate !== null && _alternate === common) { + break; + } + + pathTo.push(to); + to = getParent(to); + } + + for (var i = 0; i < pathFrom.length; i++) { + fn(pathFrom[i], 'bubbled', argFrom); + } + + for (var _i = pathTo.length; _i-- > 0;) { + fn(pathTo[_i], 'captured', argTo); + } + } + /** + * Some event types have a notion of different registration names for different + * "phases" of propagation. This finds listeners by a given phase. + */ + + + function listenerAtPhase(inst, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListener(inst, registrationName); + } + /** + * A small set of propagation patterns, each of which will accept a small amount + * of information, and generate a set of "dispatch ready event objects" - which + * are sets of events that have already been annotated with a set of dispatched + * listener functions/ids. The API is designed this way to discourage these + * propagation strategies from actually executing the dispatches, since we + * always want to collect the entire set of dispatches before executing even a + * single one. + */ + + /** + * Tags a `SyntheticEvent` with dispatched listeners. Creating this function + * here, allows us to not have to bind or create functions for each event. + * Mutating the event's members allows us to not have to create a wrapping + * "dispatch" object that pairs the event with the listener. + */ + + + function accumulateDirectionalDispatches(inst, phase, event) { + { + !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0; + } + var listener = listenerAtPhase(inst, event, phase); + + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + } + /** + * Collect dispatches (must be entirely collected before dispatching - see unit + * tests). Lazily allocate the array to conserve memory. We must loop through + * each event and perform the traversal for each one. We cannot perform a + * single traversal for the entire collection of events because each event may + * have a different target. + */ + + + function accumulateTwoPhaseDispatchesSingle(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); + } + } + /** + * Accumulates without regard to direction, does not look for phased + * registration names. Same as `accumulateDirectDispatchesSingle` but without + * requiring that the `dispatchMarker` be the same as the dispatched ID. + */ + + + function accumulateDispatches(inst, ignoredDirection, event) { + if (inst && event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName; + var listener = getListener(inst, registrationName); + + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + } + } + /** + * Accumulates dispatches on an `SyntheticEvent`, but only for the + * `dispatchMarker`. + * @param {SyntheticEvent} event + */ + + + function accumulateDirectDispatchesSingle(event) { + if (event && event.dispatchConfig.registrationName) { + accumulateDispatches(event._targetInst, null, event); + } + } + + function accumulateTwoPhaseDispatches(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); + } + + function accumulateEnterLeaveDispatches(leave, enter, from, to) { + traverseEnterLeave(from, to, accumulateDispatches, leave, enter); + } + + function accumulateDirectDispatches(events) { + forEachAccumulated(events, accumulateDirectDispatchesSingle); + } + + var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); // Do not use the below two methods directly! + // Instead use constants exported from DOMTopLevelEventTypes in ReactDOM. + // (It is the only module that is allowed to access these methods.) + + function unsafeCastStringToDOMTopLevelType(topLevelType) { + return topLevelType; + } + + function unsafeCastDOMTopLevelTypeToString(topLevelType) { + return topLevelType; + } + /** + * Generate a mapping of standard vendor prefixes using the defined style property and event name. + * + * @param {string} styleProp + * @param {string} eventName + * @returns {object} + */ + + + function makePrefixMap(styleProp, eventName) { + var prefixes = {}; + prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); + prefixes['Webkit' + styleProp] = 'webkit' + eventName; + prefixes['Moz' + styleProp] = 'moz' + eventName; + return prefixes; + } + /** + * A list of event names to a configurable list of vendor prefixes. + */ + + + var vendorPrefixes = { + animationend: makePrefixMap('Animation', 'AnimationEnd'), + animationiteration: makePrefixMap('Animation', 'AnimationIteration'), + animationstart: makePrefixMap('Animation', 'AnimationStart'), + transitionend: makePrefixMap('Transition', 'TransitionEnd') + }; + /** + * Event names that have already been detected and prefixed (if applicable). + */ + + var prefixedEventNames = {}; + /** + * Element to check for prefixes on. + */ + + var style = {}; + /** + * Bootstrap if a DOM exists. + */ + + if (canUseDOM) { + style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x, + // the un-prefixed "animation" and "transition" properties are defined on the + // style object but the events that fire will still be prefixed, so we need + // to check if the un-prefixed events are usable, and if not remove them from the map. + + if (!('AnimationEvent' in window)) { + delete vendorPrefixes.animationend.animation; + delete vendorPrefixes.animationiteration.animation; + delete vendorPrefixes.animationstart.animation; + } // Same as above + + + if (!('TransitionEvent' in window)) { + delete vendorPrefixes.transitionend.transition; + } + } + /** + * Attempts to determine the correct vendor prefixed event name. + * + * @param {string} eventName + * @returns {string} + */ + + + function getVendorPrefixedEventName(eventName) { + if (prefixedEventNames[eventName]) { + return prefixedEventNames[eventName]; + } else if (!vendorPrefixes[eventName]) { + return eventName; + } + + var prefixMap = vendorPrefixes[eventName]; + + for (var styleProp in prefixMap) { + if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) { + return prefixedEventNames[eventName] = prefixMap[styleProp]; + } + } + + return eventName; + } + /** + * To identify top level events in ReactDOM, we use constants defined by this + * module. This is the only module that uses the unsafe* methods to express + * that the constants actually correspond to the browser event names. This lets + * us save some bundle size by avoiding a top level type -> event name map. + * The rest of ReactDOM code should import top level types from this file. + */ + + + var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort'); + var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend')); + var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration')); + var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart')); + var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur'); + var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay'); + var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough'); + var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel'); + var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change'); + var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click'); + var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close'); + var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend'); + var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart'); + var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate'); + var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu'); + var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy'); + var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut'); + var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick'); + var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick'); + var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag'); + var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend'); + var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter'); + var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit'); + var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave'); + var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover'); + var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart'); + var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop'); + var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange'); + var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied'); + var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted'); + var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended'); + var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error'); + var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus'); + var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture'); + var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input'); + var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid'); + var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown'); + var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress'); + var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup'); + var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load'); + var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart'); + var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata'); + var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata'); + var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture'); + var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown'); + var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove'); + var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout'); + var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover'); + var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup'); + var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste'); + var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause'); + var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play'); + var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing'); + var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel'); + var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown'); + var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove'); + var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout'); + var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover'); + var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup'); + var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress'); + var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange'); + var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset'); + var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll'); + var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked'); + var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking'); + var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange'); + var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled'); + var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit'); + var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend'); + var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput'); + var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate'); + var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle'); + var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel'); + var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend'); + var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove'); + var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart'); + var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend')); + var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange'); + var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting'); + var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements. + // Note that events in this list will *not* be listened to at the top level + // unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`. + + var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING]; + + function getRawEventName(topLevelType) { + return unsafeCastDOMTopLevelTypeToString(topLevelType); + } + /** + * These variables store information about text content of a target node, + * allowing comparison of content before and after a given event. + * + * Identify the node where selection currently begins, then observe + * both its text content and its current position in the DOM. Since the + * browser may natively replace the target node during composition, we can + * use its position to find its replacement. + * + * + */ + + + var root = null; + var startText = null; + var fallbackText = null; + + function initialize(nativeEventTarget) { + root = nativeEventTarget; + startText = getText(); + return true; + } + + function reset() { + root = null; + startText = null; + fallbackText = null; + } + + function getData() { + if (fallbackText) { + return fallbackText; + } + + var start = void 0; + var startValue = startText; + var startLength = startValue.length; + var end = void 0; + var endValue = getText(); + var endLength = endValue.length; + + for (start = 0; start < startLength; start++) { + if (startValue[start] !== endValue[start]) { + break; + } + } + + var minEnd = startLength - start; + + for (end = 1; end <= minEnd; end++) { + if (startValue[startLength - end] !== endValue[endLength - end]) { + break; + } + } + + var sliceTail = end > 1 ? 1 - end : undefined; + fallbackText = endValue.slice(start, sliceTail); + return fallbackText; + } + + function getText() { + if ('value' in root) { + return root.value; + } + + return root.textContent; + } + /* eslint valid-typeof: 0 */ + + + var EVENT_POOL_SIZE = 10; + /** + * @interface Event + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + + var EventInterface = { + type: null, + target: null, + // currentTarget is set when dispatching; no use in copying it here + currentTarget: function () { + return null; + }, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function (event) { + return event.timeStamp || Date.now(); + }, + defaultPrevented: null, + isTrusted: null + }; + + function functionThatReturnsTrue() { + return true; + } + + function functionThatReturnsFalse() { + return false; + } + /** + * Synthetic events are dispatched by event plugins, typically in response to a + * top-level event delegation handler. + * + * These systems should generally use pooling to reduce the frequency of garbage + * collection. The system should check `isPersistent` to determine whether the + * event should be released into the pool after being dispatched. Users that + * need a persisted event should invoke `persist`. + * + * Synthetic events (and subclasses) implement the DOM Level 3 Events API by + * normalizing browser quirks. Subclasses do not necessarily have to implement a + * DOM interface; custom application-specific events can also subclass this. + * + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {*} targetInst Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @param {DOMEventTarget} nativeEventTarget Target node. + */ + + + function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { + { + // these have a getter/setter for warnings + delete this.nativeEvent; + delete this.preventDefault; + delete this.stopPropagation; + delete this.isDefaultPrevented; + delete this.isPropagationStopped; + } + this.dispatchConfig = dispatchConfig; + this._targetInst = targetInst; + this.nativeEvent = nativeEvent; + var Interface = this.constructor.Interface; + + for (var propName in Interface) { + if (!Interface.hasOwnProperty(propName)) { + continue; + } + + { + delete this[propName]; // this has a getter/setter for warnings + } + var normalize = Interface[propName]; + + if (normalize) { + this[propName] = normalize(nativeEvent); + } else { + if (propName === 'target') { + this.target = nativeEventTarget; + } else { + this[propName] = nativeEvent[propName]; + } + } + } + + var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; + + if (defaultPrevented) { + this.isDefaultPrevented = functionThatReturnsTrue; + } else { + this.isDefaultPrevented = functionThatReturnsFalse; + } + + this.isPropagationStopped = functionThatReturnsFalse; + return this; + } + + _assign(SyntheticEvent.prototype, { + preventDefault: function () { + this.defaultPrevented = true; + var event = this.nativeEvent; + + if (!event) { + return; + } + + if (event.preventDefault) { + event.preventDefault(); + } else if (typeof event.returnValue !== 'unknown') { + event.returnValue = false; + } + + this.isDefaultPrevented = functionThatReturnsTrue; + }, + stopPropagation: function () { + var event = this.nativeEvent; + + if (!event) { + return; + } + + if (event.stopPropagation) { + event.stopPropagation(); + } else if (typeof event.cancelBubble !== 'unknown') { + // The ChangeEventPlugin registers a "propertychange" event for + // IE. This event does not support bubbling or cancelling, and + // any references to cancelBubble throw "Member not found". A + // typeof check of "unknown" circumvents this issue (and is also + // IE specific). + event.cancelBubble = true; + } + + this.isPropagationStopped = functionThatReturnsTrue; + }, + + /** + * We release all dispatched `SyntheticEvent`s after each event loop, adding + * them back into the pool. This allows a way to hold onto a reference that + * won't be added back into the pool. + */ + persist: function () { + this.isPersistent = functionThatReturnsTrue; + }, + + /** + * Checks if this event should be released back into the pool. + * + * @return {boolean} True if this should not be released, false otherwise. + */ + isPersistent: functionThatReturnsFalse, + + /** + * `PooledClass` looks for `destructor` on each instance it releases. + */ + destructor: function () { + var Interface = this.constructor.Interface; + + for (var propName in Interface) { + { + Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); + } + } + + this.dispatchConfig = null; + this._targetInst = null; + this.nativeEvent = null; + this.isDefaultPrevented = functionThatReturnsFalse; + this.isPropagationStopped = functionThatReturnsFalse; + this._dispatchListeners = null; + this._dispatchInstances = null; + { + Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); + Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse)); + Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse)); + Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {})); + Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {})); + } + } + }); + + SyntheticEvent.Interface = EventInterface; + /** + * Helper to reduce boilerplate when creating subclasses. + */ + + SyntheticEvent.extend = function (Interface) { + var Super = this; + + var E = function () {}; + + E.prototype = Super.prototype; + var prototype = new E(); + + function Class() { + return Super.apply(this, arguments); + } + + _assign(prototype, Class.prototype); + + Class.prototype = prototype; + Class.prototype.constructor = Class; + Class.Interface = _assign({}, Super.Interface, Interface); + Class.extend = Super.extend; + addEventPoolingTo(Class); + return Class; + }; + + addEventPoolingTo(SyntheticEvent); + /** + * Helper to nullify syntheticEvent instance properties when destructing + * + * @param {String} propName + * @param {?object} getVal + * @return {object} defineProperty object + */ + + function getPooledWarningPropertyDefinition(propName, getVal) { + var isFunction = typeof getVal === 'function'; + return { + configurable: true, + set: set, + get: get + }; + + function set(val) { + var action = isFunction ? 'setting the method' : 'setting the property'; + warn(action, 'This is effectively a no-op'); + return val; + } + + function get() { + var action = isFunction ? 'accessing the method' : 'accessing the property'; + var result = isFunction ? 'This is a no-op function' : 'This is set to null'; + warn(action, result); + return getVal; + } + + function warn(action, result) { + var warningCondition = false; + !warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0; + } + } + + function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { + var EventConstructor = this; + + if (EventConstructor.eventPool.length) { + var instance = EventConstructor.eventPool.pop(); + EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); + return instance; + } + + return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst); + } + + function releasePooledEvent(event) { + var EventConstructor = this; + + (function () { + if (!(event instanceof EventConstructor)) { + { + throw ReactError(Error('Trying to release an event instance into a pool of a different type.')); + } + } + })(); + + event.destructor(); + + if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) { + EventConstructor.eventPool.push(event); + } + } + + function addEventPoolingTo(EventConstructor) { + EventConstructor.eventPool = []; + EventConstructor.getPooled = getPooledEvent; + EventConstructor.release = releasePooledEvent; + } + /** + * @interface Event + * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents + */ + + + var SyntheticCompositionEvent = SyntheticEvent.extend({ + data: null + }); + /** + * @interface Event + * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 + * /#events-inputevents + */ + + var SyntheticInputEvent = SyntheticEvent.extend({ + data: null + }); + var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space + + var START_KEYCODE = 229; + var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window; + var documentMode = null; + + if (canUseDOM && 'documentMode' in document) { + documentMode = document.documentMode; + } // Webkit offers a very useful `textInput` event that can be used to + // directly represent `beforeInput`. The IE `textinput` event is not as + // useful, so we don't use it. + + + var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied + // by the native compositionend event may be incorrect. Japanese ideographic + // spaces, for instance (\u3000) are not recorded correctly. + + var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); + var SPACEBAR_CODE = 32; + var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); // Events and their corresponding property names. + + var eventTypes = { + beforeInput: { + phasedRegistrationNames: { + bubbled: 'onBeforeInput', + captured: 'onBeforeInputCapture' + }, + dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE] + }, + compositionEnd: { + phasedRegistrationNames: { + bubbled: 'onCompositionEnd', + captured: 'onCompositionEndCapture' + }, + dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN] + }, + compositionStart: { + phasedRegistrationNames: { + bubbled: 'onCompositionStart', + captured: 'onCompositionStartCapture' + }, + dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN] + }, + compositionUpdate: { + phasedRegistrationNames: { + bubbled: 'onCompositionUpdate', + captured: 'onCompositionUpdateCapture' + }, + dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN] + } + }; // Track whether we've ever handled a keypress on the space key. + + var hasSpaceKeypress = false; + /** + * Return whether a native keypress event is assumed to be a command. + * This is required because Firefox fires `keypress` events for key commands + * (cut, copy, select-all, etc.) even though no character is inserted. + */ + + function isKeypressCommand(nativeEvent) { + return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command. + !(nativeEvent.ctrlKey && nativeEvent.altKey); + } + /** + * Translate native top level events into event types. + * + * @param {string} topLevelType + * @return {object} + */ + + + function getCompositionEventType(topLevelType) { + switch (topLevelType) { + case TOP_COMPOSITION_START: + return eventTypes.compositionStart; + + case TOP_COMPOSITION_END: + return eventTypes.compositionEnd; + + case TOP_COMPOSITION_UPDATE: + return eventTypes.compositionUpdate; + } + } + /** + * Does our fallback best-guess model think this event signifies that + * composition has begun? + * + * @param {string} topLevelType + * @param {object} nativeEvent + * @return {boolean} + */ + + + function isFallbackCompositionStart(topLevelType, nativeEvent) { + return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE; + } + /** + * Does our fallback mode think that this event is the end of composition? + * + * @param {string} topLevelType + * @param {object} nativeEvent + * @return {boolean} + */ + + + function isFallbackCompositionEnd(topLevelType, nativeEvent) { + switch (topLevelType) { + case TOP_KEY_UP: + // Command keys insert or clear IME input. + return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; + + case TOP_KEY_DOWN: + // Expect IME keyCode on each keydown. If we get any other + // code we must have exited earlier. + return nativeEvent.keyCode !== START_KEYCODE; + + case TOP_KEY_PRESS: + case TOP_MOUSE_DOWN: + case TOP_BLUR: + // Events are not possible without cancelling IME. + return true; + + default: + return false; + } + } + /** + * Google Input Tools provides composition data via a CustomEvent, + * with the `data` property populated in the `detail` object. If this + * is available on the event object, use it. If not, this is a plain + * composition event and we have nothing special to extract. + * + * @param {object} nativeEvent + * @return {?string} + */ + + + function getDataFromCustomEvent(nativeEvent) { + var detail = nativeEvent.detail; + + if (typeof detail === 'object' && 'data' in detail) { + return detail.data; + } + + return null; + } + /** + * Check if a composition event was triggered by Korean IME. + * Our fallback mode does not work well with IE's Korean IME, + * so just use native composition events when Korean IME is used. + * Although CompositionEvent.locale property is deprecated, + * it is available in IE, where our fallback mode is enabled. + * + * @param {object} nativeEvent + * @return {boolean} + */ + + + function isUsingKoreanIME(nativeEvent) { + return nativeEvent.locale === 'ko'; + } // Track the current IME composition status, if any. + + + var isComposing = false; + /** + * @return {?object} A SyntheticCompositionEvent. + */ + + function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var eventType = void 0; + var fallbackData = void 0; + + if (canUseCompositionEvent) { + eventType = getCompositionEventType(topLevelType); + } else if (!isComposing) { + if (isFallbackCompositionStart(topLevelType, nativeEvent)) { + eventType = eventTypes.compositionStart; + } + } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) { + eventType = eventTypes.compositionEnd; + } + + if (!eventType) { + return null; + } + + if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) { + // The current composition is stored statically and must not be + // overwritten while composition continues. + if (!isComposing && eventType === eventTypes.compositionStart) { + isComposing = initialize(nativeEventTarget); + } else if (eventType === eventTypes.compositionEnd) { + if (isComposing) { + fallbackData = getData(); + } + } + } + + var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget); + + if (fallbackData) { + // Inject data generated from fallback path into the synthetic event. + // This matches the property of native CompositionEventInterface. + event.data = fallbackData; + } else { + var customData = getDataFromCustomEvent(nativeEvent); + + if (customData !== null) { + event.data = customData; + } + } + + accumulateTwoPhaseDispatches(event); + return event; + } + /** + * @param {TopLevelType} topLevelType Number from `TopLevelType`. + * @param {object} nativeEvent Native browser event. + * @return {?string} The string corresponding to this `beforeInput` event. + */ + + + function getNativeBeforeInputChars(topLevelType, nativeEvent) { + switch (topLevelType) { + case TOP_COMPOSITION_END: + return getDataFromCustomEvent(nativeEvent); + + case TOP_KEY_PRESS: + /** + * If native `textInput` events are available, our goal is to make + * use of them. However, there is a special case: the spacebar key. + * In Webkit, preventing default on a spacebar `textInput` event + * cancels character insertion, but it *also* causes the browser + * to fall back to its default spacebar behavior of scrolling the + * page. + * + * Tracking at: + * https://code.google.com/p/chromium/issues/detail?id=355103 + * + * To avoid this issue, use the keypress event as if no `textInput` + * event is available. + */ + var which = nativeEvent.which; + + if (which !== SPACEBAR_CODE) { + return null; + } + + hasSpaceKeypress = true; + return SPACEBAR_CHAR; + + case TOP_TEXT_INPUT: + // Record the characters to be added to the DOM. + var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled + // it at the keypress level and bail immediately. Android Chrome + // doesn't give us keycodes, so we need to ignore it. + + if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { + return null; + } + + return chars; + + default: + // For other native event types, do nothing. + return null; + } + } + /** + * For browsers that do not provide the `textInput` event, extract the + * appropriate string to use for SyntheticInputEvent. + * + * @param {number} topLevelType Number from `TopLevelEventTypes`. + * @param {object} nativeEvent Native browser event. + * @return {?string} The fallback string for this `beforeInput` event. + */ + + + function getFallbackBeforeInputChars(topLevelType, nativeEvent) { + // If we are currently composing (IME) and using a fallback to do so, + // try to extract the composed characters from the fallback object. + // If composition event is available, we extract a string only at + // compositionevent, otherwise extract it at fallback events. + if (isComposing) { + if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) { + var chars = getData(); + reset(); + isComposing = false; + return chars; + } + + return null; + } + + switch (topLevelType) { + case TOP_PASTE: + // If a paste event occurs after a keypress, throw out the input + // chars. Paste events should not lead to BeforeInput events. + return null; + + case TOP_KEY_PRESS: + /** + * As of v27, Firefox may fire keypress events even when no character + * will be inserted. A few possibilities: + * + * - `which` is `0`. Arrow keys, Esc key, etc. + * + * - `which` is the pressed key code, but no char is available. + * Ex: 'AltGr + d` in Polish. There is no modified character for + * this key combination and no character is inserted into the + * document, but FF fires the keypress for char code `100` anyway. + * No `input` event will occur. + * + * - `which` is the pressed key code, but a command combination is + * being used. Ex: `Cmd+C`. No character is inserted, and no + * `input` event will occur. + */ + if (!isKeypressCommand(nativeEvent)) { + // IE fires the `keypress` event when a user types an emoji via + // Touch keyboard of Windows. In such a case, the `char` property + // holds an emoji character like `\uD83D\uDE0A`. Because its length + // is 2, the property `which` does not represent an emoji correctly. + // In such a case, we directly return the `char` property instead of + // using `which`. + if (nativeEvent.char && nativeEvent.char.length > 1) { + return nativeEvent.char; + } else if (nativeEvent.which) { + return String.fromCharCode(nativeEvent.which); + } + } + + return null; + + case TOP_COMPOSITION_END: + return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data; + + default: + return null; + } + } + /** + * Extract a SyntheticInputEvent for `beforeInput`, based on either native + * `textInput` or fallback behavior. + * + * @return {?object} A SyntheticInputEvent. + */ + + + function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var chars = void 0; + + if (canUseTextInputEvent) { + chars = getNativeBeforeInputChars(topLevelType, nativeEvent); + } else { + chars = getFallbackBeforeInputChars(topLevelType, nativeEvent); + } // If no characters are being inserted, no BeforeInput event should + // be fired. + + + if (!chars) { + return null; + } + + var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget); + event.data = chars; + accumulateTwoPhaseDispatches(event); + return event; + } + /** + * Create an `onBeforeInput` event to match + * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. + * + * This event plugin is based on the native `textInput` event + * available in Chrome, Safari, Opera, and IE. This event fires after + * `onKeyPress` and `onCompositionEnd`, but before `onInput`. + * + * `beforeInput` is spec'd but not implemented in any browsers, and + * the `input` event does not provide any useful information about what has + * actually been added, contrary to the spec. Thus, `textInput` is the best + * available event to identify the characters that have actually been inserted + * into the target node. + * + * This plugin is also responsible for emitting `composition` events, thus + * allowing us to share composition fallback code for both `beforeInput` and + * `composition` event types. + */ + + + var BeforeInputEventPlugin = { + eventTypes: eventTypes, + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget); + var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget); + + if (composition === null) { + return beforeInput; + } + + if (beforeInput === null) { + return composition; + } + + return [composition, beforeInput]; + } + }; // Use to restore controlled state after a change event has fired. + + var restoreImpl = null; + var restoreTarget = null; + var restoreQueue = null; + + function restoreStateOfTarget(target) { + // We perform this translation at the end of the event loop so that we + // always receive the correct fiber here + var internalInstance = getInstanceFromNode(target); + + if (!internalInstance) { + // Unmounted + return; + } + + (function () { + if (!(typeof restoreImpl === 'function')) { + { + throw ReactError(Error('setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.')); + } + } + })(); + + var props = getFiberCurrentPropsFromNode(internalInstance.stateNode); + restoreImpl(internalInstance.stateNode, internalInstance.type, props); + } + + function setRestoreImplementation(impl) { + restoreImpl = impl; + } + + function enqueueStateRestore(target) { + if (restoreTarget) { + if (restoreQueue) { + restoreQueue.push(target); + } else { + restoreQueue = [target]; + } + } else { + restoreTarget = target; + } + } + + function needsStateRestore() { + return restoreTarget !== null || restoreQueue !== null; + } + + function restoreStateIfNeeded() { + if (!restoreTarget) { + return; + } + + var target = restoreTarget; + var queuedTargets = restoreQueue; + restoreTarget = null; + restoreQueue = null; + restoreStateOfTarget(target); + + if (queuedTargets) { + for (var i = 0; i < queuedTargets.length; i++) { + restoreStateOfTarget(queuedTargets[i]); + } + } + } + + var enableUserTimingAPI = true; // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: + + var debugRenderPhaseSideEffects = false; // In some cases, StrictMode should also double-render lifecycles. + // This can be confusing for tests though, + // And it can be bad for performance in production. + // This feature flag can be used to control the behavior: + + var debugRenderPhaseSideEffectsForStrictMode = true; // To preserve the "Pause on caught exceptions" behavior of the debugger, we + // replay the begin phase of a failed component inside invokeGuardedCallback. + + var replayFailedUnitOfWorkWithInvokeGuardedCallback = true; // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: + + var warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees. + + var enableProfilerTimer = true; // Trace which interactions trigger each commit. + + var enableSchedulerTracing = true; // Only used in www builds. + + var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false. + // Only used in www builds. + // Only used in www builds. + // Disable javascript: URL strings in href for XSS protection. + + var disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing + // with their related DOM properties + + var disableInputAttributeSyncing = false; // These APIs will no longer be "unstable" in the upcoming 16.7 release, + // Control this behavior with a flag to support 16.6 minor releases in the meanwhile. + + var enableStableConcurrentModeAPIs = false; + var warnAboutShorthandPropertyCollision = false; // See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information + // This is a flag so we can fix warnings in RN core before turning it on + // Experimental React Flare event system and event components support. + + var enableFlareAPI = false; // Experimental Host Component support. + + var enableFundamentalAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107 + // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) + // Till then, we warn about the missing mock, but still fallback to a sync mode compatible version + + var warnAboutUnmockedScheduler = false; // Temporary flag to revert the fix in #15650 + + var revertPassiveEffectsChange = false; // For tests, we flush suspense fallbacks in an act scope; + // *except* in some of our own tests, where we test incremental loading states. + + var flushSuspenseFallbacksInTests = true; // Changes priority of some events like mousemove to user-blocking priority, + // but without making them discrete. The flag exists in case it causes + // starvation problems. + + var enableUserBlockingEvents = false; // Add a callback property to suspense to notify which promises are currently + // in the update queue. This allows reporting and tracing of what is causing + // the user to see a loading state. + + var enableSuspenseCallback = false; // Part of the simplification of React.createElement so we can eventually move + // from React.createElement to React.jsx + // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md + + var warnAboutDefaultPropsOnFunctionComponents = false; + var disableLegacyContext = false; + var disableSchedulerTimeoutBasedOnReactExpirationTime = false; // Used as a way to call batchedUpdates when we don't have a reference to + // the renderer. Such as when we're dispatching events or if third party + // libraries need to call batchedUpdates. Eventually, this API will go away when + // everything is batched by default. We'll then have a similar API to opt-out of + // scheduled work and instead do synchronous work. + // Defaults + + var batchedUpdatesImpl = function (fn, bookkeeping) { + return fn(bookkeeping); + }; + + var discreteUpdatesImpl = function (fn, a, b, c) { + return fn(a, b, c); + }; + + var flushDiscreteUpdatesImpl = function () {}; + + var batchedEventUpdatesImpl = batchedUpdatesImpl; + var isInsideEventHandler = false; + + function finishEventHandler() { + // Here we wait until all updates have propagated, which is important + // when using controlled components within layers: + // https://github.com/facebook/react/issues/1698 + // Then we restore state of any controlled component. + var controlledComponentsHavePendingUpdates = needsStateRestore(); + + if (controlledComponentsHavePendingUpdates) { + // If a controlled event was fired, we may need to restore the state of + // the DOM node back to the controlled value. This is necessary when React + // bails out of the update without touching the DOM. + flushDiscreteUpdatesImpl(); + restoreStateIfNeeded(); + } + } + + function batchedUpdates(fn, bookkeeping) { + if (isInsideEventHandler) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(bookkeeping); + } + + isInsideEventHandler = true; + + try { + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = false; + finishEventHandler(); + } + } + + function batchedEventUpdates(fn, a, b) { + if (isInsideEventHandler) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(a, b); + } + + isInsideEventHandler = true; + + try { + return batchedEventUpdatesImpl(fn, a, b); + } finally { + isInsideEventHandler = false; + finishEventHandler(); + } + } + + function discreteUpdates(fn, a, b, c) { + var prevIsInsideEventHandler = isInsideEventHandler; + isInsideEventHandler = true; + + try { + return discreteUpdatesImpl(fn, a, b, c); + } finally { + isInsideEventHandler = prevIsInsideEventHandler; + + if (!isInsideEventHandler) { + finishEventHandler(); + } + } + } + + var lastFlushedEventTimeStamp = 0; + + function flushDiscreteUpdatesIfNeeded(timeStamp) { + // event.timeStamp isn't overly reliable due to inconsistencies in + // how different browsers have historically provided the time stamp. + // Some browsers provide high-resolution time stamps for all events, + // some provide low-resolution time stamps for all events. FF < 52 + // even mixes both time stamps together. Some browsers even report + // negative time stamps or time stamps that are 0 (iOS9) in some cases. + // Given we are only comparing two time stamps with equality (!==), + // we are safe from the resolution differences. If the time stamp is 0 + // we bail-out of preventing the flush, which can affect semantics, + // such as if an earlier flush removes or adds event listeners that + // are fired in the subsequent flush. However, this is the same + // behaviour as we had before this change, so the risks are low. + if (!isInsideEventHandler && (!enableFlareAPI || timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)) { + lastFlushedEventTimeStamp = timeStamp; + flushDiscreteUpdatesImpl(); + } + } + + function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) { + batchedUpdatesImpl = _batchedUpdatesImpl; + discreteUpdatesImpl = _discreteUpdatesImpl; + flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl; + batchedEventUpdatesImpl = _batchedEventUpdatesImpl; + } + /** + * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary + */ + + + var supportedInputTypes = { + color: true, + date: true, + datetime: true, + 'datetime-local': true, + email: true, + month: true, + number: true, + password: true, + range: true, + search: true, + tel: true, + text: true, + time: true, + url: true, + week: true + }; + + function isTextInputElement(elem) { + var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); + + if (nodeName === 'input') { + return !!supportedInputTypes[elem.type]; + } + + if (nodeName === 'textarea') { + return true; + } + + return false; + } + /** + * HTML nodeType values that represent the type of the node + */ + + + var ELEMENT_NODE = 1; + var TEXT_NODE = 3; + var COMMENT_NODE = 8; + var DOCUMENT_NODE = 9; + var DOCUMENT_FRAGMENT_NODE = 11; + /** + * Gets the target node from a native browser event by accounting for + * inconsistencies in browser DOM APIs. + * + * @param {object} nativeEvent Native browser event. + * @return {DOMEventTarget} Target node. + */ + + function getEventTarget(nativeEvent) { + // Fallback to nativeEvent.srcElement for IE9 + // https://github.com/facebook/react/issues/12506 + var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG element events #4963 + + if (target.correspondingUseElement) { + target = target.correspondingUseElement; + } // Safari may fire events on text nodes (Node.TEXT_NODE is 3). + // @see http://www.quirksmode.org/js/events_properties.html + + + return target.nodeType === TEXT_NODE ? target.parentNode : target; + } + /** + * Checks if an event is supported in the current execution environment. + * + * NOTE: This will not work correctly for non-generic events such as `change`, + * `reset`, `load`, `error`, and `select`. + * + * Borrows from Modernizr. + * + * @param {string} eventNameSuffix Event name, e.g. "click". + * @return {boolean} True if the event is supported. + * @internal + * @license Modernizr 3.0.0pre (Custom Build) | MIT + */ + + + function isEventSupported(eventNameSuffix) { + if (!canUseDOM) { + return false; + } + + var eventName = 'on' + eventNameSuffix; + var isSupported = eventName in document; + + if (!isSupported) { + var element = document.createElement('div'); + element.setAttribute(eventName, 'return;'); + isSupported = typeof element[eventName] === 'function'; + } + + return isSupported; + } + + function isCheckable(elem) { + var type = elem.type; + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); + } + + function getTracker(node) { + return node._valueTracker; + } + + function detachTracker(node) { + node._valueTracker = null; + } + + function getValueFromNode(node) { + var value = ''; + + if (!node) { + return value; + } + + if (isCheckable(node)) { + value = node.checked ? 'true' : 'false'; + } else { + value = node.value; + } + + return value; + } + + function trackValueOnNode(node) { + var valueField = isCheckable(node) ? 'checked' : 'value'; + var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); + var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail + // and don't track value will cause over reporting of changes, + // but it's better then a hard failure + // (needed for certain tests that spyOn input values and Safari) + + if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { + return; + } + + var get = descriptor.get, + set = descriptor.set; + Object.defineProperty(node, valueField, { + configurable: true, + get: function () { + return get.call(this); + }, + set: function (value) { + currentValue = '' + value; + set.call(this, value); + } + }); // We could've passed this the first time + // but it triggers a bug in IE11 and Edge 14/15. + // Calling defineProperty() again should be equivalent. + // https://github.com/facebook/react/issues/11768 + + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable + }); + var tracker = { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + currentValue = '' + value; + }, + stopTracking: function () { + detachTracker(node); + delete node[valueField]; + } + }; + return tracker; + } + + function track(node) { + if (getTracker(node)) { + return; + } // TODO: Once it's just Fiber we can move this to node._wrapperState + + + node._valueTracker = trackValueOnNode(node); + } + + function updateValueIfChanged(node) { + if (!node) { + return false; + } + + var tracker = getTracker(node); // if there is no tracker at this point it's unlikely + // that trying again will succeed + + if (!tracker) { + return true; + } + + var lastValue = tracker.getValue(); + var nextValue = getValueFromNode(node); + + if (nextValue !== lastValue) { + tracker.setValue(nextValue); + return true; + } + + return false; + } + + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. + // Current owner and dispatcher used to share the same ref, + // but PR #14548 split them out to better support the react-debug-tools package. + + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { + ReactSharedInternals.ReactCurrentDispatcher = { + current: null + }; + } + + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { + ReactSharedInternals.ReactCurrentBatchConfig = { + suspense: null + }; + } + + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; + + var describeComponentFrame = function (name, source, ownerName) { + var sourceInfo = ''; + + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + + return '\n in ' + (name || 'Unknown') + sourceInfo; + }; // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + + + var hasSymbol = typeof Symbol === 'function' && Symbol.for; + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary + // (unstable) APIs that have been removed. Can we remove the symbols? + + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; + var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; + var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; + } + + var Pending = 0; + var Resolved = 1; + var Rejected = 2; + + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; + } + + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName); + } + + function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return 'Profiler'; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; + } + + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + + function describeFiber(fiber) { + switch (fiber.tag) { + case HostRoot: + case HostPortal: + case HostText: + case Fragment: + case ContextProvider: + case ContextConsumer: + return ''; + + default: + var owner = fiber._debugOwner; + var source = fiber._debugSource; + var name = getComponentName(fiber.type); + var ownerName = null; + + if (owner) { + ownerName = getComponentName(owner.type); + } + + return describeComponentFrame(name, source, ownerName); + } + } + + function getStackByFiberInDevAndProd(workInProgress) { + var info = ''; + var node = workInProgress; + + do { + info += describeFiber(node); + node = node.return; + } while (node); + + return info; + } + + var current = null; + var phase = null; + + function getCurrentFiberOwnerNameInDevOrNull() { + { + if (current === null) { + return null; + } + + var owner = current._debugOwner; + + if (owner !== null && typeof owner !== 'undefined') { + return getComponentName(owner.type); + } + } + return null; + } + + function getCurrentFiberStackInDev() { + { + if (current === null) { + return ''; + } // Safe because if current fiber exists, we are reconciling, + // and it is guaranteed to be the work-in-progress version. + + + return getStackByFiberInDevAndProd(current); + } + return ''; + } + + function resetCurrentFiber() { + { + ReactDebugCurrentFrame.getCurrentStack = null; + current = null; + phase = null; + } + } + + function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev; + current = fiber; + phase = null; + } + } + + function setCurrentPhase(lifeCyclePhase) { + { + phase = lifeCyclePhase; + } + } + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + + var warning = warningWithoutStack$1; + { + warning = function (condition, format) { + if (condition) { + return; + } + + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args + + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack])); + }; + } + var warning$1 = warning; // A reserved attribute. + // It is handled by React separately and shouldn't be written to the DOM. + + var RESERVED = 0; // A simple string attribute. + // Attributes that aren't in the whitelist are presumed to have this type. + + var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called + // "enumerated" attributes with "true" and "false" as possible values. + // When true, it should be set to a "true" string. + // When false, it should be set to a "false" string. + + var BOOLEANISH_STRING = 2; // A real boolean attribute. + // When true, it should be present (set either to an empty string or its name). + // When false, it should be omitted. + + var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. + // When true, it should be present (set either to an empty string or its name). + // When false, it should be omitted. + // For any other value, should be present with that value. + + var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. + // When falsy, it should be removed. + + var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. + // When falsy, it should be removed. + + var POSITIVE_NUMERIC = 6; + /* eslint-disable max-len */ + + var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD'; + /* eslint-enable max-len */ + + var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040'; + var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; + var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); + var hasOwnProperty = Object.prototype.hasOwnProperty; + var illegalAttributeNameCache = {}; + var validatedAttributeNameCache = {}; + + function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { + return true; + } + + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { + return false; + } + + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } + + illegalAttributeNameCache[attributeName] = true; + { + warning$1(false, 'Invalid attribute name: `%s`', attributeName); + } + return false; + } + + function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null) { + return propertyInfo.type === RESERVED; + } + + if (isCustomComponentTag) { + return false; + } + + if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { + return true; + } + + return false; + } + + function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null && propertyInfo.type === RESERVED) { + return false; + } + + switch (typeof value) { + case 'function': // $FlowIssue symbol is perfectly valid here + + case 'symbol': + // eslint-disable-line + return true; + + case 'boolean': + { + if (isCustomComponentTag) { + return false; + } + + if (propertyInfo !== null) { + return !propertyInfo.acceptsBooleans; + } else { + var prefix = name.toLowerCase().slice(0, 5); + return prefix !== 'data-' && prefix !== 'aria-'; + } + } + + default: + return false; + } + } + + function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { + if (value === null || typeof value === 'undefined') { + return true; + } + + if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { + return true; + } + + if (isCustomComponentTag) { + return false; + } + + if (propertyInfo !== null) { + switch (propertyInfo.type) { + case BOOLEAN: + return !value; + + case OVERLOADED_BOOLEAN: + return value === false; + + case NUMERIC: + return isNaN(value); + + case POSITIVE_NUMERIC: + return isNaN(value) || value < 1; + } + } + + return false; + } + + function getPropertyInfo(name) { + return properties.hasOwnProperty(name) ? properties[name] : null; + } + + function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) { + this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; + this.attributeName = attributeName; + this.attributeNamespace = attributeNamespace; + this.mustUseProperty = mustUseProperty; + this.propertyName = name; + this.type = type; + this.sanitizeURL = sanitizeURL; + } // When adding attributes to this list, be sure to also add them to + // the `possibleStandardNames` module to ensure casing and incorrect + // name warnings. + + + var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. + + ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular + // elements (not just inputs). Now that ReactDOMInput assigns to the + // defaultValue property -- do we need this? + 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + } // sanitizeURL + ); // A few React string attributes have a different name. + // This is a mapping from React prop names to the attribute names. + + [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { + var name = _ref[0], + attributeName = _ref[1]; + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, // attributeName + null, // attributeNamespace + false); + } // sanitizeURL + ); // These are "enumerated" HTML attributes that accept "true" and "false". + // In React, we let users pass `true` and `false` even though technically + // these aren't boolean attributes (they are coerced to strings). + + ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); + } // sanitizeURL + ); // These are "enumerated" SVG attributes that accept "true" and "false". + // In React, we let users pass `true` and `false` even though technically + // these aren't boolean attributes (they are coerced to strings). + // Since these are SVG attributes, their attribute names are case-sensitive. + + ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + } // sanitizeURL + ); // These are HTML boolean attributes. + + ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM + // on the client side because the browsers are inconsistent. Instead we call focus(). + 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata + 'itemScope'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); + } // sanitizeURL + ); // These are the few React props that we set as DOM properties + // rather than attributes. These are all booleans. + + ['checked', // Note: `option.selected` is not updated if `select.multiple` is + // disabled with `removeAttribute`. We have special logic for handling this. + 'multiple', 'muted', 'selected'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + } // sanitizeURL + ); // These are HTML attributes that are "overloaded booleans": they behave like + // booleans, but can also accept a string value. + + ['capture', 'download'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + } // sanitizeURL + ); // These are HTML attributes that must be positive numbers. + + ['cols', 'rows', 'size', 'span'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + } // sanitizeURL + ); // These are HTML attributes that must be numbers. + + ['rowSpan', 'start'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); + } // sanitizeURL + ); + var CAMELIZE = /[\-\:]([a-z])/g; + + var capitalize = function (token) { + return token[1].toUpperCase(); + }; // This is a list of all SVG attributes that need special casing, namespacing, + // or boolean value assignment. Regular attributes that just accept strings + // and have the same names are omitted, just like in the HTML whitelist. + // Some of these attributes can be hard to find. This list was created by + // scrapping the MDN documentation. + + + ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, null, // attributeNamespace + false); + } // sanitizeURL + ); // String SVG attributes with the xlink namespace. + + ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/1999/xlink', false); + } // sanitizeURL + ); // String SVG attributes with the xml namespace. + + ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/XML/1998/namespace', false); + } // sanitizeURL + ); // These attribute exists both in HTML and SVG. + // The attribute name is case-sensitive in SVG so we can't just use + // the React name like we do for attributes that exist only in HTML. + + ['tabIndex', 'crossOrigin'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + false); + } // sanitizeURL + ); // These attributes accept URLs. These must not allow javascript: URLS. + // These will also need to accept Trusted Types object in the future. + + var xlinkHref = 'xlinkHref'; + properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty + 'xlink:href', 'http://www.w3.org/1999/xlink', true); + ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + true); + } // sanitizeURL + ); + var ReactDebugCurrentFrame$1 = null; + { + ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + } // A javascript: URL can contain leading C0 control or \u0020 SPACE, + // and any newline or tab are filtered out as if they're not part of the URL. + // https://url.spec.whatwg.org/#url-parsing + // Tab or newline are defined as \r\n\t: + // https://infra.spec.whatwg.org/#ascii-tab-or-newline + // A C0 control is a code point in the range \u0000 NULL to \u001F + // INFORMATION SEPARATOR ONE, inclusive: + // https://infra.spec.whatwg.org/#c0-control-or-space + + /* eslint-disable max-len */ + + var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; + var didWarn = false; + + function sanitizeURL(url) { + if (disableJavaScriptURLs) { + (function () { + if (!!isJavaScriptProtocol.test(url)) { + { + throw ReactError(Error('React has blocked a javascript: URL as a security precaution.' + ReactDebugCurrentFrame$1.getStackAddendum())); + } + } + })(); + } else if ( true && !didWarn && isJavaScriptProtocol.test(url)) { + didWarn = true; + warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); + } + } + /** + * Get the value for a property on a node. Only used in DEV for SSR validation. + * The "expected" argument is used as a hint of what the expected value is. + * Some properties have multiple equivalent values. + */ + + + function getValueForProperty(node, name, expected, propertyInfo) { + { + if (propertyInfo.mustUseProperty) { + var propertyName = propertyInfo.propertyName; + return node[propertyName]; + } else { + if (!disableJavaScriptURLs && propertyInfo.sanitizeURL) { + // If we haven't fully disabled javascript: URLs, and if + // the hydration is successful of a javascript: URL, we + // still want to warn on the client. + sanitizeURL('' + expected); + } + + var attributeName = propertyInfo.attributeName; + var stringValue = null; + + if (propertyInfo.type === OVERLOADED_BOOLEAN) { + if (node.hasAttribute(attributeName)) { + var value = node.getAttribute(attributeName); + + if (value === '') { + return true; + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return value; + } + + if (value === '' + expected) { + return expected; + } + + return value; + } + } else if (node.hasAttribute(attributeName)) { + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + // We had an attribute but shouldn't have had one, so read it + // for the error message. + return node.getAttribute(attributeName); + } + + if (propertyInfo.type === BOOLEAN) { + // If this was a boolean, it doesn't matter what the value is + // the fact that we have it is the same as the expected. + return expected; + } // Even if this property uses a namespace we use getAttribute + // because we assume its namespaced name is the same as our config. + // To use getAttributeNS we need the local name which we don't have + // in our config atm. + + + stringValue = node.getAttribute(attributeName); + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return stringValue === null ? expected : stringValue; + } else if (stringValue === '' + expected) { + return expected; + } else { + return stringValue; + } + } + } + } + /** + * Get the value for a attribute on a node. Only used in DEV for SSR validation. + * The third argument is used as a hint of what the expected value is. Some + * attributes have multiple equivalent values. + */ + + + function getValueForAttribute(node, name, expected) { + { + if (!isAttributeNameSafe(name)) { + return; + } + + if (!node.hasAttribute(name)) { + return expected === undefined ? undefined : null; + } + + var value = node.getAttribute(name); + + if (value === '' + expected) { + return expected; + } + + return value; + } + } + /** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} value + */ + + + function setValueForProperty(node, name, value, isCustomComponentTag) { + var propertyInfo = getPropertyInfo(name); + + if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { + return; + } + + if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { + value = null; + } // If the prop isn't in the special list, treat it as a simple attribute. + + + if (isCustomComponentTag || propertyInfo === null) { + if (isAttributeNameSafe(name)) { + var _attributeName = name; + + if (value === null) { + node.removeAttribute(_attributeName); + } else { + node.setAttribute(_attributeName, '' + value); + } + } + + return; + } + + var mustUseProperty = propertyInfo.mustUseProperty; + + if (mustUseProperty) { + var propertyName = propertyInfo.propertyName; + + if (value === null) { + var type = propertyInfo.type; + node[propertyName] = type === BOOLEAN ? false : ''; + } else { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propertyName] = value; + } + + return; + } // The rest are treated as attributes with special cases. + + + var attributeName = propertyInfo.attributeName, + attributeNamespace = propertyInfo.attributeNamespace; + + if (value === null) { + node.removeAttribute(attributeName); + } else { + var _type = propertyInfo.type; + var attributeValue = void 0; + + if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { + attributeValue = ''; + } else { + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + attributeValue = '' + value; + + if (propertyInfo.sanitizeURL) { + sanitizeURL(attributeValue); + } + } + + if (attributeNamespace) { + node.setAttributeNS(attributeNamespace, attributeName, attributeValue); + } else { + node.setAttribute(attributeName, attributeValue); + } + } + } // Flow does not allow string concatenation of most non-string types. To work + // around this limitation, we use an opaque type that can only be obtained by + // passing the value through getToStringValue first. + + + function toString(value) { + return '' + value; + } + + function getToStringValue(value) { + switch (typeof value) { + case 'boolean': + case 'number': + case 'object': + case 'string': + case 'undefined': + return value; + + default: + // function, symbol are assigned as empty strings + return ''; + } + } + + var ReactDebugCurrentFrame$2 = null; + var ReactControlledValuePropTypes = { + checkPropTypes: null + }; + { + ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame; + var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true + }; + var propTypes = { + value: function (props, propName, componentName) { + if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) { + return null; + } + + return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + checked: function (props, propName, componentName) { + if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) { + return null; + } + + return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + } + }; + /** + * Provide a linked `value` attribute for controlled forms. You should not use + * this outside of the ReactDOM controlled form components. + */ + + ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { + checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum); + }; + } // TODO: direct imports like some-package/src/* are bad. Fix me. + + var didWarnValueDefaultValue = false; + var didWarnCheckedDefaultChecked = false; + var didWarnControlledToUncontrolled = false; + var didWarnUncontrolledToControlled = false; + + function isControlled(props) { + var usesChecked = props.type === 'checkbox' || props.type === 'radio'; + return usesChecked ? props.checked != null : props.value != null; + } + /** + * Implements an host component that allows setting these optional + * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. + * + * If `checked` or `value` are not supplied (or null/undefined), user actions + * that affect the checked state or value will trigger updates to the element. + * + * If they are supplied (and not null/undefined), the rendered element will not + * trigger updates to the element. Instead, the props must change in order for + * the rendered element to be updated. + * + * The rendered element will be initialized as unchecked (or `defaultChecked`) + * with an empty value (or `defaultValue`). + * + * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html + */ + + + function getHostProps(element, props) { + var node = element; + var checked = props.checked; + + var hostProps = _assign({}, props, { + defaultChecked: undefined, + defaultValue: undefined, + value: undefined, + checked: checked != null ? checked : node._wrapperState.initialChecked + }); + + return hostProps; + } + + function initWrapperState(element, props) { + { + ReactControlledValuePropTypes.checkPropTypes('input', props); + + if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { + warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + didWarnCheckedDefaultChecked = true; + } + + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + didWarnValueDefaultValue = true; + } + } + var node = element; + var defaultValue = props.defaultValue == null ? '' : props.defaultValue; + node._wrapperState = { + initialChecked: props.checked != null ? props.checked : props.defaultChecked, + initialValue: getToStringValue(props.value != null ? props.value : defaultValue), + controlled: isControlled(props) + }; + } + + function updateChecked(element, props) { + var node = element; + var checked = props.checked; + + if (checked != null) { + setValueForProperty(node, 'checked', checked, false); + } + } + + function updateWrapper(element, props) { + var node = element; + { + var _controlled = isControlled(props); + + if (!node._wrapperState.controlled && _controlled && !didWarnUncontrolledToControlled) { + warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); + didWarnUncontrolledToControlled = true; + } + + if (node._wrapperState.controlled && !_controlled && !didWarnControlledToUncontrolled) { + warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); + didWarnControlledToUncontrolled = true; + } + } + updateChecked(element, props); + var value = getToStringValue(props.value); + var type = props.type; + + if (value != null) { + if (type === 'number') { + if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible. + // eslint-disable-next-line + node.value != value) { + node.value = toString(value); + } + } else if (node.value !== toString(value)) { + node.value = toString(value); + } + } else if (type === 'submit' || type === 'reset') { + // Submit/reset inputs need the attribute removed completely to avoid + // blank-text buttons. + node.removeAttribute('value'); + return; + } + + if (disableInputAttributeSyncing) { + // When not syncing the value attribute, React only assigns a new value + // whenever the defaultValue React prop has changed. When not present, + // React does nothing + if (props.hasOwnProperty('defaultValue')) { + setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); + } + } else { + // When syncing the value attribute, the value comes from a cascade of + // properties: + // 1. The value React property + // 2. The defaultValue React property + // 3. Otherwise there should be no change + if (props.hasOwnProperty('value')) { + setDefaultValue(node, props.type, value); + } else if (props.hasOwnProperty('defaultValue')) { + setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); + } + } + + if (disableInputAttributeSyncing) { + // When not syncing the checked attribute, the attribute is directly + // controllable from the defaultValue React property. It needs to be + // updated as new props come in. + if (props.defaultChecked == null) { + node.removeAttribute('checked'); + } else { + node.defaultChecked = !!props.defaultChecked; + } + } else { + // When syncing the checked attribute, it only changes when it needs + // to be removed, such as transitioning from a checkbox into a text input + if (props.checked == null && props.defaultChecked != null) { + node.defaultChecked = !!props.defaultChecked; + } + } + } + + function postMountWrapper(element, props, isHydrating) { + var node = element; // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + + if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { + var type = props.type; + var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the + // default value provided by the browser. See: #12872 + + if (isButton && (props.value === undefined || props.value === null)) { + return; + } + + var _initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + + + if (!isHydrating) { + if (disableInputAttributeSyncing) { + var value = getToStringValue(props.value); // When not syncing the value attribute, the value property points + // directly to the React prop. Only assign it if it exists. + + if (value != null) { + // Always assign on buttons so that it is possible to assign an + // empty string to clear button text. + // + // Otherwise, do not re-assign the value property if is empty. This + // potentially avoids a DOM write and prevents Firefox (~60.0.1) from + // prematurely marking required inputs as invalid. Equality is compared + // to the current value in case the browser provided value is not an + // empty string. + if (isButton || value !== node.value) { + node.value = toString(value); + } + } + } else { + // When syncing the value attribute, the value property should use + // the wrapperState._initialValue property. This uses: + // + // 1. The value React property when present + // 2. The defaultValue React property when present + // 3. An empty string + if (_initialValue !== node.value) { + node.value = _initialValue; + } + } + } + + if (disableInputAttributeSyncing) { + // When not syncing the value attribute, assign the value attribute + // directly from the defaultValue React property (when present) + var defaultValue = getToStringValue(props.defaultValue); + + if (defaultValue != null) { + node.defaultValue = toString(defaultValue); + } + } else { + // Otherwise, the value attribute is synchronized to the property, + // so we assign defaultValue to the same thing as the value property + // assignment step above. + node.defaultValue = _initialValue; + } + } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug + // this is needed to work around a chrome bug where setting defaultChecked + // will sometimes influence the value of checked (even after detachment). + // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 + // We need to temporarily unset name to avoid disrupting radio button groups. + + + var name = node.name; + + if (name !== '') { + node.name = ''; + } + + if (disableInputAttributeSyncing) { + // When not syncing the checked attribute, the checked property + // never gets assigned. It must be manually set. We don't want + // to do this when hydrating so that existing user input isn't + // modified + if (!isHydrating) { + updateChecked(element, props); + } // Only assign the checked attribute if it is defined. This saves + // a DOM write when controlling the checked attribute isn't needed + // (text inputs, submit/reset) + + + if (props.hasOwnProperty('defaultChecked')) { + node.defaultChecked = !node.defaultChecked; + node.defaultChecked = !!props.defaultChecked; + } + } else { + // When syncing the checked attribute, both the checked property and + // attribute are assigned at the same time using defaultChecked. This uses: + // + // 1. The checked React property when present + // 2. The defaultChecked React property when present + // 3. Otherwise, false + node.defaultChecked = !node.defaultChecked; + node.defaultChecked = !!node._wrapperState.initialChecked; + } + + if (name !== '') { + node.name = name; + } + } + + function restoreControlledState(element, props) { + var node = element; + updateWrapper(node, props); + updateNamedCousins(node, props); + } + + function updateNamedCousins(rootNode, props) { + var name = props.name; + + if (props.type === 'radio' && name != null) { + var queryRoot = rootNode; + + while (queryRoot.parentNode) { + queryRoot = queryRoot.parentNode; + } // If `rootNode.form` was non-null, then we could try `form.elements`, + // but that sometimes behaves strangely in IE8. We could also try using + // `form.getElementsByName`, but that will only return direct children + // and won't include inputs that use the HTML5 `form=` attribute. Since + // the input might not even be in a form. It might not even be in the + // document. Let's just use the local `querySelectorAll` to ensure we don't + // miss anything. + + + var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); + + for (var i = 0; i < group.length; i++) { + var otherNode = group[i]; + + if (otherNode === rootNode || otherNode.form !== rootNode.form) { + continue; + } // This will throw if radio buttons rendered by different copies of React + // and the same name are rendered into the same form (same as #1939). + // That's probably okay; we don't support it just as we don't support + // mixing React radio buttons with non-React ones. + + + var otherProps = getFiberCurrentPropsFromNode$1(otherNode); + + (function () { + if (!otherProps) { + { + throw ReactError(Error('ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.')); + } + } + })(); // We need update the tracked value on the named cousin since the value + // was changed but the input saw no event or value set + + + updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that + // was previously checked to update will cause it to be come re-checked + // as appropriate. + + updateWrapper(otherNode, otherProps); + } + } + } // In Chrome, assigning defaultValue to certain input types triggers input validation. + // For number inputs, the display value loses trailing decimal points. For email inputs, + // Chrome raises "The specified value is not a valid email address". + // + // Here we check to see if the defaultValue has actually changed, avoiding these problems + // when the user is inputting text + // + // https://github.com/facebook/react/issues/7253 + + + function setDefaultValue(node, type, value) { + if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js + type !== 'number' || node.ownerDocument.activeElement !== node) { + if (value == null) { + node.defaultValue = toString(node._wrapperState.initialValue); + } else if (node.defaultValue !== toString(value)) { + node.defaultValue = toString(value); + } + } + } + + var eventTypes$1 = { + change: { + phasedRegistrationNames: { + bubbled: 'onChange', + captured: 'onChangeCapture' + }, + dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE] + } + }; + + function createAndAccumulateChangeEvent(inst, nativeEvent, target) { + var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target); + event.type = 'change'; // Flag this event loop as needing state restore. + + enqueueStateRestore(target); + accumulateTwoPhaseDispatches(event); + return event; + } + /** + * For IE shims + */ + + + var activeElement = null; + var activeElementInst = null; + /** + * SECTION: handle `change` event + */ + + function shouldUseChangeEvent(elem) { + var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); + return nodeName === 'select' || nodeName === 'input' && elem.type === 'file'; + } + + function manualDispatchChangeEvent(nativeEvent) { + var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the + // other events and have it go through ReactBrowserEventEmitter. Since it + // doesn't, we manually listen for the events and so we have to enqueue and + // process the abstract event manually. + // + // Batching is necessary here in order to ensure that all event handlers run + // before the next rerender (including event handlers attached to ancestor + // elements instead of directly on the input). Without this, controlled + // components don't work properly in conjunction with event bubbling because + // the component is rerendered and the value reverted before all the event + // handlers can run. See https://github.com/facebook/react/issues/708. + + batchedUpdates(runEventInBatch, event); + } + + function runEventInBatch(event) { + runEventsInBatch(event); + } + + function getInstIfValueChanged(targetInst) { + var targetNode = getNodeFromInstance$1(targetInst); + + if (updateValueIfChanged(targetNode)) { + return targetInst; + } + } + + function getTargetInstForChangeEvent(topLevelType, targetInst) { + if (topLevelType === TOP_CHANGE) { + return targetInst; + } + } + /** + * SECTION: handle `input` event + */ + + + var isInputEventSupported = false; + + if (canUseDOM) { + // IE9 claims to support the input event but fails to trigger it when + // deleting text, so we ignore its input events. + isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9); + } + /** + * (For IE <=9) Starts tracking propertychange events on the passed-in element + * and override the value property so that we can distinguish user events from + * value changes in JS. + */ + + + function startWatchingForValueChange(target, targetInst) { + activeElement = target; + activeElementInst = targetInst; + activeElement.attachEvent('onpropertychange', handlePropertyChange); + } + /** + * (For IE <=9) Removes the event listeners from the currently-tracked element, + * if any exists. + */ + + + function stopWatchingForValueChange() { + if (!activeElement) { + return; + } + + activeElement.detachEvent('onpropertychange', handlePropertyChange); + activeElement = null; + activeElementInst = null; + } + /** + * (For IE <=9) Handles a propertychange event, sending a `change` event if + * the value of the active element has changed. + */ + + + function handlePropertyChange(nativeEvent) { + if (nativeEvent.propertyName !== 'value') { + return; + } + + if (getInstIfValueChanged(activeElementInst)) { + manualDispatchChangeEvent(nativeEvent); + } + } + + function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) { + if (topLevelType === TOP_FOCUS) { + // In IE9, propertychange fires for most input events but is buggy and + // doesn't fire when text is deleted, but conveniently, selectionchange + // appears to fire in all of the remaining cases so we catch those and + // forward the event if the value has changed + // In either case, we don't want to call the event handler if the value + // is changed from JS so we redefine a setter for `.value` that updates + // our activeElementValue variable, allowing us to ignore those changes + // + // stopWatching() should be a noop here but we call it just in case we + // missed a blur event somehow. + stopWatchingForValueChange(); + startWatchingForValueChange(target, targetInst); + } else if (topLevelType === TOP_BLUR) { + stopWatchingForValueChange(); + } + } // For IE8 and IE9. + + + function getTargetInstForInputEventPolyfill(topLevelType, targetInst) { + if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) { + // On the selectionchange event, the target is just document which isn't + // helpful for us so just check activeElement instead. + // + // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire + // propertychange on the first input event after setting `value` from a + // script and fires only keydown, keypress, keyup. Catching keyup usually + // gets it and catching keydown lets us fire an event for the first + // keystroke if user does a key repeat (it'll be a little delayed: right + // before the second keystroke). Other input methods (e.g., paste) seem to + // fire selectionchange normally. + return getInstIfValueChanged(activeElementInst); + } + } + /** + * SECTION: handle `click` event + */ + + + function shouldUseClickEvent(elem) { + // Use the `click` event to detect changes to checkbox and radio inputs. + // This approach works across all browsers, whereas `change` does not fire + // until `blur` in IE8. + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio'); + } + + function getTargetInstForClickEvent(topLevelType, targetInst) { + if (topLevelType === TOP_CLICK) { + return getInstIfValueChanged(targetInst); + } + } + + function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) { + if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) { + return getInstIfValueChanged(targetInst); + } + } + + function handleControlledInputBlur(node) { + var state = node._wrapperState; + + if (!state || !state.controlled || node.type !== 'number') { + return; + } + + if (!disableInputAttributeSyncing) { + // If controlled, assign the value attribute to the current value on blur + setDefaultValue(node, 'number', node.value); + } + } + /** + * This plugin creates an `onChange` event that normalizes change events + * across form elements. This event fires at a time when it's possible to + * change the element's value without seeing a flicker. + * + * Supported elements are: + * - input (see `isTextInputElement`) + * - textarea + * - select + */ + + + var ChangeEventPlugin = { + eventTypes: eventTypes$1, + _isInputEventSupported: isInputEventSupported, + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window; + var getTargetInstFunc = void 0, + handleEventFunc = void 0; + + if (shouldUseChangeEvent(targetNode)) { + getTargetInstFunc = getTargetInstForChangeEvent; + } else if (isTextInputElement(targetNode)) { + if (isInputEventSupported) { + getTargetInstFunc = getTargetInstForInputOrChangeEvent; + } else { + getTargetInstFunc = getTargetInstForInputEventPolyfill; + handleEventFunc = handleEventsForInputEventPolyfill; + } + } else if (shouldUseClickEvent(targetNode)) { + getTargetInstFunc = getTargetInstForClickEvent; + } + + if (getTargetInstFunc) { + var inst = getTargetInstFunc(topLevelType, targetInst); + + if (inst) { + var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget); + return event; + } + } + + if (handleEventFunc) { + handleEventFunc(topLevelType, targetNode, targetInst); + } // When blurring, set the value attribute for number inputs + + + if (topLevelType === TOP_BLUR) { + handleControlledInputBlur(targetNode); + } + } + }; + /** + * Module that is injectable into `EventPluginHub`, that specifies a + * deterministic ordering of `EventPlugin`s. A convenient way to reason about + * plugins, without having to package every one of them. This is better than + * having plugins be ordered in the same order that they are injected because + * that ordering would be influenced by the packaging order. + * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that + * preventing default on events is convenient in `SimpleEventPlugin` handlers. + */ + + var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin']; + var SyntheticUIEvent = SyntheticEvent.extend({ + view: null, + detail: null + }); + var modifierKeyToProp = { + Alt: 'altKey', + Control: 'ctrlKey', + Meta: 'metaKey', + Shift: 'shiftKey' + }; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support + // getModifierState. If getModifierState is not supported, we map it to a set of + // modifier keys exposed by the event. In this case, Lock-keys are not supported. + + /** + * Translation from modifier key to the associated property in the event. + * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers + */ + + function modifierStateGetter(keyArg) { + var syntheticEvent = this; + var nativeEvent = syntheticEvent.nativeEvent; + + if (nativeEvent.getModifierState) { + return nativeEvent.getModifierState(keyArg); + } + + var keyProp = modifierKeyToProp[keyArg]; + return keyProp ? !!nativeEvent[keyProp] : false; + } + + function getEventModifierState(nativeEvent) { + return modifierStateGetter; + } + + var previousScreenX = 0; + var previousScreenY = 0; // Use flags to signal movementX/Y has already been set + + var isMovementXSet = false; + var isMovementYSet = false; + /** + * @interface MouseEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + + var SyntheticMouseEvent = SyntheticUIEvent.extend({ + screenX: null, + screenY: null, + clientX: null, + clientY: null, + pageX: null, + pageY: null, + ctrlKey: null, + shiftKey: null, + altKey: null, + metaKey: null, + getModifierState: getEventModifierState, + button: null, + buttons: null, + relatedTarget: function (event) { + return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); + }, + movementX: function (event) { + if ('movementX' in event) { + return event.movementX; + } + + var screenX = previousScreenX; + previousScreenX = event.screenX; + + if (!isMovementXSet) { + isMovementXSet = true; + return 0; + } + + return event.type === 'mousemove' ? event.screenX - screenX : 0; + }, + movementY: function (event) { + if ('movementY' in event) { + return event.movementY; + } + + var screenY = previousScreenY; + previousScreenY = event.screenY; + + if (!isMovementYSet) { + isMovementYSet = true; + return 0; + } + + return event.type === 'mousemove' ? event.screenY - screenY : 0; + } + }); + /** + * @interface PointerEvent + * @see http://www.w3.org/TR/pointerevents/ + */ + + var SyntheticPointerEvent = SyntheticMouseEvent.extend({ + pointerId: null, + width: null, + height: null, + pressure: null, + tangentialPressure: null, + tiltX: null, + tiltY: null, + twist: null, + pointerType: null, + isPrimary: null + }); + var eventTypes$2 = { + mouseEnter: { + registrationName: 'onMouseEnter', + dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER] + }, + mouseLeave: { + registrationName: 'onMouseLeave', + dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER] + }, + pointerEnter: { + registrationName: 'onPointerEnter', + dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER] + }, + pointerLeave: { + registrationName: 'onPointerLeave', + dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER] + } + }; + var EnterLeaveEventPlugin = { + eventTypes: eventTypes$2, + + /** + * For almost every interaction we care about, there will be both a top-level + * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that + * we do not extract duplicate events. However, moving the mouse into the + * browser from outside will not fire a `mouseout` event. In this case, we use + * the `mouseover` top-level event. + */ + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER; + var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT; + + if (isOverEvent && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { + return null; + } + + if (!isOutEvent && !isOverEvent) { + // Must not be a mouse or pointer in or out - ignoring. + return null; + } + + var win = void 0; + + if (nativeEventTarget.window === nativeEventTarget) { + // `nativeEventTarget` is probably a window object. + win = nativeEventTarget; + } else { + // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. + var doc = nativeEventTarget.ownerDocument; + + if (doc) { + win = doc.defaultView || doc.parentWindow; + } else { + win = window; + } + } + + var from = void 0; + var to = void 0; + + if (isOutEvent) { + from = targetInst; + var related = nativeEvent.relatedTarget || nativeEvent.toElement; + to = related ? getClosestInstanceFromNode(related) : null; + } else { + // Moving to a node from outside the window. + from = null; + to = targetInst; + } + + if (from === to) { + // Nothing pertains to our managed components. + return null; + } + + var eventInterface = void 0, + leaveEventType = void 0, + enterEventType = void 0, + eventTypePrefix = void 0; + + if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) { + eventInterface = SyntheticMouseEvent; + leaveEventType = eventTypes$2.mouseLeave; + enterEventType = eventTypes$2.mouseEnter; + eventTypePrefix = 'mouse'; + } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) { + eventInterface = SyntheticPointerEvent; + leaveEventType = eventTypes$2.pointerLeave; + enterEventType = eventTypes$2.pointerEnter; + eventTypePrefix = 'pointer'; + } + + var fromNode = from == null ? win : getNodeFromInstance$1(from); + var toNode = to == null ? win : getNodeFromInstance$1(to); + var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget); + leave.type = eventTypePrefix + 'leave'; + leave.target = fromNode; + leave.relatedTarget = toNode; + var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget); + enter.type = eventTypePrefix + 'enter'; + enter.target = toNode; + enter.relatedTarget = fromNode; + accumulateEnterLeaveDispatches(leave, enter, from, to); + return [leave, enter]; + } + }; + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + + function is(x, y) { + return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare + ; + } + + var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + /** + * Performs equality by iterating through keys on an object and returning false + * when any key has values which are not strictly equal between the arguments. + * Returns true when the values of all keys are strictly equal. + */ + + function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + + if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { + return false; + } + + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); + + if (keysA.length !== keysB.length) { + return false; + } // Test for A's keys different from B. + + + for (var i = 0; i < keysA.length; i++) { + if (!hasOwnProperty$1.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { + return false; + } + } + + return true; + } + + var PLUGIN_EVENT_SYSTEM = 1; + var RESPONDER_EVENT_SYSTEM = 1 << 1; + var IS_PASSIVE = 1 << 2; + var IS_ACTIVE = 1 << 3; + var PASSIVE_NOT_SUPPORTED = 1 << 4; + + function createResponderListener(responder, props) { + var eventResponderListener = { + responder: responder, + props: props + }; + { + Object.freeze(eventResponderListener); + } + return eventResponderListener; + } + + function isFiberSuspenseAndTimedOut(fiber) { + return fiber.tag === SuspenseComponent && fiber.memoizedState !== null; + } + + function getSuspenseFallbackChild(fiber) { + return fiber.child.sibling.child; + } + + function createResponderInstance(responder, responderProps, responderState, target, fiber) { + return { + fiber: fiber, + props: responderProps, + responder: responder, + rootEventTypes: null, + state: responderState, + target: target + }; + } + + var DiscreteEvent = 0; + var UserBlockingEvent = 1; + var ContinuousEvent = 2; // Intentionally not named imports because Rollup would use dynamic dispatch for + // CommonJS interop named imports. + + var UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority; + var runWithPriority$1 = Scheduler.unstable_runWithPriority; + var listenToResponderEventTypesImpl = void 0; + + function setListenToResponderEventTypes(_listenToResponderEventTypesImpl) { + listenToResponderEventTypesImpl = _listenToResponderEventTypesImpl; + } + + var activeTimeouts = new Map(); + var rootEventTypesToEventResponderInstances = new Map(); + var ownershipChangeListeners = new Set(); + var globalOwner = null; + var currentTimeStamp = 0; + var currentTimers = new Map(); + var currentInstance = null; + var currentEventQueue = null; + var currentEventQueuePriority = ContinuousEvent; + var currentTimerIDCounter = 0; + var currentDocument = null; + var eventResponderContext = { + dispatchEvent: function (eventValue, eventListener, eventPriority) { + validateResponderContext(); + validateEventValue(eventValue); + + if (eventPriority < currentEventQueuePriority) { + currentEventQueuePriority = eventPriority; + } + + currentEventQueue.push(createEventQueueItem(eventValue, eventListener)); + }, + isTargetWithinResponder: function (target) { + validateResponderContext(); + + if (target != null) { + var fiber = getClosestInstanceFromNode(target); + var responderFiber = currentInstance.fiber; + + while (fiber !== null) { + if (fiber === responderFiber || fiber.alternate === responderFiber) { + return true; + } + + fiber = fiber.return; + } + } + + return false; + }, + isTargetWithinResponderScope: function (target) { + validateResponderContext(); + var componentInstance = currentInstance; + var responder = componentInstance.responder; + + if (target != null) { + var fiber = getClosestInstanceFromNode(target); + var responderFiber = currentInstance.fiber; + + while (fiber !== null) { + if (fiber === responderFiber || fiber.alternate === responderFiber) { + return true; + } + + if (doesFiberHaveResponder(fiber, responder)) { + return false; + } + + fiber = fiber.return; + } + } + + return false; + }, + isTargetWithinNode: function (childTarget, parentTarget) { + validateResponderContext(); + var childFiber = getClosestInstanceFromNode(childTarget); + var parentFiber = getClosestInstanceFromNode(parentTarget); + var parentAlternateFiber = parentFiber.alternate; + var node = childFiber; + + while (node !== null) { + if (node === parentFiber || node === parentAlternateFiber) { + return true; + } + + node = node.return; + } + + return false; + }, + addRootEventTypes: function (rootEventTypes) { + validateResponderContext(); + var activeDocument = getActiveDocument(); + listenToResponderEventTypesImpl(rootEventTypes, activeDocument); + + for (var i = 0; i < rootEventTypes.length; i++) { + var rootEventType = rootEventTypes[i]; + var eventResponderInstance = currentInstance; + registerRootEventType(rootEventType, eventResponderInstance); + } + }, + removeRootEventTypes: function (rootEventTypes) { + validateResponderContext(); + + for (var i = 0; i < rootEventTypes.length; i++) { + var rootEventType = rootEventTypes[i]; + var rootEventResponders = rootEventTypesToEventResponderInstances.get(rootEventType); + var rootEventTypesSet = currentInstance.rootEventTypes; + + if (rootEventTypesSet !== null) { + rootEventTypesSet.delete(rootEventType); + } + + if (rootEventResponders !== undefined) { + rootEventResponders.delete(currentInstance); + } + } + }, + hasOwnership: function () { + validateResponderContext(); + return globalOwner === currentInstance; + }, + requestGlobalOwnership: function () { + validateResponderContext(); + + if (globalOwner !== null) { + return false; + } + + globalOwner = currentInstance; + triggerOwnershipListeners(); + return true; + }, + releaseOwnership: function () { + validateResponderContext(); + return releaseOwnershipForEventResponderInstance(currentInstance); + }, + setTimeout: function (func, delay) { + validateResponderContext(); + + if (currentTimers === null) { + currentTimers = new Map(); + } + + var timeout = currentTimers.get(delay); + var timerId = currentTimerIDCounter++; + + if (timeout === undefined) { + var _timers = new Map(); + + var _id = setTimeout(function () { + processTimers(_timers, delay); + }, delay); + + timeout = { + id: _id, + timers: _timers + }; + currentTimers.set(delay, timeout); + } + + timeout.timers.set(timerId, { + instance: currentInstance, + func: func, + id: timerId, + timeStamp: currentTimeStamp + }); + activeTimeouts.set(timerId, timeout); + return timerId; + }, + clearTimeout: function (timerId) { + validateResponderContext(); + var timeout = activeTimeouts.get(timerId); + + if (timeout !== undefined) { + var _timers2 = timeout.timers; + + _timers2.delete(timerId); + + if (_timers2.size === 0) { + clearTimeout(timeout.id); + } + } + }, + getFocusableElementsInScope: function (deep) { + validateResponderContext(); + var focusableElements = []; + var eventResponderInstance = currentInstance; + var currentResponder = eventResponderInstance.responder; + var focusScopeFiber = eventResponderInstance.fiber; + + if (deep) { + var deepNode = focusScopeFiber.return; + + while (deepNode !== null) { + if (doesFiberHaveResponder(deepNode, currentResponder)) { + focusScopeFiber = deepNode; + } + + deepNode = deepNode.return; + } + } + + var child = focusScopeFiber.child; + + if (child !== null) { + collectFocusableElements(child, focusableElements); + } + + return focusableElements; + }, + getActiveDocument: getActiveDocument, + objectAssign: _assign, + getTimeStamp: function () { + validateResponderContext(); + return currentTimeStamp; + }, + isTargetWithinHostComponent: function (target, elementType) { + validateResponderContext(); + var fiber = getClosestInstanceFromNode(target); + + while (fiber !== null) { + if (fiber.tag === HostComponent && fiber.type === elementType) { + return true; + } + + fiber = fiber.return; + } + + return false; + }, + enqueueStateRestore: enqueueStateRestore + }; + + function validateEventValue(eventValue) { + if (typeof eventValue === 'object' && eventValue !== null) { + var target = eventValue.target, + type = eventValue.type, + _timeStamp = eventValue.timeStamp; + + if (target == null || type == null || _timeStamp == null) { + throw new Error('context.dispatchEvent: "target", "timeStamp", and "type" fields on event object are required.'); + } + + var showWarning = function (name) { + { + warning$1(false, '%s is not available on event objects created from event responder modules (React Flare). ' + 'Try wrapping in a conditional, i.e. `if (event.type !== "press") { event.%s }`', name, name); + } + }; + + eventValue.preventDefault = function () { + { + showWarning('preventDefault()'); + } + }; + + eventValue.stopPropagation = function () { + { + showWarning('stopPropagation()'); + } + }; + + eventValue.isDefaultPrevented = function () { + { + showWarning('isDefaultPrevented()'); + } + }; + + eventValue.isPropagationStopped = function () { + { + showWarning('isPropagationStopped()'); + } + }; // $FlowFixMe: we don't need value, Flow thinks we do + + + Object.defineProperty(eventValue, 'nativeEvent', { + get: function () { + { + showWarning('nativeEvent'); + } + } + }); + } + } + + function collectFocusableElements(node, focusableElements) { + if (isFiberSuspenseAndTimedOut(node)) { + var fallbackChild = getSuspenseFallbackChild(node); + + if (fallbackChild !== null) { + collectFocusableElements(fallbackChild, focusableElements); + } + } else { + if (isFiberHostComponentFocusable(node)) { + focusableElements.push(node.stateNode); + } else { + var child = node.child; + + if (child !== null) { + collectFocusableElements(child, focusableElements); + } + } + } + + var sibling = node.sibling; + + if (sibling !== null) { + collectFocusableElements(sibling, focusableElements); + } + } + + function createEventQueueItem(value, listener) { + return { + value: value, + listener: listener + }; + } + + function doesFiberHaveResponder(fiber, responder) { + if (fiber.tag === HostComponent) { + var dependencies = fiber.dependencies; + + if (dependencies !== null) { + var respondersMap = dependencies.responders; + + if (respondersMap !== null && respondersMap.has(responder)) { + return true; + } + } + } + + return false; + } + + function getActiveDocument() { + return currentDocument; + } + + function releaseOwnershipForEventResponderInstance(eventResponderInstance) { + if (globalOwner === eventResponderInstance) { + globalOwner = null; + triggerOwnershipListeners(); + return true; + } + + return false; + } + + function isFiberHostComponentFocusable(fiber) { + if (fiber.tag !== HostComponent) { + return false; + } + + var type = fiber.type, + memoizedProps = fiber.memoizedProps; + + if (memoizedProps.tabIndex === -1 || memoizedProps.disabled) { + return false; + } + + if (memoizedProps.tabIndex === 0 || memoizedProps.contentEditable === true) { + return true; + } + + if (type === 'a' || type === 'area') { + return !!memoizedProps.href && memoizedProps.rel !== 'ignore'; + } + + if (type === 'input') { + return memoizedProps.type !== 'hidden' && memoizedProps.type !== 'file'; + } + + return type === 'button' || type === 'textarea' || type === 'object' || type === 'select' || type === 'iframe' || type === 'embed'; + } + + function processTimers(timers, delay) { + var timersArr = Array.from(timers.values()); + currentEventQueuePriority = ContinuousEvent; + + try { + for (var i = 0; i < timersArr.length; i++) { + var _timersArr$i = timersArr[i], + _instance = _timersArr$i.instance, + _func = _timersArr$i.func, + _id2 = _timersArr$i.id, + _timeStamp2 = _timersArr$i.timeStamp; + currentInstance = _instance; + currentEventQueue = []; + currentTimeStamp = _timeStamp2 + delay; + + try { + _func(); + } finally { + activeTimeouts.delete(_id2); + } + } + + processEventQueue(); + } finally { + currentTimers = null; + currentInstance = null; + currentEventQueue = null; + currentTimeStamp = 0; + } + } + + function createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, passive, passiveSupported) { + var _ref = nativeEvent, + pointerType = _ref.pointerType; + var eventPointerType = ''; + var pointerId = null; + + if (pointerType !== undefined) { + eventPointerType = pointerType; + pointerId = nativeEvent.pointerId; + } else if (nativeEvent.key !== undefined) { + eventPointerType = 'keyboard'; + } else if (nativeEvent.button !== undefined) { + eventPointerType = 'mouse'; + } else if (nativeEvent.changedTouches !== undefined) { + eventPointerType = 'touch'; + } + + return { + nativeEvent: nativeEvent, + passive: passive, + passiveSupported: passiveSupported, + pointerId: pointerId, + pointerType: eventPointerType, + responderTarget: null, + target: nativeEventTarget, + type: topLevelType + }; + } + + function processEvents(eventQueue) { + for (var i = 0, length = eventQueue.length; i < length; i++) { + var _eventQueue$i = eventQueue[i], + _value = _eventQueue$i.value, + _listener = _eventQueue$i.listener; + var type = typeof _value === 'object' && _value !== null ? _value.type : ''; + invokeGuardedCallbackAndCatchFirstError(type, _listener, undefined, _value); + } + } + + function processEventQueue() { + var eventQueue = currentEventQueue; + + if (eventQueue.length === 0) { + return; + } + + switch (currentEventQueuePriority) { + case DiscreteEvent: + { + flushDiscreteUpdatesIfNeeded(currentTimeStamp); + discreteUpdates(function () { + batchedEventUpdates(processEvents, eventQueue); + }); + break; + } + + case UserBlockingEvent: + { + if (enableUserBlockingEvents) { + runWithPriority$1(UserBlockingPriority$1, batchedEventUpdates.bind(null, processEvents, eventQueue)); + } else { + batchedEventUpdates(processEvents, eventQueue); + } + + break; + } + + case ContinuousEvent: + { + batchedEventUpdates(processEvents, eventQueue); + break; + } + } + } + + function responderEventTypesContainType(eventTypes, type) { + for (var i = 0, len = eventTypes.length; i < len; i++) { + if (eventTypes[i] === type) { + return true; + } + } + + return false; + } + + function validateResponderTargetEventTypes(eventType, responder) { + var targetEventTypes = responder.targetEventTypes; // Validate the target event type exists on the responder + + if (targetEventTypes !== null) { + return responderEventTypesContainType(targetEventTypes, eventType); + } + + return false; + } + + function validateOwnership(responderInstance) { + return globalOwner === null || globalOwner === responderInstance; + } + + function traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) { + var isPassiveEvent = (eventSystemFlags & IS_PASSIVE) !== 0; + var isPassiveSupported = (eventSystemFlags & PASSIVE_NOT_SUPPORTED) === 0; + var isPassive = isPassiveEvent || !isPassiveSupported; + var eventType = isPassive ? topLevelType : topLevelType + '_active'; // Trigger event responders in this order: + // - Bubble target responder phase + // - Root responder phase + + var visitedResponders = new Set(); + var responderEvent = createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, isPassiveEvent, isPassiveSupported); + var node = targetFiber; + + while (node !== null) { + var _node = node, + dependencies = _node.dependencies, + tag = _node.tag; + + if (tag === HostComponent && dependencies !== null) { + var respondersMap = dependencies.responders; + + if (respondersMap !== null) { + var responderInstances = Array.from(respondersMap.values()); + + for (var i = 0, length = responderInstances.length; i < length; i++) { + var responderInstance = responderInstances[i]; + + if (validateOwnership(responderInstance)) { + var props = responderInstance.props, + responder = responderInstance.responder, + state = responderInstance.state, + target = responderInstance.target; + + if (!visitedResponders.has(responder) && validateResponderTargetEventTypes(eventType, responder)) { + visitedResponders.add(responder); + var onEvent = responder.onEvent; + + if (onEvent !== null) { + currentInstance = responderInstance; + responderEvent.responderTarget = target; + onEvent(responderEvent, eventResponderContext, props, state); + } + } + } + } + } + } + + node = node.return; + } // Root phase + + + var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(eventType); + + if (rootEventResponderInstances !== undefined) { + var _responderInstances = Array.from(rootEventResponderInstances); + + for (var _i = 0; _i < _responderInstances.length; _i++) { + var _responderInstance = _responderInstances[_i]; + + if (!validateOwnership(_responderInstance)) { + continue; + } + + var _props = _responderInstance.props, + _responder = _responderInstance.responder, + _state = _responderInstance.state, + _target = _responderInstance.target; + var onRootEvent = _responder.onRootEvent; + + if (onRootEvent !== null) { + currentInstance = _responderInstance; + responderEvent.responderTarget = _target; + onRootEvent(responderEvent, eventResponderContext, _props, _state); + } + } + } + } + + function triggerOwnershipListeners() { + var listeningInstances = Array.from(ownershipChangeListeners); + var previousInstance = currentInstance; + var previousEventQueuePriority = currentEventQueuePriority; + var previousEventQueue = currentEventQueue; + + try { + for (var i = 0; i < listeningInstances.length; i++) { + var _instance2 = listeningInstances[i]; + var props = _instance2.props, + responder = _instance2.responder, + state = _instance2.state; + currentInstance = _instance2; + currentEventQueuePriority = ContinuousEvent; + currentEventQueue = []; + var onOwnershipChange = responder.onOwnershipChange; + + if (onOwnershipChange !== null) { + onOwnershipChange(eventResponderContext, props, state); + } + } + + processEventQueue(); + } finally { + currentInstance = previousInstance; + currentEventQueue = previousEventQueue; + currentEventQueuePriority = previousEventQueuePriority; + } + } + + function mountEventResponder(responder, responderInstance, props, state) { + if (responder.onOwnershipChange !== null) { + ownershipChangeListeners.add(responderInstance); + } + + var onMount = responder.onMount; + + if (onMount !== null) { + currentEventQueuePriority = ContinuousEvent; + currentInstance = responderInstance; + currentEventQueue = []; + + try { + onMount(eventResponderContext, props, state); + processEventQueue(); + } finally { + currentEventQueue = null; + currentInstance = null; + currentTimers = null; + } + } + } + + function unmountEventResponder(responderInstance) { + var responder = responderInstance.responder; + var onUnmount = responder.onUnmount; + + if (onUnmount !== null) { + var props = responderInstance.props, + state = responderInstance.state; + currentEventQueue = []; + currentEventQueuePriority = ContinuousEvent; + currentInstance = responderInstance; + + try { + onUnmount(eventResponderContext, props, state); + processEventQueue(); + } finally { + currentEventQueue = null; + currentInstance = null; + currentTimers = null; + } + } + + releaseOwnershipForEventResponderInstance(responderInstance); + + if (responder.onOwnershipChange !== null) { + ownershipChangeListeners.delete(responderInstance); + } + + var rootEventTypesSet = responderInstance.rootEventTypes; + + if (rootEventTypesSet !== null) { + var rootEventTypes = Array.from(rootEventTypesSet); + + for (var i = 0; i < rootEventTypes.length; i++) { + var topLevelEventType = rootEventTypes[i]; + var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(topLevelEventType); + + if (rootEventResponderInstances !== undefined) { + rootEventResponderInstances.delete(responderInstance); + } + } + } + } + + function validateResponderContext() { + (function () { + if (!(currentInstance !== null)) { + { + throw ReactError(Error('An event responder context was used outside of an event cycle. Use context.setTimeout() to use asynchronous responder context outside of event cycle .')); + } + } + })(); + } + + function dispatchEventForResponderEventSystem(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) { + if (enableFlareAPI) { + var previousEventQueue = currentEventQueue; + var previousInstance = currentInstance; + var previousTimers = currentTimers; + var previousTimeStamp = currentTimeStamp; + var previousDocument = currentDocument; + var previousEventQueuePriority = currentEventQueuePriority; + currentTimers = null; + currentEventQueue = []; + currentEventQueuePriority = ContinuousEvent; // nodeType 9 is DOCUMENT_NODE + + currentDocument = nativeEventTarget.nodeType === 9 ? nativeEventTarget : nativeEventTarget.ownerDocument; // We might want to control timeStamp another way here + + currentTimeStamp = nativeEvent.timeStamp; + + try { + traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags); + processEventQueue(); + } finally { + currentTimers = previousTimers; + currentInstance = previousInstance; + currentEventQueue = previousEventQueue; + currentTimeStamp = previousTimeStamp; + currentDocument = previousDocument; + currentEventQueuePriority = previousEventQueuePriority; + } + } + } + + function addRootEventTypesForResponderInstance(responderInstance, rootEventTypes) { + for (var i = 0; i < rootEventTypes.length; i++) { + var rootEventType = rootEventTypes[i]; + registerRootEventType(rootEventType, responderInstance); + } + } + + function registerRootEventType(rootEventType, eventResponderInstance) { + var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(rootEventType); + + if (rootEventResponderInstances === undefined) { + rootEventResponderInstances = new Set(); + rootEventTypesToEventResponderInstances.set(rootEventType, rootEventResponderInstances); + } + + var rootEventTypesSet = eventResponderInstance.rootEventTypes; + + if (rootEventTypesSet === null) { + rootEventTypesSet = eventResponderInstance.rootEventTypes = new Set(); + } + + (function () { + if (!!rootEventTypesSet.has(rootEventType)) { + { + throw ReactError(Error('addRootEventTypes() found a duplicate root event type of "' + rootEventType + '". This might be because the event type exists in the event responder "rootEventTypes" array or because of a previous addRootEventTypes() using this root event type.')); + } + } + })(); + + rootEventTypesSet.add(rootEventType); + rootEventResponderInstances.add(eventResponderInstance); + } + /** + * `ReactInstanceMap` maintains a mapping from a public facing stateful + * instance (key) and the internal representation (value). This allows public + * methods to accept the user facing instance as an argument and map them back + * to internal methods. + * + * Note that this module is currently shared and assumed to be stateless. + * If this becomes an actual Map, that will break. + */ + + /** + * This API should be called `delete` but we'd have to make sure to always + * transform these to strings for IE support. When this transform is fully + * supported we can rename it. + */ + + + function get(key) { + return key._reactInternalFiber; + } + + function has(key) { + return key._reactInternalFiber !== undefined; + } + + function set(key, value) { + key._reactInternalFiber = value; + } // Don't change these two values. They're used by React Dev Tools. + + + var NoEffect = + /* */ + 0; + var PerformedWork = + /* */ + 1; // You can change the rest (and add more). + + var Placement = + /* */ + 2; + var Update = + /* */ + 4; + var PlacementAndUpdate = + /* */ + 6; + var Deletion = + /* */ + 8; + var ContentReset = + /* */ + 16; + var Callback = + /* */ + 32; + var DidCapture = + /* */ + 64; + var Ref = + /* */ + 128; + var Snapshot = + /* */ + 256; + var Passive = + /* */ + 512; // Passive & Update & Callback & Ref & Snapshot + + var LifecycleEffectMask = + /* */ + 932; // Union of all host effects + + var HostEffectMask = + /* */ + 1023; + var Incomplete = + /* */ + 1024; + var ShouldCapture = + /* */ + 2048; + var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; + var MOUNTING = 1; + var MOUNTED = 2; + var UNMOUNTED = 3; + + function isFiberMountedImpl(fiber) { + var node = fiber; + + if (!fiber.alternate) { + // If there is no alternate, this might be a new tree that isn't inserted + // yet. If it is, then it will have a pending insertion effect on it. + if ((node.effectTag & Placement) !== NoEffect) { + return MOUNTING; + } + + while (node.return) { + node = node.return; + + if ((node.effectTag & Placement) !== NoEffect) { + return MOUNTING; + } + } + } else { + while (node.return) { + node = node.return; + } + } + + if (node.tag === HostRoot) { + // TODO: Check if this was a nested HostRoot when used with + // renderContainerIntoSubtree. + return MOUNTED; + } // If we didn't hit the root, that means that we're in an disconnected tree + // that has been unmounted. + + + return UNMOUNTED; + } + + function isFiberMounted(fiber) { + return isFiberMountedImpl(fiber) === MOUNTED; + } + + function isMounted(component) { + { + var owner = ReactCurrentOwner$1.current; + + if (owner !== null && owner.tag === ClassComponent) { + var ownerFiber = owner; + var instance = ownerFiber.stateNode; + !instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0; + instance._warnedAboutRefsInRender = true; + } + } + var fiber = get(component); + + if (!fiber) { + return false; + } + + return isFiberMountedImpl(fiber) === MOUNTED; + } + + function assertIsMounted(fiber) { + (function () { + if (!(isFiberMountedImpl(fiber) === MOUNTED)) { + { + throw ReactError(Error('Unable to find node on an unmounted component.')); + } + } + })(); + } + + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + + if (!alternate) { + // If there is no alternate, then we only need to check if it is mounted. + var state = isFiberMountedImpl(fiber); + + (function () { + if (!(state !== UNMOUNTED)) { + { + throw ReactError(Error('Unable to find node on an unmounted component.')); + } + } + })(); + + if (state === MOUNTING) { + return null; + } + + return fiber; + } // If we have two possible branches, we'll walk backwards up to the root + // to see what path the root points to. On the way we may hit one of the + // special cases and we'll deal with them. + + + var a = fiber; + var b = alternate; + + while (true) { + var parentA = a.return; + + if (parentA === null) { + // We're at the root. + break; + } + + var parentB = parentA.alternate; + + if (parentB === null) { + // There is no alternate. This is an unusual case. Currently, it only + // happens when a Suspense component is hidden. An extra fragment fiber + // is inserted in between the Suspense fiber and its children. Skip + // over this extra fragment fiber and proceed to the next parent. + var nextParent = parentA.return; + + if (nextParent !== null) { + a = b = nextParent; + continue; + } // If there's no parent, we're at the root. + + + break; + } // If both copies of the parent fiber point to the same child, we can + // assume that the child is current. This happens when we bailout on low + // priority: the bailed out fiber's child reuses the current child. + + + if (parentA.child === parentB.child) { + var child = parentA.child; + + while (child) { + if (child === a) { + // We've determined that A is the current branch. + assertIsMounted(parentA); + return fiber; + } + + if (child === b) { + // We've determined that B is the current branch. + assertIsMounted(parentA); + return alternate; + } + + child = child.sibling; + } // We should never have an alternate for any mounting node. So the only + // way this could possibly happen is if this was unmounted, if at all. + + + (function () { + { + { + throw ReactError(Error('Unable to find node on an unmounted component.')); + } + } + })(); + } + + if (a.return !== b.return) { + // The return pointer of A and the return pointer of B point to different + // fibers. We assume that return pointers never criss-cross, so A must + // belong to the child set of A.return, and B must belong to the child + // set of B.return. + a = parentA; + b = parentB; + } else { + // The return pointers point to the same fiber. We'll have to use the + // default, slow path: scan the child sets of each parent alternate to see + // which child belongs to which set. + // + // Search parent A's child set + var didFindChild = false; + var _child = parentA.child; + + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentA; + b = parentB; + break; + } + + if (_child === b) { + didFindChild = true; + b = parentA; + a = parentB; + break; + } + + _child = _child.sibling; + } + + if (!didFindChild) { + // Search parent B's child set + _child = parentB.child; + + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentB; + b = parentA; + break; + } + + if (_child === b) { + didFindChild = true; + b = parentB; + a = parentA; + break; + } + + _child = _child.sibling; + } + + (function () { + if (!didFindChild) { + { + throw ReactError(Error('Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.')); + } + } + })(); + } + } + + (function () { + if (!(a.alternate === b)) { + { + throw ReactError(Error('Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.')); + } + } + })(); + } // If the root is not a host container, we're in a disconnected tree. I.e. + // unmounted. + + + (function () { + if (!(a.tag === HostRoot)) { + { + throw ReactError(Error('Unable to find node on an unmounted component.')); + } + } + })(); + + if (a.stateNode.current === a) { + // We've determined that A is the current branch. + return fiber; + } // Otherwise B has to be current branch. + + + return alternate; + } + + function findCurrentHostFiber(parent) { + var currentParent = findCurrentFiberUsingSlowPath(parent); + + if (!currentParent) { + return null; + } // Next we'll drill down this component to find the first HostComponent/Text. + + + var node = currentParent; + + while (true) { + if (node.tag === HostComponent || node.tag === HostText) { + return node; + } else if (node.child) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === currentParent) { + return null; + } + + while (!node.sibling) { + if (!node.return || node.return === currentParent) { + return null; + } + + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } // Flow needs the return null here, but ESLint complains about it. + // eslint-disable-next-line no-unreachable + + + return null; + } + + function findCurrentHostFiberWithNoPortals(parent) { + var currentParent = findCurrentFiberUsingSlowPath(parent); + + if (!currentParent) { + return null; + } // Next we'll drill down this component to find the first HostComponent/Text. + + + var node = currentParent; + + while (true) { + if (node.tag === HostComponent || node.tag === HostText || node.tag === FundamentalComponent) { + return node; + } else if (node.child && node.tag !== HostPortal) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === currentParent) { + return null; + } + + while (!node.sibling) { + if (!node.return || node.return === currentParent) { + return null; + } + + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } // Flow needs the return null here, but ESLint complains about it. + // eslint-disable-next-line no-unreachable + + + return null; + } + + function addEventBubbleListener(element, eventType, listener) { + element.addEventListener(eventType, listener, false); + } + + function addEventCaptureListener(element, eventType, listener) { + element.addEventListener(eventType, listener, true); + } + + function addEventCaptureListenerWithPassiveFlag(element, eventType, listener, passive) { + element.addEventListener(eventType, listener, { + capture: true, + passive: passive + }); + } + /** + * @interface Event + * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface + * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent + */ + + + var SyntheticAnimationEvent = SyntheticEvent.extend({ + animationName: null, + elapsedTime: null, + pseudoElement: null + }); + /** + * @interface Event + * @see http://www.w3.org/TR/clipboard-apis/ + */ + + var SyntheticClipboardEvent = SyntheticEvent.extend({ + clipboardData: function (event) { + return 'clipboardData' in event ? event.clipboardData : window.clipboardData; + } + }); + /** + * @interface FocusEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + + var SyntheticFocusEvent = SyntheticUIEvent.extend({ + relatedTarget: null + }); + /** + * `charCode` represents the actual "character code" and is safe to use with + * `String.fromCharCode`. As such, only keys that correspond to printable + * characters produce a valid `charCode`, the only exception to this is Enter. + * The Tab-key is considered non-printable and does not have a `charCode`, + * presumably because it does not produce a tab-character in browsers. + * + * @param {object} nativeEvent Native browser event. + * @return {number} Normalized `charCode` property. + */ + + function getEventCharCode(nativeEvent) { + var charCode = void 0; + var keyCode = nativeEvent.keyCode; + + if ('charCode' in nativeEvent) { + charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`. + + if (charCode === 0 && keyCode === 13) { + charCode = 13; + } + } else { + // IE8 does not implement `charCode`, but `keyCode` has the correct value. + charCode = keyCode; + } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux) + // report Enter as charCode 10 when ctrl is pressed. + + + if (charCode === 10) { + charCode = 13; + } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. + // Must not discard the (non-)printable Enter-key. + + + if (charCode >= 32 || charCode === 13) { + return charCode; + } + + return 0; + } + /** + * Normalization of deprecated HTML5 `key` values + * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names + */ + + + var normalizeKey = { + Esc: 'Escape', + Spacebar: ' ', + Left: 'ArrowLeft', + Up: 'ArrowUp', + Right: 'ArrowRight', + Down: 'ArrowDown', + Del: 'Delete', + Win: 'OS', + Menu: 'ContextMenu', + Apps: 'ContextMenu', + Scroll: 'ScrollLock', + MozPrintableKey: 'Unidentified' + }; + /** + * Translation from legacy `keyCode` to HTML5 `key` + * Only special keys supported, all others depend on keyboard layout or browser + * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names + */ + + var translateToKey = { + '8': 'Backspace', + '9': 'Tab', + '12': 'Clear', + '13': 'Enter', + '16': 'Shift', + '17': 'Control', + '18': 'Alt', + '19': 'Pause', + '20': 'CapsLock', + '27': 'Escape', + '32': ' ', + '33': 'PageUp', + '34': 'PageDown', + '35': 'End', + '36': 'Home', + '37': 'ArrowLeft', + '38': 'ArrowUp', + '39': 'ArrowRight', + '40': 'ArrowDown', + '45': 'Insert', + '46': 'Delete', + '112': 'F1', + '113': 'F2', + '114': 'F3', + '115': 'F4', + '116': 'F5', + '117': 'F6', + '118': 'F7', + '119': 'F8', + '120': 'F9', + '121': 'F10', + '122': 'F11', + '123': 'F12', + '144': 'NumLock', + '145': 'ScrollLock', + '224': 'Meta' + }; + /** + * @param {object} nativeEvent Native browser event. + * @return {string} Normalized `key` property. + */ + + function getEventKey(nativeEvent) { + if (nativeEvent.key) { + // Normalize inconsistent values reported by browsers due to + // implementations of a working draft specification. + // FireFox implements `key` but returns `MozPrintableKey` for all + // printable characters (normalized to `Unidentified`), ignore it. + var key = normalizeKey[nativeEvent.key] || nativeEvent.key; + + if (key !== 'Unidentified') { + return key; + } + } // Browser does not implement `key`, polyfill as much of it as we can. + + + if (nativeEvent.type === 'keypress') { + var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can + // thus be captured by `keypress`, no other non-printable key should. + + return charCode === 13 ? 'Enter' : String.fromCharCode(charCode); + } + + if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') { + // While user keyboard layout determines the actual meaning of each + // `keyCode` value, almost all function keys have a universal value. + return translateToKey[nativeEvent.keyCode] || 'Unidentified'; + } + + return ''; + } + /** + * @interface KeyboardEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + + + var SyntheticKeyboardEvent = SyntheticUIEvent.extend({ + key: getEventKey, + location: null, + ctrlKey: null, + shiftKey: null, + altKey: null, + metaKey: null, + repeat: null, + locale: null, + getModifierState: getEventModifierState, + // Legacy Interface + charCode: function (event) { + // `charCode` is the result of a KeyPress event and represents the value of + // the actual printable character. + // KeyPress is deprecated, but its replacement is not yet final and not + // implemented in any major browser. Only KeyPress has charCode. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + + return 0; + }, + keyCode: function (event) { + // `keyCode` is the result of a KeyDown/Up event and represents the value of + // physical keyboard key. + // The actual meaning of the value depends on the users' keyboard layout + // which cannot be detected. Assuming that it is a US keyboard layout + // provides a surprisingly accurate mapping for US and European users. + // Due to this, it is left to the user to implement at this time. + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + + return 0; + }, + which: function (event) { + // `which` is an alias for either `keyCode` or `charCode` depending on the + // type of the event. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + + return 0; + } + }); + /** + * @interface DragEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + + var SyntheticDragEvent = SyntheticMouseEvent.extend({ + dataTransfer: null + }); + /** + * @interface TouchEvent + * @see http://www.w3.org/TR/touch-events/ + */ + + var SyntheticTouchEvent = SyntheticUIEvent.extend({ + touches: null, + targetTouches: null, + changedTouches: null, + altKey: null, + metaKey: null, + ctrlKey: null, + shiftKey: null, + getModifierState: getEventModifierState + }); + /** + * @interface Event + * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events- + * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent + */ + + var SyntheticTransitionEvent = SyntheticEvent.extend({ + propertyName: null, + elapsedTime: null, + pseudoElement: null + }); + /** + * @interface WheelEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + + var SyntheticWheelEvent = SyntheticMouseEvent.extend({ + deltaX: function (event) { + return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). + 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; + }, + deltaY: function (event) { + return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). + 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). + 'wheelDelta' in event ? -event.wheelDelta : 0; + }, + deltaZ: null, + // Browsers without "deltaMode" is reporting in raw wheel delta where one + // notch on the scroll is always +/- 120, roughly equivalent to pixels. + // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or + // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. + deltaMode: null + }); + /** + * Turns + * ['abort', ...] + * into + * eventTypes = { + * 'abort': { + * phasedRegistrationNames: { + * bubbled: 'onAbort', + * captured: 'onAbortCapture', + * }, + * dependencies: [TOP_ABORT], + * }, + * ... + * }; + * topLevelEventsToDispatchConfig = new Map([ + * [TOP_ABORT, { sameConfig }], + * ]); + */ + + var eventTuples = [// Discrete events + [TOP_BLUR, 'blur', DiscreteEvent], [TOP_CANCEL, 'cancel', DiscreteEvent], [TOP_CLICK, 'click', DiscreteEvent], [TOP_CLOSE, 'close', DiscreteEvent], [TOP_CONTEXT_MENU, 'contextMenu', DiscreteEvent], [TOP_COPY, 'copy', DiscreteEvent], [TOP_CUT, 'cut', DiscreteEvent], [TOP_AUX_CLICK, 'auxClick', DiscreteEvent], [TOP_DOUBLE_CLICK, 'doubleClick', DiscreteEvent], [TOP_DRAG_END, 'dragEnd', DiscreteEvent], [TOP_DRAG_START, 'dragStart', DiscreteEvent], [TOP_DROP, 'drop', DiscreteEvent], [TOP_FOCUS, 'focus', DiscreteEvent], [TOP_INPUT, 'input', DiscreteEvent], [TOP_INVALID, 'invalid', DiscreteEvent], [TOP_KEY_DOWN, 'keyDown', DiscreteEvent], [TOP_KEY_PRESS, 'keyPress', DiscreteEvent], [TOP_KEY_UP, 'keyUp', DiscreteEvent], [TOP_MOUSE_DOWN, 'mouseDown', DiscreteEvent], [TOP_MOUSE_UP, 'mouseUp', DiscreteEvent], [TOP_PASTE, 'paste', DiscreteEvent], [TOP_PAUSE, 'pause', DiscreteEvent], [TOP_PLAY, 'play', DiscreteEvent], [TOP_POINTER_CANCEL, 'pointerCancel', DiscreteEvent], [TOP_POINTER_DOWN, 'pointerDown', DiscreteEvent], [TOP_POINTER_UP, 'pointerUp', DiscreteEvent], [TOP_RATE_CHANGE, 'rateChange', DiscreteEvent], [TOP_RESET, 'reset', DiscreteEvent], [TOP_SEEKED, 'seeked', DiscreteEvent], [TOP_SUBMIT, 'submit', DiscreteEvent], [TOP_TOUCH_CANCEL, 'touchCancel', DiscreteEvent], [TOP_TOUCH_END, 'touchEnd', DiscreteEvent], [TOP_TOUCH_START, 'touchStart', DiscreteEvent], [TOP_VOLUME_CHANGE, 'volumeChange', DiscreteEvent], // User-blocking events + [TOP_DRAG, 'drag', UserBlockingEvent], [TOP_DRAG_ENTER, 'dragEnter', UserBlockingEvent], [TOP_DRAG_EXIT, 'dragExit', UserBlockingEvent], [TOP_DRAG_LEAVE, 'dragLeave', UserBlockingEvent], [TOP_DRAG_OVER, 'dragOver', UserBlockingEvent], [TOP_MOUSE_MOVE, 'mouseMove', UserBlockingEvent], [TOP_MOUSE_OUT, 'mouseOut', UserBlockingEvent], [TOP_MOUSE_OVER, 'mouseOver', UserBlockingEvent], [TOP_POINTER_MOVE, 'pointerMove', UserBlockingEvent], [TOP_POINTER_OUT, 'pointerOut', UserBlockingEvent], [TOP_POINTER_OVER, 'pointerOver', UserBlockingEvent], [TOP_SCROLL, 'scroll', UserBlockingEvent], [TOP_TOGGLE, 'toggle', UserBlockingEvent], [TOP_TOUCH_MOVE, 'touchMove', UserBlockingEvent], [TOP_WHEEL, 'wheel', UserBlockingEvent], // Continuous events + [TOP_ABORT, 'abort', ContinuousEvent], [TOP_ANIMATION_END, 'animationEnd', ContinuousEvent], [TOP_ANIMATION_ITERATION, 'animationIteration', ContinuousEvent], [TOP_ANIMATION_START, 'animationStart', ContinuousEvent], [TOP_CAN_PLAY, 'canPlay', ContinuousEvent], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough', ContinuousEvent], [TOP_DURATION_CHANGE, 'durationChange', ContinuousEvent], [TOP_EMPTIED, 'emptied', ContinuousEvent], [TOP_ENCRYPTED, 'encrypted', ContinuousEvent], [TOP_ENDED, 'ended', ContinuousEvent], [TOP_ERROR, 'error', ContinuousEvent], [TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', ContinuousEvent], [TOP_LOAD, 'load', ContinuousEvent], [TOP_LOADED_DATA, 'loadedData', ContinuousEvent], [TOP_LOADED_METADATA, 'loadedMetadata', ContinuousEvent], [TOP_LOAD_START, 'loadStart', ContinuousEvent], [TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', ContinuousEvent], [TOP_PLAYING, 'playing', ContinuousEvent], [TOP_PROGRESS, 'progress', ContinuousEvent], [TOP_SEEKING, 'seeking', ContinuousEvent], [TOP_STALLED, 'stalled', ContinuousEvent], [TOP_SUSPEND, 'suspend', ContinuousEvent], [TOP_TIME_UPDATE, 'timeUpdate', ContinuousEvent], [TOP_TRANSITION_END, 'transitionEnd', ContinuousEvent], [TOP_WAITING, 'waiting', ContinuousEvent]]; + var eventTypes$4 = {}; + var topLevelEventsToDispatchConfig = {}; + + for (var i = 0; i < eventTuples.length; i++) { + var eventTuple = eventTuples[i]; + var topEvent = eventTuple[0]; + var event = eventTuple[1]; + var eventPriority = eventTuple[2]; + var capitalizedEvent = event[0].toUpperCase() + event.slice(1); + var onEvent = 'on' + capitalizedEvent; + var config = { + phasedRegistrationNames: { + bubbled: onEvent, + captured: onEvent + 'Capture' + }, + dependencies: [topEvent], + eventPriority: eventPriority + }; + eventTypes$4[event] = config; + topLevelEventsToDispatchConfig[topEvent] = config; + } // Only used in DEV for exhaustiveness validation. + + + var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING]; + var SimpleEventPlugin = { + eventTypes: eventTypes$4, + getEventPriority: function (topLevelType) { + var config = topLevelEventsToDispatchConfig[topLevelType]; + return config !== undefined ? config.eventPriority : ContinuousEvent; + }, + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType]; + + if (!dispatchConfig) { + return null; + } + + var EventConstructor = void 0; + + switch (topLevelType) { + case TOP_KEY_PRESS: + // Firefox creates a keypress event for function keys too. This removes + // the unwanted keypress events. Enter is however both printable and + // non-printable. One would expect Tab to be as well (but it isn't). + if (getEventCharCode(nativeEvent) === 0) { + return null; + } + + /* falls through */ + + case TOP_KEY_DOWN: + case TOP_KEY_UP: + EventConstructor = SyntheticKeyboardEvent; + break; + + case TOP_BLUR: + case TOP_FOCUS: + EventConstructor = SyntheticFocusEvent; + break; + + case TOP_CLICK: + // Firefox creates a click event on right mouse clicks. This removes the + // unwanted click events. + if (nativeEvent.button === 2) { + return null; + } + + /* falls through */ + + case TOP_AUX_CLICK: + case TOP_DOUBLE_CLICK: + case TOP_MOUSE_DOWN: + case TOP_MOUSE_MOVE: + case TOP_MOUSE_UP: // TODO: Disabled elements should not respond to mouse events + + /* falls through */ + + case TOP_MOUSE_OUT: + case TOP_MOUSE_OVER: + case TOP_CONTEXT_MENU: + EventConstructor = SyntheticMouseEvent; + break; + + case TOP_DRAG: + case TOP_DRAG_END: + case TOP_DRAG_ENTER: + case TOP_DRAG_EXIT: + case TOP_DRAG_LEAVE: + case TOP_DRAG_OVER: + case TOP_DRAG_START: + case TOP_DROP: + EventConstructor = SyntheticDragEvent; + break; + + case TOP_TOUCH_CANCEL: + case TOP_TOUCH_END: + case TOP_TOUCH_MOVE: + case TOP_TOUCH_START: + EventConstructor = SyntheticTouchEvent; + break; + + case TOP_ANIMATION_END: + case TOP_ANIMATION_ITERATION: + case TOP_ANIMATION_START: + EventConstructor = SyntheticAnimationEvent; + break; + + case TOP_TRANSITION_END: + EventConstructor = SyntheticTransitionEvent; + break; + + case TOP_SCROLL: + EventConstructor = SyntheticUIEvent; + break; + + case TOP_WHEEL: + EventConstructor = SyntheticWheelEvent; + break; + + case TOP_COPY: + case TOP_CUT: + case TOP_PASTE: + EventConstructor = SyntheticClipboardEvent; + break; + + case TOP_GOT_POINTER_CAPTURE: + case TOP_LOST_POINTER_CAPTURE: + case TOP_POINTER_CANCEL: + case TOP_POINTER_DOWN: + case TOP_POINTER_MOVE: + case TOP_POINTER_OUT: + case TOP_POINTER_OVER: + case TOP_POINTER_UP: + EventConstructor = SyntheticPointerEvent; + break; + + default: + { + if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) { + warningWithoutStack$1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType); + } + } // HTML Events + // @see http://www.w3.org/TR/html5/index.html#events-0 + + EventConstructor = SyntheticEvent; + break; + } + + var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget); + accumulateTwoPhaseDispatches(event); + return event; + } + }; + var passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners + // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support + + if (enableFlareAPI && canUseDOM) { + try { + var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value + + Object.defineProperty(options, 'passive', { + get: function () { + passiveBrowserEventsSupported = true; + } + }); + window.addEventListener('test', options, options); + window.removeEventListener('test', options, options); + } catch (e) { + passiveBrowserEventsSupported = false; + } + } // Intentionally not named imports because Rollup would use dynamic dispatch for + // CommonJS interop named imports. + + + var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; + var runWithPriority = Scheduler.unstable_runWithPriority; + var getEventPriority = SimpleEventPlugin.getEventPriority; + var CALLBACK_BOOKKEEPING_POOL_SIZE = 10; + var callbackBookkeepingPool = []; + /** + * Find the deepest React component completely containing the root of the + * passed-in instance (for use when entire React trees are nested within each + * other). If React trees are not nested, returns null. + */ + + function findRootContainerNode(inst) { + // TODO: It may be a good idea to cache this to prevent unnecessary DOM + // traversal, but caching is difficult to do correctly without using a + // mutation observer to listen for all DOM changes. + while (inst.return) { + inst = inst.return; + } + + if (inst.tag !== HostRoot) { + // This can happen if we're in a detached tree. + return null; + } + + return inst.stateNode.containerInfo; + } // Used to store ancestor hierarchy in top level callback + + + function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) { + if (callbackBookkeepingPool.length) { + var instance = callbackBookkeepingPool.pop(); + instance.topLevelType = topLevelType; + instance.nativeEvent = nativeEvent; + instance.targetInst = targetInst; + return instance; + } + + return { + topLevelType: topLevelType, + nativeEvent: nativeEvent, + targetInst: targetInst, + ancestors: [] + }; + } + + function releaseTopLevelCallbackBookKeeping(instance) { + instance.topLevelType = null; + instance.nativeEvent = null; + instance.targetInst = null; + instance.ancestors.length = 0; + + if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) { + callbackBookkeepingPool.push(instance); + } + } + + function handleTopLevel(bookKeeping) { + var targetInst = bookKeeping.targetInst; // Loop through the hierarchy, in case there's any nested components. + // It's important that we build the array of ancestors before calling any + // event handlers, because event handlers can modify the DOM, leading to + // inconsistencies with ReactMount's node cache. See #1105. + + var ancestor = targetInst; + + do { + if (!ancestor) { + var _ancestors = bookKeeping.ancestors; + + _ancestors.push(ancestor); + + break; + } + + var root = findRootContainerNode(ancestor); + + if (!root) { + break; + } + + bookKeeping.ancestors.push(ancestor); + ancestor = getClosestInstanceFromNode(root); + } while (ancestor); + + for (var i = 0; i < bookKeeping.ancestors.length; i++) { + targetInst = bookKeeping.ancestors[i]; + var eventTarget = getEventTarget(bookKeeping.nativeEvent); + var _topLevelType = bookKeeping.topLevelType; + var _nativeEvent = bookKeeping.nativeEvent; + runExtractedPluginEventsInBatch(_topLevelType, targetInst, _nativeEvent, eventTarget); + } + } // TODO: can we stop exporting these? + + + var _enabled = true; + + function setEnabled(enabled) { + _enabled = !!enabled; + } + + function isEnabled() { + return _enabled; + } + + function trapBubbledEvent(topLevelType, element) { + trapEventForPluginEventSystem(element, topLevelType, false); + } + + function trapCapturedEvent(topLevelType, element) { + trapEventForPluginEventSystem(element, topLevelType, true); + } + + function trapEventForResponderEventSystem(element, topLevelType, passive) { + if (enableFlareAPI) { + var rawEventName = getRawEventName(topLevelType); + var eventFlags = RESPONDER_EVENT_SYSTEM; // If passive option is not supported, then the event will be + // active and not passive, but we flag it as using not being + // supported too. This way the responder event plugins know, + // and can provide polyfills if needed. + + if (passive) { + if (passiveBrowserEventsSupported) { + eventFlags |= IS_PASSIVE; + } else { + eventFlags |= IS_ACTIVE; + eventFlags |= PASSIVE_NOT_SUPPORTED; + passive = false; + } + } else { + eventFlags |= IS_ACTIVE; + } // Check if interactive and wrap in discreteUpdates + + + var listener = dispatchEvent.bind(null, topLevelType, eventFlags); + + if (passiveBrowserEventsSupported) { + addEventCaptureListenerWithPassiveFlag(element, rawEventName, listener, passive); + } else { + addEventCaptureListener(element, rawEventName, listener); + } + } + } + + function trapEventForPluginEventSystem(element, topLevelType, capture) { + var listener = void 0; + + switch (getEventPriority(topLevelType)) { + case DiscreteEvent: + listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM); + break; + + case UserBlockingEvent: + listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM); + break; + + case ContinuousEvent: + default: + listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM); + break; + } + + var rawEventName = getRawEventName(topLevelType); + + if (capture) { + addEventCaptureListener(element, rawEventName, listener); + } else { + addEventBubbleListener(element, rawEventName, listener); + } + } + + function dispatchDiscreteEvent(topLevelType, eventSystemFlags, nativeEvent) { + flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp); + discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, nativeEvent); + } + + function dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, nativeEvent) { + if (enableUserBlockingEvents) { + runWithPriority(UserBlockingPriority, dispatchEvent.bind(null, topLevelType, eventSystemFlags, nativeEvent)); + } else { + dispatchEvent(topLevelType, eventSystemFlags, nativeEvent); + } + } + + function dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) { + var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst); + + try { + // Event queue being processed in the same cycle allows + // `preventDefault`. + batchedEventUpdates(handleTopLevel, bookKeeping); + } finally { + releaseTopLevelCallbackBookKeeping(bookKeeping); + } + } + + function dispatchEvent(topLevelType, eventSystemFlags, nativeEvent) { + if (!_enabled) { + return; + } + + var nativeEventTarget = getEventTarget(nativeEvent); + var targetInst = getClosestInstanceFromNode(nativeEventTarget); + + if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) { + // If we get an event (ex: img onload) before committing that + // component's mount, ignore it for now (that is, treat it as if it was an + // event on a non-React tree). We might also consider queueing events and + // dispatching them after the mount. + targetInst = null; + } + + if (enableFlareAPI) { + if (eventSystemFlags === PLUGIN_EVENT_SYSTEM) { + dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst); + } else { + // React Flare event system + dispatchEventForResponderEventSystem(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); + } + } else { + dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst); + } + } + /** + * Summary of `ReactBrowserEventEmitter` event handling: + * + * - Top-level delegation is used to trap most native browser events. This + * may only occur in the main thread and is the responsibility of + * ReactDOMEventListener, which is injected and can therefore support + * pluggable event sources. This is the only work that occurs in the main + * thread. + * + * - We normalize and de-duplicate events to account for browser quirks. This + * may be done in the worker thread. + * + * - Forward these native events (with the associated top-level type used to + * trap it) to `EventPluginHub`, which in turn will ask plugins if they want + * to extract any synthetic events. + * + * - The `EventPluginHub` will then process each event by annotating them with + * "dispatches", a sequence of listeners and IDs that care about that event. + * + * - The `EventPluginHub` then dispatches the events. + * + * Overview of React and the event system: + * + * +------------+ . + * | DOM | . + * +------------+ . + * | . + * v . + * +------------+ . + * | ReactEvent | . + * | Listener | . + * +------------+ . +-----------+ + * | . +--------+|SimpleEvent| + * | . | |Plugin | + * +-----|------+ . v +-----------+ + * | | | . +--------------+ +------------+ + * | +-----------.--->|EventPluginHub| | Event | + * | | . | | +-----------+ | Propagators| + * | ReactEvent | . | | |TapEvent | |------------| + * | Emitter | . | |<---+|Plugin | |other plugin| + * | | . | | +-----------+ | utilities | + * | +-----------.--->| | +------------+ + * | | | . +--------------+ + * +-----|------+ . ^ +-----------+ + * | . | |Enter/Leave| + * + . +-------+|Plugin | + * +-------------+ . +-----------+ + * | application | . + * |-------------| . + * | | . + * | | . + * +-------------+ . + * . + * React Core . General Purpose Event Plugin System + */ + + + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + var elementListeningSets = new PossiblyWeakMap(); + + function getListeningSetForElement(element) { + var listeningSet = elementListeningSets.get(element); + + if (listeningSet === undefined) { + listeningSet = new Set(); + elementListeningSets.set(element, listeningSet); + } + + return listeningSet; + } + /** + * We listen for bubbled touch events on the document object. + * + * Firefox v8.01 (and possibly others) exhibited strange behavior when + * mounting `onmousemove` events at some node that was not the document + * element. The symptoms were that if your mouse is not moving over something + * contained within that mount point (for example on the background) the + * top-level listeners for `onmousemove` won't be called. However, if you + * register the `mousemove` on the document object, then it will of course + * catch all `mousemove`s. This along with iOS quirks, justifies restricting + * top-level listeners to the document object only, at least for these + * movement types of events and possibly all events. + * + * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html + * + * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but + * they bubble to document. + * + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @param {object} mountAt Container where to mount the listener + */ + + + function listenTo(registrationName, mountAt) { + var listeningSet = getListeningSetForElement(mountAt); + var dependencies = registrationNameDependencies[registrationName]; + + for (var i = 0; i < dependencies.length; i++) { + var dependency = dependencies[i]; + + if (!listeningSet.has(dependency)) { + switch (dependency) { + case TOP_SCROLL: + trapCapturedEvent(TOP_SCROLL, mountAt); + break; + + case TOP_FOCUS: + case TOP_BLUR: + trapCapturedEvent(TOP_FOCUS, mountAt); + trapCapturedEvent(TOP_BLUR, mountAt); // We set the flag for a single dependency later in this function, + // but this ensures we mark both as attached rather than just one. + + listeningSet.add(TOP_BLUR); + listeningSet.add(TOP_FOCUS); + break; + + case TOP_CANCEL: + case TOP_CLOSE: + if (isEventSupported(getRawEventName(dependency))) { + trapCapturedEvent(dependency, mountAt); + } + + break; + + case TOP_INVALID: + case TOP_SUBMIT: + case TOP_RESET: + // We listen to them on the target DOM elements. + // Some of them bubble so we don't want them to fire twice. + break; + + default: + // By default, listen on the top level to all non-media events. + // Media events don't bubble so adding the listener wouldn't do anything. + var isMediaEvent = mediaEventTypes.indexOf(dependency) !== -1; + + if (!isMediaEvent) { + trapBubbledEvent(dependency, mountAt); + } + + break; + } + + listeningSet.add(dependency); + } + } + } + + function isListeningToAllDependencies(registrationName, mountAt) { + var listeningSet = getListeningSetForElement(mountAt); + var dependencies = registrationNameDependencies[registrationName]; + + for (var i = 0; i < dependencies.length; i++) { + var dependency = dependencies[i]; + + if (!listeningSet.has(dependency)) { + return false; + } + } + + return true; + } + + function getActiveElement(doc) { + doc = doc || (typeof document !== 'undefined' ? document : undefined); + + if (typeof doc === 'undefined') { + return null; + } + + try { + return doc.activeElement || doc.body; + } catch (e) { + return doc.body; + } + } + /** + * Given any node return the first leaf node without children. + * + * @param {DOMElement|DOMTextNode} node + * @return {DOMElement|DOMTextNode} + */ + + + function getLeafNode(node) { + while (node && node.firstChild) { + node = node.firstChild; + } + + return node; + } + /** + * Get the next sibling within a container. This will walk up the + * DOM if a node's siblings have been exhausted. + * + * @param {DOMElement|DOMTextNode} node + * @return {?DOMElement|DOMTextNode} + */ + + + function getSiblingNode(node) { + while (node) { + if (node.nextSibling) { + return node.nextSibling; + } + + node = node.parentNode; + } + } + /** + * Get object describing the nodes which contain characters at offset. + * + * @param {DOMElement|DOMTextNode} root + * @param {number} offset + * @return {?object} + */ + + + function getNodeForCharacterOffset(root, offset) { + var node = getLeafNode(root); + var nodeStart = 0; + var nodeEnd = 0; + + while (node) { + if (node.nodeType === TEXT_NODE) { + nodeEnd = nodeStart + node.textContent.length; + + if (nodeStart <= offset && nodeEnd >= offset) { + return { + node: node, + offset: offset - nodeStart + }; + } + + nodeStart = nodeEnd; + } + + node = getLeafNode(getSiblingNode(node)); + } + } + /** + * @param {DOMElement} outerNode + * @return {?object} + */ + + + function getOffsets(outerNode) { + var ownerDocument = outerNode.ownerDocument; + var win = ownerDocument && ownerDocument.defaultView || window; + var selection = win.getSelection && win.getSelection(); + + if (!selection || selection.rangeCount === 0) { + return null; + } + + var anchorNode = selection.anchorNode, + anchorOffset = selection.anchorOffset, + focusNode = selection.focusNode, + focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the + // up/down buttons on an . Anonymous divs do not seem to + // expose properties, triggering a "Permission denied error" if any of its + // properties are accessed. The only seemingly possible way to avoid erroring + // is to access a property that typically works for non-anonymous divs and + // catch any error that may otherwise arise. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=208427 + + try { + /* eslint-disable no-unused-expressions */ + anchorNode.nodeType; + focusNode.nodeType; + /* eslint-enable no-unused-expressions */ + } catch (e) { + return null; + } + + return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset); + } + /** + * Returns {start, end} where `start` is the character/codepoint index of + * (anchorNode, anchorOffset) within the textContent of `outerNode`, and + * `end` is the index of (focusNode, focusOffset). + * + * Returns null if you pass in garbage input but we should probably just crash. + * + * Exported only for testing. + */ + + + function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) { + var length = 0; + var start = -1; + var end = -1; + var indexWithinAnchor = 0; + var indexWithinFocus = 0; + var node = outerNode; + var parentNode = null; + + outer: while (true) { + var next = null; + + while (true) { + if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) { + start = length + anchorOffset; + } + + if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) { + end = length + focusOffset; + } + + if (node.nodeType === TEXT_NODE) { + length += node.nodeValue.length; + } + + if ((next = node.firstChild) === null) { + break; + } // Moving from `node` to its first child `next`. + + + parentNode = node; + node = next; + } + + while (true) { + if (node === outerNode) { + // If `outerNode` has children, this is always the second time visiting + // it. If it has no children, this is still the first loop, and the only + // valid selection is anchorNode and focusNode both equal to this node + // and both offsets 0, in which case we will have handled above. + break outer; + } + + if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) { + start = length; + } + + if (parentNode === focusNode && ++indexWithinFocus === focusOffset) { + end = length; + } + + if ((next = node.nextSibling) !== null) { + break; + } + + node = parentNode; + parentNode = node.parentNode; + } // Moving from `node` to its next sibling `next`. + + + node = next; + } + + if (start === -1 || end === -1) { + // This should never happen. (Would happen if the anchor/focus nodes aren't + // actually inside the passed-in node.) + return null; + } + + return { + start: start, + end: end + }; + } + /** + * In modern non-IE browsers, we can support both forward and backward + * selections. + * + * Note: IE10+ supports the Selection object, but it does not support + * the `extend` method, which means that even in modern IE, it's not possible + * to programmatically create a backward selection. Thus, for all IE + * versions, we use the old IE API to create our selections. + * + * @param {DOMElement|DOMTextNode} node + * @param {object} offsets + */ + + + function setOffsets(node, offsets) { + var doc = node.ownerDocument || document; + var win = doc && doc.defaultView || window; // Edge fails with "Object expected" in some scenarios. + // (For instance: TinyMCE editor used in a list component that supports pasting to add more, + // fails when pasting 100+ items) + + if (!win.getSelection) { + return; + } + + var selection = win.getSelection(); + var length = node.textContent.length; + var start = Math.min(offsets.start, length); + var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method. + // Flip backward selections, so we can set with a single range. + + if (!selection.extend && start > end) { + var temp = end; + end = start; + start = temp; + } + + var startMarker = getNodeForCharacterOffset(node, start); + var endMarker = getNodeForCharacterOffset(node, end); + + if (startMarker && endMarker) { + if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) { + return; + } + + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + + if (start > end) { + selection.addRange(range); + selection.extend(endMarker.node, endMarker.offset); + } else { + range.setEnd(endMarker.node, endMarker.offset); + selection.addRange(range); + } + } + } + + function isTextNode(node) { + return node && node.nodeType === TEXT_NODE; + } + + function containsNode(outerNode, innerNode) { + if (!outerNode || !innerNode) { + return false; + } else if (outerNode === innerNode) { + return true; + } else if (isTextNode(outerNode)) { + return false; + } else if (isTextNode(innerNode)) { + return containsNode(outerNode, innerNode.parentNode); + } else if ('contains' in outerNode) { + return outerNode.contains(innerNode); + } else if (outerNode.compareDocumentPosition) { + return !!(outerNode.compareDocumentPosition(innerNode) & 16); + } else { + return false; + } + } + + function isInDocument(node) { + return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node); + } + + function isSameOriginFrame(iframe) { + try { + // Accessing the contentDocument of a HTMLIframeElement can cause the browser + // to throw, e.g. if it has a cross-origin src attribute. + // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g: + // iframe.contentDocument.defaultView; + // A safety way is to access one of the cross origin properties: Window or Location + // Which might result in "SecurityError" DOM Exception and it is compatible to Safari. + // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl + return typeof iframe.contentWindow.location.href === 'string'; + } catch (err) { + return false; + } + } + + function getActiveElementDeep() { + var win = window; + var element = getActiveElement(); + + while (element instanceof win.HTMLIFrameElement) { + if (isSameOriginFrame(element)) { + win = element.contentWindow; + } else { + return element; + } + + element = getActiveElement(win.document); + } + + return element; + } + /** + * @ReactInputSelection: React input selection module. Based on Selection.js, + * but modified to be suitable for react and has a couple of bug fixes (doesn't + * assume buttons have range selections allowed). + * Input selection module for React. + */ + + /** + * @hasSelectionCapabilities: we get the element types that support selection + * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart` + * and `selectionEnd` rows. + */ + + + function hasSelectionCapabilities(elem) { + var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); + return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true'); + } + + function getSelectionInformation() { + var focusedElem = getActiveElementDeep(); + return { + focusedElem: focusedElem, + selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection$1(focusedElem) : null + }; + } + /** + * @restoreSelection: If any selection information was potentially lost, + * restore it. This is useful when performing operations that could remove dom + * nodes and place them back in, resulting in focus being lost. + */ + + + function restoreSelection(priorSelectionInformation) { + var curFocusedElem = getActiveElementDeep(); + var priorFocusedElem = priorSelectionInformation.focusedElem; + var priorSelectionRange = priorSelectionInformation.selectionRange; + + if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { + if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) { + setSelection(priorFocusedElem, priorSelectionRange); + } // Focusing a node can change the scroll position, which is undesirable + + + var ancestors = []; + var ancestor = priorFocusedElem; + + while (ancestor = ancestor.parentNode) { + if (ancestor.nodeType === ELEMENT_NODE) { + ancestors.push({ + element: ancestor, + left: ancestor.scrollLeft, + top: ancestor.scrollTop + }); + } + } + + if (typeof priorFocusedElem.focus === 'function') { + priorFocusedElem.focus(); + } + + for (var i = 0; i < ancestors.length; i++) { + var info = ancestors[i]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + } + /** + * @getSelection: Gets the selection bounds of a focused textarea, input or + * contentEditable node. + * -@input: Look up selection bounds of this input + * -@return {start: selectionStart, end: selectionEnd} + */ + + + function getSelection$1(input) { + var selection = void 0; + + if ('selectionStart' in input) { + // Modern browser with input or textarea. + selection = { + start: input.selectionStart, + end: input.selectionEnd + }; + } else { + // Content editable or old IE textarea. + selection = getOffsets(input); + } + + return selection || { + start: 0, + end: 0 + }; + } + /** + * @setSelection: Sets the selection bounds of a textarea or input and focuses + * the input. + * -@input Set selection bounds of this input or textarea + * -@offsets Object of same form that is returned from get* + */ + + + function setSelection(input, offsets) { + var start = offsets.start, + end = offsets.end; + + if (end === undefined) { + end = start; + } + + if ('selectionStart' in input) { + input.selectionStart = start; + input.selectionEnd = Math.min(end, input.value.length); + } else { + setOffsets(input, offsets); + } + } + + var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11; + var eventTypes$3 = { + select: { + phasedRegistrationNames: { + bubbled: 'onSelect', + captured: 'onSelectCapture' + }, + dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE] + } + }; + var activeElement$1 = null; + var activeElementInst$1 = null; + var lastSelection = null; + var mouseDown = false; + /** + * Get an object which is a unique representation of the current selection. + * + * The return value will not be consistent across nodes or browsers, but + * two identical selections on the same node will return identical objects. + * + * @param {DOMElement} node + * @return {object} + */ + + function getSelection(node) { + if ('selectionStart' in node && hasSelectionCapabilities(node)) { + return { + start: node.selectionStart, + end: node.selectionEnd + }; + } else { + var win = node.ownerDocument && node.ownerDocument.defaultView || window; + var selection = win.getSelection(); + return { + anchorNode: selection.anchorNode, + anchorOffset: selection.anchorOffset, + focusNode: selection.focusNode, + focusOffset: selection.focusOffset + }; + } + } + /** + * Get document associated with the event target. + * + * @param {object} nativeEventTarget + * @return {Document} + */ + + + function getEventTargetDocument(eventTarget) { + return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument; + } + /** + * Poll selection to see whether it's changed. + * + * @param {object} nativeEvent + * @param {object} nativeEventTarget + * @return {?SyntheticEvent} + */ + + + function constructSelectEvent(nativeEvent, nativeEventTarget) { + // Ensure we have the right element, and that the user is not dragging a + // selection (this matches native `select` event behavior). In HTML5, select + // fires only on input and textarea thus if there's no focused element we + // won't dispatch. + var doc = getEventTargetDocument(nativeEventTarget); + + if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) { + return null; + } // Only fire when selection has actually changed. + + + var currentSelection = getSelection(activeElement$1); + + if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { + lastSelection = currentSelection; + var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget); + syntheticEvent.type = 'select'; + syntheticEvent.target = activeElement$1; + accumulateTwoPhaseDispatches(syntheticEvent); + return syntheticEvent; + } + + return null; + } + /** + * This plugin creates an `onSelect` event that normalizes select events + * across form elements. + * + * Supported elements are: + * - input (see `isTextInputElement`) + * - textarea + * - contentEditable + * + * This differs from native browser implementations in the following ways: + * - Fires on contentEditable fields as well as inputs. + * - Fires for collapsed selection. + * - Fires after user input. + */ + + + var SelectEventPlugin = { + eventTypes: eventTypes$3, + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var doc = getEventTargetDocument(nativeEventTarget); // Track whether all listeners exists for this plugin. If none exist, we do + // not extract events. See #3639. + + if (!doc || !isListeningToAllDependencies('onSelect', doc)) { + return null; + } + + var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window; + + switch (topLevelType) { + // Track the input node that has focus. + case TOP_FOCUS: + if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') { + activeElement$1 = targetNode; + activeElementInst$1 = targetInst; + lastSelection = null; + } + + break; + + case TOP_BLUR: + activeElement$1 = null; + activeElementInst$1 = null; + lastSelection = null; + break; + // Don't fire the event while the user is dragging. This matches the + // semantics of the native select event. + + case TOP_MOUSE_DOWN: + mouseDown = true; + break; + + case TOP_CONTEXT_MENU: + case TOP_MOUSE_UP: + case TOP_DRAG_END: + mouseDown = false; + return constructSelectEvent(nativeEvent, nativeEventTarget); + // Chrome and IE fire non-standard event when selection is changed (and + // sometimes when it hasn't). IE's event fires out of order with respect + // to key and input events on deletion, so we discard it. + // + // Firefox doesn't support selectionchange, so check selection status + // after each key entry. The selection changes after keydown and before + // keyup, but we check on keydown as well in the case of holding down a + // key, when multiple keydown events are fired but only one keyup is. + // This is also our approach for IE handling, for the reason above. + + case TOP_SELECTION_CHANGE: + if (skipSelectionChangeEvent) { + break; + } + + // falls through + + case TOP_KEY_DOWN: + case TOP_KEY_UP: + return constructSelectEvent(nativeEvent, nativeEventTarget); + } + + return null; + } + }; + /** + * Inject modules for resolving DOM hierarchy and plugin ordering. + */ + + injection.injectEventPluginOrder(DOMEventPluginOrder); + setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1); + /** + * Some important event plugins included by default (without having to require + * them). + */ + + injection.injectEventPluginsByName({ + SimpleEventPlugin: SimpleEventPlugin, + EnterLeaveEventPlugin: EnterLeaveEventPlugin, + ChangeEventPlugin: ChangeEventPlugin, + SelectEventPlugin: SelectEventPlugin, + BeforeInputEventPlugin: BeforeInputEventPlugin + }); + + function endsWith(subject, search) { + var length = subject.length; + return subject.substring(length - search.length, length) === search; + } + + var didWarnSelectedSetOnOption = false; + var didWarnInvalidChild = false; + + function flattenChildren(children) { + var content = ''; // Flatten children. We'll warn if they are invalid + // during validateProps() which runs for hydration too. + // Note that this would throw on non-element objects. + // Elements are stringified (which is normally irrelevant + // but matters for ). + + React.Children.forEach(children, function (child) { + if (child == null) { + return; + } + + content += child; // Note: we don't warn about invalid children here. + // Instead, this is done separately below so that + // it happens during the hydration codepath too. + }); + return content; + } + /** + * Implements an